﻿/* optional google fonts */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');

.container-dragdrop {
    text-align: center;
    width: 100%;
    max-width: 500px;
    padding: 8px;
    margin: auto;
    background-color: white;
    border-radius: 16px;
    box-shadow: rgba(255, 255, 255, 0.1) 0px 1px 1px 0px inset, rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}

.header-section-dragdrop {
    padding: 25px 0px;
}

    .header-section-dragdrop h1 {
        font-weight: 500;
        font-size: 1.7rem;
        text-transform: uppercase;
        color: #707EA0;
        margin: 0px;
        margin-bottom: 8px;
    }

    .header-section-dragdrop p {
        margin: 5px;
        font-size: 0.95rem;
        color: #707EA0;
    }

.drop-section-dragdrop {
    min-height: 250px;
    border: 1px dashed #A8B3E3;
    background-image: linear-gradient(180deg, white, #F1F6FF);
    margin: 16px;
    padding: 16px;
    border-radius: 12px;
    position: relative;
}

    .drop-section-dragdrop div.col:first-child {
        opacity: 1;
        visibility: visible;
        transition-duration: 0.2s;
        transform: scale(1);
        width: 200px;
        margin: auto;
    }

    .drop-section-dragdrop div.col:last-child {
        font-size: 40px;
        font-weight: 700;
        color: #c0cae1;
        position: absolute;
        top: 0px;
        bottom: 0px;
        left: 0px;
        right: 0px;
        margin: auto;
        width: 200px;
        height: 55px;
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.6);
        transition-duration: 0.2s;
    }
/* we will use "drag-over-effect" class in js */
.drag-over-effect div.col:first-child {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.1);
}

.drag-over-effect div.col:last-child {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.drop-section-dragdrop .cloud-icon {
    margin-top: 25px;
    margin-bottom: 20px;
}

.drop-section-dragdrop span,
.drop-section-dragdrop button {
    display: block;
    margin: auto;
    color: #707EA0;
    margin-bottom: 10px;
}

.drop-section-dragdrop button {
    color: white;
    background-color: #5874C6;
    border: none;
    outline: none;
    padding: 7px 20px;
    border-radius: 8px;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
}

.drop-section-dragdrop input {
    display: none;
}

.list-section-dragdrop {
    display: none;
    text-align: left;
    margin: 0px 35px;
    padding-bottom: 20px;
}

    .list-section-dragdrop .list-title-dragdrop {
        font-size: 0.95rem;
        color: #707EA0;
    }

    .list-section-dragdrop li {
        display: flex;
        margin: 15px 0px;
        padding-top: 4px;
        padding-bottom: 2px;
        border-radius: 8px;
        transition-duration: 0.2s;
    }

        .list-section-dragdrop li:hover {
            box-shadow: #E3EAF9 0px 0px 4px 0px, #E3EAF9 0px 12px 16px 0px;
        }

        .list-section-dragdrop li .col {
            flex: .1;
        }

            .list-section-dragdrop li .col:nth-child(1) {
                flex: .15;
                text-align: center;
            }

            .list-section-dragdrop li .col:nth-child(2) {
                flex: .75;
                text-align: left;
                font-size: 0.9rem;
                color: #3e4046;
                padding: 8px 10px;
            }

                .list-section-dragdrop li .col:nth-child(2) div.name {
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    max-width: 250px;
                    display: inline-block;
                }

            .list-section-dragdrop li .col .file-name span {
                color: #707EA0;
                float: right;
            }

        .list-section-dragdrop li .file-progress {
            width: 100%;
            height: 5px;
            margin-top: 8px;
            border-radius: 8px;
            background-color: #dee6fd;
        }

            .list-section-dragdrop li .file-progress span {
                display: block;
                width: 0%;
                height: 100%;
                border-radius: 8px;
                background-image: linear-gradient(120deg, #6b99fd, #9385ff);
                transition-duration: 0.4s;
            }

        .list-section-dragdrop li .col .file-size {
            font-size: 0.75rem;
            margin-top: 3px;
            color: #707EA0;
        }

        .list-section-dragdrop li .col svg.cross,
        .list-section-dragdrop li .col svg.tick {
            fill: #8694d2;
            background-color: #dee6fd;
            position: relative;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            border-radius: 50%;
        }

        .list-section-dragdrop li .col svg.tick {
            fill: #50a156;
            background-color: transparent;
        }

        .list-section-dragdrop li.complete span,
        .list-section-dragdropn li.complete .file-progress,
        .list-section-dragdrop li.complete svg.cross {
            display: none;
        }

        .list-section-dragdrop li.in-prog .file-size,
        .list-section-dragdrop li.in-prog svg.tick {
            display: none;
        }

/* ============================================
   MULTI DRAG DROP CARD - Thống nhất với drag-drop-card
   ============================================ */

.multi-drag-drop-card {
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 3px dotted #0355d2 !important;
    text-align: center;
    transition: transform 0.2s ease, border 0.2s ease;
    padding: 16px;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
}

    .multi-drag-drop-card .multi-drag-drop-content {
        width: 100%;
        pointer-events: none;
    }

        .multi-drag-drop-card .multi-drag-drop-content svg {
            fill: #0355d2;
            width: 80px;
            margin: 0px 0px 16px 0px;
        }

    .multi-drag-drop-card .multi-drag-drop-title {
        font-weight: bold;
        color: #0355d2;
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .multi-drag-drop-card .multi-drag-drop-subtitle {
        color: #8c8b8b;
        font-size: 0.875rem;
    }

    .multi-drag-drop-card .multi-drag-drop-content label {
        pointer-events: auto;
        margin-bottom: 0;
    }

    /* Drag over effect - giống drag-drop-card */
    .multi-drag-drop-card.drag-over {
        border: 3px solid #0355d2 !important;
        transform: scale(0.95);
    }

/* Preview List Container */
.list-multi-drag-drop-preview {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Individual Preview Item - giống drag-drop-preview */
.multi-drag-drop-card .multi-drag-drop-preview {
    width: 100%;
    height: 50px;
    border: 2px solid #0355d2;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

    .multi-drag-drop-card .multi-drag-drop-preview svg {
        fill: #0355d2;
        width: 40px;
    }

    .multi-drag-drop-card .multi-drag-drop-preview button {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background-color: #0355d2;
        border: none;
        color: white;
        text-align: center;
        margin: 0px 6px;
    }

        .multi-drag-drop-card .multi-drag-drop-preview button:hover {
            background-color: #3f85ed;
        }

.multi-drag-drop-card .preview-title {
    width: 50%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Error container styling */
#minhChungErrors .alert {
    border-left: 4px solid #0355d2;
    margin-top: 10px;
}

#minhChungErrors .alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
}

/* ============================================
   GALLERY PREVIEW - Modern Design
   ============================================ */

/* Multi Preview Gallery Container */
.multi-preview-slider-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    padding: 20px;
    border: dashed 2px #0355d2;
}

/* Header with title and button */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.gallery-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .gallery-title svg {
        width: 20px;
        height: 20px;
        fill: #0355d2;
    }

/* Button cập nhật minh chứng */
.btn-update-minhchung {
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    background-color: gray;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

    .btn-update-minhchung:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    }

    .btn-update-minhchung:active {
        transform: translateY(0);
    }

    .btn-update-minhchung svg {
        width: 16px;
        height: 16px;
    }

/* Gallery Grid */
.multi-preview-slider {
    position: relative;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    border: 1px solid #e0e0e0;
}

    .gallery-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(3, 85, 210, 0.3);
    }

        .gallery-item:hover .gallery-overlay {
            opacity: 1;
        }

        .gallery-item:hover .btn-delete-gallery-item {
            opacity: 1;
        }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .gallery-item:hover img {
        transform: scale(1.1);
    }

/* Delete button for gallery items */
.btn-delete-gallery-item {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.95);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
}

    .btn-delete-gallery-item:hover {
        background: rgba(200, 35, 51, 1);
        transform: scale(1.1);
    }

    .btn-delete-gallery-item svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-icon {
    width: 40px;
    height: 40px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ============================================
   LIGHTBOX - Modal xem ảnh phóng to
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999 !important;
    animation: fadeIn 0.3s ease;
}

    .lightbox.active {
        display: flex;
        align-items: center;
        justify-content: center;
    }

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: zoomIn 0.3s ease;
}

    .lightbox-content img {
        max-width: 100%;
        max-height: 90vh;
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
        transition: opacity 0.15s ease;
    }

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

    .lightbox-close:hover,
    .lightbox-prev:hover,
    .lightbox-next:hover {
        background: white;
        transform: scale(1.1);
    }

