@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===========================
   CSS VARIABLES - Black Panther Theme
   =========================== */
:root {
    --primary: #E62E2F;
    --primary-sub: rgba(230, 46, 47, 0.15);
    --primary-dark: #c01f20;
    --accent: #E22F4D;
    --accent-glow: rgba(226, 47, 77, 0.4);

    --bg: #000000;
    --bg-surface: #0d0d0d;
    --bg-card: #111111;
    --bg-card-hover: #1a1a1a;
    --bg-elevated: #181818;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #FFFFFF;
    --text-secondary: #ADADAD;
    --text-muted: #6D6D6D;
    --text-dim: #3d3d3d;

    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(226, 47, 77, 0.4);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.6);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.8);
    --shadow-accent: 0 4px 24px rgba(226,47,77,0.3);

    --transition: all 0.2s ease;
    --transition-slow: all 0.35s ease;

    --header-height: 60px;
    --sidebar-width: 240px;
    --nav-height: 60px;
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
input:focus, textarea:focus, select:focus { outline: none; }
.focusable:focus { outline: none !important; }
ul, ol { list-style: none; }

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===========================
   TYPOGRAPHY
   =========================== */
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 700; }
h3 { font-size: clamp(1rem, 1.5vw, 1.2rem); font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p { line-height: 1.6; }

.text-primary-color { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ===========================
   HEADER
   =========================== */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.header-logo img {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
}

.header-logo span {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 1.5rem;
}

.header-nav a {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--text-primary);
    background: var(--primary-sub);
}

.header-nav a.active { color: var(--primary); }

.header-spacer { flex: 1; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.header-btn svg { width: 20px; height: 20px; }

.header-search-btn {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex; align-items: center; gap: 0.5rem;
    width: 180px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.header-search-btn:hover {
    border-color: var(--primary);
    color: var(--text-secondary);
}

.user-avatar {
    width: 32px; height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.user-avatar:hover { border-color: var(--primary); }

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
    padding-top: var(--header-height);
    min-height: 100vh;
}

.page-content {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* ===========================
   LOGIN PAGE
   =========================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050614; /* Deep dark blue background */
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 50%, rgba(20, 25, 50, 0.4) 0%, transparent 60%);
}

.login-bg-grid {
    display: none; /* Hide default grid for this theme */
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: center;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.login-logo-wrap {
    position: relative;
}

.login-logo-wrap img {
    width: 100px; height: 100px;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 60px rgba(226, 47, 77, 0.4);
}

.login-logo-ring { display: none; } /* Hide the red pulsing ring */

.login-brand-title {
    display: none; /* User wants just the logo, text was removed or kept small */
}

.login-brand-sub { display: none; }

.login-saved-users {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-height: 160px;
    overflow-y: auto;
}

.saved-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.saved-user-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.saved-user-avatar {
    width: 30px; height: 30px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.saved-user-info { flex: 1; min-width: 0; }
.saved-user-name { font-size: 0.82rem; font-weight: 600; }
.saved-user-url { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.login-form-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.login-form-card::before {
    display: none;
}

.form-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 0.9rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.4rem;
}

.form-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: var(--transition);
    overflow: hidden;
    height: 48px;
}

.form-input-wrap:focus-within {
    border-color: rgba(255, 255, 255, 0.3);
}

.form-input-icon {
    width: 46px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05); /* Separator line like in image */
}

.form-input-icon svg { width: 18px; height: 18px; }

.form-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.95rem;
    padding: 0 1rem;
    height: 100%;
}

.form-input::placeholder { color: rgba(255, 255, 255, 0.3); }

.form-input-toggle {
    width: 42px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.form-input-toggle:hover { color: var(--text-secondary); }
.form-input-toggle svg { width: 16px; height: 16px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-submit-btn {
    background: linear-gradient(90deg, #FF455B, #FE654F); /* Pink/Red gradient from image */
    color: white;
    width: 100%;
    margin-top: 1rem;
    height: 52px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s, filter 0.2s;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.login-submit-btn:active { transform: translateY(0); }

.btn-primary .btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary.loading .btn-spinner { display: block; }
.btn-primary.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    padding: 0.5rem 1rem;
}

.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.form-divider {
    display: flex; align-items: center; gap: 1rem;
    margin: 1.2rem 0;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.form-divider::before, .form-divider::after {
    content: ''; flex: 1;
    height: 1px;
    background: var(--border);
}

.login-dns-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.dns-chip {
    padding: 0.3rem 0.7rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.dns-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-sub);
}

.form-error {
    background: rgba(230, 46, 47, 0.1);
    border: 1px solid rgba(230, 46, 47, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: #ff6b6b;
    display: none;
    margin-top: 0.75rem;
}

.form-error.show { display: flex; align-items: center; gap: 0.5rem; }

/* ===========================
   HOME PAGE - BLACK PANTHER
   =========================== */
.home-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.home-bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 60% at 50% 0%, rgba(226, 47, 77, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(226, 47, 77, 0.06) 0%, transparent 50%),
        #000;
}

.home-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
    padding: 1.5rem;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===========================
   HOME MAIN CARDS (Live, Movies, Series)
   =========================== */
.home-main-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    flex: 2;
}

.home-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    transition: var(--transition-slow);
    border: 1px solid var(--border);
}

.home-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    transition: var(--transition-slow);
}

.home-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
    transition: var(--transition-slow);
}

