/**
 * Styles de la popup d'accueil
 * 
 * @package MW_ACF_Popup
 */

/* Empêcher le scroll quand la popup est ouverte */
body.mw-popup-active {
    overflow: hidden;
}

/* Overlay de fond */
.mw-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-sizing: border-box;
}

/* Container de la popup */
.mw-popup-container {
    position: relative;
    background: #ffffff;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: mw-popup-slide-in 0.3s ease-out;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Animation d'entrée */
@keyframes mw-popup-slide-in {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Bouton de fermeture */
.mw-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    color: #333;
}

.mw-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.mw-popup-close:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Contenu de la popup */
.mw-popup-content {
    padding: 40px 30px 30px;
    box-sizing: border-box;
    width: 100%;
}

/* Titre */
.mw-popup-title {
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Image */
.mw-popup-image {
    margin: 0 0 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.mw-popup-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}

.mw-popup-image a {
    display: inline-block;
    transition: transform 0.2s ease;
}

.mw-popup-image a:hover {
    transform: scale(1.02);
}

.mw-popup-image a:focus {
    outline: 2px solid #0066cc;
    outline-offset: 4px;
    border-radius: 8px;
}

/* Contenu texte */
.mw-popup-text {
    margin: 0 0 20px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    box-sizing: border-box;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
}

.mw-popup-text:last-child {
    margin-bottom: 0;
}

.mw-popup-text p:first-child {
    margin-top: 0;
}

.mw-popup-text p:last-child {
    margin-bottom: 0;
}

/* Bouton */
.mw-popup-button {
    text-align: center;
    margin-top: 25px;
}

.mw-popup-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #667eea;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.mw-popup-btn:hover {
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
}

.mw-popup-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 3px;
}

.mw-popup-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .mw-popup-overlay {
        padding: 15px;
    }

    .mw-popup-container {
        max-height: 95vh;
        border-radius: 12px;
    }

    .mw-popup-content {
        padding: 35px 20px 20px;
    }

    .mw-popup-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .mw-popup-text {
        font-size: 15px;
    }

    .mw-popup-btn {
        padding: 12px 28px;
        font-size: 15px;
    }

    .mw-popup-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
}

@media screen and (max-width: 480px) {
    .mw-popup-title {
        font-size: 20px;
    }

    .mw-popup-content {
        padding: 30px 15px 15px;
    }

    .mw-popup-text {
        font-size: 14px;
    }

    .mw-popup-btn {
        padding: 12px 20px;
    }
}

/* Scrollbar personnalisée pour la popup */
/* Les couleurs sont appliquées dynamiquement via PHP selon la couleur du bouton */

/* Support Firefox */
.mw-popup-container {
    scrollbar-width: thin;
}

/* Support WebKit (Chrome, Safari, Edge) */
.mw-popup-container::-webkit-scrollbar {
    width: 10px;
}

.mw-popup-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0 16px 16px 0;
}

.mw-popup-container::-webkit-scrollbar-thumb {
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background 0.3s ease;
}

/* Les couleurs de hover et normales sont définies via inline styles */

/* Support pour les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .mw-popup-container {
        animation: none;
    }

    .mw-popup-close:hover,
    .mw-popup-image a:hover,
    .mw-popup-btn:hover {
        transform: none;
    }
}

