.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox--active {
    display: block;
}

.lightbox--visible {
    opacity: 1;
}

.lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 2;
}

.lightbox__close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    z-index: 2;
}

.lightbox__nav:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
}

.lightbox__nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox__nav--prev {
    left: 1rem;
}

.lightbox__nav--next {
    right: 1rem;
}

.lightbox__image-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox__image--loaded {
    opacity: 1;
    transform: scale(1);
}

.lightbox__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lightbox__loading--active {
    opacity: 1;
}

.lightbox__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: lightboxSpin 1s linear infinite;
}

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

.lightbox__info {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .lightbox__content {
        padding: 1rem;
    }
    
    .lightbox__close {
        width: 40px;
        height: 40px;
    }
    
    .lightbox__nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox__nav--prev {
        left: 0.5rem;
    }
    
    .lightbox__nav--next {
        right: 0.5rem;
    }
    
    .lightbox__image {
        max-width: 100%;
        max-height: 80vh;
    }
}

@media (hover: none) and (pointer: coarse) {
    .lightbox__nav {
        background-color: rgba(0, 0, 0, 0.5);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox__image {
        transition: none;
    }
    
    .lightbox__spinner {
        animation: none;
    }
}