/**
 * Styles pour le système de zoom d'images
 * Utilisation : Ajouter la classe 'zoomable-image' à n'importe quelle image
 */

/* ============================
   CLASSE ZOOMABLE-IMAGE
   ============================ */

/* Classe à appliquer aux images zoomables */
.zoomable-image,
.zoomable-image img {
    cursor: pointer !important;
}

.zoomable-image:hover {
    opacity: 0.9;
}

/* ============================
   MODAL DE ZOOM
   ============================ */

/* Modal de zoom */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.image-zoom-modal.active {
    display: block;
}

.image-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.image-zoom-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-zoom-content {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-zoom-modal.active .image-zoom-content {
    transform: scale(1);
}

/* ============================
   BOUTON DE FERMETURE
   ============================ */

.image-zoom-close {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    color: #333;
    font-family: Arial, sans-serif;
    line-height: 1;
    z-index: 10000;
}

.image-zoom-close:hover {
    transform: scale(1.1);
    text-decoration: none;
}

/* ============================
   RESPONSIVE
   ============================ */

/* Très petits écrans - 481px et plus */
@media (min-width: 481px) {
    .image-zoom-overlay {
        padding: 10px;
        flex-direction: column;
    }

    .image-zoom-container {
        max-width: 95%;
        max-height: 80%;
        flex-direction: column;
    }

    .image-zoom-close {
        position: static;
        margin-top: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Mobile - 769px et plus */
@media (min-width: 769px) {
    .image-zoom-overlay {
        padding: 15px;
        flex-direction: column;
    }

    .image-zoom-container {
        max-width: 92%;
        max-height: 80%;
        flex-direction: column;
    }

    .image-zoom-close {
        position: static;
        margin-top: 20px;
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
}

/* Desktop - 1025px et plus */
@media (min-width: 1025px) {
    .image-zoom-overlay {
        padding: 20px;
        flex-direction: row !important;
        /* Retour au layout horizontal */
    }

    .image-zoom-container {
        max-width: 90%;
        max-height: 90%;
        flex-direction: row !important;
        /* Retour au layout horizontal */
    }

    .image-zoom-close {
        position: absolute !important;
        /* Retour au positionnement absolu */
        top: -50px !important;
        right: -25px !important;
        margin-top: 0 !important;
        /* Reset margin */
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Très petits écrans par défaut (0-480px) */
.image-zoom-overlay {
    padding: 5px;
    flex-direction: column;
}

.image-zoom-container {
    max-width: 98%;
    max-height: 80%;
    flex-direction: column;
}

.image-zoom-close {
    position: static;
    margin-top: 15px;
    width: 50px;
    height: 50px;
    font-size: 18px;
}

.zoomable-image:hover {
    transform: none;
    /* Désactiver l'effet hover sur mobile par défaut */
}

/* ============================
   ACCESSIBILITÉ
   ============================ */

/* Focus pour l'accessibilité clavier */
.zoomable-image:focus {
    outline: 3px solid #2196F3;
    outline-offset: 2px;
}

/* Préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {

    .image-zoom-modal,
    .image-zoom-content,
    .image-zoom-close,
    .zoomable-image {
        transition: none !important;
        animation: none !important;
    }

    .zoomable-image:hover {
        transform: none !important;
    }
}