﻿/* =============================================
   1. MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    border: 0.5px solid #e0e0e0;
    width: 100%;
    max-width: 560px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 0.5px solid #e0e0e0;
}

    .modal-header h5 {
        margin: 0;
        font-size: 15px;
        font-weight: 500;
    }

    .modal-header .btn-close {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 18px;
        color: #6c757d;
        line-height: 1;
        padding: 4px;
    }

.modal-body {
    padding: 16px 18px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 0.5px solid #e0e0e0;
}

/* =============================================
   2. DROPZONE AREA
   ============================================= */
/* Dropzone area */
#myDropzone {
    border: 1.5px dashed #adb5bd;
    border-radius: 12px;
    background: #fff;
    padding: 16px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    /* ✅ These make hint + grid stack vertically inside */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

    #myDropzone:hover,
    #myDropzone.dz-drag-hover {
        background: #f0f7ff;
        border-color: #378ADD;
    }

/* Hint */
#dzHint {
    text-align: center;
    pointer-events: none;
    color: #6c757d;
    font-size: 13px;
    width: 100%;
}

    #dzHint i {
        font-size: 28px;
        display: block;
        margin-bottom: 6px;
        color: #adb5bd;
    }

/* ✅ Thumbnail grid inside dropzone */
#dz-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
}

/* Overall progress bar — inside dropzone, below thumbs */
.overall-wrap {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.overall-bar {
    height: 100%;
    background: #378ADD;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Thumbnail card */
.thumb-item {
    width: 75px;
    height: 75px;
    border-radius: 8px;
    border: 0.5px solid #e0e0e0;
    position: relative; /* ✅ required for absolute children */
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
    cursor: pointer;
}


.thumb-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px;
}

.thumb-img-view {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-inner i {
    font-size: 20px;
    color: #6c757d;
}

.ext-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.ext-pdf {
    background: #FCEBEB;
    color: #A32D2D;
}

.ext-img {
    background: #E6F1FB;
    color: #185FA5;
}

.ext-doc {
    background: #E1F5EE;
    color: #0F6E56;
}

.ext-gen {
    background: #F1EFE8;
    color: #5F5E5A;
}

.ext-name {
    font-size: 9px;
    color: #6c757d;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-darken {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    display: none;
    z-index: 1; /* ✅ below remove button */
}

.thumb-item.is-uploading .thumb-darken {
    display: block;
}

.thumb-status {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 3; /* ✅ above everything */
}

    .thumb-status.st-uploading {
        display: flex;
        background: #E6F1FB;
        color: #185FA5;
        font-size: 8px;
        font-weight: 500;
    }

    .thumb-status.st-done {
        display: flex;
        background: #EAF3DE;
        color: #3B6D11;
    }

    .thumb-status.st-error {
        display: flex;
        background: #FCEBEB;
        color: #A32D2D;
    }

.thumb-prog-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 3; /* ✅ above darken overlay */
}

.thumb-prog-bar {
    height: 100%;
    width: 0%;
    transition: width 0.25s ease;
    background: #378ADD;
}

    .thumb-prog-bar.prog-success {
        background: #639922;
    }

    .thumb-prog-bar.prog-error {
        background: #E24B4A;
    }

.thumb-prog-bar {
    height: 100%;
    width: 0%;
    transition: width 0.25s ease;
    background: #378ADD;
}

    .thumb-prog-bar.prog-success {
        background: #639922;
    }

    .thumb-prog-bar.prog-error {
        background: #E24B4A;
    }

.thumb-remove {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px; /* ✅ slightly larger — easier to click */
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    padding: 0;
    z-index: 4; /* ✅ highest — always on top */
    opacity: 0;
    transition: opacity 0.15s ease;
    line-height: 1;
}

/* ✅ Show on hover of the CARD not the button */
.thumb-item:hover .thumb-remove {
    opacity: 1;
}

/* ✅ Also keep visible while hovering the button itself */
.thumb-remove:hover {
    opacity: 1 !important;
    background: rgba(200, 0, 0, 0.75); /* red on direct hover */
    
}
