/* ================================================
   STYLES POUR LES ANNONCES GLOBALES
   ================================================ */

/* Conteneur principal des annonces */
.global-announcements-container {
    position: relative;
    z-index: 1000;
    width: 100%;
}

/* Bandeau d'annonce */
.announcement-banner {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    margin: 0;
    padding: 0;
    font-weight: 500;
}

/* Conteneur du texte défilant */
.announcement-scroll {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

/* Contenu de l'annonce avec animation */
.announcement-content {
    display: inline-block;
    padding-left: 100%;
    animation: scroll-left 25s linear infinite;
    font-size: 0.95rem;
    line-height: 40px;
}

/* Animation de défilement */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Pause au survol */
.announcement-content:hover {
    animation-play-state: paused;
    cursor: default;
}

/* Icônes dans les annonces */
.announcement-content i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Styles spécifiques par type d'annonce */
.announcement-banner.alert-info {
    background: linear-gradient(90deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-bottom: 2px solid #bee5eb;
}

.announcement-banner.alert-success {
    background: linear-gradient(90deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-bottom: 2px solid #c3e6cb;
}

.announcement-banner.alert-warning {
    background: linear-gradient(90deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-bottom: 2px solid #ffeaa7;
}

.announcement-banner.alert-danger {
    background: linear-gradient(90deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-bottom: 2px solid #f5c6cb;
}

/* Animation de pulsation pour les annonces urgentes */
.announcement-banner.alert-danger .announcement-content {
    animation: scroll-left 25s linear infinite, pulse-urgent 2s ease-in-out infinite;
}

@keyframes pulse-urgent {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

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

/* Tablettes */
@media (max-width: 992px) {
    .announcement-content {
        font-size: 0.9rem;
        animation-duration: 22s;
    }
    
    .announcement-scroll {
        height: 36px;
    }
    
    .announcement-content {
        line-height: 36px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .announcement-content {
        font-size: 0.85rem;
        animation-duration: 20s;
    }
    
    .announcement-scroll {
        height: 32px;
    }
    
    .announcement-content {
        line-height: 32px;
    }
    
    .announcement-content i {
        font-size: 1rem;
        margin-right: 6px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .announcement-content {
        font-size: 0.8rem;
        animation-duration: 18s;
    }
    
    .announcement-scroll {
        height: 28px;
    }
    
    .announcement-content {
        line-height: 28px;
    }
}

/* ================================================
   MODE SOMBRE (si implémenté)
   ================================================ */

@media (prefers-color-scheme: dark) {
    .announcement-banner.alert-info {
        background: linear-gradient(90deg, #1a3f47 0%, #255861 100%);
        color: #a4d4e0;
        border-bottom-color: #255861;
    }
    
    .announcement-banner.alert-success {
        background: linear-gradient(90deg, #1e3a26 0%, #2d5739 100%);
        color: #a8e6b8;
        border-bottom-color: #2d5739;
    }
    
    .announcement-banner.alert-warning {
        background: linear-gradient(90deg, #4a3f1e 0%, #6b5a2d 100%);
        color: #ffe8a4;
        border-bottom-color: #6b5a2d;
    }
    
    .announcement-banner.alert-danger {
        background: linear-gradient(90deg, #4a1e26 0%, #6b2d39 100%);
        color: #f5a8b8;
        border-bottom-color: #6b2d39;
    }
}

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

/* Réduction des animations pour les utilisateurs qui le préfèrent */
@media (prefers-reduced-motion: reduce) {
    .announcement-content {
        animation: none;
        padding-left: 20px;
        transform: none;
    }
    
    .announcement-scroll {
        overflow-x: auto;
    }
}

/* Focus pour l'accessibilité au clavier */
.announcement-content:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ================================================
   EFFETS VISUELS SUPPLÉMENTAIRES
   ================================================ */

/* Effet de brillance (optionnel) */
.announcement-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 8s infinite;
}

@keyframes shine {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 150%;
    }
}

/* Désactiver l'effet de brillance au survol */
.announcement-banner:hover::before {
    animation-play-state: paused;
}

/* Ombre subtile */
.announcement-banner {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ================================================
   PRINT (masquer les annonces à l'impression)
   ================================================ */

@media print {
    .global-announcements-container {
        display: none !important;
    }
}
