/* Lightbox Gallery Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
    touch-action: none; /* Prevent scrolling while open */
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 32px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-arrow.left {
    left: 20px;
}

.lightbox-arrow.right {
    right: 20px;
}

/* Thumbnails hidden on mobile for cleaner view */
.lightbox-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    overflow-x: auto;
    max-width: 90vw;
    padding: 10px 0;
    justify-content: center;
}

.lightbox-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0.6;
}

.lightbox-thumbnail:hover {
    opacity: 1;
}

.lightbox-thumbnail.active {
    border-color: #3b82f6;
    opacity: 1;
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .lightbox-arrow {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.3); 
    }
    
    .lightbox-arrow.left { left: 10px; }
    .lightbox-arrow.right { right: 10px; }
    
    .lightbox-image {
        max-height: 60vh;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.3);
    }
    
    .lightbox-thumbnails {
        justify-content: flex-start; /* scrollable on mobile */
    }
}