/* Simple Title Marquee Animation */
/* Lightweight solution for long titles that need to scroll */

.stream-title {
    position: relative;
    height: 1.5rem; /* Fixed height for one line */
    overflow: hidden;
    white-space: nowrap;
}

/* Container for scrolling text - only shows when needed */
.title-marquee-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    overflow: hidden;
    white-space: nowrap;
    /* Optimize for smooth animations */
    contain: layout style paint;
}

/* The actual scrolling text element - contains duplicated text for seamless loop */
.title-marquee-text {
    display: inline-block;
    white-space: nowrap;
    animation: continuousScroll 12s linear infinite;
    animation-play-state: running;
    will-change: transform; /* GPU acceleration hint */
    backface-visibility: hidden; /* Prevents flickering */
}

/* Keep ONE consistent speed across all devices - no speed changes */

/* True continuous scroll - no gaps, no pauses */
@keyframes continuousScroll {
    0% {
        transform: translateX(0%);
        -webkit-transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%); /* Move exactly half way (because text is duplicated) */
        -webkit-transform: translateX(-50%);
    }
}

/* Pause animation when not visible (performance optimization) */
.title-marquee-container.paused .title-marquee-text {
    animation-play-state: paused;
}

/* Ensure smooth start - no flicker on load */
.title-marquee-container {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

/* Static fallback for short titles or when animations are disabled */
.stream-title.static-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-title.static-title .title-marquee-container {
    display: none;
}

/* Hide static text when marquee is active */
.stream-title.has-marquee > .stream-title-static {
    display: none;
}
