/**
 * Scheduled Popup - Styles CSS Frontend
 * 
 * Styles pour l'affichage des popups côté visiteur
 * Responsive, animations douces, overlay sombre
 */

/* ==========================================================
   VARIABLES CSS (personnalisables)
   ========================================================== */
:root {
    --popup-overlay-color: rgba(0, 0, 0, 0.75);
    --popup-close-bg: #ffffff;
    --popup-close-color: #333333;
    --popup-close-hover-bg: #f0f0f0;
    --popup-border-radius: 8px;
    --popup-animation-duration: 0.3s;
    --popup-max-width: 600px;
    --popup-max-height: 85vh;
    --popup-z-index: 999999;
}

/* ==========================================================
   CONTAINER PRINCIPAL
   ========================================================== */
.scheduled-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--popup-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* ==========================================================
   OVERLAY SOMBRE
   ========================================================== */
.scheduled-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--popup-overlay-color);
    opacity: 0;
    transition: opacity var(--popup-animation-duration) ease-out;
}

/* État visible de l'overlay */
.scheduled-popup.is-visible .scheduled-popup__overlay {
    opacity: 1;
}

/* ==========================================================
   CONTENU DE LA POPUP
   ========================================================== */
.scheduled-popup__content {
    position: relative;
    max-width: var(--popup-max-width);
    max-height: var(--popup-max-height);
    background-color: transparent;
    border-radius: var(--popup-border-radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    line-height: 0; /* Supprime l'espace sous l'image */
    font-size: 0; /* Supprime l'espace sous l'image */
    
    /* Animation initiale : invisible et réduit */
    opacity: 0;
    transform: scale(0.8);
    transition: 
        opacity var(--popup-animation-duration) ease-out,
        transform var(--popup-animation-duration) ease-out;
}

/* État visible du contenu */
.scheduled-popup.is-visible .scheduled-popup__content {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================
   BOUTON FERMER
   ========================================================== */
.scheduled-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--popup-close-bg);
    color: var(--popup-close-color);
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 
        background-color 0.2s ease,
        transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.scheduled-popup__close:hover {
    background-color: var(--popup-close-hover-bg);
    transform: scale(1.1);
}

.scheduled-popup__close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* ==========================================================
   LIEN ET IMAGE
   ========================================================== */
.scheduled-popup__link {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.scheduled-popup__image {
    display: block;
    max-width: var(--popup-max-width);
    max-height: var(--popup-max-height);
    width: auto;
    height: auto;
    border-radius: var(--popup-border-radius);
}

/* Image cliquable pour fermer (quand pas de lien) */
.scheduled-popup__image--clickable {
    cursor: pointer;
}

/* ==========================================================
   RESPONSIVE - TABLETTE
   ========================================================== */
@media screen and (max-width: 768px) {
    :root {
        --popup-max-height: 80vh;
    }
    
    .scheduled-popup {
        padding: 15px;
    }
    
    .scheduled-popup__content {
        max-width: 90%;
    }
    
    .scheduled-popup__close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }
}

/* ==========================================================
   RESPONSIVE - MOBILE
   ========================================================== */
@media screen and (max-width: 480px) {
    :root {
        --popup-max-height: 75vh;
    }
    
    .scheduled-popup {
        padding: 10px;
    }
    
    .scheduled-popup__content {
        max-width: 95%;
    }
    
    .scheduled-popup__close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        top: 6px;
        right: 6px;
    }
}

/* ==========================================================
   ANIMATION DE FERMETURE
   ========================================================== */
.scheduled-popup.is-closing .scheduled-popup__overlay {
    opacity: 0;
}

.scheduled-popup.is-closing .scheduled-popup__content {
    opacity: 0;
    transform: scale(0.8);
}

/* ==========================================================
   ACCESSIBILITÉ - Désactiver animations si préférence
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    .scheduled-popup__overlay,
    .scheduled-popup__content,
    .scheduled-popup__close {
        transition: none;
    }
}