.home-card:hover::after {
    border-color: var(--accent);
    box-shadow: inset 0 0 40px rgba(226,47,77,0.08), 0 0 40px rgba(226,47,77,0.15);
}

.home-card:hover { transform: translateY(-4px); }

.home-card-corner {
    position: absolute;
    bottom: 0; left: 0;
    width: 50px; height: 50px;
    background: var(--accent);
    clip-path: polygon(0 100%, 100% 100%, 0 0);
    opacity: 0.7;
    transition: var(--transition-slow);
}

.home-card:hover .home-card-corner {
    opacity: 1;
    width: 60px; height: 60px;
}

.home-card-progress {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.home-card-progress.show { display: flex; }

.home-card-progress-bar {
    width: 70%;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.home-card-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    animation: progress-anim 2s ease-in-out infinite;
}

@keyframes progress-anim {
    0% { width: 0; }
    50% { width: 80%; }
    100% { width: 100%; }
}

.home-card-body {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    gap: 0.75rem;
}

.home-card-icon-wrap {
    width: 64px; height: 64px;
    border-radius: var(--radius-xl);
    background: rgba(226, 47, 77, 0.95);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 24px rgba(226, 47, 77, 0.5);
    transition: var(--transition-slow);
}

.home-card:hover .home-card-icon-wrap {
    transform: scale(1.1);
    box-shadow: 0 8px 40px rgba(226, 47, 77, 0.7);
}

.home-card-icon-wrap svg { width: 32px; height: 32px; color: white; }

.home-card-label {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: white;
    text-align: center;
}

.home-card-meta {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

.home-card-footer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.home-card-timestamp {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
}

/* ===========================
   HOME SECONDARY CARDS
   =========================== */
.home-secondary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.home-small-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.home-small-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: var(--transition-slow);
}

.home-small-card:hover::before { transform: scaleY(1); }

.home-small-card:hover {
    border-color: var(--accent-glow);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.home-small-card-corner {
    position: absolute;
    bottom: -15px; right: -5px;
    width: 40px; height: 40px;
    background: var(--accent);
    clip-path: polygon(0 100%, 100% 100%, 0 0);
    opacity: 0.5;
}

.home-small-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: rgba(226,47,77,0.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    transition: var(--transition);
}

.home-small-card:hover .home-small-card-icon {
    background: rgba(226,47,77,0.25);
}

.home-small-card-icon svg { width: 22px; height: 22px; }

.home-small-card-info { flex: 1; }
.home-small-card-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.home-small-card-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ===========================
   CONTENT LIST PAGE (Live, Movies, Series)
   =========================== */
.content-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - var(--header-height));
}

