/* Styles pour le bandeau de flash infos */
.flash-news-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* Background plus clair pour la zone de défilement */
    background-color: rgba(var(--bs-danger-rgb, 220, 53, 69), 0.85) !important;
}

/* Variantes pour différentes couleurs de fond */
.flash-news-container.bg-danger {
    background-color: rgba(220, 53, 69, 0.85) !important;
}

.flash-news-container.bg-warning {
    background-color: rgba(255, 193, 7, 0.85) !important;
}

.flash-news-container.bg-info {
    background-color: rgba(13, 202, 240, 0.85) !important;
}

.flash-news-container.bg-primary {
    background-color: rgba(13, 110, 253, 0.85) !important;
}

.flash-news-container.bg-success {
    background-color: rgba(25, 135, 84, 0.85) !important;
}

.flash-news-container.bg-orange {
    background-color: rgba(253, 126, 20, 0.85) !important;
}

.flash-news-container.bg-secondary {
    background-color: rgba(108, 117, 125, 0.85) !important;
}

.flash-news-container.bg-dark {
    background-color: rgba(33, 37, 41, 0.85) !important;
}

.flash-news-container.bg-light {
    background-color: rgba(248, 249, 250, 0.85) !important;
}

.flash-news-label {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 0 15px;
    display: flex;
    align-items: center;
    font-weight: bold;
    z-index: 2;
    /* Label plus foncé et saturé */
    filter: brightness(0.85) saturate(1.2);
    /* Ajouter une bordure droite pour séparer visuellement */
    border-right: 2px solid rgba(0, 0, 0, 0.15);
    /* Ombre portée pour créer de la profondeur */
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

.flash-news-label::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 0;
    bottom: 0;
    width: 15px;
    background: inherit;
    clip-path: polygon(0 0, 0% 100%, 100% 50%);
    /* Hériter du filtre du parent */
    filter: brightness(0.85) saturate(1.2);
}

.flash-news-content {
    white-space: nowrap;
    padding: 12px 15px 12px 120px;
    animation-name: continuous-scroll;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    display: inline-block;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Animation alternative pour assurer un défilement continu */
@keyframes continuous-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Optimisation pour les vitesses très lentes */
.flash-news-content {
    animation-timing-function: linear;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

/* Assurer que le contenu s'enchaîne parfaitement sans pause */
.flash-news-content::before {
    content: attr(data-content);
    position: absolute;
    white-space: nowrap;
    right: 100%;
    top: 0;
    height: 100%;
    padding: 12px 15px;
    display: flex;
    align-items: center;
}

/* Assurer que l'animation ne s'arrête jamais entre deux cycles */
.flash-news-content {
    animation-delay: 0s;
    animation-play-state: running;
}

/* Pause de l'animation au survol (hover) pour desktop */
.flash-news-container:hover .flash-news-content {
    animation-play-state: paused !important;
}

/* Pause aussi les pseudo-éléments */
.flash-news-container:hover .flash-news-content::before,
.flash-news-container:hover .flash-news-content::after {
    animation-play-state: paused !important;
}

/* Classe pour mettre en pause l'animation (utilisée pour le mobile) */
.flash-news-container.paused .flash-news-content {
    animation-play-state: paused !important;
}

.flash-news-container.paused .flash-news-content::before,
.flash-news-container.paused .flash-news-content::after {
    animation-play-state: paused !important;
}

/* Indicateur visuel de pause */
.flash-news-container:hover::before,
.flash-news-container.paused::before,
.flash-news-container.hover-paused::before {
    content: '⏸';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    font-size: 1.2rem;
    z-index: 10;
    opacity: 0.7;
    animation: pulse-pause 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-pause {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.3;
    }
}

/* Améliorer le curseur pour indiquer l'interactivité */
.flash-news-container {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Ajout d'une deuxième animation pour créer un effet continu */
.flash-news-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 120px; /* Commencer après le label */
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.05) 5%, transparent 50%, rgba(0,0,0,0.05) 95%, transparent 100%);
    opacity: 0.5;
    z-index: 1;
}

/* Ajout d'une classe pour le conteneur afin d'améliorer l'enchaînement */
.flash-news-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Ajout d'un style pour dupliquer le contenu et assurer un défilement continu */
.flash-news-content::after {
    content: attr(data-content);
    padding-left: 30px;
    display: inline-block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flash-news-label {
        padding: 0 10px;
        font-size: 0.9rem;
    }
    
    .flash-news-content {
        padding: 10px 10px 10px 100px;
    }
    
    /* Ajuster le gradient sur mobile */
    .flash-news-container::after {
        left: 100px;
    }
}