/**
 * Lightbox Component Styles
 * Reusable full-screen image viewer with animations
 * 
 * Usage:
 * 1. Include this CSS file in your page
 * 2. Add lightbox HTML structure to your page
 * 3. Call openLightbox(imageUrl, imageInfo) to display an image
 * 
 * Example HTML:
 * <div id="imageLightbox" class="lightbox" onclick="closeLightbox(event)">
 *     <div class="lightbox-close" onclick="closeLightbox(event)">×</div>
 *     <img id="lightboxImage" class="lightbox-image" alt="Enlarged view">
 *     <div id="lightboxInfo" class="lightbox-info"></div>
 * </div>
 */

/* Main lightbox container */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    cursor: zoom-out;
    animation: lightboxFadeIn 0.2s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* The displayed image */
.lightbox-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    animation: lightboxZoomIn 0.3s ease;
    cursor: zoom-out;
}

/* Close button (top-right) */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 50px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding-bottom: 8px;
    user-select: none;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Info bar (bottom center) */
.lightbox-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 80%;
    text-align: center;
    pointer-events: none;
}

/* Animations */
@keyframes lightboxFadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes lightboxZoomIn {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Image hover states for clickable images */
.lightbox-trigger,
.image-preview,
.image-preview-large,
img[onclick*="openLightbox"] {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.lightbox-trigger:hover,
.image-preview:hover,
.image-preview-large:hover,
img[onclick*="openLightbox"]:hover {
    opacity: 0.85;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox.active {
        padding: 20px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 40px;
    }
    
    .lightbox-info {
        bottom: 20px;
        font-size: 12px;
        padding: 10px 15px;
        max-width: 90%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox-image,
    .lightbox-close {
        animation: none;
        transition: none;
    }
}