.categories-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-title {
    padding: 0.5rem 1rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.cat-item {
    padding: 0.55rem 1.2rem;
    cursor: pointer;
    font-size: 0.83rem;
    color: var(--text-secondary);
    transition: var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-item:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.cat-item.active {
    color: var(--primary);
    background: var(--primary-sub);
    border-left-color: var(--primary);
    font-weight: 600;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.content-area-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.content-area-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.content-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ===========================
   CHANNEL LIST (Live TV)
   =========================== */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.channel-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.channel-logo {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-elevated);
    flex-shrink: 0;
    padding: 2px;
}

.channel-logo-placeholder {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.channel-info { flex: 1; min-width: 0; }
.channel-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.channel-epg {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.channel-badge {
    padding: 0.2rem 0.5rem;
    background: var(--primary-sub);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.channel-play-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
}

.channel-play-btn svg { width: 14px; height: 14px; color: white; margin-left: 2px; }
.channel-item:hover .channel-play-btn { opacity: 1; transform: scale(1); }

/* ===========================
   MOVIE/SERIES GRID
   =========================== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.media-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 2/3;
    background: var(--bg-card);
    transition: var(--transition-slow);
    border: 1px solid var(--border);
}

.media-card:hover {
    transform: scale(1.04) translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-accent);
    z-index: 2;
}

.media-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.media-card:hover img { transform: scale(1.05); }

.media-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2rem 0.6rem 0.6rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    transform: translateY(100%);
    transition: var(--transition-slow);
}

.media-card:hover .media-card-overlay { transform: translateY(0); }

.media-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-card-rating {
    font-size: 0.65rem;
    color: #ffd700;
    margin-top: 0.2rem;
}

.media-card-type-badge {
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    padding: 0.2rem 0.4rem;
    background: rgba(0,0,0,0.7);
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    backdrop-filter: blur(4px);
}

.media-card-type-badge.tv { background: rgba(226,47,77,0.8); }
.media-card-type-badge.movie { background: rgba(33,150,243,0.8); }

.media-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg-elevated);
    color: var(--text-dim);
    font-size: 0.72rem;
    text-align: center;
    padding: 0.5rem;
}

.media-placeholder svg { width: 28px; height: 28px; }

/* ===========================
   DETAIL PAGE
   =========================== */
.detail-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    margin: -1.5rem -1.5rem 0;
}

.detail-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    filter: blur(2px) brightness(0.4);
    transform: scale(1.05);
}

.detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg) 10%, transparent 60%, rgba(0,0,0,0.3) 100%),
                linear-gradient(to right, rgba(0,0,0,0.5) 30%, transparent 70%);
}

.detail-hero-content {
    position: absolute;
    bottom: 2.5rem; left: 2rem;
    right: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-end;
}

.detail-poster {
    width: 140px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.1);
}

.detail-info { flex: 1; }

