/* ═══════════════════════════════════════════════════════════════════════
   streaming.css
   Covers:
     • templates/streaming/index.html  (full browse + modal page)
     • templates/index.html            (Trending Now carousel section only)
   Theme system: [data-theme="dark"] — matches site's dark-theme.css
   Default = light theme.
   ═══════════════════════════════════════════════════════════════════════ */


/* ── Shared keyframe ─────────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}


/* ═══════════════════════════════════════════════════════════════════════
   HERO  —  streaming/index.html
   ═══════════════════════════════════════════════════════════════════════ */

.stream-page { min-height: 100vh; }

.stream-hero {
    position:      relative;
    padding:       5rem 0 3.5rem;
    overflow:      hidden;
    background:    #eef1f5;          /* light default */
    border-radius: 1rem;
}

.stream-hero-bg {
    position: absolute;
    inset:    0;
    overflow: hidden;
}

.stream-hero-bg img {
    position:   absolute;
    inset:      0;
    width:      100%;
    height:     100%;
    object-fit: cover;
    object-position: center top;
    opacity:    0;
    transition: opacity 1.8s ease;
    filter:     brightness(0.65);
    /* No blur — the gradient overlay handles readability */
}

.stream-hero-bg img.hero-img-visible {
    opacity: 1;
}

.stream-hero-overlay {
    position:   absolute;
    inset:      0;
    background: linear-gradient(
        to bottom,
        rgba(238,241,245,0.05)  0%,
        rgba(238,241,245,0.60) 52%,
        rgba(238,241,245,1.00) 100%
    );
}

.stream-hero-inner { position: relative; z-index: 1; }

.stream-hero-title {
    color:         #1a202c;
    font-size:     clamp(1.8rem, 4vw, 2.8rem);
    font-weight:   800;
    letter-spacing: -0.5px;
    margin-bottom: 0.35rem;
    text-shadow:   0 2px 8px rgba(255,255,255,0.55);
}

.stream-hero-sub {
    color:         rgba(26,32,44,0.72);
    font-size:     1rem;
    margin-bottom: 2rem;
}

/* ── Search box ─────────────────────────────────────────────────────── */
.stream-search-box {
    display:         flex;
    gap:             0;
    max-width:       720px;
    background:      rgba(255,255,255,0.80);
    border:          1px solid rgba(0,0,0,0.13);
    border-radius:   50px;
    overflow:        hidden;
    backdrop-filter: blur(12px);
    box-shadow:      0 4px 24px rgba(0,0,0,0.10);
    transition:      border-color 0.25s, box-shadow 0.25s;
}

.stream-search-box:focus-within {
    border-color: rgba(220,53,69,0.55);
    box-shadow:   0 4px 28px rgba(220,53,69,0.18);
}

.stream-type-toggle {
    display:      flex;
    border-right: 1px solid rgba(0,0,0,0.10);
    flex-shrink:  0;
}

.sst-btn {
    background:  transparent;
    border:      none;
    color:       rgba(0,0,0,0.55);
    padding:     0.6rem 1.1rem;
    font-size:   0.85rem;
    font-weight: 500;
    cursor:      pointer;
    transition:  color 0.2s, background 0.2s;
    white-space: nowrap;
}

.sst-btn:first-child { border-radius: 50px 0 0 50px; }

.sst-btn.active {
    color:      #fff;
    background: rgba(220,53,69,0.85);
}

.sst-btn:hover:not(.active) {
    color:       rgba(0,0,0,0.80);
    background:  rgba(0,0,0,0.05);
}

.stream-input-wrap {
    flex:     1;
    position: relative;
    display:  flex;
    align-items: center;
}

.stream-input-icon {
    position:       absolute;
    left:           1rem;
    color:          rgba(0,0,0,0.38);
    font-size:      0.9rem;
    pointer-events: none;
}

.stream-input {
    flex:       1;
    background: transparent;
    border:     none;
    outline:    none;
    color:      #1a202c;
    font-size:  0.95rem;
    padding:    0.7rem 2.8rem 0.7rem 2.8rem;
    min-width:  0;
}

.stream-input::placeholder { color: rgba(0,0,0,0.36); }

.stream-input-clear {
    position:   absolute;
    right:      1rem;
    background: transparent;
    border:     none;
    color:      rgba(0,0,0,0.38);
    cursor:     pointer;
    padding:    0.2rem 0.4rem;
    font-size:  0.85rem;
    transition: color 0.2s;
}

