/* ============================================
   StreameX Theme - Main Stylesheet
   Dark theme with sidebar layout
   ============================================ */

/* --- Required Engine Utilities --- */
.d-none { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.content-lazy { content-visibility: auto; contain-intrinsic-size: auto 500px; }
.skip-link { position: absolute; top: -100%; left: 0; z-index: 9999; background: #fff; color: #000; padding: 8px 16px; }
.skip-link:focus { top: 0; }

/* --- CSS Custom Properties --- */
:root {
    --sx-bg: #0F0F0F;
    --sx-bg-sidebar: #0d0d0d;
    --sx-bg-card: #1a1a1a;
    --sx-bg-elevated: #1e1e1e;
    --sx-bg-input: #1a1a1a;
    --sx-text: #ffffff;
    --sx-text-dim: #999999;
    --sx-text-muted: #666666;
    --sx-accent: #e50914;
    --sx-green: #4caf50;
    --sx-gold: #ffd700;
    --sx-border: #222222;
    --sx-border-light: #333333;
    --sx-radius: 8px;
    --sx-radius-sm: 4px;
    --sx-radius-lg: 12px;
    --sx-sidebar-w: 256px;
    --sx-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sx-transition: 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--sx-font);
    background: var(--sx-bg);
    color: var(--sx-text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
select, input, textarea { font: inherit; color: inherit; background: var(--sx-bg-input); border: 1px solid var(--sx-border-light); border-radius: var(--sx-radius-sm); padding: 8px 12px; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--sx-accent); outline-offset: 1px; }
ul, ol { list-style: none; }

/* --- Layout: Sidebar + Main --- */

/* Sidebar — fixed, full height, semi-transparent with backdrop blur */
body {
    display: flex;
    min-height: 100vh;
}
.sx-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sx-sidebar-w);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 50;
    display: flex;
    flex-direction: column;
}
.sx-sidebar-inner {
    display: flex;
    flex-direction: column;
    padding: 28px 8px 8px;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* clip text during collapse animation */
    scrollbar-width: thin;
    scrollbar-color: var(--sx-border-light) transparent;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sx-sidebar-logo {
    display: block;
    padding: 0 8px 16px;
}
.sx-logo-text {
    font-family: 'Audiowide', var(--sx-font);
    font-size: 36px;
    font-weight: 700;
    line-height: 40px;
    letter-spacing: -0.5px;
    color: #ffffff;
    display: inline;
    white-space: nowrap;
}

/* Sidebar Nav */
.sx-nav-section { display: flex; flex-direction: column; gap: 1px; }

/* Primary nav group (Home / Search / Browse) — frosted card */
.sx-nav-primary {
    background: rgba(255, 255, 255, 0.07);
    padding: 12px;
    border-radius: 12px;
    gap: 8px;
    flex: 0 0 auto;
}

/* Media nav group — frosted card matching competitor */
.sx-nav-media {
    background: rgba(255, 255, 255, 0.07);
    padding: 12px;
    border-radius: 8px;
    gap: 8px;
    flex: 0 0 auto;
    color: #ffffff;
    font-family: 'DM Sans', var(--sx-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}
.sx-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--sx-radius);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    transition: background var(--sx-transition), color var(--sx-transition);
}
.sx-nav-link:hover { background: rgba(255,255,255,0.07); color: var(--sx-text); }
.sx-nav-link.active { background: rgba(255,255,255,0.1); color: var(--sx-text); }
.sx-nav-link svg { flex-shrink: 0; opacity: 0.7; width: 16px; height: 16px; }
.sx-nav-link:hover svg, .sx-nav-link.active svg { opacity: 1; }
.sx-nav-link-dim { opacity: 0.6; }
.sx-nav-link-dim:hover { opacity: 1; }

.sx-nav-divider {
    padding: 12px 10px 4px;
}
.sx-nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--sx-text-muted);
    text-transform: uppercase;
}

.sx-sidebar-bottom {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Main content wrapper — offset by sidebar width since sidebar is fixed */
.sx-main-wrap {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sx-sidebar-w);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile: hide sidebar, show mobile bar */
.sx-mobile-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--sx-bg-sidebar);
    border-bottom: 1px solid var(--sx-border);
    padding: 10px 16px;
    align-items: center;
    justify-content: space-between;
}
.sx-mobile-logo { display: flex; align-items: center; }
.sx-mobile-actions { display: flex; align-items: center; gap: 12px; }
.sx-mobile-icon { color: var(--sx-text-dim); }
.mobile-menu-toggle { color: var(--sx-text-dim); }
.sx-mobile-bar.header-hidden { transform: translateY(-100%); }
.sx-mobile-bar.header-scrolled { background: rgba(13,13,13,0.95); backdrop-filter: blur(8px); }
.sx-mobile-bar { transition: transform 0.3s ease, background 0.3s ease; }

@media (width < 1024px) {
    body { display: block; }
    .sx-sidebar { display: none; }
    .sx-mobile-bar { display: flex; }
    .sx-main-wrap { margin-left: 0; }
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 300;
    display: none;
    flex-direction: column;
    padding: 60px 24px 24px;
}
.mobile-menu.open { display: flex; }
.mobile-menu-nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu-link {
    display: block;
    padding: 14px 16px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    border-radius: var(--sx-radius);
}
.mobile-menu-link:hover { background: var(--sx-bg-elevated); color: var(--sx-text); }

/* --- Container --- */
.sx-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Buttons --- */
.sx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--sx-radius);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all var(--sx-transition);
    white-space: nowrap;
}
.sx-btn-icon {
    background: var(--sx-bg-elevated);
    color: var(--sx-text);
    padding: 10px;
    border: 1px solid var(--sx-border-light);
}
.sx-btn-icon:hover { background: var(--sx-border-light); }
.sx-btn-outline {
    background: transparent;
    color: var(--sx-text);
    border: 1px solid var(--sx-border-light);
}
.sx-btn-outline:hover { background: var(--sx-bg-elevated); }
.sx-btn-full { width: 100%; margin-top: 8px; }

/* --- Hero Section (Home) --- */
.sx-hero {
    position: relative;
    height: 500px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 16px;
    margin: 20px 20px 28px;
}
.sx-hero-backdrop {
    position: absolute;
    inset: 0;
}
.sx-hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}
.sx-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.6) 35%,
        rgba(0, 0, 0, 0.1) 65%,
        transparent 100%
    );
}
.sx-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    padding: 0 24px 56px;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Poster used as title logo — like competitor */
.sx-hero-poster-logo {
    width: 90px;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}

.sx-hero-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.sx-hero-desc {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.80);
    line-height: 1.6;
    margin: 0;
    max-width: 520px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.sx-hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 2px;
}

/* Play button — white pill */
.sx-btn-play {
    background: #ffffff;
    color: #000000;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background var(--sx-transition);
}
.sx-btn-play:hover { background: #e0e0e0; }

/* Add button — dark circle */
.sx-btn-add {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: var(--sx-text);
    border: 1.5px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--sx-transition);
}
.sx-btn-add:hover { background: rgba(255,255,255,0.25); }

/* Responsive */
@media (width < 768px) {
    .sx-hero { height: 380px; margin: 0 12px 20px; border-radius: 12px; }
    .sx-hero-content { padding: 0 16px 44px; max-width: 100%; }
    .sx-hero-title { font-size: 1.4rem; }
    .sx-hero-desc { font-size: 0.8rem; }
    .sx-hero-poster-logo { width: 70px; }
}
/* --- Section Headers --- */
.sx-section { padding: 28px 0 12px; overflow: visible; }
.sx-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.sx-section-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.sx-section-title-center { text-align: center; }
.sx-view-all {
    font-size: 0.8rem;
    color: var(--sx-text-dim);
    transition: color var(--sx-transition);
}
.sx-view-all:hover { color: var(--sx-text); }
.sx-slider-nav-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sx-slider-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border-light);
    color: var(--sx-text-dim);
    transition: all var(--sx-transition);
    cursor: pointer;
    text-decoration: none;
}
.sx-slider-nav-btn:hover { background: var(--sx-bg-elevated); color: var(--sx-text); border-color: var(--sx-border-light); }
.sx-page-heading {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--sx-text-muted);
    padding: 16px 0 0;
}

/* --- Content Area --- */
.sx-content-area { padding-bottom: 60px; }

