/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.1);
    --success: #22c55e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== Header ===== */
.header {
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    max-width: 830px;
    margin: 0 auto;
}

.header.scrolled {
    box-shadow: var(--shadow);
}

.header-top {
    max-width: 830px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-container {
    max-width: 830px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.logo span {
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin: 0 1px;
}

.header-nav {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.nav-links {
    max-width: 830px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-links a.active {
    color: var(--accent);
}

.nav-links a svg {
    width: 16px;
    height: 16px;
}

/* ===== Search Box ===== */
.search-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 350px;
}

/* Mobile Search Button */
.mobile-search-btn {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-search-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Search Popup */
.search-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    z-index: 2000;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-popup.active {
    display: block;
}

.search-popup-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 830px;
    margin: 0 auto;
}

.search-popup-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    flex: 1;
}

.search-popup-box .search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-popup-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 16px;
    -webkit-text-fill-color: #ffffff;
    min-width: 0;
}

.search-popup-box input::placeholder {
    color: var(--text-muted);
}

.search-popup-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    flex-shrink: 0;
}

.search-popup-host {
    flex-shrink: 0;
}

.search-popup-host select {
    appearance: none;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .desktop-search {
        display: none;
    }
    
    .mobile-search-btn {
        display: flex;
    }
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    flex: 1;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box input,
.search-box input[type="text"],
#searchInput {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    width: 100%;
    min-width: 0;
    font-size: 16px;
    padding: 0 0.5rem;
    -webkit-text-fill-color: #ffffff !important;
    -webkit-opacity: 1;
    opacity: 1;
    caret-color: #ffffff;
}

.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-icon { color: var(--text-muted); flex-shrink: 0; width: 18px; height: 18px; }

/* ===== Host Selector ===== */
.host-selector { position: relative; }

.host-selector select {
    appearance: none;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    padding: 0.625rem 2.25rem 0.625rem 1rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.host-selector select:hover {
    background: var(--accent-hover);
}

.host-selector select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.host-selector::after {
    content: '▼';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.5rem;
    pointer-events: none;
}

/* ===== Mobile Menu ===== */
.mobile-menu-btn {
    display: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.625rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ===== Main Content ===== */
.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 1.5rem;
}

/* ===== Hero Section ===== */
.hero {
    padding: 3rem 1.5rem;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid var(--border-color);
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
}

.hero-icon::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--success);
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 3px solid var(--bg-secondary);
}

.hero-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-text p {
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Section ===== */
.section {
    padding: 0.75rem 1.25rem;
    max-width: 830px;
    margin: 0 auto;
}

.section-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-link {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    transition: var(--transition);
}

.section-link:hover {
    color: var(--accent-hover);
}

/* ===== Content Grid ===== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 800px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Content Card ===== */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    background: var(--bg-hover);
}

.card-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 2;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 0.75rem;
}

.content-card:hover .card-overlay {
    opacity: 1;
}

.card-info {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin: 0;
}

.card-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== Loading & Empty States ===== */
.loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== Watch Page ===== */
.watch-page {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: calc(100vh - 120px);
}

.watch-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
}

.video-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a25 100%);
    overflow: hidden;
    position: relative;
    touch-action: pan-x;
}

/* Video Navigation Overlay */
.video-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
    pointer-events: none;
    z-index: 5;
}

.video-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    transform: scale(0.8);
}

/* Show controls when wrapper has show-controls class */
.video-wrapper.show-controls .video-nav-btn {
    opacity: 1;
    transform: scale(1);
}

.video-wrapper.show-controls .episode-counter {
    opacity: 1;
}

.video-nav-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.video-nav-btn:active {
    transform: scale(0.95);
}



/* Episode Counter */
.episode-counter {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 5;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Swipe Indicator */
.swipe-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
}

.swipe-indicator.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.swipe-indicator.prev .swipe-indicator-icon::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 18px solid #fff;
}

.swipe-indicator.next .swipe-indicator-icon::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid #fff;
}

/* Episode Toast */
.episode-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.episode-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Swipe Hint */
.swipe-hint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.swipe-hint.show {
    opacity: 1;
}

.swipe-hint-content {
    text-align: center;
    color: #fff;
}

.swipe-hint-content svg {
    margin-bottom: 0.5rem;
    animation: swipeAnim 1.5s ease-in-out infinite;
}

.swipe-hint-content p {
    font-size: 0.875rem;
    opacity: 0.9;
}

