/* Variables CSS */
:root {
    --afa-bg-color: #e74c3c;
    --afa-text-color: #ffffff;
}

/* Bannière principale */
.afa-alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--afa-bg-color) 0%, color-mix(in srgb, var(--afa-bg-color) 85%, black) 100%);
    color: var(--afa-text-color);
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: slideDown 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
}

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

/* Animation de fermeture */
@keyframes slideUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-120%);
        opacity: 0;
    }
}

.afa-alert-banner.afa-closing {
    animation: slideUp 0.4s ease-in-out forwards;
}

/* Container */
.afa-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Contenu */
.afa-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 60px 20px 20px;
    position: relative;
}

/* Icône wrapper */
.afa-icon-wrapper {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Icône SVG */
.afa-icon {
    width: 24px;
    height: 24px;
    color: var(--afa-text-color);
}

/* Message */
.afa-message {
    text-align: center;
}

.afa-title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.afa-text {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

/* Bouton de fermeture */
.afa-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    color: var(--afa-text-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.afa-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) rotate(90deg);
    border-color: rgba(255, 255, 255, 0.5);
}

.afa-close:active {
    transform: translateY(-50%) scale(0.9) rotate(90deg);
}

.afa-close svg {
    width: 18px;
    height: 18px;
}

/* Ajustement du body */
body.has-afa-alert {
    padding-top: 90px !important;
    transition: padding-top 0.3s ease;
}

body.has-afa-alert.admin-bar {
    padding-top: 122px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .afa-content {
        padding: 15px 50px 15px 15px;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .afa-icon-wrapper {
        width: 35px;
        height: 35px;
    }
    
    .afa-icon {
        width: 20px;
        height: 20px;
    }
    
    .afa-title {
        font-size: 11px;
        letter-spacing: 1px;
    }
    
    .afa-text {
        font-size: 14px;
    }
    
    .afa-close {
        right: 10px;
        width: 32px;
        height: 32px;
    }
    
    body.has-afa-alert {
        padding-top: 80px !important;
    }
    
    body.has-afa-alert.admin-bar {
        padding-top: 126px !important;
    }
}

@media (max-width: 480px) {
    .afa-content {
        padding: 12px 45px 12px 12px;
    }
    
    .afa-icon-wrapper {
        display: none;
    }
    
    .afa-text {
        font-size: 13px;
    }
    
    body.has-afa-alert {
        padding-top: 70px !important;
    }
}

/* Effet de survol sur toute la bannière */
.afa-alert-banner:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

/* Support du mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .afa-alert-banner {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
}