/* --- Cards --- */
.sx-card {
    flex: 0 0 160px;
    min-width: 0;
}
.sx-card a { display: block; }
.card-poster, .sx-card-poster {
    aspect-ratio: 2/3;
    overflow: hidden;
    position: relative;
    border-radius: var(--sx-radius);
}
.card-poster img, .sx-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.sx-card:hover .sx-card-poster img { transform: scale(1.05); }
.sx-rating-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0,0,0,0.75);
    color: var(--sx-gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: var(--sx-radius-sm);
    z-index: 2;
}
.sx-rating-badge svg { color: var(--sx-gold); }
.sx-rating-badge-lg { font-size: 0.8rem; padding: 4px 8px; }
.sx-ep-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    background: rgba(0,0,0,0.75);
    color: var(--sx-text);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--sx-radius-sm);
    z-index: 2;
}

.sx-card-info { padding: 8px 2px 4px; }
.sx-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--sx-text-muted);
    margin-bottom: 2px;
}
.sx-card-type {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sx-card-year { color: var(--sx-text-muted); }
.sx-card-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sx-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Slider --- */
.sx-slider-container {
    position: relative;
    padding: 0 0;
}
.sx-content-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 8px;
}
.sx-content-slider::-webkit-scrollbar { display: none; }

.sx-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-70%);
    z-index: 5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(30,30,30,0.92);
    border: 1px solid var(--sx-border-light);
    color: var(--sx-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--sx-transition), opacity var(--sx-transition);
    pointer-events: auto;
}
.sx-slider-btn:hover { background: var(--sx-bg-elevated); }
/* Push buttons outside the card area so they never overlap clickable posters */
.sx-slider-prev { left: -16px; }
.sx-slider-next { right: -16px; }

/* --- Content Grid (List Pages) --- */
.sx-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px 12px;
    padding: 8px 0;
}
@media (width >= 768px) {
    .sx-content-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (width >= 1200px) {
    .sx-content-grid { grid-template-columns: repeat(7, 1fr); }
}

/* --- List Page --- */
.sx-list-page { padding: 24px 0 40px; }
.sx-list-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* List Search Bar */
.sx-list-search-row { margin-bottom: 16px; }
.sx-list-search-form { width: 100%; }
.sx-list-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    padding: 10px 16px;
}
.sx-list-search-wrap svg { flex-shrink: 0; color: var(--sx-text-muted); }
.sx-list-search-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--sx-text);
    font-size: 0.9rem;
    padding: 0;
}
.sx-list-search-wrap input:focus { outline: none; }
.sx-list-search-wrap-lg { padding: 14px 20px; }
.sx-list-search-wrap-lg input { font-size: 1rem; }

/* --- Filter Tabs --- */
.sx-filter-tabs { margin-bottom: 12px; }
.sx-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.sx-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: 20px;
    transition: all var(--sx-transition);
    white-space: nowrap;
}
.sx-filter-tab:hover { color: var(--sx-text); border-color: var(--sx-border-light); }
.sx-filter-tab.active {
    background: var(--sx-text);
    color: #000;
    border-color: var(--sx-text);
}
.sx-filter-divider {
    width: 1px;
    height: 20px;
    background: var(--sx-border-light);
    margin: 0 4px;
}
.sx-filter-dropdown { position: relative; }
.sx-filter-more { cursor: pointer; }
.sx-filter-more svg { transition: transform var(--sx-transition); }
.sx-filter-dropdown[open] .sx-filter-more svg { transform: rotate(180deg); }
.sx-filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border-light);
    border-radius: var(--sx-radius);
    padding: 6px;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sx-filter-dropdown-item {
    display: block;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--sx-text-dim);
    border-radius: var(--sx-radius-sm);
    transition: background var(--sx-transition);
}
.sx-filter-dropdown-item:hover { background: var(--sx-bg-card); color: var(--sx-text); }
.sx-filter-dropdown-item.active { color: var(--sx-text); font-weight: 600; }
.sx-filter-years { margin-top: 6px; }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; padding: 24px 0; }
.pagination__list { display: flex; gap: 4px; align-items: center; list-style: none; }
.pagination__item { display: inline-flex; }
.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-sm);
    transition: all var(--sx-transition);
}
.pagination__link:hover { color: var(--sx-text); border-color: var(--sx-border-light); }
.pagination__link--active {
    background: var(--sx-text);
    color: #000;
    border-color: var(--sx-text);
}
.pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--sx-text-muted);
}

/* --- Detail Page --- */
.sx-detail-page { padding: 12px 0 40px; }
.sx-detail-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.sx-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    color: var(--sx-text-dim);
    transition: all var(--sx-transition);
    flex-shrink: 0;
}
.sx-back-btn:hover { color: var(--sx-text); background: var(--sx-bg-elevated); }
.sx-detail-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Two-column layout: player/episodes on left, info sidebar on right */
.sx-detail-layout {
    display: grid;
    grid-template-columns: 1fr 474px;
    gap: 14px;
    align-items: start;
}

/* Sidebar — scrollable panel matching competitor */
.sx-detail-sidebar {
    position: sticky;
    top: 12px;
    width: 100%;
    max-height: 100vh;
    overflow-x: auto;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--sx-border-light) transparent;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
}
.sx-detail-sidebar::-webkit-scrollbar { width: 3px; }
.sx-detail-sidebar::-webkit-scrollbar-thumb { background: var(--sx-border-light); border-radius: 2px; }

@media (width < 1200px) {
    .sx-detail-layout {
        grid-template-columns: 1fr 360px;
    }
}
@media (width < 900px) {
    .sx-detail-layout {
        grid-template-columns: 1fr 280px;
    }
}
@media (width < 768px) {
    .sx-detail-layout { grid-template-columns: 1fr; }
    .sx-detail-sidebar { position: static; max-height: none; overflow-y: visible; }
}

/* Player — cap height so it doesn't dominate the screen */
.sx-player-section { margin-bottom: 10px; }
.sx-no-player-msg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--sx-text-muted);
    background: #111;
}
.sx-player-container {
    position: relative;
    aspect-ratio: 16/9;
    width: 100%;
    max-height: 420px;
    background: #111;
    border-radius: var(--sx-radius);
    overflow: hidden;
}
.player-container { position: relative; aspect-ratio: 16/9; width: 100%; max-height: 420px; }
.player-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.player-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}
.player-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    color: var(--sx-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--sx-transition);
    z-index: 3;
}
.player-play-btn:hover { background: rgba(255,255,255,0.25); }
.player-hidden { display: none; }
.player-error { text-align: center; color: var(--sx-text-muted); padding: 20px; font-size: 0.9rem; }

/* Engine stub classes (JS references these) */
.top10-slider { display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.top10-slider::-webkit-scrollbar { display: none; }
.actors-slider { display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.actors-slider::-webkit-scrollbar { display: none; }
.toggle-tab { cursor: pointer; }
.search-filter { position: relative; }
.h-hero-slide { display: none; }
.h-hero-slide.active { display: block; }
.h-hero-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sx-border-light); border: none; cursor: pointer; }
.h-hero-dot.active { background: var(--sx-text); }

/* Player Loading */
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #111;
    color: var(--sx-text-dim);
    font-size: 0.85rem;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--sx-border-light);
    border-top-color: var(--sx-text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Now Playing Bar */
.sx-now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    margin-top: 8px;
}
.sx-now-playing-info { flex: 1; min-width: 0; }
.sx-now-playing-label {
    display: block;
    font-size: 0.7rem;
    color: var(--sx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sx-now-playing-title {
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx-now-playing-nav { flex-shrink: 0; }
.sx-now-playing-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border);
    color: var(--sx-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--sx-transition);
}
.sx-now-playing-arrow:hover:not(:disabled) { color: var(--sx-text); background: var(--sx-border-light); }
.sx-now-playing-arrow:disabled { opacity: 0.3; cursor: default; }

/* Server Hint */
.sx-server-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--sx-text-muted);
    padding: 10px 0;
}

/* Server Tabs */
.sx-server-tabs,
.server-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 8px 0;
}
@media (max-width: 600px) {
    .sx-server-tabs, .server-tabs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 380px) {
    .sx-server-tabs, .server-tabs { grid-template-columns: repeat(2, 1fr); }
}
.sx-server-tab, .server-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    transition: all var(--sx-transition);
    white-space: nowrap;
}
.sx-server-tab:hover, .server-tab:hover { color: var(--sx-text); border-color: var(--sx-border-light); }
.sx-server-tab.active, .server-tab.active {
    color: var(--sx-text);
    border-color: var(--sx-green);
}
.sx-server-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sx-green);
}

