﻿/* Breaking News Ticker - TV subtitle style with centered collapse animation */

.bnt-ticker {
    --bnt-red: #dc2f2f;
    --bnt-red-hover: #e83838;
    --bnt-red-dark: #b82525;
    --bnt-text: #ffffff;
    position: relative;
    display: flex;
    margin-left: auto;
    margin-right: auto;
    height: 42px;
    border-radius: 21px;
    animation: bnt-cycle 50s ease-in-out infinite;
}
    
/* All properties in ONE keyframe — perfectly synced */
@keyframes bnt-cycle {
    /* Phase 1: Hold collapsed (0-6.5%) */
    0%, 6.5% {
        width: 100px;
        background: var(--bnt-red);
        box-shadow: 0 2px 8px rgba(220, 47, 47, 0.3);
    }
    /* Phase 2: Expand back to full (6.5-13%) */
    13% {
        width: 100%;
        background: var(--bnt-red);
        box-shadow: 0 2px 8px rgba(220, 47, 47, 0.3);
    }
    /* Phase 3: Scroll window (13%-95%) */
    95% {
        width: 100%;
        background: var(--bnt-red);
        box-shadow: 0 2px 8px rgba(220, 47, 47, 0.3);
    }
    /* Phase 4: Collapse to label size (95-100%) */
    100% {
        width: 100px;
        background: var(--bnt-red);
        box-shadow: 0 2px 8px rgba(220, 47, 47, 0.3);
    }
}

/* Hover: just change colors + pause scroll track — don't reset animation */
.bnt-ticker:hover {
    background: var(--bnt-red-hover);
    box-shadow: 0 0 12px rgba(220, 47, 47, 0.5), 0 2px 8px rgba(220, 47, 47, 0.3);
}

.bnt-label {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 90px;
    height: 28px;
    padding-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--bnt-red-dark);
    color: var(--bnt-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 21px;
    overflow: hidden;
}

.bnt-label-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
}

.bnt-label-icon circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 2.5;
    transform-origin: center;
    animation: bnt-pulse-scale 1.5s ease-in-out infinite;
}

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

.bnt-scroll-wrapper {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
}


/* Scroll track - hidden during collapse/expand, visible only during scroll phase */
.bnt-scroll-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: bnt-scroll-rtl 50s linear infinite, bnt-track-visibility 50s ease-in-out infinite;
    will-change: transform;
}

/* Hide track during collapse (95-100%) and expand (6.5-13%), show during scroll */
@keyframes bnt-track-visibility {
    /* Phase 1: Collapsed - hidden */
    0%, 6.5% { opacity: 0; animation-play-state: paused; }
    /* Instant fade-in at end of expand phase */
    12.9% { opacity: 0; animation-play-state: paused; }
    13% { opacity: 1; animation-play-state: running; }
    /* Scroll phase - visible */
    94.9% { opacity: 1; animation-play-state: running; }
    /* Instant fade-out at start of collapse phase */
    95% { opacity: 0; animation-play-state: paused; }
    100% { opacity: 0; animation-play-state: paused; }
}

.bnt-ticker:hover .bnt-scroll-track {
    animation-play-state: paused;
}

.bnt-item {
    display: inline-block;
    padding: 0 28px;
    color: var(--bnt-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 42px;
    white-space: nowrap;
    position: relative;
    transition: all 0.3s ease;
}

.bnt-item::after {
    content: "";
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.bnt-item:last-child::after {
    display: none;
}

.bnt-item:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

@keyframes bnt-scroll-rtl {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
    .bnt-scroll-track { animation-duration: 50s; }
    .bnt-ticker:hover { animation: none; }
}

@media (max-width: 767px) {
    .bnt-ticker { height: 38px; }
    .bnt-label { width: 70px; font-size: 11px; }
    .bnt-item { font-size: 12px; line-height: 38px; padding: 0 20px; }
}
