/* =====================================================
   LIGHTBOX & GALLERY ENHANCEMENTS
   ===================================================== */

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Content */
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    line-height: 1;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1);
    color: #ef4444;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced Gallery Styles */
.popup-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.popup-photo {
    width: 100%;
    aspect-ratio: 1;
    /* Square thumbnails */
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    background: #f1f5f9;
}

.popup-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

/* =====================================================
   LIGHTBOX NAVIGATION (STYLISH & GLASSMORPHIC)
   ===================================================== */

.lightbox-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25%;
    /* Large hit area */
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 10001;
    border: none;
    background: transparent;
    outline: none;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-prev {
    left: 0;
    justify-content: flex-start;
    padding-left: 20px;
}

.lightbox-next {
    right: 0;
    justify-content: flex-end;
    padding-right: 20px;
}

/* Glassmorphic Arrow Icons */
.lightbox-nav::after {
    content: '';
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.lightbox-prev::after {
    content: '‹';
}

.lightbox-next::after {
    content: '›';
}

/* Hover Effects */
.lightbox-nav:hover::after {
    opacity: 1;
    transform: scale(1);
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav:active::after {
    transform: scale(0.95);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10002;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 1px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 15%;
    }

    .lightbox-nav::after {
        opacity: 0.8;
        /* Always slightly visible on mobile */
        transform: scale(0.7);
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .lightbox-prev {
        padding-left: 10px;
    }

    .lightbox-next {
        padding-right: 10px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(8px);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10003;
    }
}