/* ============ Live Stream Top Banner ============ */
/* Global styles - can be used on any page */

.live-stream-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(10, 0, 3, 0.98) 0%, rgba(30, 3, 10, 0.96) 50%, rgba(10, 0, 3, 0.98) 100%);
    border: 1px solid rgba(244, 1, 43, 0.45);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    animation: liveStreamFadeIn 0.5s ease-out both;
}

.live-stream-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(244, 1, 43, 0.05) 25%,
        rgba(244, 1, 43, 0.08) 50%,
        rgba(244, 1, 43, 0.05) 75%,
        transparent 100%);
    pointer-events: none;
}

.live-stream-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 120%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(244, 1, 43, 0.04),
        transparent
    );
    animation: liveStreamShimmer 3s infinite;
    pointer-events: none;
}

@keyframes liveStreamShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes liveStreamFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-stream-banner:hover {
    border-color: rgba(244, 1, 43, 0.7);
    box-shadow: 0 4px 24px rgba(244, 1, 43, 0.22);
}

.live-banner-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.live-banner-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f4012b 0%, #a3001d 100%);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(244, 1, 43, 0.45);
}

.live-banner-indicator .pulse-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.live-banner-indicator span {
    font-family: 'Apex', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.live-banner-logo {
    width: 28px;
    height: 28px;
    color: #fff;
    filter: drop-shadow(0 0 10px rgba(244, 1, 43, 0.55));
}

/* Font Awesome icon used as logo (e.g., Twitch) */
i.live-banner-logo {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.live-banner-title {
    font-family: 'Apex', sans-serif;
    font-size: 0.95rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-banner-title span {
    color: #f4012b;
}

.live-banner-right {
    position: relative;
    z-index: 1;
}

.live-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f4012b 0%, #c40026 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Apex', sans-serif;
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(244, 1, 43, 0.35);
}

.live-stream-banner:hover .live-banner-btn {
    background: linear-gradient(135deg, #ff1537 0%, #d60125 100%);
    box-shadow: 0 4px 20px rgba(244, 1, 43, 0.55);
}

.live-banner-btn i {
    font-size: 0.75rem;
}

/* ============ Mobile Responsive ============ */
@media (max-width: 768px) {
    .live-stream-banner {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .live-banner-left {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .live-banner-indicator {
        padding: 0.25rem 0.5rem;
        flex-shrink: 0;
    }

    .live-banner-indicator span {
        font-size: 0.55rem;
    }

    .live-banner-indicator .pulse-dot {
        width: 6px;
        height: 6px;
    }

    .live-banner-logo {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .live-banner-title {
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    .live-banner-right {
        flex-shrink: 0;
    }

    .live-banner-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.6rem;
        white-space: nowrap;
    }

    .live-banner-btn i {
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .live-stream-banner {
        padding: 0.4rem 0.5rem;
        gap: 0.4rem;
    }

    .live-banner-left {
        gap: 0.35rem;
    }

    .live-banner-indicator {
        padding: 0.2rem 0.4rem;
        gap: 0.3rem;
    }

    .live-banner-indicator span {
        font-size: 0.5rem;
    }

    .live-banner-indicator .pulse-dot {
        width: 5px;
        height: 5px;
    }

    .live-banner-logo {
        width: 16px;
        height: 16px;
    }

    .live-banner-title {
        font-size: 0.55rem;
    }

    /* Hide "NOW STREAMING:" prefix on very small screens */
    .live-banner-title span {
        display: none;
    }

    .live-banner-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.5rem;
        gap: 0.25rem;
    }

    /* Shorten button text on very small screens */
    .live-banner-btn i {
        font-size: 0.5rem;
    }
}

/* Extra small screens - minimal mode */
@media (max-width: 360px) {
    .live-banner-logo {
        display: none;
    }

    .live-banner-title {
        font-size: 0.5rem;
        max-width: 100px;
    }

    .live-banner-btn {
        padding: 0.2rem 0.35rem;
        font-size: 0.45rem;
    }
}

/* ============ Twitch Platform Variant ============ */
/* Red/black/white theme kept across platforms to match the site aesthetic. */

.live-stream-banner.twitch {
    border-color: rgba(244, 1, 43, 0.45);
}

.live-stream-banner.twitch::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(244, 1, 43, 0.05) 25%,
        rgba(244, 1, 43, 0.08) 50%,
        rgba(244, 1, 43, 0.05) 75%,
        transparent 100%);
}

.live-stream-banner.twitch::after {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(244, 1, 43, 0.04),
        transparent
    );
}

.live-stream-banner.twitch:hover {
    border-color: rgba(244, 1, 43, 0.7);
    box-shadow: 0 4px 24px rgba(244, 1, 43, 0.22);
}

.live-stream-banner.twitch .live-banner-indicator {
    background: linear-gradient(135deg, #f4012b 0%, #a3001d 100%);
    box-shadow: 0 0 20px rgba(244, 1, 43, 0.45);
}

.live-stream-banner.twitch .live-banner-indicator .pulse-dot {
    background: #fff;
}

.live-stream-banner.twitch .live-banner-indicator span {
    color: #fff;
}

.live-stream-banner.twitch .live-banner-logo {
    filter: drop-shadow(0 0 10px rgba(244, 1, 43, 0.55));
    color: #fff;
}

.live-stream-banner.twitch .live-banner-title span {
    color: #f4012b;
}

.live-stream-banner.twitch .live-banner-btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.live-stream-banner.twitch:hover .live-banner-btn {
    background: linear-gradient(135deg, #ff1537 0%, #d60125 100%);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ============ Twitch Live Embed Player ============ */
/* Inline embedded Twitch player shown on player-facing pages while live. */

.live-stream-embed {
    margin: 0 auto 1.5rem;
    max-width: 720px;
    background: rgba(8, 0, 3, 0.98);
    border: 1px solid rgba(244, 1, 43, 0.4);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    animation: liveStreamFadeIn 0.5s ease-out both;
}

.live-embed-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(90deg, rgba(244, 1, 43, 0.16) 0%, rgba(18, 2, 7, 0.6) 55%, rgba(18, 2, 7, 0.6) 100%);
    border-bottom: 1px solid rgba(244, 1, 43, 0.25);
}

.live-embed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #f4012b 0%, #a3001d 100%);
    color: #fff;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-family: 'Apex', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(244, 1, 43, 0.4);
}

.live-embed-badge .pulse-dot {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

.live-embed-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.live-embed-channel {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Apex', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-embed-channel i {
    color: #f4012b;
    font-size: 0.9rem;
}

.live-embed-title {
    font-size: 0.72rem;
    color: #9a9aa8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-embed-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #f4012b 0%, #c40026 100%);
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-family: 'Apex', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.live-embed-cta:hover {
    background: linear-gradient(135deg, #ff1537 0%, #d60125 100%);
    box-shadow: 0 4px 18px rgba(244, 1, 43, 0.45);
    color: #fff;
}

.live-embed-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 300px;
    background: #000;
}

.live-embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 768px) {
    .live-stream-embed {
        max-width: 100%;
    }

    .live-embed-header {
        gap: 0.5rem;
        padding: 0.5rem 0.65rem;
    }

    .live-embed-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.55rem;
        letter-spacing: 1px;
    }

    .live-embed-badge .pulse-dot {
        width: 6px;
        height: 6px;
    }

    .live-embed-channel {
        font-size: 0.7rem;
    }

    .live-embed-title {
        display: none;
    }

    .live-embed-cta {
        padding: 0.35rem 0.6rem;
        font-size: 0.6rem;
    }
}

/* ============ Live Stream Corner Widget (collapsible) ============ */
/* Fixed bottom-left. The player panel expands UP out of the persistent
   bottom bar (and retracts back into it) via an animated grid-rows
   container — the bar itself never moves, so there's no jump or flash. */

.live-stream-widget {
    position: fixed;
    bottom: 16px;
    left: calc(var(--sidebar-width-collapsed, 70px) + 16px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

body.sidebar-pinned .live-stream-widget {
    left: calc(var(--sidebar-width, 180px) + 16px);
}

/* ── Expandable section: the panel unrolls up out of the bar ── */
/* The panel is always laid out at its full size, flush on top of the bar.
   A clip-path transition reveals it from the seam upward — like a projector
   screen rolling out of the bar — so the content never moves and never
   visually disconnects from the bar mid-animation. */
.live-widget-expand {
    width: 330px;
    max-width: calc(100vw - 24px);
}

.live-widget-expand > .live-widget-expand-inner {
    overflow: hidden;
    /* own compositing layer keeps the clipped iframe flicker-free */
    transform: translateZ(0);
}

/* Panel visuals (player only), bottom edge flush with the bar — the rounded
   top corners clip the embed itself for a clean projector-screen look */
.live-widget-panel-inner {
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.95) 0%, rgba(13, 13, 13, 0.98) 100%);
    border: 1px solid rgba(244, 1, 43, 0.45);
    border-bottom: none;
    border-radius: var(--radius-xl, 24px) var(--radius-xl, 24px) 0 0;
    overflow: hidden;
    /* rolled up: fully clipped from the top; visibility flips only after the
       roll-in completes so no invisible hit area remains */
    clip-path: inset(100% 0 0 0);
    visibility: hidden;
    transition: clip-path 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
                visibility 0s linear 0.4s;
}

.live-stream-widget.is-expanded .live-widget-panel-inner {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
                visibility 0s linear 0s;
}

/* ── Persistent bottom bar (collapsed state = this bar) ── */
.live-widget-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    width: 330px;
    max-width: calc(100vw - 24px);
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.95) 0%, rgba(13, 13, 13, 0.98) 100%);
    border: 1px solid rgba(244, 1, 43, 0.45);
    border-radius: var(--radius-xl, 24px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    user-select: none;
    /* Corners re-round only after the panel has fully retracted (0.4s),
       so rounded corners never show underneath the attached panel. */
    transition: border-radius 0.3s ease 0.4s,
                border-top-color 0.2s ease 0.4s;
}

.live-widget-bar:hover {
    border-color: rgba(244, 1, 43, 0.75);
}

.live-stream-widget.is-expanded .live-widget-bar {
    /* square top corners + light divider appear instantly (panel covers the seam) */
    transition: border-radius 0s, border-top-color 0s;
    border-radius: 0 0 var(--radius-xl, 24px) var(--radius-xl, 24px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.live-widget-chevron {
    font-size: 0.65rem;
    color: #f4012b;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.live-stream-widget.is-expanded .live-widget-chevron {
    transform: rotate(180deg);
}

.live-widget-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #f4012b 0%, #c40026 100%);
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    flex-shrink: 0;
}

.live-widget-cta:hover {
    background: linear-gradient(135deg, #ff1537 0%, #d60125 100%);
    color: #fff;
}

/* The iframe renders at 533x300 (16:9, satisfies Twitch's >=400x300 autoplay
   requirement) and is visually scaled down ~0.62 for the compact preview. */
.live-widget-frame {
    position: relative;
    width: 100%;
    height: 186px;
    background: #000;
    overflow: hidden;
}

.live-widget-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 533px;
    height: 300px;
    border: 0;
    transform: scale(0.62);
    transform-origin: top left;
}

.live-widget-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.live-widget-stream-title {
    font-family: 'Apex', sans-serif;
    font-size: 0.72rem;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-widget-sub {
    font-size: 0.62rem;
    color: rgba(244, 1, 43, 0.9);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-widget-sub i {
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .live-stream-widget {
        left: 12px;
        bottom: 12px;
    }

    .live-widget-expand,
    .live-widget-bar {
        width: min(330px, calc(100vw - 24px));
    }
}
