/* ===================================
   UNIVERSAL LIGHTBOX - Fresh & Clean
   Works on all pages consistently
   =================================== */

:root {
    --lightbox-overlay: rgba(0, 0, 0, 0.95);
    --lightbox-accent: #C9A74F;
    --lightbox-accent-hover: #e31e26;
    --lightbox-white: #ffffff;
    --lightbox-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lightbox Container */
.universal-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--lightbox-overlay);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.universal-lightbox.active {
    display: flex;
    opacity: 1;
}

/* Lightbox Inner Content */
.lightbox-inner {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: lightboxZoomIn 0.4s ease;
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Lightbox Image */
.lightbox-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    user-select: none;
    -webkit-user-select: none;
}

/* Loading Spinner */
.lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--lightbox-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Close Button */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--lightbox-accent-hover);
    border: 3px solid var(--lightbox-white);
    border-radius: 50%;
    color: var(--lightbox-white);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: var(--lightbox-transition);
    box-shadow: 0 4px 15px rgba(227, 30, 38, 0.4);
}

/* ESC to Exit Hint */
.lightbox-esc-hint {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--lightbox-white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 100000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeInHint 0.5s ease;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.universal-lightbox.active .lightbox-esc-hint {
    opacity: 1;
    visibility: visible;
}

@keyframes fadeInHint {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lightbox-close:hover {
    background: var(--lightbox-white);
    color: var(--lightbox-accent-hover);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

/* Navigation Arrows */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 55px;
    height: 55px;
    background: var(--lightbox-accent);
    border: 3px solid var(--lightbox-white);
    border-radius: 50%;
    color: var(--lightbox-white);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: var(--lightbox-transition);
    box-shadow: 0 4px 15px rgba(201, 167, 79, 0.4);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--lightbox-accent-hover);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(227, 30, 38, 0.5);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: translateY(-50%) scale(1.05);
}

/* Hide navigation when only one image */
.universal-lightbox[data-count="1"] .lightbox-prev,
.universal-lightbox[data-count="1"] .lightbox-next {
    display: none;
}

/* Image Counter */
.lightbox-counter {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--lightbox-accent-hover), var(--lightbox-accent));
    color: var(--lightbox-white);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--lightbox-white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    min-width: 70px;
    text-align: center;
}

/* Image Caption/Title */
.lightbox-caption {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--lightbox-white);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    max-width: 80%;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 100000;
}

/* Clickable Image Indicators */
[data-lightbox] {
    cursor: zoom-in;
    position: relative;
    transition: var(--lightbox-transition);
}

[data-lightbox]:hover {
    opacity: 0.9;
}

/* Zoom Icon Overlay */
[data-lightbox]::after {
    content: '\f00e';
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--lightbox-accent);
    color: var(--lightbox-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transform: scale(0);
    transition: var(--lightbox-transition);
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(201, 167, 79, 0.4);
}

[data-lightbox]:hover::after {
    opacity: 1;
    transform: scale(1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(201, 167, 79, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(201, 167, 79, 0.8);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .lightbox-esc-hint {
        top: 15px;
        left: 15px;
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-counter {
        bottom: 20px;
        right: 20px;
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .lightbox-caption {
        bottom: 20px;
        font-size: 14px;
        padding: 10px 20px;
        max-width: 90%;
    }
    
    [data-lightbox]::after {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .lightbox-counter {
        display: none;
    }
    
    .lightbox-caption {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .lightbox-esc-hint {
        font-size: 10px;
        padding: 5px 10px;
        top: 10px;
        left: 10px;
    }
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}

/* Smooth Transitions */
.lightbox-image-container img {
    transition: opacity 0.3s ease;
}

.lightbox-image-container.loading img {
    opacity: 0.3;
}

