/**
 * Custom Lightbox Styles
 * Pure CSS lightbox without external dependencies
 */

/* Custom Lightbox */
.custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.lightbox-content {
    position: relative;
    text-align: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    margin-top: 10px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 100%;
}

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-close {
    top: -60px;
    right: 0;
    font-size: 24px;
    font-weight: bold;
}

.lightbox-prev {
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-counter {
    position: absolute;
    top: -60px;
    left: 0;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
}

/* Lightbox Thumbnails */
.lightbox-thumbnails {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.lightbox-thumb {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
    opacity: 0.7;
}

.lightbox-thumb:hover {
    transform: scale(1.1);
    opacity: 1;
    border-color: #007cba;
}

.lightbox-thumb.active {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.5);
    opacity: 1;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-thumb img.loaded {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-image {
        max-height: 50vh;
    }
    
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-close {
        top: -50px;
    }
    
    .lightbox-prev {
        left: -50px;
    }
    
    .lightbox-next {
        right: -50px;
    }
    
    .lightbox-counter {
        top: -50px;
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .lightbox-thumbnails {
        bottom: -70px;
        gap: 6px;
        padding: 8px;
    }
    
    .lightbox-thumb {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .lightbox-close {
        top: -45px;
    }
    
    .lightbox-prev {
        left: -45px;
    }
    
    .lightbox-next {
        right: -45px;
    }
    
    .lightbox-counter {
        top: -45px;
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .lightbox-caption {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .lightbox-image {
        max-height: 40vh;
    }
    
    .lightbox-thumbnails {
        bottom: -60px;
        gap: 4px;
        padding: 6px;
        max-width: 95%;
    }
    
    .lightbox-thumb {
        width: 40px;
        height: 40px;
    }
}

/* Animation for lightbox appearance */
.custom-lightbox {
    animation: lightboxFadeIn 0.3s ease-out;
}

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

.lightbox-image {
    animation: lightboxImageZoom 0.3s ease-out;
}

@keyframes lightboxImageZoom {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Focus states for accessibility */
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .custom-lightbox {
        display: none !important;
    }
}