/* Report */
.sx-report-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 0;
}
.sx-report-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--sx-text-muted);
    padding: 6px 12px;
    border-radius: var(--sx-radius-sm);
    transition: color var(--sx-transition);
}
.sx-report-toggle:hover { color: var(--sx-text); }
.report-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.report-form select {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: var(--sx-radius-sm);
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    color: var(--sx-text);
}
.sx-report-submit, .report-submit-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--sx-accent);
    color: var(--sx-text);
    border-radius: var(--sx-radius-sm);
    border: none;
}
.report-textarea {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.8rem;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-sm);
    color: var(--sx-text);
    resize: none;
    font-family: inherit;
}
.report-textarea::placeholder { color: var(--sx-text-dim); }

/* Watch Info (episode) */
.sx-watch-info { padding: 12px 0; }
.sx-watch-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.sx-watch-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--sx-text-muted);
    margin-bottom: 6px;
}
.sx-watch-desc { font-size: 0.85rem; color: var(--sx-text-dim); line-height: 1.6; }

/* --- Detail Sidebar --- */
.sx-sidebar-card {
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    padding: 12px;
}
.sx-sidebar-poster-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.sx-sidebar-poster {
    position: relative;
    flex-shrink: 0;
    width: 72px;
    border-radius: var(--sx-radius);
    overflow: hidden;
}
.sx-sidebar-poster img {
    width: 100%;
    height: auto;
    border-radius: var(--sx-radius);
}
.sx-sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-width: 0;
}
.sx-sidebar-meta-row {
    display: flex;
    flex-direction: column;
}
.sx-meta-label {
    font-size: 0.65rem;
    color: var(--sx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sx-meta-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sx-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx-sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}
.sx-sidebar-desc {
    font-size: 0.78rem;
    color: var(--sx-text-dim);
    line-height: 1.55;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--sx-bg-elevated);
    border-radius: var(--sx-radius);
}
.sx-sidebar-desc p { margin: 0; }
.sx-sidebar-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.sx-genre-chip {
    display: inline-block;
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border);
    border-radius: 20px;
    transition: all var(--sx-transition);
}
.sx-genre-chip:hover { color: var(--sx-text); border-color: var(--sx-border-light); }

.sx-sidebar-section { margin-bottom: 8px; }
.sx-sidebar-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--sx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sx-trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    transition: all var(--sx-transition);
}
.sx-trailer-btn:hover { color: var(--sx-text); border-color: var(--sx-border-light); }
.sx-sidebar-people {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 6px;
}
.sx-person-link {
    font-size: 0.75rem;
    color: var(--sx-text-dim);
    transition: color var(--sx-transition);
}
.sx-person-link:hover { color: var(--sx-text); }


/* --- Episode Panel --- */
.sx-episode-panel {
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    overflow: hidden;
}
.sx-episode-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--sx-border);
}
.sx-season-select {
    padding: 4px 8px;
    font-size: 0.78rem;
    border-radius: var(--sx-radius-sm);
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border-light);
}
.sx-episode-count {
    font-size: 0.72rem;
    color: var(--sx-text-muted);
    margin-left: auto;
    white-space: nowrap;
}
.sx-episode-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--sx-border);
}
.sx-episode-search svg { flex-shrink: 0; color: var(--sx-text-muted); }
.sx-episode-search input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 0.78rem;
    color: var(--sx-text);
    padding: 0;
}
.sx-episode-search input:focus { outline: none; }

/* Episode list height adapts to viewport so it doesn't push content off screen */
.sx-episode-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--sx-border-light) transparent;
}
.sx-episode-list::-webkit-scrollbar { width: 3px; }
.sx-episode-list::-webkit-scrollbar-thumb { background: var(--sx-border-light); border-radius: 2px; }

.sx-episode-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 0.78rem;
    color: var(--sx-text-dim);
    border-bottom: 1px solid var(--sx-border);
    text-align: left;
    transition: background var(--sx-transition), color var(--sx-transition);
    cursor: pointer;
}
.sx-episode-item:last-child { border-bottom: none; }
.sx-episode-item:hover { background: var(--sx-bg-elevated); color: var(--sx-text); }
.sx-episode-item.episode-active {
    background: var(--sx-bg-elevated);
    color: var(--sx-text);
    font-weight: 600;
}
.sx-ep-num {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--sx-text-muted);
    font-size: 0.72rem;
}
.sx-ep-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}
.sx-ep-empty {
    padding: 16px 10px;
    font-size: 0.78rem;
    color: var(--sx-text-muted);
    text-align: center;
}

/* --- Breadcrumbs --- */
.sx-breadcrumb {
    padding: 10px 0;
}
.sx-breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.8rem;
    color: var(--sx-text-muted);
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}
.sx-breadcrumb-item { display: inline-flex; align-items: center; }
.sx-breadcrumb-item a { color: var(--sx-text-dim); transition: color var(--sx-transition); }
.sx-breadcrumb-item a:hover { color: var(--sx-text); }
.sx-breadcrumb-item + .sx-breadcrumb-item::before {
    content: '/';
    margin: 0 6px;
    color: var(--sx-text-muted);
}
.sx-breadcrumb-item [aria-current="page"] { color: var(--sx-text); }
.sx-breadcrumb-inline { padding: 0; }
.sx-breadcrumb-inline .sx-breadcrumb-list { padding: 0; font-size: 0.78rem; }

/* --- Search Page --- */
.sx-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 50vh;
    gap: 16px;
    color: var(--sx-text-dim);
}
.sx-search-empty svg { opacity: 0.3; }
.sx-search-sub { font-size: 0.9rem; color: var(--sx-text-muted); }
.sx-search-header { margin-bottom: 16px; }
.sx-search-count { font-size: 0.85rem; color: var(--sx-text-dim); margin-top: 10px; }
.sx-search-type-row {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}
.sx-search-type-opt {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--sx-transition);
}
.sx-search-type-opt input { display: none; }
.sx-search-type-opt:hover { color: var(--sx-text); }
.sx-search-type-opt.active { background: var(--sx-text); color: #000; border-color: var(--sx-text); }

/* --- Empty State --- */
.sx-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 30vh;
    gap: 16px;
    color: var(--sx-text-dim);
}
.sx-empty-links { display: flex; gap: 10px; }

/* --- Person Page --- */
.sx-person-header { margin-bottom: 16px; }
.sx-person-role {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sx-text);
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border);
    border-radius: 20px;
    margin-bottom: 8px;
}
.sx-person-intro {
    font-size: 0.85rem;
    color: var(--sx-text-muted, #888);
    margin-top: 8px;
    line-height: 1.5;
    max-width: 600px;
}

/* --- Request Page --- */
.sx-request-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 32px;
    align-items: start;
}
@media (width < 768px) {
    .sx-request-layout { grid-template-columns: 1fr; }
}
.sx-request-info p { font-size: 0.9rem; color: var(--sx-text-dim); margin-bottom: 16px; }
.sx-request-steps {
    list-style: decimal;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--sx-text-dim);
}
.sx-request-form-wrap {
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    padding: 24px;
}
.sx-request-form { display: flex; flex-direction: column; gap: 14px; }
.sx-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (width < 480px) { .sx-form-row { grid-template-columns: 1fr; } }
.sx-form-group { display: flex; flex-direction: column; gap: 4px; }
.sx-form-group label { font-size: 0.8rem; font-weight: 600; color: var(--sx-text-dim); }
.sx-form-group input,
.sx-form-group select,
.sx-form-group textarea {
    padding: 10px 12px;
    font-size: 0.9rem;
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    color: var(--sx-text);
}
.sx-form-group textarea { min-height: 80px; resize: vertical; }
.sx-alert {
    padding: 12px 16px;
    border-radius: var(--sx-radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.sx-alert-success { background: rgba(76,175,80,0.15); color: var(--sx-green); border: 1px solid rgba(76,175,80,0.3); }
.sx-alert-error { background: rgba(229,9,20,0.15); color: var(--sx-accent); border: 1px solid rgba(229,9,20,0.3); }

/* --- 404 Page --- */
.sx-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    padding: 40px 20px;
}
.sx-error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--sx-border-light);
    line-height: 1;
}
.sx-error-title { font-size: 1.4rem; font-weight: 700; margin: 12px 0 8px; }
.sx-error-msg { font-size: 0.9rem; color: var(--sx-text-dim); margin-bottom: 24px; max-width: 400px; }
.sx-error-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* --- Footer --- */
.sx-footer {
    padding: 32px 0;
    border-top: 1px solid var(--sx-border);
    margin-top: 40px;
}
.sx-footer-logo {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
}
.sx-footer-disclaimer {
    font-size: 0.78rem;
    color: var(--sx-text-muted);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 12px;
    line-height: 1.6;
}
.sx-footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
}
.sx-footer-nav a { color: var(--sx-text-dim); transition: color var(--sx-transition); }
.sx-footer-nav a:hover { color: var(--sx-text); }

