/**
 * Image Lightbox Styles
 * 
 * Styles for fullscreen image viewer
 */

.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.image-lightbox--visible {
    opacity: 1;
    visibility: visible;
}

.image-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
}

.image-lightbox__content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Close button */
.image-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.image-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.image-lightbox__close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Navigation buttons */
.image-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.image-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.image-lightbox__nav:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.image-lightbox__nav--prev {
    left: 20px;
}

.image-lightbox__nav--next {
    right: 20px;
}

/* Image container */
.image-lightbox__image-container {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Loader */
.image-lightbox__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
}

.image-lightbox__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Caption */
.image-lightbox__caption {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 80%;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
    backdrop-filter: blur(8px);
}

/* Counter */
.image-lightbox__counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(8px);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .image-lightbox__close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
    
    .image-lightbox__nav {
        width: 48px;
        height: 48px;
    }
    
    .image-lightbox__nav--prev {
        left: 12px;
    }
    
    .image-lightbox__nav--next {
        right: 12px;
    }
    
    .image-lightbox__image-container {
        max-width: 95%;
        max-height: 80%;
    }
    
    .image-lightbox__caption {
        bottom: 70px;
        max-width: 90%;
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .image-lightbox__counter {
        bottom: 20px;
        font-size: 13px;
        padding: 6px 14px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .image-lightbox__image-container {
        max-width: 85%;
        max-height: 80%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .image-lightbox__nav,
    .image-lightbox__close {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .image-lightbox__image-container {
        max-height: 75%;
    }
    
    .image-lightbox__caption {
        bottom: 60px;
        font-size: 12px;
    }
    
    .image-lightbox__counter {
        bottom: 15px;
        font-size: 12px;
    }
}
