/* ============================================
   LayarNusa - Netflix Clone CSS
   Clean UI with horizontal strip navigation
   ============================================ */

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

:root {
    --primary: #e50914;
    --primary-hover: #f40612;
    --bg-dark: #141414;
    --bg-card: #181818;
    --bg-modal: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --gradient-hero: linear-gradient(77deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.4) 50%, transparent 100%);
    --gradient-bottom: linear-gradient(to top, #141414 5%, transparent);
    --shadow-card: 0 8px 30px rgba(0,0,0,0.8);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --focus-ring: 0 0 0 3px #e50914, 0 0 15px rgba(229,9,20,0.5);
    --focus-ring-size: 3px;
}

/* Light Mode */
:root.light {
    --bg-dark: #f5f5f5;
    --bg-card: #ffffff;
    --bg-modal: #ffffff;
    --text-primary: #141414;
    --text-secondary: #555555;
    --text-muted: #888888;
    --gradient-hero: linear-gradient(77deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.6) 50%, transparent 100%);
    --gradient-bottom: linear-gradient(to top, #f5f5f5 5%, transparent);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.15);
}

:root.light .navbar { background: rgba(255,255,255,0.98) !important; box-shadow: 0 1px 10px rgba(0,0,0,0.1); }
:root.light .navbar.scrolled { background: #ffffff !important; }
:root.light .logo .red { color: #e50914; }
:root.light .logo .white { color: #141414; }
:root.light .hamburger-btn svg { fill: #141414; }
:root.light .search-btn svg { fill: #141414; }
:root.light .search-box input { background: #e8e8e8; color: #141414; }
:root.light .genre-link { color: #333; }
:root.light .genre-link:hover { color: #e50914; }
:root.light .sidebar { background: #ffffff; }
:root.light .sidebar-item { color: #333; }
:root.light .sidebar-item:hover, .light .sidebar-item:focus { background: #f0f0f0; }
:root.light .modal { background: #fff; }
:root.light .modal-close { color: #333; }
:root.light .footer { background: #ffffff; border-top: 1px solid #ddd; }
:root.light .hero-desc { color: #333; }
:root.light .row-title { color: #141414; }
:root.light .movie-card .card-title { color: #141414; }
:root.light .player-close { background: rgba(0,0,0,0.7); }

/* Android TV / D-Pad Focus */
*:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring) !important;
    border-radius: 8px;
    z-index: 999;
}

/* Larger focus for TV */
.tv-mode *:focus-visible {
    box-shadow: 0 0 0 4px #e50914, 0 0 20px rgba(229,9,20,0.6) !important;
    transform: scale(1.05);
    transition: transform 0.15s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); }
:root.light .theme-toggle { background: rgba(0,0,0,0.08); }
:root.light .theme-toggle:hover { background: rgba(0,0,0,0.15); }

/* TV Mode indicator */
.tv-badge {
    background: #e50914;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: none;
}
.tv-mode .tv-badge { display: inline-block; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #777; }

/* ============================================
   NAVBAR (Minimal - Logo + Search only)
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 56px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.85) 100%);
    transition: background 0.4s;
}

.navbar.scrolled {
    background: rgb(20, 20, 20);
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -1px;
    flex-shrink: 0;
    font-family: "Inter", sans-serif;
}
.logo .red { color: #FF0000; }
.logo .white { color: #FFFFFF; }

.nav-right {
    display: flex;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: var(--transition);
}

.search-box.active {
    background: rgba(0,0,0,0.75);
    border-color: #fff;
}

.search-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.search-box.active input {
    width: 200px;
    padding: 8px 12px 8px 0;
}

/* ============================================
   GENRE NAV BAR (Website mode - clean text)
   ============================================ */
/* Genre dropdown */
.genre-dropdown {
    position: relative;
    display: inline-block;
}

.genre-dropdown-menu {
    display: none;
    position: fixed;
    top: 50px;
    left: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 160px;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    padding: 6px 0;
    margin-top: 4px;
}

/* hover removed - using JS mouseenter/mouseleave with dynamic positioning */
.genre-dropdown-menu-open {
    display: block !important;
}

.genre-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.genre-dropdown-menu a:hover {
    background: #333;
    color: white;
}

.genre-nav {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    padding: 0 16px;
}

.genre-nav::-webkit-scrollbar {
    display: none;
}

.genre-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    padding: 8px 14px;
    flex-shrink: 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.genre-link:hover,
.genre-link:active {
    color: #fff;
}

.genre-link.active {
    color: #fff;
    font-weight: 700;
}

/* ============================================
   COUNTRY NAV BAR (Website mode - below genre)
   ============================================ */
.country-nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0 16px;
}

.country-nav::-webkit-scrollbar {
    display: none;
}

.country-link {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    padding: 8px 12px;
    flex-shrink: 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.country-link:hover,
.country-link:active {
    color: rgba(255, 255, 255, 0.8);
}

.country-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   GENRE STRIP BAR (Website mode)
   ============================================ */
.genre-strip {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(15, 15, 15, 0.98);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 6px 12px 2px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.strip-row {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    padding: 2px 0;
    -webkit-overflow-scrolling: touch;
}

.strip-row::-webkit-scrollbar {
    display: none;
}

.strip-chip {
    display: inline-block;
    padding: 5px 12px;
    margin-right: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.strip-chip:hover,
.strip-chip:active {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.25);
}

.strip-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

/* ============================================
   COUNTRY STRIP BAR (Website mode)
   ============================================ */
.country-strip {
    position: fixed;
    top: calc(56px + 100px);
    left: 0;
    right: 0;
    z-index: 998;
    background: rgba(18, 18, 18, 0.98);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 6px 12px 2px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.strip-chip-country {
    display: inline-block;
    padding: 5px 12px;
    margin-right: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.strip-chip-country:hover,
.strip-chip-country:active {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}

.strip-chip-country.active {
    background: rgba(229, 9, 20, 0.15);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

main {
    padding-top: 96px; /* Height of navbar (56px) + country nav (40px) */
}

/* ============================================
   SIDEBAR DRAWER
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: #1a1a1a;
    z-index: 1002;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-content {
    padding: 8px 0;
}

.sidebar-section {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 20px 4px;
    margin: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}

.sidebar-item:hover,
.sidebar-item:active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-item.active {
    background: rgba(229, 9, 20, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-item.active .sidebar-icon {
    transform: scale(1.1);
}

.sidebar-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================================
   HERO BANNER
   ============================================ */
.hero {
    position: relative;
    height: 85vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    image-rendering: auto;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(20,20,20,0.8), transparent);
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 250px;
    background: linear-gradient(to top, #141414 0%, rgba(20,20,20,0.6) 40%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: 0 40px;
    max-width: 600px;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 12px;
    text-shadow: 2px 4px 12px rgba(0,0,0,0.8);
}

.hero-runtime {
    color: var(--text-secondary);
    font-size: 14px;
}

.hero-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 1px 2px 6px rgba(0,0,0,0.6);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rating {
    color: #46d369;
    font-weight: 700;
    font-size: 16px;
}

.year {
    color: var(--text-secondary);
    font-size: 14px;
}

.badge {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.hero-buttons {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.btn-play:hover {
    background: rgba(255,255,255,0.75);
    transform: scale(1.02);
}

.btn-info {
    background: rgba(109, 109, 110, 0.7);
    color: #fff;
}

.btn-info:hover {
    background: rgba(109, 109, 110, 0.4);
}

/* Hero Carousel Arrows */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    background: rgba(0,0,0,0.3);
    border: none;
    color: #fff;
    width: 50px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.hero:hover .hero-arrow {
    opacity: 1;
}

.hero-arrow:hover {
    background: rgba(0,0,0,0.7);
}

.hero-arrow svg {
    width: 36px;
    height: 36px;
}

.hero-arrow-left {
    left: 0;
    border-radius: 0 4px 4px 0;
}

.hero-arrow-right {
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* Hero Dots */
.hero-dots {
    position: absolute;
    bottom: 30%;
    right: 40px;
    z-index: 15;
    display: flex;
    gap: 8px;
    align-items: center;
}

.hero-dot {
    width: 12px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.hero-dot.active {
    width: 30px;
    background: #fff;
}

.hero-dot:hover {
    background: rgba(255,255,255,0.6);
}

/* ============================================
   CONTENT ROWS
   ============================================ */
.rows-container {
    position: relative;
    z-index: 20;
    margin-top: -100px;
    padding-bottom: 60px;
    padding-top: 30px;
}

.row {
    padding: 0 20px;
    margin-bottom: 30px;
}

.row-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.row-slider {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 16px 0 30px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    -webkit-box-orient: horizontal;
}

.row-slider::-webkit-scrollbar {
    display: none;
}

/* Scroll Buttons */
.row-wrapper {
    position: relative;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

.scroll-btn:hover {
    background: rgba(0,0,0,0.85);
    transform: translateY(-50%) scale(1.1);
}

.scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.scroll-btn-left {
    left: -8px;
}

.scroll-btn-right {
    right: -8px;
}

.scroll-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.scroll-btn-left.hidden {
    display: none;
}

.scroll-btn-right.hidden {
    display: none;
}

/* Movie Card */
.card {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: inline-block;
    width: 160px;
    cursor: pointer;
    transition: var(--transition);
    scroll-snap-align: start;
    position: relative;
    vertical-align: top;
    white-space: normal;
}

.card:hover {
    transform: scale(1.12);
    z-index: 50;
}

.card-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 6px;
    background: #222;
    box-shadow: var(--shadow-card);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 8px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    border-radius: 0 0 6px 6px;
    opacity: 0;
    transition: var(--transition);
}

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

.card-title {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-rating {
    font-size: 10px;
    color: #46d369;
    font-weight: 600;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results {
    padding: 220px 20px 60px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

/* ============================================
   MODAL - DETAIL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 16px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--bg-modal);
    border-radius: 12px;
    width: 100%;
    max-width: 850px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    animation: slideUp 0.4s ease;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(0,0,0,0.9);
    transform: rotate(90deg);
}

.modal-hero {
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-modal) 0%, transparent 60%);
}

.modal-hero-content {
    position: relative;
    z-index: 5;
    padding: 24px;
}

.modal-hero-content h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-body {
    padding: 16px 24px 24px;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.match {
    color: #46d369;
    font-weight: 700;
    font-size: 14px;
}

.badge-hd {
    border: 1px solid var(--text-muted);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.badge-sub {
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}

.modal-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal-details {
    display: flex;
    gap: 30px;
}

.label {
    color: var(--text-muted);
}

.modal-details p {
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   VIDEO PLAYER
   ============================================ */
.player-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-overlay.active {
    display: flex;
}

.player-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(0,0,0,0.7);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.player-close:hover {
    background: rgba(255,255,255,0.2);
}

#videoPlayer {
    width: 100%;
    max-height: 70vh;
    background: #000;
    display: none;
}

#videoPlayer.active {
    display: block;
}

.player-info {
    text-align: center;
    padding: 30px;
    max-width: 500px;
    width: 100%;
}

.player-info.hidden {
    display: none;
}

.player-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.player-note {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.player-inputs {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.12);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(229, 9, 20, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-ring {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 40px 20px 30px;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, rgba(229,9,20,0.03) 100%);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.footer-logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.footer-logo .red { color: #FF0000; }
.footer-logo .white { color: #FFFFFF; }

.footer-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 0;
    font-weight: 400;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ============================================
   SERIES - SEASON TABS & EPISODE GRID
============================================ */
.series-section {
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 16px;
}

.series-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.season-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.season-tabs::-webkit-scrollbar {
    display: none;
}

.season-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.season-tab:hover,
.season-tab:active {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.25);
}

.season-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.episode-count {
    background: rgba(255,255,255,0.15);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.season-tab.active .episode-count {
    background: rgba(255,255,255,0.25);
}

.episode-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 450px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    padding-right: 4px;
}

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

.episode-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.episode-card {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.04);
}

.episode-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    transform: translateX(4px);
}

.episode-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.episode-card:hover .episode-number {
    background: var(--primary);
    color: #fff;
}

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

.episode-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-runtime {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.episode-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
    transition: var(--transition);
    align-self: center;
}

.episode-card:hover .episode-play-icon {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
}

.episode-play-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    margin-left: 2px;
}

/* No episodes state */
.no-episodes {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.no-episodes-icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Episode iframe player */
.episode-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.episode-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.episode-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.episode-player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 10px;
}

.episode-player-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.episode-player-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.episode-player-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ============================================
RESPONSIVE - Portrait Mobile First
   ============================================ */

/* Tablet */
@media (min-width: 768px) {
    .navbar { padding: 0 40px; }
    .genre-strip { padding: 8px 40px 4px; }
    .country-strip { padding: 8px 40px 4px; }
    .hero-content { padding: 0 60px; }
    .hero-title { font-size: 52px; }
    .hero-desc { font-size: 15px; }
    .row { padding: 0 40px; }
    .card { width: 200px; }
    .card-img { height: 300px; }
    .search-box.active input { width: 260px; }
    .rows-container { margin-top: -100px; }
    .search-results { padding: 250px 40px 60px; }
    .results-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
}

/* Large desktop */
@media (min-width: 1200px) {
    .row { padding: 0 60px; }
    .hero-content { padding: 0 80px; }
}

/* Small mobile */
@media (max-width: 480px) {
    .card { width: 110px; }
    .card-img { height: 165px; }
    .hero-title { font-size: 24px; }
    .hero { height: 60vh; min-height: 350px; }
    .strip-chip, .strip-chip-country {
        padding: 4px 10px;
        font-size: 10px;
    }
    .hero-dots { right: 16px; }
    .hero-content { padding: 0 16px; }
    .btn { padding: 8px 16px; font-size: 12px; }
    .search-box.active input { width: 140px; }
}

/* ============================================
   ANDROID TV MODE - 10-foot UI
   ============================================ */
.tv-mode .navbar { height: 70px; padding: 0 30px; }
.tv-mode .logo { font-size: 32px; }
.tv-mode .search-box input { font-size: 18px; padding: 12px 16px; }
.tv-mode .hamburger-btn { padding: 12px; }
.tv-mode .hamburger-btn svg { width: 28px; height: 28px; }

/* TV Movie Cards - Bigger */
.tv-mode .movie-card {
    width: 220px;
    min-width: 220px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tv-mode .movie-card:focus-visible {
    transform: scale(1.12);
    box-shadow: 0 0 0 4px #e50914, 0 0 25px rgba(229,9,20,0.5) !important;
    z-index: 100;
}
.tv-mode .movie-card .card-img { height: 320px; }
.tv-mode .movie-card .card-title { font-size: 15px; }

/* TV Hero Section */
.tv-mode .hero { min-height: 65vh; }
.tv-mode .hero-title { font-size: 52px; }
.tv-mode .hero-desc { font-size: 18px; }
.tv-mode .hero-buttons .btn { 
    padding: 16px 32px; 
    font-size: 18px; 
    border-radius: 12px;
}
.tv-mode .hero-buttons .btn:focus-visible {
    transform: scale(1.08);
}

/* TV Sidebar */
.tv-mode .sidebar { width: 350px; }
.tv-mode .sidebar-item { 
    padding: 16px 20px; 
    font-size: 18px; 
}
.tv-mode .sidebar-section-title { font-size: 16px; }

/* TV Modal */
.tv-mode .modal { 
    max-width: 900px; 
    border-radius: 16px; 
}
.tv-mode .modal .btn { 
    padding: 14px 28px; 
    font-size: 16px; 
}
.tv-mode .modal-desc { font-size: 16px; }

/* TV Row scrolling */
.tv-mode .row-scroll { 
    gap: 16px; 
    scroll-snap-type: x mandatory;
}
.tv-mode .movie-card { scroll-snap-align: start; }

/* TV Footer */
.tv-mode .footer { padding: 30px; }
.tv-mode .footer-logo { font-size: 28px; }

/* D-pad Navigation helpers */
.tv-mode .row-scroll:focus-within {
    scroll-behavior: smooth;
}

/* TV Search Results */
.tv-mode .results-grid {
    gap: 20px;
}
.tv-mode .results-grid .movie-card {
    width: 200px;
}

/* Loading spinner bigger for TV */
.tv-mode .spinner {
    width: 60px;
    height: 60px;
    border-width: 5px;
}

/* Double Tap Seek Overlay */
.seek-overlay {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.seek-overlay.left { left: 20px; }
.seek-overlay.right { right: 20px; }
.seek-overlay.show { opacity: 1; }
.seek-overlay svg { width: 36px; height: 36px; fill: white; }
.seek-overlay span { color: white; font-size: 13px; margin-top: 4px; font-weight: 600; }

.tv-mode .seek-overlay {
    width: 160px;
    height: 160px;
}
.tv-mode .seek-overlay svg { width: 48px; height: 48px; }
.tv-mode .seek-overlay span { font-size: 18px; }