/* --- Notification Bar --- */
.sx-notif-bar {
    background: var(--sx-accent);
    color: var(--sx-text);
    font-size: 0.85rem;
}
.sx-notif-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}
.sx-notif-text { flex: 1; }
.sx-notif-btn {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--sx-radius-sm);
    background: rgba(255,255,255,0.2);
    color: var(--sx-text);
    border: none;
}
.sx-notif-close {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.7);
    background: none;
    border: none;
}

/* Subscribe Popup */
.sx-subscribe-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--sx-bg-card);
    padding: 20px;
    border-radius: var(--sx-radius-lg);
    border: 1px solid var(--sx-border);
    z-index: 2000;
    max-width: 280px;
    text-align: center;
}
.sx-subscribe-popup h4 { margin-bottom: 6px; font-size: 1rem; }
.sx-subscribe-popup p { font-size: 0.82rem; color: var(--sx-text-dim); margin-bottom: 12px; }
.sx-subscribe-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.2rem;
    color: var(--sx-text-muted);
    background: none;
    border: none;
}
.sx-subscribe-btn {
    display: block;
    background: #0088cc;
    color: var(--sx-text);
    padding: 10px;
    border-radius: var(--sx-radius);
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- Landing Page (Index) --- */
.sx-landing-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #111 50%, #0a0a0a 100%);
}
.sx-landing-hero-inner { max-width: 600px; }
.sx-landing-h1 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}
.sx-landing-sub {
    font-size: 0.95rem;
    color: var(--sx-text-dim);
    margin-bottom: 24px;
}
.sx-landing-search { margin-bottom: 20px; }
.sx-landing-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border-light);
    border-radius: 40px;
    padding: 6px 6px 6px 18px;
}
.sx-landing-search-wrap .sx-search-icon { flex-shrink: 0; color: var(--sx-text-muted); }
.sx-landing-search-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--sx-text);
    font-size: 0.9rem;
    padding: 8px 0;
}
.sx-landing-search-wrap input:focus { outline: none; }
.sx-landing-search-btn {
    padding: 10px 24px;
    background: var(--sx-text);
    color: #000;
    border: none;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.sx-landing-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sx-landing-link {
    font-size: 0.85rem;
    color: var(--sx-text-dim);
    padding: 6px 16px;
    border: 1px solid var(--sx-border);
    border-radius: 20px;
    transition: all var(--sx-transition);
}
.sx-landing-link:hover { color: var(--sx-text); border-color: var(--sx-border-light); }

/* Landing Stats */
.sx-landing-stats { padding: 32px 0; border-bottom: 1px solid var(--sx-border); }
.sx-stats-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.sx-stat { text-align: center; }
.sx-stat-num { display: block; font-size: 1.5rem; font-weight: 800; }
.sx-stat-label { font-size: 0.8rem; color: var(--sx-text-muted); }

/* Landing Hot */
.sx-landing-hot { padding: 32px 0; }
.sx-hot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    margin-top: 16px;
}
.sx-hot-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    transition: background var(--sx-transition);
}
.sx-hot-card:hover { background: var(--sx-bg-elevated); }
.sx-hot-rank { font-size: 0.8rem; font-weight: 700; color: var(--sx-text-muted); min-width: 24px; }
.sx-hot-title { flex: 1; font-size: 0.85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-hot-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.sx-hot-type { font-size: 0.7rem; color: var(--sx-text-muted); text-transform: uppercase; }
.sx-hot-score { font-size: 0.75rem; color: var(--sx-gold); }

/* Landing Genres */
.sx-landing-genres { padding: 32px 0; }
.sx-genre-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

/* Landing FAQ */
.sx-landing-faq { padding: 32px 0; }
.sx-faq-list {
    max-width: 700px;
    margin: 16px auto 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sx-faq-item {
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    overflow: hidden;
}
.sx-faq-q {
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.sx-faq-q::-webkit-details-marker { display: none; }
.sx-faq-q::marker { display: none; content: ''; }
.sx-faq-a {
    padding: 0 16px 14px;
    font-size: 0.85rem;
    color: var(--sx-text-dim);
    line-height: 1.6;
}
.sx-faq-a a { color: var(--sx-text); text-decoration: underline; }

/* Synopsis Read More */
.dp-read-more {
    display: inline;
    font-size: 0.8rem;
    color: var(--sx-accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
}

/* Trailer Dialog */
.trailer-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    background: rgba(0,0,0,0.9);
    border: none;
    padding: 0;
    z-index: 5000;
    /* Do NOT set display here — let the browser control open/closed state */
    align-items: center;
    justify-content: center;
}
/* Only show as flex when the dialog is actually open */
.trailer-dialog[open] {
    display: flex;
}
.trailer-dialog::backdrop { background: rgba(0,0,0,0.9); }
.trailer-modal-player {
    position: relative;
    width: 90vw;
    max-width: 900px;
    aspect-ratio: 16/9;
}
.trailer-modal-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--sx-radius);
}
.trailer-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--sx-text);
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Responsive --- */
@media (width < 768px) {
    .sx-landing-h1 { font-size: 1.4rem; }
    .sx-list-title { font-size: 1.3rem; }
    .sx-card { flex: 0 0 130px; }
    .sx-detail-page-title { font-size: 1.1rem; }
}

@media (width < 480px) {
    .sx-card { flex: 0 0 115px; }
    .sx-content-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px 8px; }
}

/* --- Browse Panel --- */
.sx-browse-btn { width: 100%; text-align: left; }

/* Backdrop overlay */
.sx-browse-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 150;
    backdrop-filter: blur(2px);
}
.sx-browse-backdrop.open { display: block; }

/* Panel itself — slides in from the left, right next to the sidebar */
.sx-browse-panel {
    position: fixed;
    top: 0;
    left: var(--sx-sidebar-w);
    width: 680px;
    max-width: calc(100vw - var(--sx-sidebar-w));
    height: 100vh;
    background: #111111;
    border-right: 1px solid var(--sx-border);
    z-index: 160;
    display: flex;
    flex-direction: column;
    transform: translateX(-110%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
}
.sx-browse-panel.open {
    transform: translateX(0);
}

.sx-browse-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Panel header with tabs + close */
.sx-browse-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
    flex-shrink: 0;
    border-bottom: 1px solid var(--sx-border);
    padding-bottom: 0;
}
.sx-browse-tabs {
    display: flex;
    gap: 0;
}
.sx-browse-tab {
    padding: 12px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sx-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color var(--sx-transition), border-color var(--sx-transition);
    margin-bottom: -1px;
}
.sx-browse-tab:hover { color: var(--sx-text-dim); }
.sx-browse-tab.active {
    color: var(--sx-text);
    border-bottom-color: var(--sx-text);
}
.sx-browse-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border-light);
    color: var(--sx-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--sx-transition);
    flex-shrink: 0;
}
.sx-browse-close:hover { color: var(--sx-text); background: var(--sx-border-light); }

/* Scrollable poster grid */
.sx-browse-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--sx-border-light) transparent;
}
.sx-browse-grid::-webkit-scrollbar { width: 4px; }
.sx-browse-grid::-webkit-scrollbar-track { background: transparent; }
.sx-browse-grid::-webkit-scrollbar-thumb { background: var(--sx-border-light); border-radius: 2px; }

/* Loading state */
.sx-browse-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.sx-browse-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--sx-border-light);
    border-top-color: var(--sx-text-dim);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Individual browse card */
.sx-browse-card {
    display: block;
    text-decoration: none;
    color: inherit;
}
.sx-browse-card-poster {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--sx-radius);
    overflow: hidden;
    background: var(--sx-bg-card);
    margin-bottom: 6px;
}
.sx-browse-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.sx-browse-card:hover .sx-browse-card-poster img { transform: scale(1.06); }
.sx-browse-card-rating {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(0,0,0,0.75);
    color: var(--sx-gold);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: var(--sx-radius-sm);
}
.sx-browse-card-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--sx-transition);
}
.sx-browse-card:hover .sx-browse-card-title { color: var(--sx-text); }

