/* ============================================
   LIGHTBOX IMAGE VIEWER - COMPLETE STYLES
   ============================================ */

/* Image Thumbnail Styles */
.lightbox-thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.lightbox-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color, #dee2e6);
    display: block;
}

.lightbox-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Main Lightbox Container */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark Backdrop */
.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

/* Lightbox Content Container */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

/* Main Image Display */
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Close Button (Top Right) */
.lightbox-close-btn {
    position: absolute;
    top: -48px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation Buttons */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10002;
}

.lightbox-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-prev-btn {
    left: -60px;
}

.lightbox-next-btn {
    right: -60px;
}

/* Image Counter Display */
.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}

/* Loading State */
.lightbox-loading {
    opacity: 0.5;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-prev-btn {
        left: 10px;
    }
    
    .lightbox-next-btn {
        right: 10px;
    }
    
    .lightbox-close-btn {
        position: fixed;
        top: 12px;
        right: 12px;
    }
    
    .lightbox-counter {
        bottom: 10px;
    }
    
    .lightbox-thumbnail {
        width: 70px;
        height: 70px;
    }
}

/* Animation for smooth appearance */
@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-overlay {
    animation: lightboxFadeIn 0.2s ease-in;
}

/* RTL Mode adjustments */
[dir="rtl"] .lightbox-prev-btn {
    left: auto;
    right: -60px;
}

[dir="rtl"] .lightbox-next-btn {
    right: auto;
    left: -60px;
}

/* Flip the arrow icons horizontally in RTL mode so they point outward */
[dir="rtl"] .lightbox-nav-btn svg {
    transform: scaleX(-1);
}

@media (max-width: 768px) {
    [dir="rtl"] .lightbox-prev-btn {
        left: auto;
        right: 10px;
    }

    [dir="rtl"] .lightbox-next-btn {
        right: auto;
        left: 10px;
    }
}

/* Close hint text */
.lightbox-close-hint {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}
