/* ════════════════════════════════════════════════════════════
   NEWS TICKER — Advanced Analysis
   ════════════════════════════════════════════════════════════ */

/* ── Conteneur principal ─────────────────────────────────── */
.news-ticker-section {
    display: flex;
    align-items: stretch;
    height: 52px;
    margin: 16px 0;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(102, 126, 234, 0.35);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Masque fondu gauche */
.news-ticker-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 100%;
    background: linear-gradient(to right, #0f172a, transparent);
    z-index: 3;
    pointer-events: none;
}

/* Masque fondu droit (avant les contrôles) */
.news-ticker-section::after {
    content: '';
    position: absolute;
    right: 54px;
    top: 0;
    width: 48px;
    height: 100%;
    background: linear-gradient(to left, #0f172a, transparent);
    z-index: 3;
    pointer-events: none;
}

/* ── Label gauche — MASQUÉ ───────────────────────────────── */
.news-ticker-label {
    display: none;
}

/* ── Zone scrollante ─────────────────────────────────────── */
.news-ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.news-ticker-wrapper:hover .news-ticker-track {
    animation-play-state: paused;
}

/* ── Track (contenu dupliqué × 2 pour boucle infinie) ────── */
.news-ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: newsTickerScroll 80s linear infinite;
    will-change: transform;
    gap: 0;
}

.news-ticker-track.paused {
    animation-play-state: paused !important;
}

@keyframes newsTickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Item individuel ─────────────────────────────────────── */
.news-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 28px 0 20px;
    height: 52px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
    position: relative;
}

.news-ticker-item:hover {
    background: rgba(102, 126, 234, 0.12);
}

/* Pastille colorée */
.news-ticker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.7);
}

/* Source */
.news-ticker-source {
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex-shrink: 0;
    background: rgba(102, 126, 234, 0.25);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Titre de l'article */
.news-ticker-headline {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.news-ticker-item:hover .news-ticker-headline {
    color: #ffffff;
}

/* Temps */
.news-ticker-time {
    font-size: 11px;
    font-weight: 500;
    color: #ffffff;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Séparateur ◆ */
.news-ticker-separator {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 10px;
    flex-shrink: 0;
    user-select: none;
}

/* ── État de chargement ──────────────────────────────────── */
.news-ticker-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.news-ticker-loading i {
    color: #ffffff;
}

/* ── État "no news" ──────────────────────────────────────── */
.news-ticker-empty {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px;
    color: #ffffff;
    font-size: 13px;
    font-style: italic;
    white-space: nowrap;
}

/* ── Bouton Pause/Play ───────────────────────────────────── */
.news-ticker-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    flex-shrink: 0;
    z-index: 4;
    background: rgba(15, 23, 42, 0.85);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.ticker-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s ease;
    outline: none;
}

.ticker-control-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.4);
}

.ticker-control-btn.is-paused {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .news-ticker-section {
        height: 46px;
    }

    .news-ticker-section::after {
        right: 50px;
        width: 32px;
    }

    .news-ticker-headline {
        max-width: 240px;
    }

    .news-ticker-item {
        padding: 0 18px 0 14px;
        gap: 7px;
    }

    .news-ticker-source {
        display: none;
    }

    .news-ticker-controls {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .news-ticker-headline {
        max-width: 160px;
    }
}

/* ── Dark mode ───────────────────────────────────────────── */
body.dark-mode .news-ticker-section {
    background: linear-gradient(135deg, #060d1a 0%, #0f172a 100%);
    border-color: rgba(102, 126, 234, 0.45);
}

body.dark-mode .news-ticker-section::before {
    background: linear-gradient(to right, #060d1a, transparent);
}

body.dark-mode .news-ticker-section::after {
    background: linear-gradient(to left, #060d1a, transparent);
}

body.dark-mode .news-ticker-controls {
    background: rgba(6, 13, 26, 0.9);
}