/* Footer view-all link */
.sx-browse-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--sx-border);
    text-align: center;
}
.sx-browse-view-all {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sx-text-dim);
    transition: color var(--sx-transition);
}
.sx-browse-view-all:hover { color: var(--sx-text); }

/* Mobile: panel takes full width */
@media (width < 1024px) {
    .sx-browse-panel {
        left: 0;
        width: 100vw;
        max-width: 100vw;
    }
}

/* --- Browse by Genre Page --- */
.sx-browse-page { padding: 24px 0 48px; }

.sx-browse-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.sx-browse-page-title {
    font-size: 1.4rem;
    font-weight: 700;
}

/* Movies / TV Shows toggle */
.sx-browse-type-toggle {
    display: flex;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border-light);
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
}
.sx-browse-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sx-text-muted);
    border-radius: 16px;
    transition: all var(--sx-transition);
    white-space: nowrap;
}
.sx-browse-type-btn:hover { color: var(--sx-text-dim); }
.sx-browse-type-btn.active {
    background: var(--sx-text);
    color: #000;
}
.sx-browse-type-btn svg { flex-shrink: 0; }

/* Genre grid — masonry-like layout matching the screenshot */
.sx-browse-genre-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 160px;
    gap: 10px;
}

/* First two cards span 2 columns + 2 rows (large featured cards) */
.sx-genre-card-large {
    grid-column: span 2;
    grid-row: span 2;
}

/* Genre card */
.sx-genre-card {
    position: relative;
    border-radius: var(--sx-radius-lg);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sx-genre-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 2;
}

/* Background image */
.sx-genre-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease;
}
.sx-genre-card:hover .sx-genre-card-bg { transform: scale(1.06); }

/* Colour overlay using the per-genre CSS variable */
.sx-genre-card-overlay {
    position: absolute;
    inset: 0;
    background: var(--genre-color, rgba(0,0,0,0.65));
    mix-blend-mode: multiply;
}

/* Dark gradient at the bottom so text is always readable */
.sx-genre-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
    pointer-events: none;
}

/* Text content */
.sx-genre-card-body {
    position: relative;
    z-index: 2;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sx-genre-card-name {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.sx-genre-card-large .sx-genre-card-name {
    font-size: 1.6rem;
}
.sx-genre-card-explore {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
}

/* Responsive */
@media (width < 900px) {
    .sx-browse-genre-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 130px;
    }
    .sx-genre-card-large { grid-column: span 2; grid-row: span 2; }
}
@media (width < 600px) {
    .sx-browse-genre-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 120px;
    }
    .sx-genre-card-large { grid-column: span 2; grid-row: span 1; }
    .sx-genre-card-large .sx-genre-card-name { font-size: 1.2rem; }
}

/* --- Browse Page Hero Banner --- */
.sx-browse-hero {
    position: relative;
    border-radius: var(--sx-radius-lg);
    overflow: hidden;
    margin-bottom: 28px;
    min-height: 200px;
    display: flex;
    align-items: center;
    background: #0d0d0d;
    /* Subtle purple-to-dark gradient matching the screenshot */
    background: linear-gradient(135deg, #0d0d0d 0%, #1a0d2e 40%, #0d1a1a 70%, #0d0d0d 100%);
}

/* Decorative radial glow in the top-right (mimics the colourful image area) */
.sx-browse-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 420px;
    height: 320px;
    background: radial-gradient(ellipse at 70% 30%,
        rgba(120,60,200,0.45) 0%,
        rgba(20,120,100,0.25) 45%,
        transparent 70%);
    pointer-events: none;
}

.sx-browse-hero-content {
    position: relative;
    z-index: 2;
    padding: 36px 40px;
    max-width: 520px;
}

.sx-browse-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--sx-text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.sx-browse-hero-title {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 10px;
    color: var(--sx-text);
}

.sx-browse-hero-sub {
    font-size: 0.85rem;
    color: var(--sx-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 380px;
}

.sx-browse-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sx-browse-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sx-transition);
    white-space: nowrap;
    text-decoration: none;
    border: none;
}

.sx-browse-hero-btn-primary {
    background: var(--sx-text);
    color: #000;
}
.sx-browse-hero-btn-primary:hover { background: #e0e0e0; }

.sx-browse-hero-btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--sx-text);
    border: 1px solid rgba(255,255,255,0.15);
}
.sx-browse-hero-btn-secondary:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.3);
}

@media (width < 600px) {
    .sx-browse-hero-content { padding: 28px 20px; }
    .sx-browse-hero-title { font-size: 1.4rem; }
    .sx-browse-hero::before { display: none; }
}

/* --- Detail Page: Compact Info Card --- */

/* Poster + title/meta side by side */
.sx-info-card {
    display: flex;
    gap: 8px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    padding: 8px;
}

.sx-info-poster {
    position: relative;
    flex-shrink: 0;
    width: 60px;
}
.sx-info-poster img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--sx-radius-sm);
    display: block;
}

.sx-info-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sx-info-title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.sx-info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}
.sx-info-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    background: var(--sx-accent);
    color: #fff;
    border-radius: var(--sx-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sx-info-meta-item {
    font-size: 0.68rem;
    color: var(--sx-text-muted);
}
.sx-info-meta-item + .sx-info-meta-item::before {
    content: '·';
    margin-right: 3px;
    color: var(--sx-border-light);
}

.sx-info-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.sx-info-play-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
    margin-top: 2px;
    align-self: flex-start;
}
.sx-info-play-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.sx-info-play-row .sx-info-play-btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
}

/* Description */
.sx-info-desc {
    font-size: 0.72rem;
    color: var(--sx-text-dim);
    line-height: 1.5;
    padding: 6px 8px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-sm);
}
.sx-info-desc p { margin: 0; }

/* Extra details rows */
.sx-info-details {
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-sm);
    overflow: hidden;
}
.sx-info-detail-row {
    display: flex;
    gap: 6px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--sx-border);
    align-items: baseline;
}
.sx-info-detail-row:last-child { border-bottom: none; }
.sx-info-detail-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--sx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    width: 44px;
    padding-top: 1px;
}
.sx-info-detail-val {
    font-size: 0.7rem;
    color: var(--sx-text-dim);
    display: flex;
    flex-wrap: wrap;
    gap: 2px 5px;
    min-width: 0;
}

/* --- Recommended / Related Grid (detail pages) --- */
.sx-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 4px 0;
}

/* Cards inside the grid don't need a fixed flex width */
.sx-card-grid .sx-card {
    flex: none;
    width: 100%;
    min-width: 0;
}

/* Slightly larger on wider screens */
@media (width >= 1200px) {
    .sx-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Tighter on narrow left columns (detail page sidebar layout) */
@media (width < 600px) {
    .sx-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
}

/* ============================================
   Collapsible Sidebar — Icon Rail Mode
   ============================================ */

:root {
    --sx-sidebar-rail: 60px; /* collapsed icon-rail width */
}

/* Sidebar width transitions smoothly */
.sx-sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    position: fixed; /* already set above — ensure transition applies */
}

