/* ═══════════════════════════════════════════════════════════════════════════
   CINE STREAM - Professional Movie Streaming UI
   Theme: Cinematic Dark + Light | Typography: DM Sans + Unbounded
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Unbounded:wght@400;600;700;900&display=swap');

:root {
  /* ═══════ Dark Theme (Default) ═══════ */
  --bg-primary: #050508;
  --bg-secondary: #0a0c12;
  --bg-tertiary: #12141c;
  --bg-elevated: #1a1e2a;
  --bg-hover: #222836;
  
  --surface-card: rgba(20, 24, 36, 0.6);
  --surface-glass: rgba(20, 24, 36, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  
  --accent-primary: #e11d48;
  --accent-secondary: #f43f5e;
  --accent-glow: rgba(225, 29, 72, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-default: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-active: rgba(225, 29, 72, 0.5);
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  
  --header-height: 64px;
  --tab-bar-height: 72px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ═══════ Light Theme ═══════ */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-elevated: #ffffff;
  --bg-hover: #e2e8f0;
  
  --surface-card: rgba(255, 255, 255, 0.7);
  --surface-glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-default: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.16);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
}

/* ═══════ Global Reset & Base ═══════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom));
}

/* ═══════ App Container ═══════ */
.app-container {
  min-height: 100vh;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent 60%),
    var(--bg-primary);
}

/* ═══════ Header ═══════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 2rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.global-search {
  width: 100%;
  height: 44px;
  padding: 0 4rem 0 2.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  transition: all var(--transition-base);
}

.global-search::placeholder {
  color: var(--text-muted);
}

.global-search:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-shortcut {
  position: absolute;
  right: 1rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.sun-icon { display: block; }
.moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ═══════ Tab Bar ═══════ */
.tab-bar {
  position: fixed;
  bottom: var(--safe-area-bottom);
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
  height: calc(var(--tab-bar-height) + var(--safe-area-bottom));
  padding: 0.5rem 1rem var(--safe-area-bottom);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
}

.tab-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

.tab-item:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.tab-item.active {
  color: var(--accent-primary);
  background: rgba(225, 29, 72, 0.1);
}

.tab-item.active svg {
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.badge {
  position: absolute;
  top: 0;
  right: 0.5rem;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ═══════ Main Content ═══════ */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem max(2rem, calc(var(--tab-bar-height) * 0.35 + 1rem));
}

/* Ad Banners — overflow visible so network iframes aren’t clipped; many fills only on HTTPS live domain */
.ad-banner-top,
.ad-banner-bottom,
.ad-banner-sidebar {
  margin: 1rem 0;
  min-height: 90px;
  max-width: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: visible;
  box-sizing: border-box;
}

.ad-native-slot {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 300×160 high-performance block (below leaderboard) */
.ad-slot-rectangle {
  width: 100%;
  max-width: 160px;
  min-height: 300px;
  margin: 0.75rem auto 1.25rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: visible;
}

@media (max-width: 480px) {
  .ad-slot-rectangle {
    max-width: 100%;
  }
}

.ad-banner-top iframe,
.ad-banner-sidebar iframe,
.ad-banner-bottom iframe {
  max-width: 100%;
}

.tab-content {
  display: none;
  animation: fadeIn var(--transition-base) ease-out;
}

.tab-content.active {
  display: block;
}

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

/* ═══════ Hero Section ═══════ */
.hero-section {
  position: relative;
  margin: 1rem 0 2rem;
  padding: 2rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-image: url('https://image.tmdb.org/t/p/original/xOMo8BRKlP4eUZFDEp6fVgLQbf.jpg');
  background-size: cover;
  background-position: center top;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-primary) 0%,
    rgba(5, 5, 8, 0.9) 30%,
    rgba(5, 5, 8, 0.6) 60%,
    transparent 100%
  );
}

[data-theme="light"] .hero-gradient {
  background: linear-gradient(
    to top,
    var(--bg-primary) 0%,
    rgba(248, 250, 252, 0.95) 35%,
    rgba(248, 250, 252, 0.65) 65%,
    transparent 100%
  );
}

