/* Lightbox améliorée avec navigation continue */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    cursor: pointer;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
}

.lightbox img:hover {
    transform: scale(1.02);
}

/* Informations sur l'image */
.lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: white;
    max-width: 600px;
}

.lightbox-category {
    font-size: 14px;
    color: var(--warm-orange);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lightbox-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    font-family: 'Poppins', sans-serif;
}

/* Bouton de fermeture */
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 36px;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

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

/* Navigation latérale */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

/* Compteur */
.lightbox-counter {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

/* Contrôles en bas */
.lightbox-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10001;
}

.lightbox-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 16px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-control-btn:active {
    transform: scale(0.95);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox.show .lightbox-content {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .lightbox.show {
        padding: 20px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 80%;
    }
    
    .lightbox img {
        border-radius: 8px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
    
    .lightbox-counter {
        bottom: 100px;
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .lightbox-controls {
        bottom: 20px;
        gap: 10px;
    }
    
    .lightbox-control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .lightbox-info {
        margin-top: 15px;
    }
    
    .lightbox-category {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .lightbox-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .lightbox-counter {
        bottom: 90px;
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .lightbox-controls {
        bottom: 15px;
        gap: 8px;
    }
    
    .lightbox-control-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}

/* Indicateurs de chargement */
.lightbox img {
    background: rgba(255, 255, 255, 0.1);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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