/* 
 * Public Styles - MARRIFA Promo Banner v2.0
 * Design responsive - Bannière permanente sous le header
 */

/* Bannière principale */
#marrifa-promo-banner {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

/* Container */
.marrifa-banner-container {
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
}

/* Contenu */
.marrifa-banner-content {
    flex: 1;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-align: center;
}

.marrifa-banner-content:hover {
    opacity: 0.9;
}

.marrifa-banner-content:active {
    opacity: 0.8;
}

.marrifa-banner-message {
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Popup Modal */
.marrifa-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.marrifa-popup-overlay.active {
    opacity: 1;
}

.marrifa-popup-content {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90vh;
    width: 900px;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.marrifa-popup-overlay.active .marrifa-popup-content {
    transform: scale(1);
}

.marrifa-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    color: #333;
    font-size: 28px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

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

.marrifa-popup-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Container pour iframe */
.marrifa-popup-iframe-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.marrifa-popup-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Footer du popup (pour masquer signature Tally) */
.marrifa-popup-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

/* Responsive Design */

/* Tablettes */
@media (max-width: 1024px) {
    #marrifa-promo-banner {
        height: auto !important;
        min-height: 60px;
        padding: 12px 0;
    }
    
    .marrifa-banner-container {
        padding: 0 20px;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    #marrifa-promo-banner {
        padding: 10px 0;
    }
    
    .marrifa-banner-container {
        padding: 0 15px;
    }
    
    .marrifa-popup-content {
        width: 95%;
        max-width: 500px;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    #marrifa-promo-banner {
        padding: 8px 0;
    }
    
    .marrifa-banner-container {
        padding: 0 12px;
    }
    
    .marrifa-popup-content {
        border-radius: 8px;
    }
}

/* Animation d'entrée */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#marrifa-promo-banner {
    animation: slideDown 0.4s ease-out;
}

/* Optimisation performance */
#marrifa-promo-banner,
.marrifa-banner-content {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibilité - Préférence réduit mouvement */
@media (prefers-reduced-motion: reduce) {
    #marrifa-promo-banner,
    .marrifa-popup-overlay,
    .marrifa-popup-content {
        transition: none;
        animation: none;
    }
}

/* Print - Cacher la bannière */
@media print {
    #marrifa-promo-banner {
        display: none !important;
    }
}

/* Dark mode support (optionnel) */
@media (prefers-color-scheme: dark) {
    .marrifa-popup-content {
        background: #1e1e1e;
        color: #ffffff;
    }
    
    .marrifa-popup-close {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .marrifa-popup-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}