/* ── Toggle button — fixed to viewport center, tracks sidebar edge ── */
.sx-sidebar-toggle {
    position: fixed;
    top: 50vh;
    left: var(--sx-sidebar-w);
    transform: translateY(-50%);
    z-index: 300;
    width: 18px;
    height: 40px;
    border-radius: 0 6px 6px 0;
    background: var(--sx-bg-elevated);
    border: 1px solid var(--sx-border-light);
    border-left: none;
    color: var(--sx-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background var(--sx-transition), color var(--sx-transition),
                left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.sx-sidebar-toggle:hover {
    background: var(--sx-border-light);
    color: var(--sx-text);
}
.sx-sidebar-toggle:focus-visible {
    outline: 2px solid var(--sx-accent);
    outline-offset: 2px;
}

/* Chevron icon rotates when collapsed */
.sx-sidebar-toggle-icon {
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   COLLAPSED — icon rail state
   ══════════════════════════════════════════ */
body.sx-sidebar-collapsed .sx-sidebar {
    width: var(--sx-sidebar-rail);
}

/* Main wrap shrinks its offset to match the rail */
body.sx-sidebar-collapsed .sx-main-wrap {
    margin-left: var(--sx-sidebar-rail);
}

/* Tighter padding, centered content */
body.sx-sidebar-collapsed .sx-sidebar-inner {
    padding: 16px 0;
    align-items: center;
}

/* X icon — hidden in expanded state */
.sx-logo-icon-collapsed {
    display: none;
    color: var(--sx-text);
    flex-shrink: 0;
}

/* Logo: switch to X icon when collapsed */
body.sx-sidebar-collapsed .sx-sidebar-logo {
    padding: 0 0 14px;
    width: 100%;
    display: flex;
    justify-content: center;
}
body.sx-sidebar-collapsed .sx-logo-text {
    display: none;
}
body.sx-sidebar-collapsed .sx-logo-icon-collapsed {
    display: block;
}

/* Nav sections: center-align */
body.sx-sidebar-collapsed .sx-nav-section {
    width: 100%;
    align-items: center;
}

/* Nav links: icon-only, centered, no gap */
body.sx-sidebar-collapsed .sx-nav-link {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    gap: 0;
    border-radius: var(--sx-radius);
    position: relative;
}

/* Hide text labels */
body.sx-sidebar-collapsed .sx-nav-link span {
    display: none;
}

/* Icons: full opacity, slightly larger */
body.sx-sidebar-collapsed .sx-nav-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.75;
}
body.sx-sidebar-collapsed .sx-nav-link:hover svg,
body.sx-sidebar-collapsed .sx-nav-link.active svg {
    opacity: 1;
}

/* Hide section dividers and labels */
body.sx-sidebar-collapsed .sx-nav-divider {
    width: 100%;
    padding: 8px 0 4px;
    display: flex;
    justify-content: center;
}
body.sx-sidebar-collapsed .sx-nav-label {
    display: none;
}
/* Show a thin horizontal rule instead of the label */
body.sx-sidebar-collapsed .sx-nav-divider::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--sx-border-light);
}

/* Tooltip on hover — shows the link text */
body.sx-sidebar-collapsed .sx-nav-link[title]::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--sx-bg-elevated);
    color: var(--sx-text);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: var(--sx-radius-sm);
    border: 1px solid var(--sx-border-light);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 400;
}
body.sx-sidebar-collapsed .sx-nav-link[title]:hover::after {
    opacity: 1;
}

/* Chevron flips to point right when collapsed */
body.sx-sidebar-collapsed .sx-sidebar-toggle-icon {
    transform: rotate(180deg);
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .sx-sidebar,
    .sx-sidebar-inner,
    .sx-main-wrap,
    .sx-sidebar-toggle,
    .sx-sidebar-toggle-icon {
        transition: none;
    }
}

/* Hide toggle on mobile — sidebar is already hidden there */
@media (width < 1024px) {
    .sx-sidebar-toggle { display: none; }
}

/* --- Search + Filters Bar --- */
.sx-search-filter-row {
    margin-bottom: 8px;
}
.sx-search-filter-form {
    width: 100%;
}
.sx-search-filter-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 0 4px 0 14px;
    height: 46px;
    transition: border-color var(--sx-transition);
}
.sx-search-filter-wrap:focus-within {
    border-color: #444;
}
.sx-search-filter-icon {
    flex-shrink: 0;
    color: var(--sx-text-muted);
    margin-right: 10px;
}
.sx-search-filter-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--sx-text);
    font-size: 0.9rem;
    padding: 0;
    min-width: 0;
}
.sx-search-filter-input::placeholder {
    color: var(--sx-text-muted);
}

/* Filters button — right side of search bar */
.sx-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    height: 36px;
    border-radius: 7px;
    background: #252525;
    border: 1px solid #333;
    color: var(--sx-text-dim);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background var(--sx-transition), color var(--sx-transition), border-color var(--sx-transition);
    margin-left: 6px;
}
.sx-filters-btn:hover {
    background: #2e2e2e;
    color: var(--sx-text);
    border-color: #444;
}
.sx-filters-btn-active {
    color: var(--sx-text);
    border-color: #555;
}
/* Active dot indicator */
.sx-filters-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sx-accent);
}

/* Filters panel — hidden by default */
.sx-filters-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
}
.sx-filters-panel.open {
    max-height: 400px;
    opacity: 1;
}

/* --- Filters Panel Dropdown --- */
.sx-filters-panel-inner {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px 20px 16px;
    margin-top: 6px;
}
.sx-filters-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sx-text);
    margin-bottom: 16px;
}
.sx-filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}
@media (width < 768px) {
    .sx-filters-grid { grid-template-columns: 1fr 1fr; }
}
@media (width < 480px) {
    .sx-filters-grid { grid-template-columns: 1fr; }
}

.sx-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sx-filter-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--sx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sx-filter-select-wrap {
    position: relative;
}
.sx-filter-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: #111;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    color: var(--sx-text);
    font-size: 0.88rem;
    padding: 10px 36px 10px 12px;
    cursor: pointer;
    transition: border-color var(--sx-transition);
}
.sx-filter-select:focus {
    outline: none;
    border-color: #444;
}
.sx-filter-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sx-text-muted);
    pointer-events: none;
}

/* Footer: reset + apply */
.sx-filters-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #222;
}
.sx-filters-reset {
    font-size: 0.82rem;
    color: var(--sx-text-muted);
    transition: color var(--sx-transition);
}
.sx-filters-reset:hover { color: var(--sx-text); }
.sx-filters-apply {
    padding: 9px 22px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--sx-transition);
}
.sx-filters-apply:hover { background: #e0e0e0; }

/* ============================================
   Movie/Series Detail — Right Sidebar Panel
   ============================================ */

/* Poster row: poster left, meta right */
.sx-dp-poster-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.sx-dp-poster-wrap {
    position: relative;
    flex-shrink: 0;
    width: 150px;
}
.sx-dp-poster-wrap img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.sx-dp-rating-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0,0,0,0.75);
    color: #f5c518;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
}

/* Meta column: Status / Production / Aired */
.sx-dp-meta-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}
.sx-dp-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sx-dp-meta-label {
    font-size: 0.72rem;
    color: var(--sx-text-muted);
    font-weight: 500;
}
.sx-dp-meta-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--sx-text);
    word-break: break-word;
}
.sx-dp-meta-link {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--sx-text);
    transition: color var(--sx-transition);
}
.sx-dp-meta-link:hover { color: var(--sx-text-dim); }

/* Title */
.sx-dp-title {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--sx-text);
    margin: 0;
}

/* Description box */
.sx-dp-desc {
    background: #222;
    border-radius: 10px;
    padding: 14px;
    font-size: 0.85rem;
    color: var(--sx-text-dim);
    line-height: 1.65;
}
.sx-dp-desc p { margin: 0; }

/* Genre chips — white bg, dark text */
.sx-dp-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sx-dp-genre-chip {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #000;
    background: #fff;
    border-radius: 6px;
    transition: background var(--sx-transition);
}
.sx-dp-genre-chip:hover { background: #e0e0e0; }

/* Section heading */
.sx-dp-section { display: flex; flex-direction: column; gap: 8px; }
.sx-dp-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sx-text);
    margin: 0;
}

