/* ══════════════════════════════════════════════════════
   NEWS TICKER PRO — Professional TV-style ticker bar
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;700&family=Barlow:wght@400;500&display=swap');

/* ── Reset scope ── */
#ntp-ticker-bar *,
#ntp-ticker-bar *::before,
#ntp-ticker-bar *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Root bar ── */
#ntp-ticker-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    height: 42px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 12px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.04);
    will-change: transform;
}

/* ── Push page content below the bar ── */
body.ntp-active {
    margin-top: 42px !important;
    padding-top: 0 !important;
}

/* ────────────────────────────────
   THEMES
──────────────────────────────── */

/* Dark (default — TV/Bloomberg style) */
#ntp-ticker-bar.ntp-theme-dark {
    background: #0d0e10;
    border-bottom: 2px solid #c8102e;
}

#ntp-ticker-bar.ntp-theme-dark .ntp-label {
    background: #c8102e;
    background: linear-gradient(135deg, #e8001c 0%, #a8001a 100%);
}

#ntp-ticker-bar.ntp-theme-dark .ntp-track-wrap {
    background: #111214;
}

#ntp-ticker-bar.ntp-theme-dark .ntp-headline,
#ntp-ticker-bar.ntp-theme-dark .ntp-sep,
#ntp-ticker-bar.ntp-theme-dark .ntp-divider {
    color: #e8eaed;
}

#ntp-ticker-bar.ntp-theme-dark .ntp-controls,
#ntp-ticker-bar.ntp-theme-dark .ntp-time {
    background: #1a1b1f;
    color: #9aa0aa;
    border-left: 1px solid #2a2c33;
}

/* Light */
#ntp-ticker-bar.ntp-theme-light {
    background: #f2f3f5;
    border-bottom: 2px solid #1a6ed8;
}

#ntp-ticker-bar.ntp-theme-light .ntp-label {
    background: linear-gradient(135deg, #1a6ed8 0%, #0d4fa8 100%);
}

#ntp-ticker-bar.ntp-theme-light .ntp-track-wrap {
    background: #ffffff;
}

#ntp-ticker-bar.ntp-theme-light .ntp-headline,
#ntp-ticker-bar.ntp-theme-light .ntp-sep,
#ntp-ticker-bar.ntp-theme-light .ntp-divider {
    color: #1a1a2e;
}

#ntp-ticker-bar.ntp-theme-light .ntp-controls,
#ntp-ticker-bar.ntp-theme-light .ntp-time {
    background: #e8eaed;
    color: #555;
    border-left: 1px solid #ccc;
}

/* Red (Breaking News) */
#ntp-ticker-bar.ntp-theme-red {
    background: #1a0000;
    border-bottom: 2px solid #ff1a1a;
}

#ntp-ticker-bar.ntp-theme-red .ntp-label {
    background: linear-gradient(135deg, #ff1a1a 0%, #cc0000 100%);
    animation: ntp-label-pulse 2s ease-in-out infinite;
}

@keyframes ntp-label-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.82; }
}

#ntp-ticker-bar.ntp-theme-red .ntp-track-wrap {
    background: #120000;
}

#ntp-ticker-bar.ntp-theme-red .ntp-headline,
#ntp-ticker-bar.ntp-theme-red .ntp-sep,
#ntp-ticker-bar.ntp-theme-red .ntp-divider {
    color: #ffe8e8;
}

#ntp-ticker-bar.ntp-theme-red .ntp-controls,
#ntp-ticker-bar.ntp-theme-red .ntp-time {
    background: #1e0000;
    color: #cc6666;
    border-left: 1px solid #3a0000;
}

/* ────────────────────────────────
   LABEL  (left badge)
──────────────────────────────── */
.ntp-label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px 0 13px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
    padding-right: 22px;
    min-width: 140px;
    justify-content: center;
}

.ntp-label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(255,255,255,0.9);
    animation: ntp-blink 1.4s ease-in-out infinite;
}

@keyframes ntp-blink {
    0%, 100% { opacity: 1;   box-shadow: 0 0 6px rgba(255,255,255,0.9); }
    50%       { opacity: 0.3; box-shadow: none; }
}

.ntp-label-text {
    font-size: 13px;
    letter-spacing: 0.15em;
}

/* ────────────────────────────────
   SCROLLING TRACK
──────────────────────────────── */
.ntp-track-wrap {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

/* Left fade */
.ntp-track-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

#ntp-ticker-bar.ntp-theme-dark  .ntp-track-wrap::before { background: linear-gradient(to right, #111214, transparent); }
#ntp-ticker-bar.ntp-theme-light .ntp-track-wrap::before { background: linear-gradient(to right, #fff, transparent); }
#ntp-ticker-bar.ntp-theme-red   .ntp-track-wrap::before { background: linear-gradient(to right, #120000, transparent); }

.ntp-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    /* JS drives the animation via requestAnimationFrame */
}

/* ────────────────────────────────
   NEWS ITEMS
──────────────────────────────── */
.ntp-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 6px;
    font-size: 14.5px;
    line-height: 1;
}

.ntp-source {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}

.ntp-sep {
    font-size: 11px;
    opacity: 0.5;
    flex-shrink: 0;
}

.ntp-headline {
    font-weight: 500;
    font-size: 14.5px;
    font-family: 'Barlow', Arial, sans-serif;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    transition: color 0.18s;
}

a.ntp-headline:hover {
    text-decoration: underline !important;
    opacity: 0.88;
}

.ntp-divider {
    font-size: 9px;
    opacity: 0.28;
    padding: 0 12px;
    flex-shrink: 0;
}

/* ────────────────────────────────
   CONTROLS (right side)
──────────────────────────────── */
.ntp-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 4px;
}

.ntp-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, opacity 0.15s;
    opacity: 0.55;
    width: 26px;
    height: 26px;
}

.ntp-btn svg {
    width: 13px;
    height: 13px;
}

.ntp-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.ntp-btn-reload svg {
    width: 14px;
    height: 14px;
}

.ntp-btn-reload.ntp-spinning svg {
    animation: ntp-spin 0.7s linear infinite;
}

@keyframes ntp-spin {
    to { transform: rotate(360deg); }
}

/* ────────────────────────────────
   CLOCK
──────────────────────────────── */
.ntp-time {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    white-space: nowrap;
    min-width: 56px;
    justify-content: center;
    border-left: 1px solid;
}

/* ────────────────────────────────
   LOADING SKELETON
──────────────────────────────── */
.ntp-loading {
    padding: 0 20px;
    font-size: 13px;
    opacity: 0.5;
    letter-spacing: 0.08em;
    animation: ntp-fade 1.2s ease-in-out infinite alternate;
}

@keyframes ntp-fade {
    from { opacity: 0.3; }
    to   { opacity: 0.7; }
}

/* ────────────────────────────────
   PAUSED STATE
──────────────────────────────── */
#ntp-ticker-bar.ntp-paused .ntp-label-dot {
    animation: none;
    opacity: 0.4;
}

/* ────────────────────────────────
   MOBILE
──────────────────────────────── */
@media (max-width: 600px) {
    #ntp-ticker-bar {
        height: 38px;
    }
    body.ntp-active {
        margin-top: 38px !important;
    }
    .ntp-label {
        min-width: 100px;
        font-size: 11px;
        padding-right: 16px;
    }
    .ntp-label-text {
        font-size: 11px;
    }
    .ntp-item {
        font-size: 13.5px;
    }
    .ntp-headline {
        font-size: 13.5px;
    }
    .ntp-time {
        display: none;
    }
}