.hero-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  min-height: 360px;
}

.hero-tag {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  margin: 0.75rem 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.hero-meta span {
  display: flex;
  align-items: center;
}

.hero-meta .rating {
  color: #fbbf24;
  font-weight: 600;
}

.hero-meta .quality {
  padding: 0.125rem 0.375rem;
  background: rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-overview {
  max-width: 48ch;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

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

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-secondary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
}

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

/* 3D Hero Card */
.hero-3d-card {
  perspective: 1000px;
}

.movie-card-3d {
  position: relative;
  width: 280px;
  height: 400px;
  border-radius: var(--radius-lg);
  transform: rotateY(-12deg) rotateX(6deg);
  transform-style: preserve-3d;
  transition: transform var(--transition-slow);
}

.movie-card-3d::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: linear-gradient(135deg, var(--accent-primary), #9333ea);
  border-radius: calc(var(--radius-lg) + 8px);
  transform: translateZ(-20px);
  filter: blur(20px);
  opacity: 0.5;
}

.movie-card-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--poster) center/cover;
  border-radius: var(--radius-lg);
  transform: translateZ(40px);
  box-shadow: var(--shadow-lg);
}

.card-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 50%,
    transparent 100%
  );
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.hero-section:hover .movie-card-3d {
  transform: rotateY(-6deg) rotateX(2deg);
}

/* ═══════ Categories Section ═══════ */
.categories-section {
  margin-bottom: 2rem;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

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

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

/* Content Row */
.content-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

/* Movie Cards */
.movie-card {
  flex: 0 0 auto;
  width: 160px;
  scroll-snap-align: start;
  cursor: pointer;
}

.poster-wrapper {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  transition: all var(--transition-base);
}

.poster-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.poster-wrapper .no-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.movie-card:hover .poster-wrapper {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.movie-card:hover .poster-wrapper img {
  transform: scale(1.05);
}

.card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--transition-base);
}

.movie-card:hover .card-actions {
  opacity: 1;
  transform: translateY(0);
}

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-action-btn:hover {
  background: var(--accent-primary);
  transform: scale(1.1);
}

.card-action-btn.saved {
  color: var(--accent-primary);
}