.stream-input-clear:hover { color: #1a202c; }


/* ═══════════════════════════════════════════════════════════════════════
   TAB NAV + FILTERS  —  streaming/index.html
   ═══════════════════════════════════════════════════════════════════════ */

.stream-main-tabs {
    border-bottom: 2px solid #dee2e6;
    gap:           0.25rem;
}

.stream-main-tab {
    background:     transparent;
    border:         none;
    border-bottom:  3px solid transparent;
    color:          #6c757d;
    padding:        0.6rem 1.4rem;
    font-size:      0.95rem;
    font-weight:    600;
    cursor:         pointer;
    transition:     color 0.2s, border-color 0.2s;
    margin-bottom:  -2px;
    border-radius:  0;
}

.stream-main-tab:hover { color: #343a40; }

.stream-main-tab.active {
    color:              #dc3545;
    border-bottom-color: #dc3545;
}

.stream-section-title {
    font-size:   1.25rem;
    font-weight: 700;
    color:       #212529;
}

.stream-filters {
    display:     flex;
    align-items: center;
    gap:         0.75rem;
    flex-wrap:   wrap;
}

.stream-filter-label {
    font-size:      0.85rem;
    font-weight:    600;
    color:          #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stream-filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.filter-pill {
    background:    transparent;
    border:        1.5px solid #dee2e6;
    border-radius: 20px;
    padding:       0.3rem 0.85rem;
    font-size:     0.8rem;
    font-weight:   500;
    color:         #6c757d;
    cursor:        pointer;
    transition:    all 0.2s;
}

.filter-pill:hover { border-color: #dc3545; color: #dc3545; }

.filter-pill.active {
    background:   #dc3545;
    border-color: #dc3545;
    color:        #fff;
}


/* ═══════════════════════════════════════════════════════════════════════
   CARDS GRID  —  streaming/index.html  +  modal similar panel
   ═══════════════════════════════════════════════════════════════════════ */

.stream-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap:                   1.1rem;
}

.stream-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap:                   0.75rem;
}

.stream-card {
    cursor:        pointer;
    border-radius: 0.6rem;
    overflow:      hidden;
    background:    #fff;
    box-shadow:    0 2px 8px rgba(0,0,0,0.08);
    transition:    transform 0.22s ease, box-shadow 0.22s ease;
}

.stream-card:hover {
    transform:  translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.stream-poster-wrap {
    position:     relative;
    aspect-ratio: 2/3;
    background:   #dee2e6;
    overflow:     hidden;
}

.stream-poster {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform 0.35s ease;
}

.stream-card:hover .stream-poster { transform: scale(1.05); }

.stream-no-poster-bg {
    position:    absolute;
    inset:       0;
    display:     flex;
    align-items: center;
    justify-content: center;
    background:  linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
}

.stream-poster-hover {
    position:        absolute;
    inset:           0;
    background:      rgba(0,0,0,0);
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             0.6rem;
    padding:         1rem;
    transition:      background 0.28s ease;
    pointer-events:  none;
}

.stream-card:hover .stream-poster-hover { background: rgba(0,0,0,0.55); }

.stream-hover-play {
    width:        52px;
    height:       52px;
    background:   rgba(220,53,69,0.9);
    border-radius: 50%;
    display:      flex;
    align-items:  center;
    justify-content: center;
    opacity:      0;
    transform:    scale(0.7);
    transition:   opacity 0.28s, transform 0.28s;
    box-shadow:   0 4px 20px rgba(220,53,69,0.5);
}

.stream-card:hover .stream-hover-play { opacity: 1; transform: scale(1); }

.stream-hover-play i { color: #fff; font-size: 1.1rem; margin-left: 3px; }

.stream-hover-genres {
    color:      rgba(255,255,255,0.85);
    font-size:  0.7rem;
    font-weight: 500;
    text-align: center;
    opacity:    0;
    transition: opacity 0.28s 0.05s;
    letter-spacing: 0.3px;
}

.stream-card:hover .stream-hover-genres { opacity: 1; }

/* Corner badges */
.stream-card-rating {
    position:      absolute;
    top:           0.45rem;
    left:          0.45rem;
    color:         #fff;
    font-size:     0.72rem;
    font-weight:   700;
    padding:       2px 6px;
    border-radius: 4px;
    letter-spacing: 0.2px;
    box-shadow:    0 1px 6px rgba(0,0,0,0.4);
}

.stream-card-type-badge {
    position:       absolute;
    top:            0.45rem;
    right:          0.45rem;
    font-size:      0.65rem;
    font-weight:    800;
    padding:        2px 6px;
    border-radius:  4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-movie { background: rgba(13,110,253,0.88); color: #fff; }
.badge-tv    { background: rgba(13,202,240,0.88); color: #000; }

.stream-card-footer { padding: 0.55rem 0.6rem 0.6rem; }

.stream-card-title {
    font-size:      0.8rem;
    font-weight:    600;
    color:          #212529;
    white-space:    nowrap;
    overflow:       hidden;
    text-overflow:  ellipsis;
    line-height:    1.3;
}

.stream-card-year {
    font-size:  0.72rem;
    color:      #6c757d;
    margin-top: 2px;
}

/* ── History / Favourites management cards ──────────────────────────── */
.stream-card-sub-badge {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background: rgba(13,110,253,0.85);
    padding: 1px 6px;
    border-radius: 4px;
}

.stream-card-sub-badge.badge-fav {
    background: rgba(220,53,69,0.85);
}

.stream-card-remove-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(220,53,69,0.12);
    color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-top: 2px;
}

.stream-card-remove-btn:hover {
    background: #dc3545;
    color: #fff;
    transform: scale(1.08);
}

[data-theme="dark"] .stream-card-remove-btn {
    background: rgba(220,53,69,0.18);
}

/* ── Heart / favourite button on Trending, Search & Similar cards ────── */
.stream-card-heart-btn {
    position:        absolute;
    bottom:          6px;
    right:           6px;
    width:           28px;
    height:          28px;
    border-radius:   50%;
    border:          none;
    background:      rgba(0,0,0,0.55);
    color:           rgba(255,255,255,0.85);
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       0.78rem;
    cursor:          pointer;
    z-index:         2;
    backdrop-filter: blur(2px);
    transition:      background 0.2s, transform 0.2s, color 0.2s;
}

.stream-card-heart-btn:hover {
    background: rgba(220,53,69,0.9);
    color:      #fff;
    transform:  scale(1.12);
}

.stream-card-heart-btn.active {
    background: rgba(220,53,69,0.88);
    color:      #fff;
}

.stream-card-heart-btn.active:hover {
    background: #dc3545;
}

@media (max-width: 480px) {
    .stream-card-heart-btn {
        width:  25px;
        height: 25px;
        font-size: 0.7rem;
    }
}

/* ── Load more button ───────────────────────────────────────────────── */
.stream-load-btn {
    border-radius: 24px;
    padding:       0.5rem 2rem;
    font-weight:   500;
}

/* ── Error / empty / loading states ────────────────────────────────── */
.stream-error-msg,
.stream-loading-msg {
    grid-column: 1 / -1;
    padding:     2.5rem 1rem;
    text-align:  center;
    color:       #6c757d;
    font-size:   0.9rem;
}

.stream-empty-msg {
    grid-column: 1 / -1;
    padding:     3rem 1rem;
    text-align:  center;
    color:       #6c757d;
}

/* ── Skeleton loader ────────────────────────────────────────────────── */
.stream-skeleton-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap:                   1.1rem;
    margin-bottom:         1rem;
}

.stream-skeleton-card { border-radius: 0.6rem; overflow: hidden; }

.stream-skeleton-poster {
    aspect-ratio: 2/3;
    border-radius: 0.6rem 0.6rem 0 0;
}

.stream-skeleton-line {
    height:       12px;
    border-radius: 6px;
    margin-left:  0.6rem;
    margin-right: 0.6rem;
}

/* Light shimmer */
.shimmer {
    background:      linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation:       shimmer 1.5s infinite;
}


/* ═══════════════════════════════════════════════════════════════════════
   STREAM DETAIL MODAL  —  streaming/index.html + index.html quick-view
   ═══════════════════════════════════════════════════════════════════════ */

.stream-modal-dialog  { max-width: min(96vw, 1100px); }

.stream-modal-content {
    border:        none;
    border-radius: 0.75rem;
    overflow:      hidden;
}

/* ── Hero backdrop header ─────────────────────────────────────────── */
.stream-modal-hero {
    position:          relative;
    min-height:        280px;
    background:        #0d1117 no-repeat center / cover;
    display:           flex;
    align-items:       flex-end;
    transition:        background-image 0.6s ease;
}

.stream-modal-hero-overlay {
    position:   absolute;
    inset:      0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.3)  0%,
        rgba(0,0,0,0.7)  60%,
        rgba(13,17,23,0.98) 100%
    );
}

.stream-modal-close {
    position:        absolute;
    top:             1rem;
    right:           1rem;
    z-index:         10;
    background:      rgba(0,0,0,0.55);
    border:          none;
    color:           rgba(255,255,255,0.8);
    width:           36px;
    height:          36px;
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       0.9rem;
    transition:      background 0.2s, color 0.2s;
    cursor:          pointer;
}

.stream-modal-close:hover {
    background: rgba(220,53,69,0.8);
    color:      #fff;
}

.stream-modal-hero-body { position: relative; z-index: 1; width: 100%; }

.stream-modal-poster {
    width:        120px;
    min-width:    120px;
    border-radius: 0.5rem;
    box-shadow:   0 6px 24px rgba(0,0,0,0.55);
    flex-shrink:  0;
    object-fit:   cover;
    aspect-ratio: 2/3;
}

.stream-modal-info  { color: #fff; }

.stream-modal-title {
    font-size:     clamp(1.15rem, 3vw, 1.7rem);
    font-weight:   800;
    margin-bottom: 0.5rem;
    text-shadow:   0 2px 8px rgba(0,0,0,0.6);
    line-height:   1.2;
}

.stream-modal-meta {
    display:       flex;
    flex-wrap:     wrap;
    gap:           0.4rem;
    margin-bottom: 0.6rem;
}

.stream-modal-overview {
    color:     rgba(255,255,255,0.78);
    font-size: 0.87rem;
    line-height: 1.55;
    margin-bottom: 0;
    max-width: 700px;
}

/* Meta badges — always on dark backdrop, no light override needed */
.sm-badge {
    display:        inline-flex;
    align-items:    center;
    font-size:      0.75rem;
    font-weight:    600;
    padding:        3px 9px;
    border-radius:  20px;
    letter-spacing: 0.2px;
}

.sm-badge-year   { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); }
.sm-badge-rating { color: #fff; box-shadow: 0 1px 6px rgba(0,0,0,0.35); }
.sm-badge-info   { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); }
.sm-badge-genre  { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.70); }
.sm-badge-movie  { background: rgba(13,110,253,0.75);  color: #fff; }
.sm-badge-tv     { background: rgba(13,202,240,0.75);  color: #000; }

/* ── Modal tab nav ──────────────────────────────────────────────────── */
.stream-modal-tabs-nav {
    display: flex;
    gap:     0;
}

.stream-modal-tab-btn {
    background:    transparent;
    border:        none;
    border-bottom: 3px solid transparent;
    color:         rgba(255,255,255,0.5);
    padding:       0.6rem 1.2rem;
    font-size:     0.87rem;
    font-weight:   500;
    cursor:        pointer;
    transition:    color 0.2s, border-color 0.2s;
}

.stream-modal-tab-btn:hover { color: rgba(255,255,255,0.85); }

.stream-modal-tab-btn.active {
    color:              #fff;
    border-bottom-color: #dc3545;
}

/* ── Episode control bar ────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════
   UNIFIED EMBED CONTROL BAR
   Add this entire block at the END of streaming.css.
   It replaces the scattered stream-ep-bar label rules that existed before.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── The bar itself is always dark, regardless of page theme ─────────── */
.embed-ctrl-bar {
    background:   #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    padding:       0.45rem 0.75rem;
}

/* ── Single flex row — wraps cleanly on narrow viewports ─────────────── */
.embed-ctrl-row {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         0.4rem;
    min-height:  32px;
}

/* ── All text labels inside the bar ─────────────────────────────────── */
.embed-ctrl-bar .ecb-label {
    font-size:   0.75rem;
    font-weight: 600;
    color:       rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

/* ── Thin vertical divider ───────────────────────────────────────────── */
.embed-ctrl-bar .ecb-divider {
    width:        1px;
    height:       18px;
    background:   rgba(255, 255, 255, 0.15);
    flex-shrink:  0;
    margin:       0 0.1rem;
}

/* ── Season / Episode selects ────────────────────────────────────────── */
.ecb-select {
    background-color: #1f2937 !important;
    border:           1px solid rgba(255, 255, 255, 0.18) !important;
    color:            #fff !important;
    font-size:        0.78rem !important;
    padding:          2px 24px 2px 7px !important;
    border-radius:    5px !important;
    height:           28px !important;
    cursor:           pointer;
    flex-shrink:      0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat:   no-repeat !important;
    background-position: right 6px center !important;
    background-size:     12px !important;
    appearance:          none !important;
    -webkit-appearance:  none !important;
    max-width: 160px;
}

.ecb-select:focus {
    outline:    none !important;
    border-color: rgba(220, 53, 69, 0.6) !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.20) !important;
}

.ecb-select option {
    background: #1f2937;
    color:      #fff;
}

/* ── Source buttons ──────────────────────────────────────────────────── */
.ecb-src-btn {
    font-size:     0.72rem !important;
    padding:       2px 9px !important;
    border-radius: 5px !important;
    height:        26px !important;
    line-height:   1 !important;
    flex-shrink:   0;
    transition:    background 0.18s, border-color 0.18s, color 0.18s;
}

/* Active source — red */
.ecb-src-btn.ecb-src-active {
    background:   #dc3545 !important;
    border-color: #dc3545 !important;
    color:        #fff    !important;
}

/* Inactive source */
.ecb-src-btn.ecb-src-inactive {
    background:   transparent !important;
    border:       1px solid rgba(255, 255, 255, 0.25) !important;
    color:        rgba(255, 255, 255, 0.65) !important;
}

.ecb-src-btn.ecb-src-inactive:hover {
    border-color: rgba(255, 255, 255, 0.55) !important;
    color:        #fff !important;
}

/* Disabled / offline source */
.ecb-src-btn:disabled {
    opacity:        0.35 !important;
    cursor:         not-allowed !important;
    pointer-events: none !important;
}

/* ── "Load Episode" and similar action buttons ────────────────────────── */
.ecb-action-btn {
    font-size:     0.72rem !important;
    padding:       2px 10px !important;
    border-radius: 5px !important;
    height:        26px !important;
    line-height:   1 !important;
    flex-shrink:   0;
}

/* ── Subtitle section ────────────────────────────────────────────────── */
.ecb-sub-btn {
    font-size:     0.72rem !important;
    padding:       2px 9px !important;
    border-radius: 5px !important;
    height:        26px !important;
    line-height:   1 !important;
    flex-shrink:   0;
}

/* Status text (right side) */
.ecb-sub-status {
    font-size:   0.72rem;
    color:       #22d3ee;          /* cyan-400 */
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
    max-width:   140px;
}

.ecb-src-status {
    font-size:   0.7rem;
    color:       rgba(255, 255, 255, 0.40);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Archive file-picker row (shown when a ZIP is selected) ──────────── */
.ecb-picker-row {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         0.3rem;
    padding-top: 0.35rem;
    margin-top:  0.35rem;
    border-top:  1px solid rgba(255, 255, 255, 0.07);
}

.ecb-picker-row .ecb-pick-label {
    font-size:  0.7rem;
    color:      #fbbf24;           /* amber-400 */
    flex-shrink: 0;
}

/* ── Subtitle Dropdown ────────────────────────────────────────────────── */
.ecb-sub-dropdown-wrap {
    position:   relative;
    flex-shrink: 0;
}

.ecb-sub-dropdown {
    position:   absolute;
    top:        calc(100% + 4px);
    left:       0;
    z-index:    1080;
    min-width:  220px;
    max-width:  340px;
    background: #1f2937;
    border:     1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    overflow:   hidden;
    /* Hidden by default */
    display:    none;
}

/* When JS adds .open */
.ecb-sub-dropdown.open {
    display: block;
    animation: ecbDropIn 0.14s ease;
}

@keyframes ecbDropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* Dropdown header / empty / loading states */
.ecb-drop-header {
    font-size:   0.68rem;
    font-weight: 700;
    color:       rgba(255, 255, 255, 0.40);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding:     6px 12px 4px;
    user-select: none;
}

.ecb-drop-empty {
    font-size: 0.78rem;
    color:     rgba(255, 255, 255, 0.45);
    padding:   8px 12px 10px;
}

.ecb-drop-loading {
    display:     flex;
    align-items: center;
    gap:         8px;
    font-size:   0.78rem;
    color:       rgba(255, 255, 255, 0.55);
    padding:     8px 12px 10px;
}

/* Dropdown items */
.ecb-drop-item {
    display:     flex;
    align-items: center;
    justify-content: space-between;
    gap:         8px;
    padding:     7px 12px;
    cursor:      pointer;
    transition:  background 0.14s;
    border-top:  1px solid rgba(255, 255, 255, 0.06);
}

.ecb-drop-item:first-of-type {
    border-top: none;
}

.ecb-drop-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.ecb-drop-item.ecb-drop-active {
    background: rgba(34, 211, 238, 0.12);
}

.ecb-drop-item-label {
    font-size:  0.8rem;
    color:      rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    overflow:   hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.ecb-drop-item-badge {
    font-size:     0.65rem;
    font-weight:   700;
    padding:       2px 6px;
    border-radius: 4px;
    flex-shrink:   0;
    white-space:   nowrap;
}

.ecb-drop-item-badge.badge-ep   { background: rgba(59,130,246,0.35); color: #93c5fd; }
.ecb-drop-item-badge.badge-full { background: rgba(124,58,237,0.35); color: #c4b5fd; }
.ecb-drop-item-badge.badge-rng  { background: rgba(245,158,11,0.35); color: #fcd34d; }

/* Checkmark for loaded subtitle */
.ecb-drop-check {
    color:      #22d3ee;
    font-size:  0.75rem;
    flex-shrink: 0;
}

/* "Clear" footer row inside dropdown */
.ecb-drop-clear {
    display:     flex;
    align-items: center;
    gap:         6px;
    padding:     6px 12px 8px;
    cursor:      pointer;
    border-top:  1px solid rgba(255, 255, 255, 0.10);
    font-size:   0.75rem;
    color:       rgba(255, 255, 255, 0.45);
    transition:  color 0.15s;
}

.ecb-drop-clear:hover { color: #f87171; }

/* ── File-picker buttons (inside picker row) ─────────────────────────── */
.ecb-file-btn {
    font-size:     0.70rem !important;
    padding:       2px 7px !important;
    border-radius: 4px !important;
    height:        24px !important;
    line-height:   1 !important;
}

/* ── Right-side spacer ───────────────────────────────────────────────── */
.ecb-spacer { flex: 1 1 0; min-width: 0; }

/* ══════════════════════════════════════════════════════════════
   REMOVALS / OVERRIDES — old stream-ep-bar label rules
   These selectors existed in streaming.css previously and are
   now superseded by .embed-ctrl-bar.  The old rules are kept
   below as comments so you know what to DELETE from the file.

   DELETE these blocks from streaming.css:
      .stream-ep-bar { background: #111; }

      .stream-ep-bar label,
      .stream-ep-bar span {
          color: rgba(255, 255, 255, 0.75) !important;
      }

      .stream-ep-bar small {
          color: rgba(255, 255, 255, 0.50) !important;
      }

      .stream-ep-bar .form-select {
          background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
      }

   The new .embed-ctrl-bar + .ecb-* classes replace them all.
   ══════════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — control bar on narrow screens
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .ecb-sub-status { max-width: 90px; }
    .ecb-select     { max-width: 110px; }

    /* Let the dropdown open upward on mobile to avoid viewport clip */
    .ecb-sub-dropdown-wrap .ecb-sub-dropdown {
        top:    auto;
        bottom: calc(100% + 4px);
    }
}

/* ── Idle / start screen ────────────────────────────────────────────── */
.stream-idle {
    min-height: 340px;
    width: 100%;
    padding: 2.5rem 1.5rem;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
}

/* ── Idle states ────────────────────────────────────────────────────── */
#stIdleDefault,
#stIdleError:not(.d-none) {
    width: 100%;
    max-width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    gap: 0.6rem;
}

/* ── Play / status icon ─────────────────────────────────────────────── */
.stream-idle-play-btn {
    width: 80px;
    height: 80px;

    background: rgba(220,53,69,0.88);
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow: 0 6px 28px rgba(220,53,69,0.45);

    transition:
        transform 0.22s,
        background 0.22s;

    margin: 0 auto 0.75rem;
}

.stream-idle-play-btn:hover {
    transform: scale(1.12);
    background: #dc3545;
}

.stream-idle-play-btn i {
    color: #fff;
    font-size: 1.8rem;
    margin-left: 5px;
}

/* ── Title ──────────────────────────────────────────────────────────── */
.stream-idle-title {
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0;
}

/* ── Subtitle ───────────────────────────────────────────────────────── */
.stream-idle-sub {
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    margin: 0;
}

/* ── Error state ────────────────────────────────────────────────────── */
#stIdleError .stream-idle-play-btn {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

#stIdleError .stream-idle-play-btn:hover {
    transform: none;
    background: rgba(220,53,69,0.88);
}

#stIdleError .stream-idle-sub {
    color: rgba(255,255,255,0.65);
}

#stIdleError .btn {
    margin-top: 0.25rem;
}

/* ── Modal panels ───────────────────────────────────────────────────── */
.stream-modal-panel { /* panels sit on dark bg in both themes */ }


/* ═══════════════════════════════════════════════════════════════════════
   INDEX PAGE — TRENDING NOW CAROUSEL
   Covers the .trending-section block inside templates/index.html
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper — light default ─────────────────────────────── */
.trending-section {
    background:    linear-gradient(135deg, #f8f9fa 0%, #edf0f4 100%);
    border:        1px solid #dee2e6;
    border-radius: 1.2rem;
    padding:       1.5rem;
    margin-bottom: 2rem;
    overflow:      hidden;
}

.trending-section-hdr {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    margin-bottom:   1.1rem;
    flex-wrap:       wrap;
    gap:             0.5rem;
}

.trending-section-title {
    color:       #212529;
    font-size:   1.15rem;
    font-weight: 700;
    margin:      0;
    display:     flex;
    align-items: center;
    gap:         0.5rem;
}

.trending-section-title .fa-fire { color: #dc3545; }

/* Movie / TV toggle tabs */
.idx-trend-tabs {
    display:       flex;
    gap:           0.3rem;
    background:    rgba(0,0,0,0.06);
    border-radius: 24px;
    padding:       3px;
}

.idx-trend-tab {
    background:    transparent;
    border:        none;
    color:         rgba(0,0,0,0.50);
    font-size:     0.8rem;
    font-weight:   500;
    padding:       0.28rem 0.85rem;
    border-radius: 20px;
    cursor:        pointer;
    transition:    all 0.2s;
}

.idx-trend-tab.active {
    background: rgba(220,53,69,0.85);
    color:      #fff;
}

/* ── Carousel wrapper ───────────────────────────────────────────────── */
.trend-carousel-outer { position: relative; }

.trend-carousel {
    display:         flex;
    gap:             0.75rem;
    overflow-x:      auto;
    padding-bottom:  0.5rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(220,53,69,0.4) transparent;
}

.trend-carousel::-webkit-scrollbar        { height: 4px; }
.trend-carousel::-webkit-scrollbar-track  { background: transparent; }
.trend-carousel::-webkit-scrollbar-thumb  {
    background:    rgba(220,53,69,0.4);
    border-radius: 2px;
}

/* Navigation arrows */
.trend-nav-btn {
    position:        absolute;
    top:             50%;
    transform:       translateY(-50%);
    z-index:         2;
    background:      rgba(255,255,255,0.90);
    border:          1px solid rgba(0,0,0,0.10);
    color:           rgba(0,0,0,0.65);
    width:           36px;
    height:          36px;
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    cursor:          pointer;
    transition:      background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    font-size:       0.85rem;
    box-shadow:      0 1px 4px rgba(0,0,0,0.10);
}

.trend-nav-btn:hover {
    background:   rgba(220,53,69,0.90);
    color:        #fff;
    border-color: transparent;
    box-shadow:   none;
}

.trend-nav-prev { left:  -18px; }
.trend-nav-next { right: -18px; }

/* ── Mini cards — light default ──────────────────────────────────── */
.trend-mini-card {
    flex-shrink:   0;
    width:         120px;
    cursor:        pointer;
    border-radius: 0.5rem;
    overflow:      hidden;
    background:    #ffffff;
    border:        1px solid #dee2e6;
    box-shadow:    0 2px 8px rgba(0,0,0,0.06);
    transition:    transform 0.2s, box-shadow 0.2s;
}

.trend-mini-card:hover {
    transform:  translateY(-5px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.14);
}

.trend-mini-poster-wrap {
    position:     relative;
    aspect-ratio: 2/3;
    overflow:     hidden;
    background:   #dee2e6;
}

.trend-mini-poster {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform 0.3s;
    filter:     none !important;
    opacity:    1   !important;
}

.trend-mini-card:hover .trend-mini-poster { transform: scale(1.06); }

.trend-mini-play-icon {
    position:        absolute;
    inset:           0;
    background:      rgba(0,0,0,0);
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      background 0.25s;
}

.trend-mini-card:hover .trend-mini-play-icon { background: rgba(0,0,0,0.42); }

.trend-mini-play-icon i {
    color:      #fff;
    font-size:  1.3rem;
    opacity:    0;
    transform:  scale(0.7);
    transition: opacity 0.25s, transform 0.25s;
    filter:     drop-shadow(0 0 6px rgba(220,53,69,0.8));
}

.trend-mini-card:hover .trend-mini-play-icon i {
    opacity:   1;
    transform: scale(1);
}

.trend-mini-rating {
    position:      absolute;
    top:           4px;
    left:          4px;
    font-size:     0.65rem;
    font-weight:   700;
    color:         #fff;
    padding:       2px 5px;
    border-radius: 3px;
}

.trend-mini-info { padding: 0.4rem 0.45rem 0.45rem; }

.trend-mini-title {
    color:         #212529;
    font-size:     0.72rem;
    font-weight:   600;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
    line-height:   1.3;
}

.trend-mini-year {
    color:      #6c757d;
    font-size:  0.65rem;
    margin-top: 1px;
}

/* ── Skeleton — light ────────────────────────────────────────────── */
.trend-skel-card {
    flex-shrink:   0;
    width:         120px;
    border-radius: 0.5rem;
    overflow:      hidden;
}

.trend-skel-poster {
    aspect-ratio:    2/3;
    background:      linear-gradient(90deg, #dee2e6 25%, #f8f9fa 50%, #dee2e6 75%);
    background-size: 200% 100%;
    animation:       shimmer 1.5s infinite;
}

.trend-skel-line {
    height:          10px;
    border-radius:   5px;
    margin:          0.4rem 0.45rem 0.2rem;
    background:      linear-gradient(90deg, #dee2e6 25%, #f8f9fa 50%, #dee2e6 75%);
    background-size: 200% 100%;
    animation:       shimmer 1.5s infinite;
}


/* ═══════════════════════════════════════════════════════════════════════
   DARK THEME OVERRIDES  —  [data-theme="dark"]
   Must match the attribute used in dark-theme.css and layout_new.html
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────────── */
[data-theme="dark"] .stream-hero             { background: #0d1117; }
[data-theme="dark"] .stream-hero-bg img {
    filter: brightness(0.55);
}
[data-theme="dark"] .stream-hero-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.20)     0%,
        rgba(0,0,0,0.50)     60%,
        rgba(13,17,23,1.00)  100%
    );
}
[data-theme="dark"] .stream-hero-title {
    color:       #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}
[data-theme="dark"] .stream-hero-sub { color: rgba(255,255,255,0.7); }

/* ── Search box ──────────────────────────────────────────────────── */
[data-theme="dark"] .stream-search-box {
    background:  rgba(255,255,255,0.08);
    border:      1px solid rgba(255,255,255,0.18);
    box-shadow:  0 4px 24px rgba(0,0,0,0.45);
}
[data-theme="dark"] .stream-search-box:focus-within {
    border-color: rgba(220,53,69,0.7);
    box-shadow:   0 4px 28px rgba(220,53,69,0.25);
}
[data-theme="dark"] .stream-type-toggle { border-right: 1px solid rgba(255,255,255,0.14); }
[data-theme="dark"] .sst-btn            { color: rgba(255,255,255,0.6); }
[data-theme="dark"] .sst-btn.active     { color: #fff; background: rgba(220,53,69,0.35); }
[data-theme="dark"] .sst-btn:hover:not(.active) {
    color:      rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .stream-input              { color: #fff; }
[data-theme="dark"] .stream-input::placeholder { color: rgba(255,255,255,0.38); }
[data-theme="dark"] .stream-input-icon         { color: rgba(255,255,255,0.45); }
[data-theme="dark"] .stream-input-clear        { color: rgba(255,255,255,0.45); }
[data-theme="dark"] .stream-input-clear:hover  { color: #fff; }

/* ── Tabs + filters ──────────────────────────────────────────────── */
[data-theme="dark"] .stream-main-tab       { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .stream-main-tab:hover { color: rgba(255,255,255,0.85); }
[data-theme="dark"] .stream-section-title  { color: #f8f9fa; }
[data-theme="dark"] .filter-pill {
    border-color: #495057;
    color:        #adb5bd;
    background:   transparent;
}
[data-theme="dark"] .filter-pill:hover {
    border-color: #dc3545;
    color:        #dc3545;
}
[data-theme="dark"] .filter-pill.active {
    background:   #dc3545;
    border-color: #dc3545;
    color:        #fff;
}

/* ── Cards ───────────────────────────────────────────────────────── */
[data-theme="dark"] .stream-card {
    background: #1e2029;
    box-shadow: 0 2px 8px rgba(0,0,0,0.30);
}
[data-theme="dark"] .stream-card-footer  { background: #1e2029; }
[data-theme="dark"] .stream-card-title   { color: #f8f9fa; }
[data-theme="dark"] .stream-card-year    { color: #adb5bd; }
[data-theme="dark"] .stream-poster-wrap  { background: #0d1117; }
[data-theme="dark"] .stream-no-poster-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #26264a 100%);
}

/* ── Skeletons ───────────────────────────────────────────────────── */
[data-theme="dark"] .shimmer,
[data-theme="dark"] .stream-skeleton-poster,
[data-theme="dark"] .stream-skeleton-line {
    background:      linear-gradient(90deg, #1e2029 25%, #2c2f3e 50%, #1e2029 75%);
    background-size: 200% 100%;
    animation:       shimmer 1.5s infinite;
}

/* ── Trending section ─────────────────────────────────────────────── */
[data-theme="dark"] .trending-section {
    background: linear-gradient(135deg, #0d1117 0%, #1a1a2e 100%);
    border:     none;
}
[data-theme="dark"] .trending-section-title { color: #fff; }
[data-theme="dark"] .idx-trend-tabs         { background: rgba(255,255,255,0.07); }
[data-theme="dark"] .idx-trend-tab          { color: rgba(255,255,255,0.55); }

/* ── Trending mini cards ─────────────────────────────────────────── */
[data-theme="dark"] .trend-mini-card {
    background: #1a1a2e;
    border:     none;
    box-shadow: none;
}
[data-theme="dark"] .trend-mini-poster-wrap          { background: #0d1117; }
[data-theme="dark"] .trend-mini-card:hover .trend-mini-play-icon { background: rgba(0,0,0,0.5); }
[data-theme="dark"] .trend-mini-title                { color: rgba(255,255,255,0.9); }
[data-theme="dark"] .trend-mini-year                 { color: rgba(255,255,255,0.45); }

/* ── Trending nav arrows ─────────────────────────────────────────── */
[data-theme="dark"] .trend-nav-btn {
    background:  rgba(0,0,0,0.65);
    border:      none;
    color:       rgba(255,255,255,0.8);
    box-shadow:  none;
}
[data-theme="dark"] .trend-nav-btn:hover {
    background: rgba(220,53,69,0.85);
    color:      #fff;
}

/* ── Trending skeletons ──────────────────────────────────────────── */
[data-theme="dark"] .trend-skel-poster,
[data-theme="dark"] .trend-skel-line {
    background:      linear-gradient(90deg, #1a1a2e 25%, #26264a 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation:       shimmer 1.5s infinite;
}

/* ── Poster images — never dimmed/filtered in either theme ────────── */
[data-theme="dark"] .trend-mini-poster,
[data-theme="dark"] .stream-poster {
    filter:  none !important;
    opacity: 1    !important;
}


/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .stream-hero { padding: 3.5rem 0 2.5rem; }

    /* Search box stacks vertically */
    .stream-search-box    { flex-direction: column; border-radius: 1rem; }
    .stream-type-toggle   { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.14); }
    .sst-btn:first-child  { border-radius: 0; }

    [data-theme="dark"] .stream-type-toggle {
        border-right:  none;
        border-bottom: 1px solid rgba(255,255,255,0.14);
    }

    /* Grids */
    .stream-grid          { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
    .stream-grid-sm       { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.50rem; }
    .stream-skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

    /* Modal */
    .stream-modal-poster  { width: 80px; min-width: 80px; }
    .stream-modal-hero    { min-height: 200px; }
    .stream-modal-overview{ font-size: 0.8rem; }

    /* Hide carousel nav arrows on small screens */
    .trend-nav-btn        { display: none; }
    .trend-mini-card      { width: 100px; }
    
    /* Remove Bootstrap px-5 padding — arrows are hidden on mobile */
    .trend-carousel-outer.px-5,
    .idx-trend-panel.px-5 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Reduce section padding to give cards more horizontal space */
    .trending-section {
        padding: 1rem 0.75rem;
    }

    .trending-section-hdr {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stream-grid          { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .stream-skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .trend-mini-card      { width: 90px; }
    
    .trend-skel-card      { width: 90px; }

    .trend-carousel-outer.px-5,
    .idx-trend-panel.px-5 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .trending-section {
        padding: 0.75rem 0.5rem;
    }
}