.detail-badges {
    display: flex; gap: 0.5rem; margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.detail-badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-type { background: var(--primary); color: white; }
.badge-year { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.badge-rating { background: rgba(255,215,0,0.15); color: #ffd700; }
.badge-genre {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

.detail-title {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 900;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.detail-meta {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}

.detail-meta-item {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.detail-meta-item svg { width: 14px; height: 14px; opacity: 0.7; }

.detail-actions {
    display: flex; gap: 0.75rem; flex-wrap: wrap;
}

.btn-play {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-play:hover {
    background: var(--primary-dark);
    transform: scale(1.03);
    box-shadow: var(--shadow-accent);
}

.btn-play svg { width: 18px; height: 18px; }

.btn-outline {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    transition: var(--transition);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.btn-outline svg { width: 18px; height: 18px; }

.detail-body {
    padding: 2rem 0;
}

.detail-synopsis {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 700px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.detail-synopsis.expanded {
    -webkit-line-clamp: unset;
}

.read-more-btn {
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

.detail-section {
    margin-top: 2rem;
}

.detail-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Seasons Tabs */
.seasons-tabs {
    display: flex; gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.season-tab {
    padding: 0.45rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.season-tab:hover,
.season-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Episodes List */
.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.episode-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    align-items: flex-start;
}

.episode-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.episode-thumb {
    width: 120px; height: 70px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.episode-thumb-placeholder {
    width: 120px; height: 70px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--text-dim);
}

.episode-info { flex: 1; min-width: 0; }
.episode-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.episode-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.episode-desc {
    font-size: 0.77rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-duration {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

/* ===========================
   PLAYER PAGE
   =========================== */
.player-page {
    background: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.player-header-bar {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.player-back-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: white;
    transition: var(--transition);
    flex-shrink: 0;
}

.player-back-btn:hover { background: rgba(255,255,255,0.2); }
.player-back-btn svg { width: 20px; height: 20px; }

.player-info { flex: 1; }
.player-show-title { font-size: 0.88rem; font-weight: 600; }
.player-show-sub { font-size: 0.75rem; color: var(--text-muted); }

.player-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.video-container {
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16/9;
    position: relative;
    background: #000;
}

#main-video {
    width: 100%;
    height: 100%;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-overlay.show { opacity: 1; }

.video-big-play {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(230, 46, 47, 0.9);
    display: flex; align-items: center; justify-content: center;
    pointer-events: all;
    cursor: pointer;
    transition: var(--transition);
}

.video-big-play:hover { transform: scale(1.1); }
.video-big-play svg { width: 32px; height: 32px; color: white; margin-left: 4px; }

.player-loading {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.7);
    flex-direction: column;
    gap: 1rem;
}

.player-spinner {
    width: 50px; height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.player-controls {
    padding: 1.5rem;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}

.player-progress-wrap {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1rem;
}

.player-progress {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.player-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    position: relative;
    pointer-events: none;
}

.player-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px; top: 50%;
    transform: translateY(-50%);
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(230,46,47,0.8);
}

.player-time {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.player-buttons {
    display: flex; align-items: center; gap: 0.5rem;
}

.player-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.player-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.player-btn svg { width: 20px; height: 20px; }

.player-btn.large { width: 44px; height: 44px; }
.player-btn.large svg { width: 24px; height: 24px; }

.player-volume-wrap {
    display: flex; align-items: center; gap: 0.5rem;
}

.player-volume {
    width: 80px; height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.player-volume-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    pointer-events: none;
}

.player-spacer { flex: 1; }

/* ===========================
   SEARCH PAGE
   =========================== */
.search-header {
    padding: 2rem 0 1.5rem;
    text-align: center;
}

.search-input-wrap {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.2rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px; height: 20px;
}

.search-input {
    width: 100%;
    padding: 1rem 1.2rem 1rem 3.2rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(230,46,47,0.1);
}

.search-input::placeholder { color: var(--text-muted); }

.search-results-section { margin-top: 2rem; }

.search-section-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1rem;
}

.search-section-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.search-section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.search-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.search-empty svg {
    width: 60px; height: 60px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

/* ===========================
   SKELETON LOADING
   =========================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
}

.skeleton-channel {
    height: 68px;
    border-radius: var(--radius-md);
}

.skeleton-text { height: 14px; border-radius: 4px; }
.skeleton-text.sm { height: 10px; }
.skeleton-text.lg { height: 20px; }

/* ===========================
   TOAST
   =========================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    z-index: 9999;
}

.toast {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.8rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    min-width: 260px;
    animation: toast-in 0.3s ease;
    backdrop-filter: blur(20px);
}

.toast.success { border-left: 3px solid #4CAF50; }
.toast.error { border-left: 3px solid var(--primary); }
.toast.info { border-left: 3px solid #2196F3; }

@keyframes toast-in {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===========================
   DROPDOWN MENU
   =========================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 180px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    display: none;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item:hover { background: var(--bg-card); color: var(--text-primary); }
.dropdown-item svg { width: 16px; height: 16px; }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0;
}

/* ===========================
   BOTTOM NAV (Mobile)
   =========================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(10,10,10,0.95);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
}

.bottom-nav-inner {
    display: flex;
    height: 100%;
}

.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
}

.bottom-nav-btn svg { width: 22px; height: 22px; }

.bottom-nav-btn.active {
    color: var(--primary);
}

.bottom-nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 30px; height: 2px;
    background: var(--primary);
    border-radius: 0 0 2px 2px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 960px) {
    .home-main-cards { grid-template-columns: repeat(2, 1fr); }
    .home-secondary-cards { grid-template-columns: repeat(2, 1fr); }
    .header-nav { display: none; }
    .header-search-btn { width: 140px; }
    .login-container { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .detail-poster { width: 100px; }
}

@media (max-width: 640px) {
    .app-header { padding: 0 1rem; }
    .home-container { padding: 1rem; }
    .page-content { padding: 1rem; }
    .home-main-cards { grid-template-columns: 1fr 1fr; }
    .home-secondary-cards { grid-template-columns: 1fr 1fr; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .bottom-nav { display: block; }
    .main-content { padding-bottom: var(--nav-height); }
    .categories-sidebar { display: none; }
    .detail-hero-content { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .detail-poster { width: 80px; }
    .episode-thumb, .episode-thumb-placeholder { display: none; }
}

@media (max-width: 420px) {
    .home-main-cards { grid-template-columns: 1fr; }
    .home-card { min-height: 160px; }
}

/* ===========================
   UTILITY
   =========================== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Fade In */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Loading dots */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(3, end) infinite;
}
@keyframes dots {
    0%   { content: ''; }
    33%  { content: '.'; }
    66%  { content: '..'; }
    100% { content: '...'; }
}

/* ===========================
   TV INTERFACE - STREAMBOX
   =========================== */
.tv-bg {
    position: fixed; inset: 0; z-index: -1;
    background-color: #0b0c10;
}

.tv-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2rem 3rem 1rem 3rem;
}

.tv-header-logo { display: flex; align-items: center; gap: 1rem; }

.tv-logo-box {
    background: #E62E2F; border-radius: 8px;
    padding: 0.3rem 0.6rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(230,46,47,0.4);
}

.tv-logo-box-text { font-size: 0.6rem; font-weight: 900; color: white; margin-top: -3px; }

.tv-brand { font-size: 1.8rem; font-weight: 600; color: white; letter-spacing: 0.5px; }

.tv-header-center { flex: 1; text-align: center; }

.tv-date-text { font-size: 1.25rem; font-weight: 500; color: #f0f0f0; }

.tv-header-actions { display: flex; gap: 1.5rem; align-items: center; }

.tv-icon-btn {
    color: white; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 3px solid transparent; /* for focus */
    transition: all 0.2s;
    background: transparent; outline: none;
}

.tv-icon-btn svg { width: 24px; height: 24px; pointer-events: none; }

.tv-main-container {
    padding: 1rem 3rem;
    display: flex; flex-direction: column; gap: 1.5rem;
    max-width: 1600px; margin: 0 auto;
}

.tv-grid-large {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}

.tv-card {
    position: relative; border-radius: 20px;
    height: 340px; overflow: hidden; outline: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 4px solid transparent; /* for focus */
    transition: transform 0.2s, border-color 0.2s;
}

.tv-card-bg-pattern {
    position: absolute; inset: 0; opacity: 0.15; z-index: 0;
    /* Basic CSS pattern substitute for the subtle background */
    background-image: radial-gradient(circle at center, rgba(255,255,255,0.8) 1px, transparent 1.5px);
    background-size: 30px 30px;
}

.tv-card-cyan { background: linear-gradient(135deg, #3EEAB6, #4160E3); }
.tv-card-orange { background: linear-gradient(135deg, #FF455B, #F88A24); }
.tv-card-purple { background: linear-gradient(135deg, #B52FDD, #3F6FEC); }

.tv-card-badge {
    position: absolute; top: 1rem; right: 1rem; z-index: 2;
    background: rgba(255,255,255,0.2);
    color: white; font-weight: 700; font-size: 0.9rem;
    padding: 0.3rem 0.8rem; border-radius: 6px;
}

.tv-card-content {
    position: relative; z-index: 1; pointer-events: none;
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    margin-top: -2rem;
}

.tv-card-icon { width: 100px; height: 100px; color: white; }

.tv-card-title {
    font-size: 2rem; font-weight: 700; color: white; text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.tv-card-footer {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 60px;
    background: rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem; z-index: 2; pointer-events: none;
}

.tv-card-footer.dark { background: rgba(0,0,0,0.3); }

.tv-card-update { color: white; font-size: 0.95rem; opacity: 0.9; }

.tv-card-refresh-icon {
    width: 42px; height: 42px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #333;
}

.tv-card-refresh-icon svg { width: 22px; height: 22px; }

.tv-grid-small { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.tv-card-small {
    background: #54B4A4; outline: none; cursor: pointer;
    height: 100px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    color: white; font-size: 1.25rem; font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 4px solid transparent; /* for focus */
    transition: transform 0.2s, border-color 0.2s;
}

.tv-small-icon { width: 32px; height: 32px; opacity: 0.8; pointer-events: none; }
.tv-small-label { pointer-events: none; }

.tv-footer {
    position: fixed; bottom: 2rem; left: 3.5rem; right: 3.5rem;
    display: flex; justify-content: space-between;
    color: white; font-size: 1.25rem; font-weight: 500;
}
.tv-footer span { font-weight: 800; }

/* ===========================
   TV REMOTE NAVIGATION FOCUS STATES
   =========================== */
.focusable.focused {
    border-color: #FFFFFF !important;
    outline: none !important;
    box-shadow: 0 0 0 2px #FFFFFF, 0 10px 30px rgba(0,0,0,0.8);
    z-index: 10;
}

/* Specific override for Smarters cards to avoid any transform/zoom */
.smarters-card.focusable.focused {
    transform: none !important;
    border: 3px solid #FFFFFF !important;
}

/* ===========================
   SMARTERS REDESIGN STYLES
   =========================== */
:root {
    --smarters-blue: #00A3C4;
    --smarters-bg: #030a12;
    --smarters-sidebar: rgba(0, 0, 0, 0.4);
    --smarters-card-bg: rgba(255, 255, 255, 0.05);
}

.smarters-layout {
    display: flex;
    height: 100vh;
    background: var(--smarters-bg);
    overflow: hidden;
}

.smarters-sidebar {
    width: 320px;
    background: var(--smarters-sidebar);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    z-index: 100;
}

.smarters-sidebar-logo {
    padding: 0 2rem 2rem;
    text-align: center;
}

.smarters-sidebar-logo img {
    max-width: 180px;
    margin: 0 auto;
}

.smarters-cat-list {
    flex: 1;
    overflow-y: auto;
}

.smarters-cat-item {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.smarters-cat-item:hover,
.smarters-cat-item.active {
    background: var(--smarters-blue);
    border-left-color: #FFFFFF;
}

.smarters-cat-item.active .smarters-cat-name,
.smarters-cat-item.active .smarters-cat-count {
    color: #FFFFFF;
}

.smarters-cat-name {
    font-size: 0.9rem;
    font-weight: 700;
}

.smarters-cat-count {
    font-size: 0.85rem;
    font-weight: 400;
}

.smarters-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.smarters-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    background: rgba(0,0,0,0.3);
}

.smarters-header-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.smarters-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: max-content;
    gap: 20px 15px;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    align-content: start;
    min-height: 0;
}

/* Smarters Card */
.smarters-card {
    position: relative;
    width: 100%;
    aspect-ratio: 10 / 16; /* Thinner and smaller look */
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    border: 3px solid transparent;
    transition: none;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.smarters-card.focusable.focused {
    transform: none !important;
    border: 3px solid #FFFFFF !important;
    box-shadow: 0 0 20px rgba(255,255,255,0.4);
}

#btn-load-more {
    color: #FFFFFF !important;
    border-color: rgba(255,255,255,0.4) !important;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
}

#btn-load-more.focused {
    background: #FFFFFF !important;
    color: #000000 !important;
    border-color: #FFFFFF !important;
    transform: scale(1.05);
}

.smarters-card img {
    width: 100%; height: 100%; object-fit: cover;
}

.smarters-card-badge {
    position: absolute;
    top: 0; left: 0;
    background: var(--smarters-blue);
    color: white;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 900;
    border-bottom-right-radius: 4px;
    z-index: 2;
}

.smarters-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.75);
    padding: 0.6rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smarters-card-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #FFFFFF;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
}

/* Detail Redesign */
.smarters-detail-container {
    min-height: 100vh;
    position: relative;
    overflow-y: auto;
    background: #000;
}

.smarters-detail-bg {
    display: none; /* Removed background image as requested */
}

.smarters-detail-content {
    position: relative;
    z-index: 10;
    padding: 0 6rem 4rem; /* Adjusted padding */
    display: flex;
    flex-direction: column;
}

.smarters-detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.smarters-detail-body {
    display: flex;
    gap: 4rem;
    flex: 1;
}

.smarters-detail-left {
    width: 320px;
    flex-shrink: 0;
}

.smarters-detail-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    object-fit: cover;
    margin-bottom: 2rem;
}

.smarters-detail-right {
    flex: 1;
}

.smarters-meta-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.smarters-meta-item {
    display: flex;
    gap: 1rem;
    font-size: 1.1rem;
}

.smarters-meta-label {
    font-weight: 800;
    width: 140px;
}

.smarters-meta-value {
    color: #eee;
    opacity: 0.9;
}

.smarters-btn-play {
    margin-top: 3rem;
    background: linear-gradient(to bottom, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 1rem 4rem;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0, 163, 196, 0.3);
    transition: all 0.2s;
}

.smarters-btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 163, 196, 0.5);
}

.smarters-synopsis {
    margin-top: 3rem;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 1000px;
    opacity: 0.8;
}

.rating-stars {
    display: flex;
    gap: 4px;
    color: #FFD700;
    margin-bottom: 1rem;
}

/* ===========================
   SERIES DETAIL REDESIGN
   =========================== */
.series-detail-tabs {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-top: 2px solid rgba(255,255,255,0.1);
    margin: 2rem -2rem 0;
}

.series-detail-tab {
    padding: 1rem 3rem;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    border-bottom: 4px solid transparent;
    transition: all 0.2s;
}

.series-detail-tab.active {
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
    border-bottom-color: #e91e63; /* Pink accent from Smarters */
}

.episode-list {
    padding: 1.5rem 0;
}

.episode-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.episode-item.focused {
    background: rgba(255,255,255,0.1);
    border-color: #FFFFFF;
}

.episode-img-wrap {
    position: relative;
    width: 220px;
    height: 125px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.episode-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-img-wrap .play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
}

.episode-info {
    flex: 1;
}

.episode-info-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.episode-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFFFFF;
}

.episode-rating {
    display: flex;
    gap: 2px;
}

.episode-rating svg {
    width: 14px;
    height: 14px;
    fill: #ffd700;
}

.episode-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.episode-duration {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.episode-overview {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Season Selector */
.season-select-wrap {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-season {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    font-weight: 800;
    color: #FFFFFF;
    min-width: 260px;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-season.focused {
    background: #FFFFFF;
    color: #000000;
}

/* Season Modal / Grid */
.season-grid-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.season-grid-box {
    background: #1a1a1a;
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.season-grid-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.season-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.season-item {
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.season-item.active {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
}


.season-item.focused {
    border-color: #FFFFFF;
    background: rgba(255,255,255,0.15);
}

/* ===========================
   SMARTERS PLAYER REDESIGN
   =========================== */
.smarters-player-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    color: #fff;
    overflow: hidden;
}

#player-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-ui-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.player-ui-overlay.visible {
    opacity: 1;
}

/* Top Bar */
.player-top-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100px;
    padding: 2.5rem 3rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.player-back-circle {
    float: left;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: block;
    line-height: 60px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.player-back-circle svg {
    margin-top: 15px;
}

.player-back-circle.focused {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
    transform: scale(1.1);
}

.player-top-title {
    float: left;
    margin-left: 1.5rem;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 60px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.player-top-right {
    float: right;
}

.player-icon-btn {
    float: left;
    margin-left: 10px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: block;
    line-height: 60px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.player-icon-btn svg {
    margin-top: 16px;
}

.player-icon-btn.focused {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
    transform: scale(1.1);
}

/* Bottom Controls */
.player-bottom-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2rem 4rem 3rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.player-progress-area {
    margin-bottom: 2rem;
    height: 40px;
    position: relative;
}

.player-time-current {
    position: absolute;
    left: 0; top: 0;
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 80px;
    line-height: 40px;
}
.player-time-total {
    position: absolute;
    right: 0; top: 0;
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 80px;
    line-height: 40px;
    text-align: right;
}

.player-progress-container {
    margin: 0 100px;
    height: 40px;
    cursor: pointer;
    position: relative;
    outline: none;
}

.player-progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    position: absolute;
    top: 16px;
    left: 0;
    overflow: visible;
}

.player-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    position: relative;
}

.player-progress-thumb {
    position: absolute;
    right: -10px;
    top: 50%;
    margin-top: -10px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    display: none;
}

.player-progress-container.focused {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.player-progress-container.focused .player-progress-bg {
    height: 18px;
    top: 11px;
    background: rgba(255,255,255,0.3);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.player-progress-container.focused .player-progress-fill {
    background: #00d2ff;
}

.player-progress-container.focused .player-progress-thumb {
    display: block;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    right: -14px;
    background: #fff;
    border: 4px solid #00d2ff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
}

/* Utility Row */
.player-utility-row {
    text-align: center;
    width: 100%;
    margin-top: 1.5rem;
}

.player-util-row-group {
    display: inline-block;
    vertical-align: middle;
    /* Removed flex properties */
    /* gap: 1.5rem; */
    /* flex: 1; */
}

.player-util-row-group.right {
    /* Removed justify-content: flex-end; */
}

.player-util-item {
    display: inline-block;
    vertical-align: middle;
    /* Removed display: flex; align-items: center; gap: 0.75rem; */
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.7;
}
.player-util-item svg {
    vertical-align: middle;
    margin-right: 8px;
}

.player-util-item.focused {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    opacity: 1;
    transform: scale(1.05);
}

.player-util-text {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
}

.player-play-btn {
    display: inline-block;
    vertical-align: middle;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    /* Removed display: flex; align-items: center; justify-content: center; */
    margin: 0 3rem;
    cursor: pointer;
    border: 3px solid rgba(255,255,255,0.5); /* Always highlighted */
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    transition: all 0.2s;
    line-height: 100px;
    text-align: center;
}
.player-play-btn svg {
    display: inline-block;
    vertical-align: middle;
}

.player-play-btn.focused {
    background: #fff;
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255,255,255,0.5);
}

.player-play-btn.focused svg {
    fill: #000;
}

/* Buffering */
.player-buffering {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Removed inset: 0; */
    /* Removed display: flex; align-items: center; justify-content: center; */
    background: rgba(0,0,0,0.2);
    z-index: 5;
    display: none;
}
.player-buffering .smarters-spinner {
    position: absolute;
    top: 50%; left: 50%;
    margin-left: -40px; margin-top: -40px;
}

.smarters-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255,255,255,0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Modals for Speed/Episodes */
.player-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Removed inset: 0; */
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: none;
    /* Removed align-items: center; justify-content: center; */
}

.player-modal-content {
    background: #1a1a1a;
    width: 400px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    position: absolute;
    top: 50%; left: 50%;
    margin-left: -200px;
    margin-top: -250px; /* Assuming a height of 500px for centering */
}

.player-modal-title {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 800;
    text-align: center;
    font-size: 1.2rem;
}

.player-modal-list {
    max-height: 400px;
    overflow-y: auto;
}

.player-modal-item {
    padding: 1.2rem 2rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 600;
    transition: all 0.2s;
}

.player-modal-item.active {
    color: #00d2ff;
}

.player-modal-item.focused {
    background: rgba(255,255,255,0.1);
}