.lightbox-close {
    top: 20px;
    right: 20px;
}

    .lightbox-close svg {
        width: 24px;
        height: 24px;
        fill: #333;
    }


.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

    .lightbox-prev svg,
    .lightbox-next svg {
        width: 24px;
        height: 24px;
        fill: #333;
    }

/* Image info */
.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for images */
.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Empty state */
.gallery-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

    .gallery-empty svg {
        width: 60px;
        height: 60px;
        fill: #d0d0d0;
        margin-bottom: 15px;
    }

    .gallery-empty p {
        margin: 0;
        font-size: 0.9rem;
    }

/* Responsive */
@media (max-width: 768px) {
    .multi-preview-slider-container {
        padding: 15px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .gallery-title {
        font-size: 0.875rem;
    }

        .gallery-title svg {
            width: 16px;
            height: 16px;
        }

    .btn-update-minhchung {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

        .btn-update-minhchung span {
            display: none;
        }

    .image-counter {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

        .lightbox-prev svg,
        .lightbox-next svg {
            width: 20px;
            height: 20px;
        }

    .lightbox-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }

        .lightbox-close svg {
            width: 20px;
            height: 20px;
        }

    .lightbox-info {
        font-size: 0.75rem;
        padding: 8px 16px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }
}

/* Print styles */
@media print {
    .lightbox,
    .btn-update-minhchung {
        display: none !important;
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        page-break-inside: avoid;
    }
}

/* Cancel button */
#btnCancelUpdateMinhChung {
    padding: 10px 24px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

    #btnCancelUpdateMinhChung:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    }

/* Animation for toggle */
.multi-preview-slider-container,
.multi-drag-drop-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

    .multi-preview-slider-container[hidden],
    .multi-drag-drop-card[hidden] {
        opacity: 0;
        transform: scale(0.95);
        display: none;
    }
