/* Image picker + gallery for the gestionale (ImagePicker.razor / ImageGallery.razor).
   Light surfaces, matching the Metronic cards these sit inside. */

/* ---------------------------------------------------------------- drop zone */

.abito-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: 1.75rem 1rem;
    text-align: center;
    border: 2px dashed #d9dce1;
    border-radius: .625rem;
    background-color: #f9f9f9;
    color: #5e6278;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.abito-drop:hover {
    border-color: var(--bs-primary);
    background-color: #f1faff;
}

.abito-uploader.is-over .abito-drop {
    border-color: var(--bs-primary);
    background-color: #f1faff;
}

.abito-drop-icon {
    font-size: 1.75rem;
    color: var(--bs-primary);
}

.abito-drop-title {
    font-weight: 600;
}

.abito-drop-hint {
    font-size: .8125rem;
    color: #a1a5b7;
}

/* The input covers the whole zone, which is what makes both click-to-browse and
   native file drop work without any JavaScript of our own. */
.abito-drop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ------------------------------------------------------------- upload queue */

.abito-queue {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
}

.abito-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .375rem .75rem;
    margin-bottom: .25rem;
    border-radius: .375rem;
    background-color: #f9f9f9;
    font-size: .8125rem;
}

.abito-queue-item.is-error {
    background-color: #fff5f8;
    color: var(--bs-danger);
}

.abito-queue-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.abito-queue-meta {
    flex: 0 0 auto;
    color: #a1a5b7;
}

.abito-queue-item.is-error .abito-queue-meta {
    color: inherit;
}

/* ------------------------------------------------------------------ gallery */

.abito-gallery {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
    margin: 1rem 0 0;
    padding: 0;
}

.abito-tile {
    position: relative;
    border-radius: .5rem;
    overflow: hidden;
    background-color: #f5f8fa;
}

.abito-tile[draggable="true"] {
    cursor: grab;
}

.abito-tile.is-dragging {
    opacity: .4;
}

.abito-tile-image {
    display: block;
    aspect-ratio: 4 / 3;
    background-color: #eef3f7;
}

.abito-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Let the tile own the drag; dragging the inner image would start an image drag instead. */
    pointer-events: none;
}

.abito-tile-order {
    position: absolute;
    top: .375rem;
    left: .375rem;
    min-width: 1.5rem;
    padding: 0 .375rem;
    border-radius: 1rem;
    font-size: .75rem;
    line-height: 1.5rem;
    text-align: center;
    color: #fff;
    background-color: rgba(0, 0, 0, .6);
}

.abito-tile-actions {
    position: absolute;
    top: .375rem;
    right: .375rem;
    display: flex;
    gap: .25rem;
}

.abito-tile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    font-size: .875rem;
    color: #fff;
    background-color: rgba(0, 0, 0, .6);
    cursor: pointer;
}

.abito-tile-btn:hover {
    background-color: rgba(0, 0, 0, .85);
}

.abito-tile-delete:hover {
    background-color: var(--bs-danger);
}

.abito-tile-star.is-on {
    color: #ffc700;
}

.abito-tile-name {
    display: block;
    padding: .25rem .5rem;
    font-size: .75rem;
    color: #5e6278;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abito-tile-tag {
    display: inline-block;
    margin-right: .25rem;
    padding: 0 .25rem;
    border-radius: .25rem;
    font-size: .6875rem;
    color: #fff;
    background-color: #7e8299;
}

/* ------------------------------------------------- single-image preview card */

.abito-single {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.abito-single-image {
    flex: 0 0 auto;
    width: 160px;
    aspect-ratio: 4 / 3;
    border-radius: .5rem;
    overflow: hidden;
    background-color: #eef3f7;
}

.abito-single-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
