/* Lightbox - Système d'agrandissement d'images */

/* Indicateur visuel sur les images zoomables */
.zoomable {
    cursor: zoom-in;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zoomable:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Icône de zoom sur les images */
.zoomable::after {
    content: '🔍';
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.zoomable:hover::after {
    opacity: 1;
}

/* Overlay de la lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Conteneur de la lightbox */
.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-container {
    transform: scale(1);
}

/* Image dans la lightbox */
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
    user-select: none;
    background: white;
}

/* Bouton de fermeture */
.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 10001;
    font-weight: 300;
}

.lightbox-close:hover {
    transform: rotate(90deg);
    color: #e5c8b8;
}

/* Boutons de navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #434f5a;
    font-size: 32px;
    cursor: pointer;
    padding: 20px 16px;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10001;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lightbox-nav:hover {
    background: #e5c8b8;
    transform: translateY(-50%) scale(1.1);
}

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

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

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

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

/* Compteur d'images */
.lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #434f5a;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Loader pendant le chargement de l'image */
.lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(229, 200, 184, 0.3);
    border-top-color: #e5c8b8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Titre/description de l'image */
.lightbox-caption {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    max-width: 600px;
    font-size: 16px;
    padding: 10px 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .lightbox-container {
        max-width: 95vw;
        max-height: 85vh;
    }

    .lightbox-close {
        top: -40px;
        font-size: 32px;
        right: -10px;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
        padding: 15px 12px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        bottom: -40px;
        font-size: 12px;
        padding: 8px 16px;
    }

    .lightbox-caption {
        bottom: -70px;
        font-size: 14px;
        max-width: 90%;
    }

    .zoomable::after {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Animation de chargement */
.lightbox-image.loading {
    opacity: 0;
}

.lightbox-image.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Désactiver le scroll du body quand la lightbox est ouverte */
body.lightbox-open {
    overflow: hidden;
}

/* Zoom additionnel sur l'image */
.lightbox-image.zoomed {
    cursor: zoom-out;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}

.display-none {
    display: none !important;
}