.card-rating {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-info {
  padding: 0.75rem 0.25rem 0;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-year {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══════ Browse Section ═══════ */
.filters-section {
  margin-bottom: 1.5rem;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 140px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.filter-group select {
  height: 40px;
  padding: 0 2rem 0 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-clear {
  align-self: flex-end;
}

.status-text {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.load-more-btn {
  min-width: 180px;
}

/* ═══════ Watch Section ═══════ */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
}

.player-section {
  min-width: 0;
}

.video-player {
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.player-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 100%;
  color: var(--text-muted);
}

.player-placeholder .player-icon {
  font-size: 3rem;
  color: var(--accent-primary);
}

.now-playing-info {
  margin-top: 1rem;
}

.np-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.np-meta {
  color: var(--text-secondary);
}

.details-sidebar {
  background: var(--surface-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.details-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-default);
}

.details-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.details-content {
  padding: 1rem;
}

/* ═══════ Saved Section ═══════ */
.saved-section {
  min-height: 60vh;
}

.saved-count {
  padding: 0.375rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  font-size: 4rem;
  color: var(--accent-primary);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 32ch;
}

/* ═══════ Toast ═══════ */
.toast {
  position: fixed;
  bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.75rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastIn 0.3s ease-out;
}

.toast.hidden {
  display: none;
}

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

/* ═══════ Responsive ═══════ */
@media (max-width: 1024px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }
  
  .details-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .header-center {
    display: none;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
  }
  
  .hero-3d-card {
    display: none;
  }
  
  .movie-card-3d {
    display: none;
  }
  
  .filters-bar {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-group select {
    width: 100%;
  }
  
  .filter-clear {
    width: 100%;
  }
  
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 1.5rem 1rem;
  }
  
  .hero-actions {
    flex-direction: column;
  }
  
  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
  }
  
  .movie-card {
    width: 140px;
  }
  
  .section-title {
    font-size: 1.125rem;
  }
}

/* ═══════ Animation Utilities ═══════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════ Scrollbar ═══════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ═══════ Focus Styles ═══════ */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ═══════ Utilities ═══════ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════ Player Controls (Old - Hidden) ═══════ */
.player-controls {
  display: none !important;
}

/* ═══════ TV season / episode controls ═══════ */
.tv-controls {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.tv-controls-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tv-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  align-items: end;
}

.tv-nav-buttons {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tv-control-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.tv-field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tv-select {
  height: 44px;
  width: 100%;
  padding: 0 2rem 0 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  min-width: 0;
}

.tv-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.tv-nav-btn {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.tv-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 480px) {
  .tv-controls-grid {
    grid-template-columns: 1fr;
  }
  .tv-nav-buttons {
    grid-column: auto;
  }
}

.player-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.setting-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.setting-toggle:hover {
  color: var(--text-primary);
}

.auto-next-countdown {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.auto-next-countdown .cancel-btn {
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auto-next-countdown .cancel-btn:hover {
  background: var(--accent-primary);
  color: white;
}

/* ═══════ Progress Bar ═══════ */
.progress-bar {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--surface-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-percent {
  font-weight: 600;
  color: var(--text-primary);
}

.progress-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ═══════ Settings Button ═══════ */
.settings-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-btn svg {
  width: 18px;
  height: 18px;
}

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

/* ═══════ Settings Panel ═══════ */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
  z-index: 200;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
}

.settings-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
}

.close-settings {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.close-settings:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.settings-content {
  padding: 1.25rem;
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group > label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

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

.setting-row span {
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.setting-row select {
  height: 36px;
  padding: 0 2rem 0 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  min-width: 100px;
}

.setting-row input[type="checkbox"] {
  width: 44px;
  height: 24px;
  appearance: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast);
}

.setting-row input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.setting-row input[type="checkbox"]:checked {
  background: var(--accent-primary);
}

.setting-row input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.color-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-btn {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: var(--text-primary);
}

.resume-options .no-resume {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

.resume-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.resume-item img {
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

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

.resume-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resume-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ═══════ Custom Player Controls Bar ═══════ */
.player-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
  padding: 2rem 1rem 1rem;
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 50;
}

.video-player:hover .player-controls-bar,
.player-controls-bar:hover,
.player-controls-bar.active {
  opacity: 1;
}

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

.now-playing-mini {
  font-size: 0.875rem;
  color: white;
  font-weight: 500;
}

.controls-right {
  display: flex;
  gap: 0.5rem;
}

.controls-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

.skip-btn {
  width: 44px;
  height: 44px;
}

.skip-btn svg {
  width: 24px;
  height: 24px;
}

.play-pause-btn {
  width: 56px;
  height: 56px;
  background: var(--accent-primary);
}

.play-pause-btn:hover {
  background: var(--accent-secondary);
}

.play-pause-btn svg {
  width: 24px;
  height: 24px;
}

.controls-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-current,
.time-duration {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  min-width: 40px;
  font-variant-numeric: tabular-nums;
}

.time-current {
  text-align: right;
}

.progress-slider {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
}

.progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
}

.progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 10%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
}

.progress-thumb {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.progress-slider:hover .progress-thumb {
  opacity: 1;
}

.controls-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.controls-actions .control-btn {
  width: 40px;
  height: 40px;
}

.controls-actions .control-btn svg {
  width: 20px;
  height: 20px;
}

.volume-slider {
  width: 0;
  opacity: 0;
  transition: all var(--transition-base);
  accent-color: var(--accent-primary);
}

.volume-btn:hover .volume-slider {
  width: 60px;
  opacity: 1;
  margin-left: 0.5rem;
}

.volume-btn.muted .volume-high {
  display: none;
}

.volume-btn.muted .volume-mute {
  display: block;
}

.fullscreen-btn.active .fullscreen-enter {
  display: none;
}

.fullscreen-btn.active .fullscreen-exit {
  display: block;
}

.quality-btn span {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
}