/* Trailer button */
.sx-dp-trailer-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1e1e1e;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sx-text);
    transition: background var(--sx-transition);
    text-decoration: none;
}
.sx-dp-trailer-btn:hover { background: #2a2a2a; }

/* StreameX Trailer Modal — slide-down, green accent */
.sx-trailer-overlay { display: none; position: fixed; inset: 0; z-index: 700; align-items: flex-start; justify-content: center; padding-top: 60px; background: rgba(0,0,0,0.75); }
.sx-trailer-overlay.open { display: flex; }
.sx-trailer-panel { width: 92%; max-width: 900px; background: #1a1a1a; border: 1px solid var(--sx-accent, #10b981); border-radius: 12px; overflow: hidden; animation: sxSlideDown 0.3s ease-out; }
@keyframes sxSlideDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
.sx-trailer-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(16,185,129,0.08); border-bottom: 1px solid rgba(16,185,129,0.2); }
.sx-trailer-label { font-size: 13px; font-weight: 600; color: var(--sx-accent, #10b981); text-transform: uppercase; letter-spacing: 0.5px; }
.sx-trailer-close { background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; opacity: 0.6; transition: opacity 0.2s; line-height: 1; padding: 0 4px; }
.sx-trailer-close:hover { opacity: 1; }
.sx-trailer-video { position: relative; padding-bottom: 56.25%; height: 0; background: #000; }
.sx-trailer-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Cast list */
.sx-dp-cast {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}
.sx-dp-cast-item {
    font-size: 0.8rem;
    color: var(--sx-text-dim);
    transition: color var(--sx-transition);
}
.sx-dp-cast-item:hover { color: var(--sx-text); }

/* ============================================
   Series Detail — Episode Panel (new design)
   ============================================ */

/* Outer dark card wrapping the episode panel */
.sx-ep-card {
    background: rgb(18, 18, 18);
    border-radius: 8px;
    padding: 16px;
}

.sx-ep-panel {
    background: transparent;
    overflow: hidden;
}

/* Header: season dropdown + count + view toggles */
.sx-ep-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* Season dropdown — pill style */
.sx-ep-season-wrap {
    position: relative;
    flex-shrink: 0;
}
.sx-ep-season-select {
    appearance: none;
    -webkit-appearance: none;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    color: var(--sx-text);
    font-size: 0.88rem;
    font-weight: 700;
    padding: 10px 36px 10px 14px;
    cursor: pointer;
    min-width: 120px;
}
.sx-ep-season-select:focus { outline: none; border-color: #555; }
.sx-ep-season-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sx-text-muted);
    pointer-events: none;
}

/* Episode count — separate pill */
.sx-ep-count-badge {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sx-text-dim);
    padding: 10px 14px;
    text-align: left;
}
.sx-ep-jump-input {
    cursor: text;
    outline: none;
    -moz-appearance: textfield;
}
.sx-ep-jump-input::-webkit-outer-spin-button,
.sx-ep-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sx-ep-jump-input:focus {
    border-color: var(--sx-accent, #10b981);
    color: var(--sx-text);
}

/* List / Grid view toggle buttons */
.sx-ep-view-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.sx-ep-view-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: var(--sx-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--sx-transition);
}
.sx-ep-view-btn:hover { background: #333; color: var(--sx-text); }
.sx-ep-view-btn.active {
    background: #333;
    border-color: #555;
    color: var(--sx-text);
}

/* Episode list container — scrollable */
.sx-ep-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--sx-border-light) transparent;
    padding-right: 2px;
}
.sx-ep-list::-webkit-scrollbar { width: 3px; }
.sx-ep-list::-webkit-scrollbar-thumb { background: var(--sx-border-light); border-radius: 2px; }

/* Each episode — its own rounded card */
.sx-ep-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #242424;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--sx-text-dim);
    transition: background var(--sx-transition), color var(--sx-transition);
    width: 100%;
}
.sx-ep-row:hover { background: #2e2e2e; color: var(--sx-text); }
.sx-ep-row.episode-active {
    background: #303030;
    color: var(--sx-text);
}
.sx-ep-row-num {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sx-text-muted);
    width: 24px;
}
.sx-ep-row-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.sx-ep-row-play {
    flex-shrink: 0;
    opacity: 0;
    color: var(--sx-text);
    transition: opacity var(--sx-transition);
}
.sx-ep-row:hover .sx-ep-row-play,
.sx-ep-row.episode-active .sx-ep-row-play {
    opacity: 1;
}

/* --- Episode Panel: Card/Grid view --- */

/* Card mode row — thumbnail left, ep number + title right */
.sx-ep-row.sx-ep-row-card {
    padding: 8px;
    gap: 12px;
    align-items: center;
    border-radius: 10px;
}

/* Episode thumbnail */
.sx-ep-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #1a1a1a;
}

/* Card info: Ep N bold + title below */
.sx-ep-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    text-align: left;
}
.sx-ep-card-num {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sx-text);
}
.sx-ep-card-title {
    font-size: 0.82rem;
    color: var(--sx-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Active card gets a border highlight */
.sx-ep-row.sx-ep-row-card.episode-active {
    border: 1px solid rgba(255,255,255,0.15);
}

/* Separator between episode panel card and poster detail section */
.sx-ep-card + .sx-dp-poster-row {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--sx-border-light);
}

/* ============================================
   Index Page — No Sidebar Layout
   On the landing page, hide the desktop sidebar
   and show the mobile top bar on all viewports.
   ============================================ */
body.sf-page-index { display: block; }
body.sf-page-index .sx-sidebar { display: none !important; }
body.sf-page-index .sx-sidebar-toggle { display: none !important; }
body.sf-page-index .sx-main-wrap { margin-left: 0 !important; display: block; }
body.sf-page-index .sx-mobile-bar { display: none !important; }
body.sf-page-index.sx-sidebar-collapsed .sx-main-wrap { margin-left: 0 !important; }

/* Browse panel offset — no sidebar on index */
body.sf-page-index .sx-browse-panel { left: 0; width: 100vw; max-width: 100vw; }

/* ============================================
   Mobile Menu — Close Button
   ============================================ */
.mobile-menu-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--sx-text-dim);
    transition: background var(--sx-transition), color var(--sx-transition);
    z-index: 2;
}
.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--sx-text);
}

/* ============================================
   Index Page - About & Why Sections
   ============================================ */
.sx-landing-about { padding: 32px 0; }
.sx-about-content {
    max-width: 700px;
    margin: 16px auto 0;
    text-align: center;
}
.sx-about-content p {
    font-size: 0.9rem;
    color: var(--sx-text-dim);
    line-height: 1.7;
    margin-bottom: 12px;
}
.sx-about-content p:last-child { margin-bottom: 0; }

.sx-landing-why { padding: 32px 0; }
.sx-why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.sx-why-item {
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    padding: 20px;
}
.sx-why-item h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.sx-why-item p {
    font-size: 0.82rem;
    color: var(--sx-text-dim);
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   Home Page - SEO H1 (visible but subtle)
   ============================================ */
.sx-home-h1 {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--sx-text-muted);
    padding: 16px 20px 0;
    margin: 0;
    max-width: 1400px;
    margin-inline: auto;
}

/* ============================================
   Search Page - Redesigned
   ============================================ */
.sx-search-page-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}
.sx-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border-light);
    border-radius: 40px;
    padding: 6px 6px 6px 18px;
    transition: border-color var(--sx-transition);
}
.sx-search-bar:focus-within {
    border-color: #444;
}
.sx-search-bar svg {
    flex-shrink: 0;
    color: var(--sx-text-muted);
}
.sx-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--sx-text);
    font-size: 0.9rem;
    padding: 10px 0;
    min-width: 0;
}
.sx-search-bar input:focus { outline: none; }
.sx-search-bar input::placeholder { color: var(--sx-text-muted); }
.sx-search-submit {
    padding: 10px 22px;
    background: var(--sx-text);
    color: #000;
    border: none;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--sx-transition);
}
.sx-search-submit:hover { background: #e0e0e0; }

/* Type filter buttons */
.sx-search-type-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.sx-search-type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sx-text-dim);
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: 24px;
    cursor: pointer;
    transition: all var(--sx-transition);
}
.sx-search-type-btn:hover {
    color: var(--sx-text);
    border-color: var(--sx-border-light);
}
.sx-search-type-btn.active {
    background: var(--sx-text);
    color: #000;
    border-color: var(--sx-text);
}

/* Empty state adjustments */
.sx-search-empty {
    min-height: 50vh;
    gap: 12px;
}
.sx-search-empty .sx-list-title {
    font-size: 1.3rem;
    margin: 0;
}
.sx-search-empty .sx-search-sub {
    margin-bottom: 8px;
}
.sx-search-empty .sx-search-page-form {
    margin-top: 12px;
}
.sx-search-quick {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Results header */
.sx-search-results-title {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--sx-text-dim);
    margin-top: 16px;
}
.sx-search-header .sx-search-page-form {
    max-width: 100%;
}
.sx-search-header .sx-search-bar {
    max-width: 100%;
}
.sx-search-header .sx-search-type-row {
    justify-content: flex-start;
}

/* ============================================
   Request Page - Simplified
   ============================================ */
.sx-request-wrap {
    max-width: 520px;
    margin: 0 auto;
    padding: 32px 0 48px;
}
.sx-request-header {
    text-align: center;
    margin-bottom: 24px;
}
.sx-request-header .sx-list-title {
    font-size: 1.4rem;
    margin-bottom: 8px;
}
.sx-request-sub {
    font-size: 0.88rem;
    color: var(--sx-text-dim);
    line-height: 1.5;
}
.sx-request-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    padding: 24px;
}
.sx-request-wrap .sx-alert {
    margin-bottom: 16px;
}