@keyframes swipeAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Mobile video styles */
@media (max-width: 768px) {
    .watch-page {
        background: var(--bg-primary);
        padding-bottom: 0;
    }
    
    .watch-container {
        display: flex;
        flex-direction: column;
        padding: 0;
        gap: 0;
        max-width: 100%;
    }
    
    .video-section {
        gap: 0;
    }
    
    .video-wrapper {
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: #000;
    }
    
    .video-player {
        aspect-ratio: 9/16;
        max-height: 75vh;
        min-height: 400px;
    }
    
    /* Larger nav buttons for mobile */
    .video-nav-btn {
        width: 52px;
        height: 52px;
        background: rgba(0, 0, 0, 0.7);
    }
    
    .video-nav-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .video-nav-overlay {
        padding: 0 1rem;
    }
    
    /* Episode counter mobile */
    .episode-counter {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        top: 1rem;
        right: 1rem;
        background: rgba(0, 0, 0, 0.8);
    }
    
    /* Content info mobile */
    .content-info {
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 1.25rem;
        background: var(--bg-secondary);
    }
    
    .content-title {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .content-info-header {
        margin-bottom: 0.5rem;
    }
    
    .share-btn {
        width: 32px;
        height: 32px;
    }
    
    .content-meta {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .content-meta span {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .content-description {
        font-size: 0.8rem;
        line-height: 1.6;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Episode sidebar mobile */
    .episode-sidebar {
        border-radius: 0;
        border: none;
        box-shadow: none;
        max-height: none;
        position: relative;
        top: 0;
        background: var(--bg-primary);
    }
    
    .sidebar-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg-secondary);
        padding: 0.875rem 1.25rem;
    }
    
    .sidebar-title {
        font-size: 0.9rem;
    }
    
    .episode-count-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .episode-list {
        max-height: none;
        background: var(--bg-primary);
    }
    
    .episode-item {
        padding: 0.65rem 1rem;
        gap: 0.75rem;
    }
    
    .episode-number {
        min-width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
    
    .episode-thumb {
        width: 55px;
        border-radius: 6px;
    }
    
    .episode-title {
        font-size: 0.75rem;
    }
    
    /* Placeholder mobile */
    .placeholder-icon {
        width: 70px !important;
        height: 70px !important;
    }
    
    .video-placeholder svg {
        width: 35px !important;
        height: 35px !important;
    }
    
    .video-placeholder p {
        font-size: 0.95rem !important;
    }
    
    .video-placeholder .placeholder-hint {
        font-size: 0.7rem;
    }
    
    /* Footer mobile adjustments */
    .watch-page .footer {
        margin-top: 0;
    }
    
    /* Desktop only elements */
    .desktop-only {
        display: none !important;
    }
}

/* Mobile Quick Actions Bar */
.mobile-quick-actions {
    display: none;
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .mobile-quick-actions {
        display: flex;
        justify-content: space-around;
        align-items: center;
        margin-bottom: 0.75rem;
    }
    
    .content-info {
        margin-bottom: 0.75rem;
    }
    
    .episode-sidebar {
        margin-top: 0.5rem;
    }
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius);
}

.quick-action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.quick-action-btn:active {
    transform: scale(0.95);
}

.quick-action-btn span {
    font-size: 0.65rem;
    font-weight: 500;
}

.quick-action-btn svg {
    opacity: 0.8;
}

.video-player video,
.video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 1rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
}

.video-placeholder .placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.video-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

.video-placeholder p {
    font-size: 1rem;
    font-weight: 500;
}

.video-placeholder .placeholder-hint {
    font-size: 0.75rem;
    opacity: 0.5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Content Info Card */
.content-info {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.content-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.content-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.share-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.share-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.content-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.content-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-hover);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.content-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.8;
}

/* ===== Episode Sidebar ===== */
.episode-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.sidebar-title-wrap svg {
    opacity: 0.7;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.episode-count-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

.episode-list {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.episode-list::-webkit-scrollbar {
    width: 4px;
}

.episode-list::-webkit-scrollbar-track {
    background: transparent;
}

.episode-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.episode-item:hover { 
    background: var(--bg-hover); 
}

.episode-item.active {
    background: linear-gradient(90deg, var(--accent-light) 0%, transparent 100%);
    border-left: 3px solid var(--accent);
}

.episode-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 6px;
}

.episode-item.active .episode-number { 
    color: #fff;
    background: var(--accent); 
}

.episode-thumb {
    width: 65px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.episode-info { 
    flex: 1; 
    min-width: 0; 
}

.episode-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-item.active .episode-title {
    color: var(--accent);
    font-weight: 600;
}

/* Season Selector */
.season-selector {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.season-selector label {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
}

.season-selector select {
    background: var(--bg-hover) !important;
    border-color: var(--border-color) !important;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    max-width: 830px;
    margin: 2rem auto 0;
}

.footer-content {
    max-width: 830px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-brand {
    flex: 1;
    min-width: 200px;
}

.footer-brand .logo {
    margin-bottom: 0.75rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.6;
    max-width: 280px;
}

.footer-links-group {
    display: flex;
    gap: 3rem;
}

.footer-links-col h4 {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-links-col a {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.25rem 0;
    transition: var(--transition);
}

.footer-links-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--accent);
}

/* Simple footer fallback */
.footer-simple {
    text-align: center;
    padding: 1.5rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: var(--transition);
}

.footer-links a:hover { 
    color: var(--accent); 
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .watch-container { 
        grid-template-columns: 1fr; 
    }
    .episode-sidebar { 
        max-height: 350px; 
        position: static; 
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    .header-nav.active {
        display: block;
    }
    .nav-links {
        flex-direction: column;
        padding: 0.5rem 1rem;
        gap: 0;
    }
    .nav-links a {
        padding: 0.875rem 1rem;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    .nav-links a:last-child {
        border-bottom: none;
    }
    .mobile-menu-btn { 
        display: flex; 
        align-items: center; 
        justify-content: center; 
    }
}

@media (max-width: 768px) {
    .header-container { 
        padding: 0.875rem 1rem;
        flex-wrap: wrap; 
        gap: 0.75rem; 
    }
    .search-container { 
        order: 3; 
        width: 100%; 
        max-width: none; 
    }
    .hero { 
        padding: 1.5rem 1rem; 
    }
    .hero-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    .hero-text h1 {
        font-size: 1.5rem;
    }
    .hero-text p {
        justify-content: center;
    }
    .section { 
        padding: 1rem; 
    }
    .section-card {
        padding: 1rem;
    }
    .content-grid { 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        gap: 1rem; 
    }
    .watch-container { 
        padding: 1rem; 
    }
    .logo {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .content-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 0.75rem; 
    }
    .card-info {
        padding: 0.75rem;
    }
    .card-info .card-title {
        font-size: 0.8rem;
    }
}

/* ===== Utilities ===== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }
