/* ============================================
   CARI-IPTV Web Player Stylesheet
   Dark theme, optimized for content consumption
   ============================================ */

:root {
    --p-bg: #06060e;
    --p-bg-alt: #0d0d18;
    --p-surface: #141422;
    --p-surface-hover: #1c1c30;
    --p-surface-active: #24243a;
    --p-border: #2a2a40;

    --p-primary: #6366f1;
    --p-primary-hover: #5558e8;
    --p-primary-glow: rgba(99, 102, 241, 0.25);
    --p-accent: #a78bfa;

    --p-text: #eef0f6;
    --p-text-secondary: #9ca3b8;
    --p-text-muted: #5a5f7a;

    --p-success: #22c55e;
    --p-warning: #f59e0b;
    --p-danger: #ef4444;

    --p-sidebar-w: 240px;
    --p-header-h: 56px;
    --p-radius: 10px;
    --p-radius-sm: 6px;
    --p-radius-lg: 16px;
    --p-transition: 0.2s ease;

    --p-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--p-font); background: var(--p-bg); color: var(--p-text); line-height: 1.5; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--p-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--p-text-muted); }

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--p-bg);
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(167, 139, 250, 0.06) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite alternate;
}

@keyframes bgFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-3%, -3%); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 0 1.5rem;
}

.login-card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 2.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--p-primary), var(--p-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.login-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
}

.login-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.login-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--p-text-secondary);
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--p-text-secondary);
    margin-bottom: 0.5rem;
}

.login-form .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--p-bg);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    color: var(--p-text);
    font-size: 0.9375rem;
    transition: border-color var(--p-transition), box-shadow var(--p-transition);
    outline: none;
}

.login-form .form-input:focus {
    border-color: var(--p-primary);
    box-shadow: 0 0 0 3px var(--p-primary-glow);
}

.login-form .form-input::placeholder {
    color: var(--p-text-muted);
}

.input-group {
    position: relative;
}

.input-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--p-text-muted);
    padding: 0.25rem;
    cursor: pointer;
}

.input-toggle:hover { color: var(--p-text-secondary); }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--p-text-secondary);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--p-primary);
    cursor: pointer;
}

.form-link {
    color: var(--p-primary);
    font-weight: 500;
}

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

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--p-primary), #7c3aed);
    border: none;
    border-radius: var(--p-radius);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: opacity var(--p-transition), transform var(--p-transition);
}

.login-btn:hover { opacity: 0.92; }
.login-btn:active { transform: scale(0.99); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--p-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    color: #fca5a5;
    display: none;
}

.login-error.visible { display: block; }

.login-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

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

/* Login/Register footer link */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--p-text-muted);
}

.login-footer a {
    color: var(--p-primary);
    font-weight: 500;
}

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

/* Registration page */
.register-container {
    max-width: 520px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-required {
    color: var(--p-danger);
}

.form-hint {
    font-size: 0.6875rem;
    color: var(--p-text-muted);
    margin-top: 0.375rem;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1.25rem;
    color: var(--p-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--p-border);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5f7a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .register-container {
        max-width: 420px;
    }
}

/* Email verification result icons */
.verify-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.75rem;
}

.verify-icon-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--p-success);
}

.verify-icon-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--p-danger);
}

/* Success message box (used on registration) */
.login-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--p-radius-sm);
    padding: 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    color: #86efac;
    display: none;
}

.login-success.visible { display: block; }

.login-success h4 {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    color: var(--p-success);
}

/* Resend verification link */
.resend-link {
    color: var(--p-primary);
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
    background: none;
    border: none;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}

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

/* ============================================
   APP SHELL
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--p-sidebar-w);
    background: var(--p-surface);
    border-right: 1px solid var(--p-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--p-transition);
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--p-border);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--p-primary), var(--p-accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
}

.sidebar-brand-name {
    font-weight: 700;
    font-size: 1.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.nav-section-label {
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--p-text-muted);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: var(--p-text-secondary);
    transition: all var(--p-transition);
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
}

.nav-item:hover {
    background: var(--p-surface-hover);
    color: var(--p-text);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--p-primary);
    border-left-color: var(--p-primary);
}

.nav-item i { font-size: 1.125rem; width: 22px; flex-shrink: 0; }

/* Sidebar user */
.sidebar-user {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--p-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--p-primary), var(--p-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 0.6875rem; color: var(--p-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-logout {
    background: none;
    border: none;
    color: var(--p-text-muted);
    padding: 0.25rem;
    transition: color var(--p-transition);
}

.sidebar-logout:hover { color: var(--p-danger); }

/* Main content */
.app-main {
    flex: 1;
    min-width: 0; /* Prevent flex item from expanding beyond viewport — required for child overflow-x to work */
    margin-left: var(--p-sidebar-w);
    min-height: 100vh;
    transition: margin var(--p-transition);
}

/* Header */
.app-header {
    height: var(--p-header-h);
    background: rgba(6, 6, 14, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--p-border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}

.header-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--p-text);
    font-size: 1.25rem;
    padding: 0.25rem;
}

.header-spacer { flex: 1; }

/* ============================================
   CONTENT AREA
   ============================================ */

.app-content {
    padding: 0;
    min-height: calc(100vh - var(--p-header-h));
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-slide.active { opacity: 1; }

.hero-backdrop {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--p-bg) 0%, transparent 60%),
                linear-gradient(to right, rgba(6, 6, 14, 0.9) 0%, transparent 50%);
}

.hero-content {
    position: absolute;
    bottom: 3rem;
    left: 2rem;
    max-width: 540px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--p-primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

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

.hero-meta-dot { width: 3px; height: 3px; background: var(--p-text-muted); border-radius: 50%; }

.hero-description {
    font-size: 0.9375rem;
    color: var(--p-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--p-radius);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--p-transition);
    cursor: pointer;
}

.btn-play {
    background: #fff;
    color: #0a0a0f;
}

.btn-play:hover { background: #e5e5e5; }

.btn-info {
    background: rgba(255,255,255,0.15);
    color: #fff;
    backdrop-filter: blur(4px);
}

.btn-info:hover { background: rgba(255,255,255,0.25); }

.btn-primary {
    background: var(--p-primary);
    color: #fff;
}

.btn-primary:hover { background: var(--p-primary-hover); }

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}

.btn-icon:hover { background: rgba(255,255,255,0.2); }

/* Hero navigation dots */
.hero-dots {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all var(--p-transition);
}

.hero-dot.active {
    background: var(--p-primary);
    width: 24px;
    border-radius: 4px;
}

/* ============================================
   CONTENT ROWS
   ============================================ */

.content-section {
    padding: 0 2rem 2rem;
}

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

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-see-all {
    color: var(--p-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--p-transition);
}

.section-see-all:hover { color: var(--p-accent); }

/* Scrollable row */
.content-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--p-border) transparent;
}

.content-row::-webkit-scrollbar { height: 6px; }
.content-row::-webkit-scrollbar-track { background: transparent; }
.content-row::-webkit-scrollbar-thumb { background: var(--p-border); border-radius: 3px; }
.content-row::-webkit-scrollbar-thumb:hover { background: var(--p-text-muted); }

/* Scroll navigation arrows for content rows (Netflix-style) */
.content-row-wrap {
    position: relative;
}

.scroll-arrow {
    position: absolute;
    top: 0;
    height: calc(100% - 0.5rem); /* account for padding-bottom on content-row */
    width: 48px;
    background: rgba(15, 23, 42, 0.6);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
    padding: 0;
    outline: none;
}

.scroll-arrow:hover {
    background: rgba(15, 23, 42, 0.85);
}

.scroll-arrow:active {
    background: rgba(99, 102, 241, 0.7);
}

.scroll-arrow-left {
    left: 0;
    border-radius: 0 var(--p-radius) var(--p-radius) 0;
}

.scroll-arrow-right {
    right: 0;
    border-radius: var(--p-radius) 0 0 var(--p-radius);
}

.scroll-arrow i {
    font-size: 2rem;
}

/* Hide scroll arrows on touch/mobile (native swipe works) */
@media (max-width: 1024px) {
    .scroll-arrow { display: none !important; }
}

@media (pointer: coarse) {
    .scroll-arrow { display: none !important; }
}

/* Content cards */
.card-poster {
    flex-shrink: 0;
    width: 170px;
    cursor: pointer;
    transition: transform var(--p-transition);
}

.card-poster:hover { transform: translateY(-4px); }

.card-poster-img {
    width: 170px;
    height: 255px;
    border-radius: var(--p-radius);
    object-fit: cover;
    background: var(--p-surface);
}

.card-poster-title {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-poster-meta {
    font-size: 0.6875rem;
    color: var(--p-text-muted);
}

.card-backdrop {
    flex-shrink: 0;
    width: 300px;
    cursor: pointer;
    transition: transform var(--p-transition);
}

.card-backdrop:hover { transform: translateY(-4px); }

.card-backdrop-img {
    width: 300px;
    height: 169px;
    border-radius: var(--p-radius);
    object-fit: cover;
    background: var(--p-surface);
}

.card-backdrop-title {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-backdrop-meta {
    font-size: 0.6875rem;
    color: var(--p-text-muted);
}

/* Channel cards */
.card-channel {
    flex-shrink: 0;
    width: 140px;
    text-align: center;
    cursor: pointer;
    padding: 1rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    transition: all var(--p-transition);
}

.card-channel:hover {
    background: var(--p-surface-hover);
    border-color: var(--p-primary);
}

.card-channel-logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: contain;
    margin: 0 auto 0.5rem;
    background: var(--p-bg);
}

.card-channel-name {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-channel-now {
    font-size: 0.6875rem;
    color: var(--p-text-muted);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.card-category {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--p-transition);
}

.card-category:hover {
    background: var(--p-surface-hover);
    border-color: var(--p-primary);
    transform: translateY(-2px);
}

.card-category i {
    font-size: 1.5rem;
    color: var(--p-primary);
    margin-bottom: 0.5rem;
}

.card-category-name {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Spotlight */
.spotlight {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: var(--p-surface);
    border-radius: var(--p-radius-lg);
    border: 1px solid var(--p-border);
}

.spotlight-img {
    width: 200px;
    height: 300px;
    border-radius: var(--p-radius);
    object-fit: cover;
    flex-shrink: 0;
}

.spotlight-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.spotlight-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.spotlight-meta { display: flex; gap: 0.75rem; color: var(--p-text-secondary); font-size: 0.875rem; margin-bottom: 1rem; }
.spotlight-desc { color: var(--p-text-secondary); font-size: 0.9375rem; line-height: 1.6; margin-bottom: 1.5rem; }

/* Banner */
.promo-banner {
    border-radius: var(--p-radius-lg);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.promo-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* Text divider */
.text-divider {
    padding: 1rem 0;
}

.text-divider h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--p-text-secondary);
}

/* ============================================
   MOVIES / SERIES PAGE GRID
   ============================================ */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1.25rem;
    padding: 0 2rem 2rem;
}

.content-grid .card-poster {
    width: 100%;
}

.content-grid .card-poster-img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
}

/* Page header */
.page-hero {
    padding: 2rem 2rem 1.5rem;
}

.page-hero-title {
    font-size: 2rem;
    font-weight: 800;
}

.page-hero-subtitle {
    color: var(--p-text-secondary);
    font-size: 0.9375rem;
    margin-top: 0.25rem;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    padding: 0 2rem 1.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.375rem 1rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 20px;
    color: var(--p-text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--p-transition);
}

.filter-chip:hover { border-color: var(--p-primary); color: var(--p-text); }
.filter-chip.active { background: var(--p-primary); border-color: var(--p-primary); color: #fff; }

/* ============================================
   LIVE TV PAGE
   ============================================ */

:root {
    --epg-channel-w: 150px;
    --epg-row-h: 52px;
    --epg-time-h: 36px;
}

.live-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--p-header-h));
    overflow: hidden;
}

/* ---- Top Section: Player + Info Side by Side ---- */

.live-top-section {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid var(--p-border);
    background: #000;
    max-height: 38vh;
}

.live-player-section {
    flex: 0 0 50%;
    max-width: 50%;
    background: #000;
    display: flex;
    align-items: stretch;
    position: relative;
}

.live-player-container {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
    overflow: hidden;
}

.live-player-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Unmute prompt (shown when browser blocks unmuted autoplay) */
.unmute-prompt {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    font-size: 0.875rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    animation: unmuteFadeIn 0.3s ease;
}

.unmute-prompt:hover {
    background: rgba(99, 102, 241, 0.8);
    border-color: var(--p-primary);
}

.unmute-prompt i {
    font-size: 1rem;
}

@keyframes unmuteFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(0.5rem); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Live player bottom controls bar (CC + fullscreen) */
.live-player-controls {
    position: absolute;
    bottom: 0.625rem;
    right: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.live-player-container:hover .live-player-controls,
.live-player-controls:focus-within {
    opacity: 1;
}

.live-player-btn {
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s ease, border-color 0.15s ease;
    padding: 0;
}

.live-player-btn:hover {
    background: rgba(99, 102, 241, 0.8);
    border-color: var(--p-primary);
}

/* CC toggle button */
.cc-toggle-btn {
    font-weight: 700;
    font-size: 0.7rem;
    font-family: inherit;
    letter-spacing: 0.5px;
}

.cc-toggle-btn.cc-active {
    background: rgba(99, 102, 241, 0.9);
    border-color: var(--p-primary);
    color: #fff;
}

/* VOD player CC button */
.vod-cc-btn {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    opacity: 0;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    padding: 0;
}

.player-container:hover .vod-cc-btn,
.vod-cc-btn:focus {
    opacity: 1;
}

.vod-cc-btn:hover {
    background: rgba(99, 102, 241, 0.8);
    border-color: var(--p-primary);
}

/* Shaka Player caption text styling */
.shaka-text-container {
    bottom: 3rem !important;
}

.shaka-text-container span {
    background: rgba(0, 0, 0, 0.8) !important;
    padding: 0.15em 0.4em !important;
    border-radius: 2px !important;
    font-size: 1.1em !important;
}

/* When in fullscreen mode */
.live-player-container:fullscreen {
    max-height: none;
}

.live-player-container:fullscreen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.live-player-container:fullscreen .live-player-controls {
    opacity: 0;
    bottom: 1rem;
    right: 1rem;
}

.live-player-container:fullscreen:hover .live-player-controls {
    opacity: 1;
}

/* ---- Fullscreen Info Overlay ---- */

.fs-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.live-player-container:fullscreen .fs-overlay {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.live-player-container:fullscreen .fs-overlay.visible {
    opacity: 1;
}

.live-player-container:fullscreen .fs-overlay.visible * {
    pointer-events: auto;
}

/* Hide controls when overlay is visible */
.live-player-container:fullscreen .fs-overlay.visible ~ .live-player-controls {
    opacity: 0 !important;
}

.fs-overlay-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.fs-overlay-channel {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fs-overlay-logo {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.fs-overlay-channel-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fs-overlay-channel-info h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.fs-overlay-exit {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.125rem;
    transition: background 0.15s ease;
}

.fs-overlay-exit:hover {
    background: rgba(255,255,255,0.2);
}

.fs-overlay-bottom {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    padding: 2rem 2rem 1.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
}

.fs-overlay-now {
    flex: 1;
    min-width: 0;
}

.fs-overlay-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--p-primary);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.fs-overlay-programme h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0.25rem 0 0.125rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-overlay-time {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.fs-overlay-progress {
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.fs-overlay-progress-fill {
    height: 100%;
    background: var(--p-primary);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.fs-overlay-next {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
}

.fs-overlay-next-title {
    color: rgba(255,255,255,0.85);
    font-weight: 600;
}

.fs-overlay-next-time {
    color: rgba(255,255,255,0.5);
    font-size: 0.8125rem;
}

.fs-overlay-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.fs-overlay-nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 8px;
    width: 40px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s ease;
}

.fs-overlay-nav-btn:hover {
    background: rgba(99, 102, 241, 0.6);
    border-color: var(--p-primary);
}

.fs-overlay-nav-label {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Info Panel (Right of Player) ---- */

.live-info-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--p-surface);
    overflow: hidden;
    min-width: 0;
}

.live-info-channel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--p-border);
    flex-shrink: 0;
}

.live-info-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--p-bg);
    flex-shrink: 0;
}

.live-info-channel-name {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.live-info-channel-name h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-info-programme {
    flex: 1;
    padding: 0.875rem 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.live-info-now {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.live-info-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--p-primary);
}

.live-info-now h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.live-info-time {
    font-size: 0.8125rem;
    color: var(--p-text-muted);
    margin: 0;
}

.live-info-progress {
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 0.375rem;
    overflow: hidden;
}

.live-info-progress-fill {
    height: 100%;
    background: var(--p-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.live-info-desc {
    font-size: 0.8125rem;
    color: var(--p-text-secondary);
    line-height: 1.6;
    overflow-y: auto;
}

.live-info-next {
    border-top: 1px solid var(--p-border);
    padding-top: 0.75rem;
    margin-top: auto;
}

.live-info-next-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.live-info-next-time {
    font-size: 0.75rem;
    color: var(--p-text-muted);
}

.live-info-next-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--p-text);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(239, 68, 68, 0.15);
    color: var(--p-danger);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--p-danger);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ---- Guide Section ---- */

.live-guide-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--p-bg);
}

.live-guide-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    border-bottom: 1px solid var(--p-border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.live-guide-title {
    font-size: 0.9375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin: 0;
}

.live-guide-title i {
    font-size: 1rem;
    color: var(--p-primary);
}

.live-category-filters {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    flex: 1;
}

/* ---- EPG Navigation Controls ---- */

.epg-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.epg-nav-btn {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    color: var(--p-text-secondary);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s ease;
}

.epg-nav-btn:hover {
    background: var(--p-surface-hover);
    border-color: var(--p-primary);
    color: var(--p-text);
}

.epg-nav-btn i { font-size: 0.875rem; }

.epg-nav-now {
    background: var(--p-primary);
    border-color: var(--p-primary);
    color: #fff;
    font-size: 0.6875rem;
    padding: 0.25rem 0.625rem;
}

.epg-nav-now:hover {
    background: var(--p-primary-hover);
    color: #fff;
}

/* ---- EPG Grid ---- */

.epg-grid-container {
    flex: 1;
    overflow: auto;
    position: relative;
}

.epg-time-header {
    display: flex;
    border-bottom: 1px solid var(--p-border);
    background: var(--p-surface);
    height: var(--epg-time-h);
    width: fit-content;
    min-width: 100%;
    position: sticky;
    top: 0;
    z-index: 8;
}

.epg-time-header .epg-channel-col {
    width: var(--epg-channel-w);
    min-width: var(--epg-channel-w);
    flex-shrink: 0;
    border-right: 1px solid var(--p-border);
    background: var(--p-surface);
    position: sticky;
    left: 0;
    z-index: 9;
}

.epg-timeline-header {
    position: relative;
}

.epg-time-slot {
    position: absolute;
    top: 0;
    height: var(--epg-time-h);
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--p-text-muted);
    border-left: 1px solid var(--p-border);
    white-space: nowrap;
}

.epg-grid-body {
    position: relative;
    width: fit-content;
    min-width: 100%;
}

/* Now indicator line */
.epg-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--p-danger);
    z-index: 10;
    pointer-events: none;
}

.epg-now-line::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: var(--p-danger);
    border-radius: 50%;
}

/* Channel row */
.epg-row {
    display: flex;
    height: var(--epg-row-h);
    border-bottom: 1px solid rgba(42, 42, 64, 0.4);
    transition: background 0.15s ease;
    width: fit-content;
    min-width: 100%;
}

.epg-row:hover {
    background: rgba(99, 102, 241, 0.03);
}

.epg-row-active {
    background: rgba(99, 102, 241, 0.15);
}

.epg-row-active .epg-channel-col {
    border-left: 3px solid var(--p-primary);
    background: #1f1e3b;
}

.epg-row-active .epg-channel-col .epg-now-playing-icon {
    display: flex;
}

.epg-now-playing-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-left: auto;
}

.epg-now-playing-icon .epg-eq-bar {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.epg-now-playing-icon .epg-eq-bar span {
    display: block;
    width: 3px;
    background: var(--p-primary);
    border-radius: 1px;
    animation: epgEqBounce 0.8s ease-in-out infinite alternate;
}

.epg-now-playing-icon .epg-eq-bar span:nth-child(1) {
    height: 40%;
    animation-delay: 0s;
}

.epg-now-playing-icon .epg-eq-bar span:nth-child(2) {
    height: 70%;
    animation-delay: 0.2s;
}

.epg-now-playing-icon .epg-eq-bar span:nth-child(3) {
    height: 50%;
    animation-delay: 0.4s;
}

@keyframes epgEqBounce {
    0% { transform: scaleY(0.4); }
    100% { transform: scaleY(1); }
}

.epg-channel-col {
    width: var(--epg-channel-w);
    min-width: var(--epg-channel-w);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    border-right: 1px solid var(--p-border);
    background: var(--p-surface);
    cursor: pointer;
    transition: background 0.15s ease;
    overflow: hidden;
    position: sticky;
    left: 0;
    z-index: 5;
}

.epg-channel-col:hover {
    background: var(--p-surface-hover);
}

.epg-channel-col img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: contain;
    background: var(--p-bg);
    flex-shrink: 0;
}

.epg-channel-name {
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Programme timeline row */
.epg-timeline-row {
    position: relative;
}

.epg-programme {
    position: absolute;
    top: 2px;
    height: calc(var(--epg-row-h) - 4px);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.epg-programme:hover {
    background: var(--p-surface-hover);
    border-color: var(--p-primary);
    z-index: 5;
}

.epg-programme-now {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--p-primary);
}

.epg-programme-past {
    opacity: 0.5;
}

.epg-programme-future {
    background: var(--p-surface);
}

.epg-programme-title {
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.epg-programme-time {
    font-size: 0.5625rem;
    color: var(--p-text-muted);
    line-height: 1;
}

.epg-reminder-icon {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 0.5625rem;
    color: var(--p-warning);
}

/* Progress bar inside current programme */
.epg-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.1);
}

.epg-progress-fill {
    height: 100%;
    background: var(--p-primary);
    border-radius: 0 1px 0 0;
}

/* ---- Programme Info Modal ---- */

.epg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 1rem;
    overflow-y: auto;
}

.epg-modal-overlay.show {
    opacity: 1;
}

.epg-modal {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 440px;
    width: 100%;
    position: relative;
    animation: epgModalIn 0.2s ease;
}

/* Enhanced modal — wider with backdrop + poster layout */
.epg-modal.epg-modal-enhanced {
    max-width: 680px;
    padding: 0;
    overflow: hidden;
}

.epg-modal-backdrop {
    width: 100%;
    height: 200px;
    background: var(--p-bg);
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    position: relative;
}

.epg-modal-backdrop.has-image {
    background-color: #000;
}

.epg-modal-backdrop::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--p-surface) 0%, transparent 100%);
}

.epg-modal-enhanced .epg-modal-close {
    z-index: 5;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    top: 0.75rem;
    right: 0.75rem;
}

.epg-modal-enhanced .epg-modal-close:hover {
    background: rgba(0,0,0,0.8);
}

.epg-modal-content {
    padding: 0 1.5rem 1.5rem;
}

.epg-modal-top {
    display: flex;
    gap: 1.25rem;
    margin-top: -60px;
    position: relative;
    z-index: 2;
}

.epg-modal-poster {
    flex-shrink: 0;
    width: 120px;
    display: none;
}

.epg-modal-poster.has-image {
    display: block;
}

.epg-modal-poster img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.epg-modal-info {
    flex: 1;
    min-width: 0;
    padding-top: 60px;
}

.epg-modal-poster.has-image + .epg-modal-info {
    padding-top: 0;
}

@keyframes epgModalIn {
    from { transform: scale(0.95) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.epg-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--p-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.epg-modal-close:hover {
    color: var(--p-text);
}

.epg-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.epg-modal-logo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    background: var(--p-bg);
    flex-shrink: 0;
}

.epg-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.epg-modal-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--p-text-secondary);
    flex-wrap: wrap;
}

/* TMDB metadata row (rating, year, type, genres) */
.epg-modal-tmdb-meta {
    display: flex;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--p-text-secondary);
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.epg-modal-tmdb-meta:empty {
    display: none;
}

.epg-modal-rating {
    color: #fbbf24;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.epg-modal-rating i {
    font-size: 0.75rem;
}

.epg-modal-type {
    background: var(--p-primary);
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.epg-modal-desc {
    font-size: 0.875rem;
    color: var(--p-text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    max-height: 6.4em;
    overflow-y: auto;
}

.epg-modal-desc:empty {
    display: none;
}

.epg-modal-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.epg-modal-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: none;
    transition: background 0.15s ease;
}

.btn-primary.epg-modal-btn {
    background: var(--p-primary);
    color: #fff;
}

.btn-primary.epg-modal-btn:hover {
    background: var(--p-primary-hover);
}

.btn-secondary.epg-modal-btn {
    background: var(--p-surface-hover);
    color: var(--p-text);
}

.btn-secondary.epg-modal-btn:hover {
    background: var(--p-border);
}

/* Cast section inside modal */
.epg-modal-cast {
    margin-top: 1rem;
}

.epg-modal-cast:empty {
    display: none;
}

.epg-modal-directors {
    font-size: 0.8125rem;
    color: var(--p-text-secondary);
    margin-bottom: 0.75rem;
}

.epg-modal-director-label {
    color: var(--p-text-muted);
    font-weight: 600;
}

/* Loading spinner */
.epg-modal-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    color: var(--p-text-muted);
    font-size: 0.8125rem;
}

.epg-modal-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--p-border);
    border-top-color: var(--p-primary);
    border-radius: 50%;
    animation: epgSpin 0.8s linear infinite;
}

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

/* "More Info" button in info panel */
.live-info-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--p-surface-hover);
    color: var(--p-text-secondary);
    border: 1px solid var(--p-border);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 0.5rem;
}

.live-info-more-btn:hover {
    background: var(--p-primary);
    color: #fff;
    border-color: var(--p-primary);
}

/* ---- Reminder Toast ---- */

.epg-reminder-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--p-surface);
    border: 1px solid var(--p-primary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1100;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.epg-reminder-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.epg-reminder-toast > i {
    color: var(--p-warning);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.epg-reminder-toast strong {
    display: block;
    font-size: 0.875rem;
}

.epg-reminder-toast-channel {
    font-size: 0.75rem;
    color: var(--p-text-muted);
}

.epg-reminder-toast-tune {
    background: var(--p-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.epg-reminder-toast-close {
    background: none;
    border: none;
    color: var(--p-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

/* ============================================
   VIDEO PLAYER (SHAKA)
   ============================================ */

.player-page {
    background: #000;
    height: calc(100vh - var(--p-header-h));
    display: flex;
    flex-direction: column;
}

.player-container {
    flex: 1;
    position: relative;
}

.player-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(transparent 60%, rgba(0,0,0,0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.player-container:hover .player-overlay {
    opacity: 1;
    pointer-events: auto;
}

.player-controls {
    padding: 1rem 1.5rem;
}

.player-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.player-progress-fill {
    height: 100%;
    background: var(--p-primary);
    border-radius: 2px;
    transition: width 0.1s;
}

.player-controls-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    padding: 0.25rem;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity var(--p-transition);
}

.player-btn:hover { opacity: 1; }

.player-time {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.7);
    font-variant-numeric: tabular-nums;
}

.player-title-bar {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

/* Detail panel below player */
.player-details {
    background: var(--p-surface);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--p-border);
    overflow-y: auto;
}

.player-details-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.player-details-meta { display: flex; gap: 0.75rem; font-size: 0.875rem; color: var(--p-text-secondary); margin-bottom: 1rem; }
.player-details-desc { color: var(--p-text-secondary); font-size: 0.9375rem; line-height: 1.6; }

/* ============================================
   SEARCH PAGE
   ============================================ */

.search-page { padding: 0 0 2rem; }

/* Search input bar (on the search page) */
.search-input-bar {
    position: sticky;
    top: var(--p-header-h);
    z-index: 50;
    padding: 1rem 2rem;
    background: rgba(6, 6, 14, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--p-border);
}
.search-input-wrap {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}
.search-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--p-text-muted);
    font-size: 1.125rem;
    pointer-events: none;
    transition: color var(--p-transition);
}
.search-input-wrap input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    background: var(--p-surface);
    border: 2px solid var(--p-border);
    border-radius: 2rem;
    color: var(--p-text);
    font-size: 1rem;
    font-weight: 500;
    transition: border-color var(--p-transition), box-shadow var(--p-transition);
    outline: none;
}
.search-input-wrap input:focus {
    border-color: var(--p-primary);
    box-shadow: 0 0 0 4px var(--p-primary-glow);
}
.search-input-wrap input:focus ~ .search-input-icon { color: var(--p-primary); }
.search-input-wrap input::placeholder { color: var(--p-text-muted); font-weight: 400; }
.search-input-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--p-surface-hover);
    border: none;
    border-radius: 50%;
    color: var(--p-text-secondary);
    cursor: pointer;
    transition: background var(--p-transition), color var(--p-transition);
}
.search-input-clear:hover { background: var(--p-border); color: var(--p-text); }
.search-input-clear i { font-size: 0.875rem; }

/* Quick filter chips */
.search-quick-filters {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.quick-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 2rem;
    color: var(--p-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--p-transition);
}
.quick-filter-chip i { font-size: 0.8125rem; }
.quick-filter-chip:hover { border-color: var(--p-primary); color: var(--p-text); background: rgba(99, 102, 241, 0.08); }
.quick-filter-divider {
    width: 1px;
    height: 20px;
    background: var(--p-border);
    margin: 0 0.25rem;
}

/* Featured promo banner */
.search-promo-banner {
    position: relative;
    margin: 1rem 2rem 0.5rem;
    border-radius: 1rem;
    overflow: hidden;
    min-height: 180px;
    cursor: pointer;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
}
.search-promo-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}
.search-promo-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(6, 6, 14, 0.95) 35%, rgba(6, 6, 14, 0.3) 100%);
}
.search-promo-content {
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem;
    max-width: 60%;
}
.search-promo-badge {
    display: inline-block;
    padding: 0.1875rem 0.625rem;
    background: var(--p-primary);
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.search-promo-title {
    font-size: 1.375rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
    line-height: 1.2;
}
.search-promo-desc {
    font-size: 0.8125rem;
    color: var(--p-text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-promo-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--p-text-muted);
    align-items: center;
}
.search-promo-meta i { vertical-align: middle; }
.search-promo-banner:hover .search-promo-bg { opacity: 0.55; transition: opacity 0.3s; }

/* Search sections */
.search-section { margin-bottom: 0.5rem; }
.search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem 0.75rem;
}
.search-section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.search-section-header h3 i { font-size: 1rem; color: var(--p-primary); }

/* Clear all button */
.search-clear-all {
    background: none;
    border: none;
    color: var(--p-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background var(--p-transition);
}
.search-clear-all:hover { background: rgba(99, 102, 241, 0.1); }

/* Recent search chips */
.recent-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 2rem 1rem;
}
.recent-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 2rem;
    padding: 0.375rem 0.5rem 0.375rem 0.875rem;
    font-size: 0.8125rem;
    transition: border-color var(--p-transition);
}
.recent-chip:hover { border-color: var(--p-primary); }
.recent-chip-text { cursor: pointer; color: var(--p-text); }
.recent-chip-remove {
    background: none;
    border: none;
    color: var(--p-text-muted);
    cursor: pointer;
    padding: 0.125rem;
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--p-transition), background var(--p-transition);
}
.recent-chip-remove:hover { color: var(--p-danger); background: rgba(239, 68, 68, 0.1); }
.recent-chip-remove i { font-size: 0.75rem; }

/* Category grid in search */
.search-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 0 2rem;
}

/* Search results header */
.search-results-header { padding: 0.75rem 2rem; }
.search-results-title { font-size: 1.125rem; font-weight: 700; }

/* Filter tabs */
.search-filter-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem 1.5rem;
    flex-wrap: wrap;
}
.search-tab {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 2rem;
    color: var(--p-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--p-transition);
}
.search-tab i { font-size: 0.875rem; }
.search-tab:hover { border-color: var(--p-primary); color: var(--p-text); }
.search-tab.active {
    background: var(--p-primary);
    border-color: var(--p-primary);
    color: #fff;
}
.search-tab-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.0625rem 0.375rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
}
.search-tab:not(.active) .search-tab-count {
    background: var(--p-border);
    color: var(--p-text-muted);
}

/* Result groups */
.search-result-group { margin-bottom: 1.5rem; }
.search-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 2rem 1rem;
    font-size: 1rem;
    font-weight: 700;
}
.search-group-header i { color: var(--p-primary); font-size: 1rem; }
.search-group-count {
    background: var(--p-surface);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--p-text-muted);
}

/* Channel grid in search results */
.search-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0 2rem;
}

/* No results state */
.search-no-results {
    text-align: center;
    padding: 3rem 2rem;
}
.search-no-results i { font-size: 3rem; color: var(--p-text-muted); display: block; margin-bottom: 1rem; }
.search-no-results h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.search-no-results p { color: var(--p-text-secondary); font-size: 0.9375rem; max-width: 400px; margin: 0 auto; }

/* ============================================
   DETAIL MODAL / PAGE
   ============================================ */

.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.detail-overlay.visible { opacity: 1; visibility: visible; }

.detail-modal {
    background: var(--p-surface);
    border-radius: var(--p-radius-lg);
    border: 1px solid var(--p-border);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.detail-overlay.visible .detail-modal { transform: translateY(0); }

.detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.detail-backdrop {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--p-radius-lg) var(--p-radius-lg) 0 0;
}

.detail-body { padding: 1.5rem 2rem 2rem; }
.detail-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; color: var(--p-text-secondary); font-size: 0.875rem; margin-bottom: 1rem; }
.detail-desc { color: var(--p-text-secondary); line-height: 1.7; margin-bottom: 1.5rem; }
.detail-actions { display: flex; gap: 0.75rem; }

/* Trailer embed */
.trailer-embed {
    margin-top: 1rem;
    border-radius: var(--p-radius);
    overflow: hidden;
}
.trailer-embed iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: var(--p-radius);
}

/* Rating badge */
.rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--p-warning);
    font-weight: 600;
}

/* ============================================
   SERIES DETAIL PAGE
   ============================================ */

.series-detail { min-height: calc(100vh - var(--p-header-h)); }

.series-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.series-hero-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 20%, rgba(0,0,0,0.85) 80%, var(--p-bg) 100%);
}

.series-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 2rem;
    padding: 2rem 2.5rem;
    width: 100%;
    align-items: flex-end;
}

.series-hero-poster {
    width: 180px;
    height: 270px;
    object-fit: cover;
    border-radius: var(--p-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.series-hero-info { flex: 1; min-width: 0; }
.series-hero-title { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.series-hero-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; color: var(--p-text-secondary); font-size: 0.875rem; margin-bottom: 0.75rem; }
.series-hero-desc { color: var(--p-text-secondary); line-height: 1.6; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.series-hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Seasons / Episodes */
.series-seasons { padding: 1.5rem 2.5rem 2rem; }

.season-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--p-border);
    padding-bottom: 0;
}
.season-tabs::-webkit-scrollbar { display: none; }

.season-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--p-text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--p-transition), border-color var(--p-transition);
}
.season-tab:hover { color: var(--p-text); }
.season-tab.active { color: var(--p-primary); border-bottom-color: var(--p-primary); }

.episode-list { display: flex; flex-direction: column; gap: 0.75rem; }

.episode-card {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--p-radius);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    transition: background var(--p-transition), border-color var(--p-transition);
}
.episode-card { cursor: pointer; }
.episode-card:hover { background: var(--p-surface-hover, rgba(255,255,255,0.05)); border-color: var(--p-primary); }

.episode-thumb {
    position: relative;
    width: 200px;
    height: 112px;
    flex-shrink: 0;
    border-radius: var(--p-radius-sm, 6px);
    overflow: hidden;
    background: rgba(0,0,0,0.3);
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }

.episode-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s;
}
.episode-play-overlay i { font-size: 2rem; color: #fff; }
.episode-card:hover .episode-play-overlay { opacity: 1; }

.episode-number {
    position: absolute;
    bottom: 0.375rem;
    left: 0.375rem;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
}

.episode-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.episode-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.episode-meta { display: flex; gap: 0.75rem; font-size: 0.8125rem; color: var(--p-text-muted); margin-bottom: 0.375rem; }
.episode-desc { font-size: 0.8125rem; color: var(--p-text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Episode modal badge (Season X · Episode Y) */
.ep-modal-badge {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--p-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

/* No stream message in episode modal */
.episode-no-stream {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--p-text-muted);
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
}

/* Series detail responsive */
@media (max-width: 768px) {
    .series-hero { min-height: 300px; }
    .series-hero-content { flex-direction: column; align-items: flex-start; padding: 1.5rem; }
    .series-hero-poster { width: 120px; height: 180px; }
    .series-hero-title { font-size: 1.5rem; }
    .series-seasons { padding: 1rem 1rem 2rem; }
    .episode-thumb { width: 140px; height: 79px; }
    .episode-desc { display: none; }
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i { font-size: 3rem; color: var(--p-text-muted); margin-bottom: 1rem; display: block; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--p-text-muted); font-size: 0.9375rem; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--p-surface) 25%, var(--p-surface-hover) 50%, var(--p-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--p-radius);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .header-menu-btn { display: flex; }
    .live-top-section { max-height: 35vh; }
    .live-player-section { flex: 0 0 55%; max-width: 55%; }
    :root { --epg-channel-w: 120px; }
    .hero { height: 400px; }
    .hero-title { font-size: 2rem; }
}

/* Mobile */
@media (max-width: 640px) {
    .hero { height: 300px; }
    .hero-title { font-size: 1.5rem; }
    .hero-content { left: 1rem; bottom: 2rem; right: 1rem; }
    .hero-description { display: none; }
    .content-section { padding: 0 1rem 1.5rem; }
    .page-hero { padding: 1.5rem 1rem 1rem; }
    .filter-bar { padding: 0 1rem 1rem; }
    .content-grid { padding: 0 1rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
    .card-poster { width: 130px; }
    .card-poster-img { width: 130px; height: 195px; }
    .card-backdrop { width: 250px; }
    .card-backdrop-img { width: 250px; height: 141px; }
    .spotlight { flex-direction: column; padding: 1.25rem; }
    .spotlight-img { width: 100%; height: 200px; }
    .detail-modal { margin: 0; max-height: 100vh; border-radius: 0; }
    .detail-backdrop { height: 200px; border-radius: 0; }

    /* Live TV mobile */
    :root { --epg-channel-w: 90px; --epg-row-h: 44px; }
    .live-top-section { flex-direction: column; max-height: none; }
    .live-player-section { flex: none; max-width: 100%; max-height: 30vh; }
    .live-player-container { max-height: 30vh; }
    .live-info-panel { max-height: 120px; }
    .live-info-channel { padding: 0.5rem 1rem; }
    .live-info-programme { padding: 0.5rem 1rem; gap: 0.375rem; }
    .live-info-desc { display: none; }
    .live-info-next { display: none; }
    .live-guide-header { padding: 0.5rem 1rem; }
    .live-guide-title { font-size: 0.875rem; }
    .epg-channel-name { font-size: 0.625rem; }
    .epg-channel-col img { width: 22px; height: 22px; }
    .epg-programme-title { font-size: 0.625rem; }
    .epg-programme-time { font-size: 0.5rem; }
    .epg-modal { padding: 1.25rem; }
    .epg-modal.epg-modal-enhanced { max-width: 100%; padding: 0; }
    .epg-modal-backdrop { height: 140px; }
    .epg-modal-top { flex-direction: column; gap: 0.75rem; margin-top: -40px; }
    .epg-modal-poster { width: 80px; }
    .epg-modal-poster.has-image + .epg-modal-info { padding-top: 0; }
    .epg-reminder-toast { bottom: 4.5rem; right: 1rem; left: 1rem; max-width: none; }
    .epg-nav-controls { order: -1; width: 100%; justify-content: center; }

    /* Search page mobile */
    .search-hero { padding: 2rem 1rem 1.5rem; }
    .search-hero-title { font-size: 1.5rem; }
    .search-hero-icon { width: 52px; height: 52px; }
    .search-hero-icon i { font-size: 1.25rem; }
    .search-section-header { padding: 0 1rem 0.75rem; }
    /* Search page mobile */
    .search-input-bar { padding: 0.75rem 1rem; }
    .search-input-wrap input { padding: 0.625rem 2.25rem 0.625rem 2.5rem; font-size: 0.9375rem; }
    .search-input-icon { left: 0.875rem; font-size: 1rem; }
    .search-quick-filters { padding: 0.75rem 1rem 0.25rem; gap: 0.375rem; }
    .quick-filter-chip { padding: 0.3125rem 0.625rem; font-size: 0.75rem; }
    .search-promo-banner { margin: 0.75rem 1rem 0.25rem; min-height: 150px; }
    .search-promo-content { max-width: 75%; padding: 1.25rem; }
    .search-promo-title { font-size: 1.125rem; }
    .search-promo-desc { display: none; }
    .search-section-header { padding: 0 1rem 0.75rem; }
    .recent-search-chips { padding: 0 1rem 1rem; }
    .search-category-grid { padding: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .search-results-header { padding: 0.5rem 1rem; }
    .search-filter-tabs { padding: 0 1rem 1rem; gap: 0.375rem; }
    .search-tab { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
    .search-group-header { padding: 0 1rem 0.75rem; }
    .search-channel-grid { padding: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .search-no-results { padding: 2rem 1rem; }

    /* Bottom tab bar on mobile */
    .app-sidebar { display: none; }
    .app-main { margin-left: 0; padding-bottom: 60px; }

    .mobile-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--p-surface);
        border-top: 1px solid var(--p-border);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 200;
    }

    .mobile-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        color: var(--p-text-muted);
        font-size: 0.625rem;
        font-weight: 500;
        padding: 0.375rem 0.75rem;
        transition: color var(--p-transition);
        background: none;
        border: none;
    }

    .mobile-tab i { font-size: 1.25rem; }
    .mobile-tab.active { color: var(--p-primary); }
}

/* Desktop: hide mobile tabs */
@media (min-width: 641px) {
    .mobile-tabs { display: none; }
}

/* Sidebar overlay backdrop on tablet */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
}

@media (max-width: 1024px) {
    .sidebar-backdrop.visible { display: block; }
}

/* =========================================================================
   Navigation Style Overrides (admin-configurable via data-nav-style)
   ========================================================================= */

/* Top navigation bar (hidden by default, shown for top_bar style) */
.top-nav {
    display: none;
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
    padding: 0 1rem;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: var(--p-header-h);
    z-index: 99;
}
.top-nav::-webkit-scrollbar { display: none; }

.top-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--p-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color var(--p-transition), border-color var(--p-transition);
}
.top-nav-item:hover { color: var(--p-text); }
.top-nav-item.active {
    color: var(--p-primary);
    border-bottom-color: var(--p-primary);
}
.top-nav-item i { font-size: 1.125rem; }

/* ---- Bottom Tab style ---- */
[data-nav-style="bottom_tab"] .app-sidebar { display: none !important; }
[data-nav-style="bottom_tab"] .sidebar-backdrop { display: none !important; }
[data-nav-style="bottom_tab"] .app-main { margin-left: 0 !important; padding-bottom: 60px; }
[data-nav-style="bottom_tab"] .header-menu-btn { display: none !important; }
[data-nav-style="bottom_tab"] .top-nav { display: none !important; }

/* Bottom tabs need full positioning at all screen sizes (base styles are mobile-only) */
[data-nav-style="bottom_tab"] .mobile-tabs {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--p-surface);
    border-top: 1px solid var(--p-border);
    align-items: center;
    justify-content: space-around;
    z-index: 200;
}
[data-nav-style="bottom_tab"] .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--p-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color var(--p-transition);
    background: none;
    border: none;
    cursor: pointer;
}
[data-nav-style="bottom_tab"] .mobile-tab i { font-size: 1.25rem; }
[data-nav-style="bottom_tab"] .mobile-tab.active { color: var(--p-primary); }

/* ---- Top Bar style ---- */
[data-nav-style="top_bar"] .app-sidebar { display: none !important; }
[data-nav-style="top_bar"] .sidebar-backdrop { display: none !important; }
[data-nav-style="top_bar"] .app-main { margin-left: 0 !important; }
[data-nav-style="top_bar"] .mobile-tabs { display: none !important; }
[data-nav-style="top_bar"] .header-menu-btn { display: none !important; }
[data-nav-style="top_bar"] .top-nav { display: flex !important; }

/* ---- Sidebar style (default — responsive breakpoints apply) ---- */
[data-nav-style="sidebar"] .top-nav { display: none !important; }

/* ---- Icon/Label visibility overrides ---- */
[data-nav-icons="false"] .nav-item i,
[data-nav-icons="false"] .mobile-tab i,
[data-nav-icons="false"] .top-nav-item i { display: none; }

[data-nav-labels="false"] .nav-item span,
[data-nav-labels="false"] .mobile-tab span,
[data-nav-labels="false"] .top-nav-item span { display: none; }

/* ============================================
   LOCKED CONTENT STYLES
   ============================================ */

/* Card lock overlay */
.card-locked { position: relative; }

.card-lock-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 5;
}

.card-lock-overlay i {
    font-size: 0.875rem;
    color: var(--p-warning);
}

/* Hero lock badge */
.hero-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(245, 158, 11, 0.2);
    color: var(--p-warning);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.hero-lock-badge i { font-size: 0.75rem; }

/* Spotlight lock badge */
.spotlight-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(245, 158, 11, 0.15);
    color: var(--p-warning);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: var(--p-radius-sm);
    margin-bottom: 0.75rem;
}

.spotlight-lock-badge i { font-size: 0.875rem; }

/* Detail modal lock badge */
.detail-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(245, 158, 11, 0.15);
    color: var(--p-warning);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: var(--p-radius-sm);
    margin-bottom: 0.75rem;
}

.detail-lock-badge i { font-size: 0.875rem; }

/* Subscribe button */
.btn-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--p-warning), #d97706);
    color: #000;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--p-radius);
    border: none;
    cursor: pointer;
    transition: transform var(--p-transition), box-shadow var(--p-transition);
}

.btn-subscribe:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-subscribe i { font-size: 1rem; }

/* ============================================
   PACKAGES & SUBSCRIPTION PAGE
   ============================================ */

.subscribe-page {
    padding: 0 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.packages-section { padding: 0 2rem 2rem; }

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.package-card {
    position: relative;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform var(--p-transition), border-color var(--p-transition), box-shadow var(--p-transition);
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.package-card.featured {
    border-color: var(--p-primary);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, var(--p-surface) 50%);
}

.package-card.selected {
    border-color: var(--p-success);
    box-shadow: 0 0 0 2px var(--p-success);
}

.package-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--p-primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

.package-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.package-price {
    margin-bottom: 1rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--p-text);
}

.price-period {
    font-size: 0.9375rem;
    color: var(--p-text-muted);
}

.package-desc {
    color: var(--p-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.package-features {
    list-style: none;
    margin-bottom: 1.5rem;
    flex: 1;
}

.package-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--p-text-secondary);
    border-bottom: 1px solid var(--p-border);
}

.package-features li:last-child { border-bottom: none; }

.package-features li i {
    color: var(--p-success);
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.package-btn {
    width: 100%;
    justify-content: center;
}

/* ============================================
   PAYMENT MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--p-surface-hover);
    border: none;
    color: var(--p-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--p-transition), color var(--p-transition);
}

.modal-close:hover {
    background: var(--p-surface-active);
    color: var(--p-text);
}

.payment-modal {
    position: relative;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.payment-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.payment-summary {
    background: var(--p-bg);
    border-radius: var(--p-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.payment-plan {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.payment-amount {
    color: var(--p-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.payment-methods-label {
    font-size: 0.875rem;
    color: var(--p-text-muted);
    margin-bottom: 1rem;
}

.payment-placeholder {
    background: var(--p-bg);
    border: 1px dashed var(--p-border);
    border-radius: var(--p-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.payment-placeholder i {
    font-size: 2.5rem;
    color: var(--p-text-muted);
    margin-bottom: 1rem;
    display: block;
}

.payment-placeholder p {
    font-size: 0.875rem;
    color: var(--p-text-secondary);
    margin-bottom: 0.5rem;
}

.payment-contact {
    color: var(--p-text-muted) !important;
    font-size: 0.8125rem !important;
}

.payment-action {
    text-align: center;
    padding: 1.5rem 0;
}

.payment-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--p-success);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

.payment-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--p-danger);
    padding: 0.75rem 1rem;
    border-radius: var(--p-radius);
    font-size: 0.875rem;
    margin: 1rem 0;
    text-align: center;
}

.btn-subscribed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--p-success);
    cursor: default;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.package-card.subscribed {
    border-color: var(--p-success);
}

.subscribed-badge {
    background: var(--p-success) !important;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.locked-player-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.locked-player-message {
    text-align: center;
    padding: 3rem;
}

.locked-player-message i.lucide-lock {
    font-size: 3rem;
    color: var(--p-danger);
    margin-bottom: 1rem;
    display: block;
}

.locked-player-message h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.locked-player-message p {
    color: var(--p-text-secondary);
    margin-bottom: 1.5rem;
}

.subscription-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.profile-page {
    padding: 0 2rem 3rem;
    max-width: 600px;
    margin: 0 auto;
}

.profile-section {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--p-text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: var(--p-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.profile-details { flex: 1; min-width: 0; }

.profile-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-email {
    color: var(--p-text-muted);
    font-size: 0.875rem;
}

.profile-option {
    padding: 1rem 0;
    border-bottom: 1px solid var(--p-border);
}

.profile-option:last-child { border-bottom: none; }

.profile-option-desc {
    color: var(--p-text-muted);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.profile-empty {
    color: var(--p-text-muted);
    margin-bottom: 1rem;
}

/* Toggle switch */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.toggle-label input { display: none; }

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--p-border);
    border-radius: 13px;
    transition: background var(--p-transition);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--p-transition);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--p-primary);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(22px);
}

.subscription-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--p-border);
}

.subscription-item:last-child { border-bottom: none; }

.subscription-name { font-weight: 500; }

.subscription-status {
    background: rgba(34, 197, 94, 0.15);
    color: var(--p-success);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--p-radius-sm);
}

.btn-danger {
    background: var(--p-danger);
    color: #fff;
    width: 100%;
    justify-content: center;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ============================================
   PIN MODAL
   ============================================ */

.pin-modal {
    position: relative;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 360px;
    text-align: center;
}

.pin-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pin-modal-desc {
    color: var(--p-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.pin-input-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pin-input {
    width: 48px;
    height: 56px;
    border: 2px solid var(--p-border);
    border-radius: var(--p-radius);
    background: var(--p-bg);
    color: var(--p-text);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color var(--p-transition);
}

.pin-input:focus {
    border-color: var(--p-primary);
}

.pin-modal-hint {
    color: var(--p-text-muted);
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

/* Responsive for packages/profile */
@media (max-width: 640px) {
    .subscribe-page { padding: 0 1rem 3rem; }
    .packages-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .package-card { padding: 1.5rem; }
    .price-amount { font-size: 2rem; }
    .profile-page { padding: 0 1rem 3rem; }
    .profile-section { padding: 1.25rem; }
}

/* ============================================
   Cast & Person Styles
   ============================================ */

/* Cast row in detail modal & series detail */
.detail-cast {
    margin-top: 1.5rem;
}

.cast-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--p-text);
    margin-bottom: 0.75rem;
}

.cast-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--p-border) transparent;
}

.cast-row::-webkit-scrollbar {
    height: 4px;
}

.cast-row::-webkit-scrollbar-track {
    background: transparent;
}

.cast-row::-webkit-scrollbar-thumb {
    background: var(--p-border);
    border-radius: 2px;
}

.cast-card {
    flex-shrink: 0;
    width: 100px;
    text-align: center;
    transition: transform 0.2s;
}

.cast-card:hover {
    transform: translateY(-2px);
}

.cast-photo {
    width: 80px;
    height: 120px;
    border-radius: var(--p-radius-sm);
    object-fit: cover;
    background: var(--p-surface);
    display: block;
    margin: 0 auto 0.5rem;
}

.cast-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--p-text);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cast-character {
    font-size: 0.6875rem;
    color: var(--p-text-muted);
    line-height: 1.2;
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Person back navigation */
.person-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--p-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0;
    background: none;
    border: none;
    transition: color var(--p-transition);
    margin-bottom: 0.5rem;
    font-family: inherit;
}

.person-back:hover {
    color: var(--p-primary);
}

.person-back i {
    font-size: 1rem;
}

/* Person Page */
.person-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.person-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2.5rem;
}

.person-photo {
    width: 185px;
    height: 278px;
    border-radius: var(--p-radius);
    object-fit: cover;
    background: var(--p-surface);
    flex-shrink: 0;
}

.person-info {
    flex: 1;
    padding-top: 1rem;
}

.person-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--p-text);
    margin-bottom: 0.75rem;
}

.person-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9375rem;
    color: var(--p-text-secondary);
}

.person-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (max-width: 640px) {
    .person-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    .person-photo {
        width: 140px;
        height: 210px;
    }
    .person-name {
        font-size: 1.5rem;
    }
    .person-stats {
        justify-content: center;
    }
    .person-page {
        padding: 1rem;
    }
    .cast-card {
        width: 85px;
    }
    .cast-photo {
        width: 70px;
        height: 105px;
    }
    .person-epg-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .person-epg-channel {
        width: 100%;
    }
    .person-epg-tune {
        align-self: flex-end;
    }
}

/* ---- Person Page: EPG Upcoming Section ---- */

.person-epg-section {
    margin-top: 1.5rem;
}

.person-epg-section .content-row-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.person-epg-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.person-epg-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.person-epg-card:hover {
    background: var(--p-surface-hover, rgba(255,255,255,0.05));
    border-color: var(--p-accent);
}

.person-epg-card.is-live {
    border-color: var(--p-accent);
}

.person-epg-channel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
    flex-shrink: 0;
}

.person-epg-channel-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
}

.person-epg-channel-name {
    font-size: 0.8125rem;
    color: var(--p-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.person-epg-details {
    flex: 1;
    min-width: 0;
}

.person-epg-title {
    font-weight: 600;
    color: var(--p-text);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-epg-year {
    font-weight: 400;
    color: var(--p-text-secondary);
    font-size: 0.8125rem;
}

.person-epg-time {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--p-text-secondary);
    margin-top: 0.2rem;
}

.person-epg-live-badge {
    background: var(--p-accent, #ef4444);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.person-epg-tune {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--p-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.person-epg-tune:hover {
    opacity: 0.85;
}