.sx-request-instructions {
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--sx-text-dim);
    line-height: 1.7;
}
.sx-request-instructions strong { color: var(--sx-text); }
.sx-request-instructions ol { padding-left: 20px; margin: 8px 0; }
.sx-request-instructions p { margin-top: 8px; }

.sx-req { color: var(--sx-accent); }
.sx-opt { opacity: 0.5; font-size: 0.85em; }

.sx-helper-links {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.sx-helper-links a {
    font-size: 0.8rem;
    color: var(--sx-text-dim);
    text-decoration: none;
    transition: color 0.2s;
}
.sx-helper-links a:hover { color: var(--sx-accent); }

/* ============================================
   Index Page - Minimal App Entry
   ============================================ */
.sx-index-page {
    display: flex;
    flex-direction: column;
    min-height: 80vh;
}

/* Hero */
.sx-index-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px 48px;
    flex: 1;
}
.sx-index-h1 {
    font-family: 'Audiowide', var(--sx-font);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin: 0 0 8px;
}
.sx-index-tagline {
    font-size: 1rem;
    color: var(--sx-text-dim);
    margin: 0 0 32px;
}

/* Search */
.sx-index-search {
    width: 100%;
    max-width: 540px;
    margin-bottom: 24px;
}
.sx-index-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border-light);
    border-radius: 40px;
    padding: 6px 6px 6px 18px;
    transition: border-color var(--sx-transition);
}
.sx-index-search-bar:focus-within { border-color: #444; }
.sx-index-search-bar svg { flex-shrink: 0; color: var(--sx-text-muted); }
.sx-index-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--sx-text);
    font-size: 0.9rem;
    padding: 10px 0;
    min-width: 0;
}
.sx-index-search-bar input:focus { outline: none; }
.sx-index-search-bar input::placeholder { color: var(--sx-text-muted); }
.sx-index-search-btn {
    padding: 10px 22px;
    background: var(--sx-text);
    color: #000;
    border: none;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--sx-transition);
}
.sx-index-search-btn:hover { background: #e0e0e0; }

/* Nav buttons */
.sx-index-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.sx-index-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    color: var(--sx-text-dim);
    transition: all var(--sx-transition);
}
.sx-index-nav-btn:hover { color: var(--sx-text); border-color: var(--sx-border-light); }
.sx-index-nav-primary {
    background: var(--sx-text);
    color: #000;
    border-color: var(--sx-text);
}
.sx-index-nav-primary:hover { background: #e0e0e0; color: #000; border-color: #e0e0e0; }

/* Trending */
.sx-index-trending {
    padding: 0 20px 32px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}
.sx-index-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--sx-text);
}
.sx-index-trending-text {
    font-size: 0.88rem;
    color: var(--sx-text-dim);
    line-height: 1.8;
}
.sx-index-trending-text a {
    color: var(--sx-text);
    transition: color var(--sx-transition);
}
.sx-index-trending-text a:hover { color: var(--sx-text-dim); }

/* Genres */
.sx-index-genres {
    padding: 0 20px 48px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}
.sx-index-genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sx-index-genre-tag {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sx-text-dim);
    background: var(--sx-bg-card);
    border: 1px solid var(--sx-border);
    border-radius: 20px;
    transition: all var(--sx-transition);
}
.sx-index-genre-tag:hover { color: var(--sx-text); border-color: var(--sx-border-light); }

/* Responsive */
@media (width < 600px) {
    .sx-index-hero { padding: 60px 16px 36px; }
    .sx-index-h1 { font-size: 2.2rem; }
    .sx-index-tagline { font-size: 0.9rem; }
}

/* Index FAQ - Flat definition list (no accordion) */
.sx-index-faq {
    padding: 0 20px 48px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}
.sx-index-faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sx-index-faq-q {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sx-text);
    margin: 0;
}
.sx-index-faq-a {
    font-size: 0.84rem;
    color: var(--sx-text-dim);
    line-height: 1.6;
    margin: 4px 0 0;
}

/* Index About/SEO Content */
.sx-index-about {
    padding: 0 20px 32px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}
.sx-index-about-inner h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sx-text);
    margin: 0 0 8px;
}
.sx-index-about-inner h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--sx-text);
    margin: 16px 0 4px;
}
.sx-index-about-inner p {
    font-size: 0.84rem;
    color: var(--sx-text-dim);
    line-height: 1.65;
    margin: 0;
}
.sx-index-about-inner a {
    color: var(--sx-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sx-index-about-inner a:hover { color: var(--sx-text-dim); }

/* Index Genre Labels */
.sx-index-genre-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 8px;
}
.sx-index-genre-label:first-of-type { margin-top: 0; }

/* ============================================
   Hero Carousel - Slides, Nav, Dots
   ============================================ */

/* Slides stack on top of each other */
#heroCarousel {
    position: absolute;
    inset: 0;
}
.h-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.h-hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Prev / Next buttons */
.sx-hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--sx-transition), color var(--sx-transition);
    backdrop-filter: blur(4px);
}
.sx-hero-nav:hover { background: rgba(0,0,0,0.7); color: #fff; }
.sx-hero-prev { left: 12px; }
.sx-hero-next { right: 12px; }

/* Dots */
.sx-hero-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.h-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--sx-transition), transform var(--sx-transition);
}
.h-hero-dot.active {
    background: #fff;
    transform: scale(1.25);
}

@media (width < 768px) {
    .sx-hero-nav { width: 30px; height: 30px; }
    .sx-hero-prev { left: 6px; }
    .sx-hero-next { right: 6px; }
    .sx-hero-badge { font-size: 0.7rem; padding: 6px 10px; }
}

/* ============================================
   Card Type Badge (Movie / TV icon on poster)
   ============================================ */
.sx-type-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    z-index: 2;
}
.sx-type-movie {
    background: rgba(229, 9, 20, 0.85);
    color: #fff;
}
.sx-type-tv {
    background: rgba(37, 99, 235, 0.85);
    color: #fff;
}
.sx-type-badge svg { flex-shrink: 0; }

/* ============================================
   Recommended — last on mobile
   ============================================ */
@media (width < 768px) {
    .sx-detail-layout { display: flex; flex-direction: column; }
    .sx-recommended { order: 99; }
}

/* ============================================
   Series Detail — Mobile Order
   1. Player  2. Episodes  3. Details  4. Recommended
   ============================================ */
@media (width < 768px) {
    .sx-detail-layout {
        display: flex;
        flex-direction: column;
    }
    .sx-detail-main { order: 1; display: contents; }
    .sx-detail-sidebar { order: 3; }
    .sx-player-section { order: 1; }
    .sx-recommended { order: 99; }

    /* Server tabs — no wrap, scroll horizontally */
    .sx-server-tabs::-webkit-scrollbar,
    .server-tabs::-webkit-scrollbar { display: none; }
}

/* Hero Badge (type + season info) */
.sx-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sx-text);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    backdrop-filter: blur(6px);
    white-space: nowrap;
}
.sx-hero-badge svg { flex-shrink: 0; opacity: 0.8; }

/* Fix: prevent empty space below player when right sidebar is taller */
.sx-detail-main {
    min-height: 0;
    align-self: start;
}


/* Upcoming episode — air_date is in the future */
.episode-item.sx-ep-upcoming {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    border-style: dashed;
    background: transparent;
}
.episode-item.sx-ep-upcoming:hover { background: transparent; }
.sx-ep-upcoming .sx-ep-airs {
    flex-shrink: 0;
    opacity: 1 !important;
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.72rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sx-ep-card-airs {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.player-coming-soon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.55);
}

.sx-share-cta { margin: 28px auto; padding: 16px; text-align: center; max-width: 720px; }
.sx-share-cta__title { font-size: 17px; font-weight: 700; color: var(--sx-text, #fff); margin: 0 0 4px; }
.sx-share-cta__desc { font-size: 13px; color: var(--sx-text-muted, rgba(255,255,255,.6)); margin: 0 0 12px; }
.sx-share-cta__buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sx-share-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; transition: transform .15s, opacity .15s; text-decoration: none; color: #fff; }
.sx-share-btn:hover { transform: scale(1.1); opacity: .85; }
.sx-share-btn--x { background: #000; border: 1px solid rgba(255,255,255,.2); }
.sx-share-btn--fb { background: #1877F2; }
.sx-share-btn--wa { background: #25D366; }
.sx-share-btn--tg { background: #0088cc; }
.sx-share-btn--reddit { background: #FF4500; }
.sx-share-btn--copy { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.sx-share-btn--copy.copied { background: #22c55e; border-color: #22c55e; }
