/* ================================
   YKSIDE — Design System
   Dark cinematic streaming platform
   ================================ */

:root {
  /* Core Palette */
  --bg-void: #040408;
  --bg-deep: #08080f;
  --bg-surface: #0e0e1a;
  --bg-raised: #14141f;
  --bg-card: #1a1a28;
  --bg-hover: #1e1e2e;

  /* Accent — electric violet/purple spectrum */
  --accent: #a855f7;
  --accent-bright: #c084fc;
  --accent-dim: #7c3aed;
  --accent-glow: rgba(168, 85, 247, 0.35);
  --accent-subtle: rgba(168, 85, 247, 0.1);

  /* Gold for premium elements */
  --gold: #f59e0b;
  --gold-dim: rgba(245, 158, 11, 0.3);

  /* Typography */
  --text-primary: #f8f8ff;
  --text-secondary: #a0a0b8;
  --text-muted: #60607a;
  --text-accent: #c084fc;

  /* Glass */
  --glass-bg: rgba(14, 14, 26, 0.7);
  --glass-border: rgba(168, 85, 247, 0.15);
  --glass-blur: blur(20px);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Nav */
  --nav-h: 68px;

  /* Shadows */
  --shadow-card: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-glow: 0 0 40px var(--accent-glow);
}

/* ====== RESET & BASE ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100%;
  overflow-x: hidden;
}

/* Cinematic text rendering */
h1, h2, h3, h4, h5 {
  font-family: 'Syne', 'Inter', sans-serif;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ====== NAVIGATION ====== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-xl);
  transition: background var(--t-med), backdrop-filter var(--t-med);
}

.nav.scrolled {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent-bright), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--t-fast);
  position: relative;
}

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-search-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  display: grid; place-items: center;
  transition: all var(--t-fast);
  color: var(--text-secondary);
}
.nav-search-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-dim);
  color: var(--accent-bright);
}

/* Mobile nav toggle */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
}

.nav-hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--t-med);
}

@media (max-width: 768px) {
  .nav { padding: 0 var(--space-md); gap: var(--space-md); }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: var(--nav-h);
    left: 0; right: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-md);
    gap: var(--space-sm);
    z-index: 999;
  }
}

/* ====== PAGE WRAPPER ====== */
.page { min-height: 100vh; padding-top: var(--nav-h); }

/* ====== HERO SECTION ====== */
.hero {
  position: relative;
  height: 90vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  transition: opacity 1s ease;
}

.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(4,4,8,0.1) 0%,
    rgba(4,4,8,0.3) 40%,
    rgba(4,4,8,0.85) 75%,
    var(--bg-void) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  max-width: 700px;
  animation: hero-slide-up 0.8s var(--t-spring) both;
}

@keyframes hero-slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--accent-subtle);
  border: 1px solid var(--glass-border);
  color: var(--accent-bright);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: var(--r-full);
  margin-bottom: var(--space-md);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.hero-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
}

.hero-genre, .hero-year {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: var(--space-lg);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  box-shadow: 0 4px 20px var(--accent-glow);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  background: var(--glass-bg);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  transition: all var(--t-fast);
}

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

/* Hero slider dots */
.hero-dots {
  position: absolute;
  bottom: var(--space-xl);
  right: var(--space-xl);
  display: flex;
  gap: var(--space-sm);
  z-index: 3;
}

.hero-dot {
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all var(--t-med);
}

.hero-dot.active {
  width: 28px;
  background: var(--accent);
}

/* ====== CONTENT ROWS ====== */
.section {
  padding: var(--space-xl) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  margin-bottom: var(--space-lg);
}

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

.section-title span {
  color: var(--accent-bright);
}

.section-see-all {
  color: var(--accent-bright);
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity var(--t-fast);
}
.section-see-all:hover { opacity: 1; }

/* Horizontal scroll row */
.scroll-row {
  display: flex;
  gap: var(--space-md);
  padding: 0 var(--space-xl) var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: var(--space-xl);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }

/* ====== CARDS ====== */
.card {
  flex-shrink: 0;
  width: 180px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-med);
  scroll-snap-align: start;
  position: relative;
}

.card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: var(--accent-dim);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-dim), var(--shadow-glow);
  z-index: 10;
}

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

.card-info {
  padding: var(--space-sm);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.card-rating {
  color: var(--gold);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 2px;
}

.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--t-med);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-sm);
}

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

.card-play-btn {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: var(--accent);
  display: grid; place-items: center;
  margin: 0 auto var(--space-sm);
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform var(--t-spring);
}

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

/* Wide card (16:9) */
.card-wide {
  width: 280px;
}

.card-wide .card-poster {
  aspect-ratio: 16/9;
}

/* ====== SKELETON LOADERS ====== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-hover) 50%, var(--bg-raised) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r-md);
}

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

.skeleton-card {
  flex-shrink: 0;
  width: 180px;
}

.skeleton-poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--r-md) var(--r-md) 0 0;
}

.skeleton-text {
  height: 14px;
  margin: var(--space-sm) var(--space-sm) 4px;
  border-radius: var(--r-sm);
}

.skeleton-text-sm {
  height: 11px;
  margin: 0 var(--space-sm) var(--space-sm);
  width: 60%;
  border-radius: var(--r-sm);
}

/* ====== SEARCH OVERLAY ====== */
.search-overlay {
  position: fixed; inset: 0;
  z-index: 2000;
  background: rgba(4, 4, 8, 0.95);
  backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med);
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 2px solid var(--accent);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-xl);
}

.search-input-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--text-primary);
  caret-color: var(--accent);
}

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

.search-close {
  color: var(--text-secondary);
  padding: var(--space-sm);
  border-radius: var(--r-md);
  transition: color var(--t-fast);
}

.search-close:hover { color: var(--text-primary); }

.search-results {
  flex: 1;
  overflow-y: auto;
}

.search-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* ====== CHANNEL CARDS ====== */
.ch-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
}

.ch-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent-dim);
}

.ch-logo {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  object-fit: contain;
  background: var(--bg-raised);
  flex-shrink: 0;
}

.ch-logo-placeholder {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  background: var(--bg-raised);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--accent);
}

.ch-info { min-width: 0; }

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

.ch-group {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ====== PLAYER STYLES ====== */
.yk-player {
  position: relative;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  width: 100%;
}

#yk-video {
  width: 100%; height: 100%;
  display: block;
  object-fit: contain;
}

.yk-player-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
}

.yk-player-top {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  transition: opacity 0.3s;
}

.yk-player-title {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.yk-overlay-center {
  flex: 1;
  display: grid;
  place-items: center;
}

.yk-loading-ring {
  width: 56px; height: 56px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.yk-play-btn-big {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(168,85,247,0.9);
  display: grid; place-items: center;
  box-shadow: 0 4px 30px var(--accent-glow);
  transition: all var(--t-spring);
}

.yk-play-btn-big svg { width: 32px; height: 32px; fill: white; margin-left: 4px; }

.yk-controls {
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  transition: opacity 0.3s;
}

.yk-progress-bar {
  position: relative;
  height: 4px;
  margin-bottom: var(--space-md);
  cursor: pointer;
}

.yk-progress-bg {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.yk-progress-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s;
}

.yk-progress-handle {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: white;
  border-radius: 50%;
  left: 0%;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.yk-progress-bar:hover .yk-progress-handle { opacity: 1; }
.yk-progress-bar:hover .yk-progress-bg,
.yk-progress-bar:hover .yk-progress-fill { height: 6px; }

.yk-controls-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.yk-btn-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.8);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.yk-btn-icon:hover { color: white; background: rgba(255,255,255,0.1); }
.yk-btn-icon svg { width: 20px; height: 20px; }

.yk-vol-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.yk-vol-slider {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}

.yk-time {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  margin-left: var(--space-sm);
}

.yk-error-msg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  color: var(--text-secondary);
  text-align: center;
  padding: var(--space-xl);
}

.yk-error-msg svg { width: 48px; height: 48px; color: var(--accent); }

.btn-retry {
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border-radius: var(--r-md);
  font-weight: 600;
  transition: all var(--t-fast);
}
.btn-retry:hover { background: var(--accent-bright); }

/* ====== MODAL ====== */
.modal-backdrop {
  position: fixed; inset: 0;
  z-index: 1500;
  background: rgba(4, 4, 8, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med);
}

.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--t-spring);
}

.modal-backdrop.open .modal { transform: scale(1) translateY(0); }

.modal-hero {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

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

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

.modal-close {
  position: absolute; top: var(--space-md); right: var(--space-md);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  display: grid; place-items: center;
  color: white;
  transition: background var(--t-fast);
  z-index: 2;
}
.modal-close:hover { background: rgba(0,0,0,0.9); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: var(--space-lg) var(--space-xl) var(--space-xl); }

.modal-title { font-size: 1.8rem; font-weight: 800; margin-bottom: var(--space-md); }

.modal-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.badge {
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-subtle);
  color: var(--accent-bright);
  border: 1px solid var(--glass-border);
}

.modal-desc {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

/* ====== TABS ====== */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-raised);
  padding: 4px;
  border-radius: var(--r-lg);
  margin-bottom: var(--space-xl);
}

.tab {
  flex: 1;
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--t-fast);
  text-align: center;
}

.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.tab:hover:not(.active) { color: var(--text-primary); }

/* ====== FILTER CHIPS ====== */
.filter-row {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: 0 var(--space-xl) var(--space-md);
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.chip:hover { border-color: var(--accent-dim); color: var(--text-primary); }
.chip.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-bright); }

/* ====== GLASS CARD ====== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
}

/* ====== AMBIENT BG ====== */
.ambient-bg {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.06;
  animation: orb-drift 20s ease-in-out infinite alternate;
}

.orb-1 {
  width: 600px; height: 600px;
  background: var(--accent);
  top: -200px; left: -100px;
}

.orb-2 {
  width: 400px; height: 400px;
  background: #3b82f6;
  bottom: -100px; right: -100px;
  animation-duration: 25s;
  animation-delay: -10s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: var(--gold);
  top: 50%; left: 60%;
  animation-duration: 18s;
  animation-delay: -5s;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.1); }
}

/* ====== TOAST ====== */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 340px;
  animation: toast-in 0.3s var(--t-spring) both;
  pointer-events: all;
}

.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ====== EMPTY STATE ====== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
  gap: var(--space-md);
}

.empty-state svg { width: 64px; height: 64px; opacity: 0.4; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-secondary); }
.empty-state p { font-size: 0.875rem; max-width: 300px; }

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

.fade-in {
  animation: fade-in 0.4s ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-md);
  padding: 0 var(--space-xl);
}

@media (max-width: 480px) {
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--space-sm); padding: 0 var(--space-md); }
  .section-header { padding: 0 var(--space-md); }
  .scroll-row { padding: 0 var(--space-md) var(--space-sm); }
  .hero-content { padding: var(--space-2xl) var(--space-md) var(--space-lg); }
  .hero-actions { gap: var(--space-sm); }
  .btn-primary, .btn-secondary { padding: 10px 20px; font-size: 0.875rem; }
  .filter-row { padding: 0 var(--space-md) var(--space-sm); }
  .toast-container { bottom: var(--space-md); right: var(--space-md); left: var(--space-md); }
}

/* ====== PAGE TRANSITIONS ====== */
.page-enter {
  animation: page-enter 0.5s var(--t-spring) both;
}

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

/* ====== FOOTER ====== */
footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--glass-border);
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: var(--space-2xl);
}

footer a { color: var(--accent-bright); }

/* ====== LOADING SCREEN ====== */
#app-loading {
  position: fixed; inset: 0;
  background: var(--bg-void);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  transition: opacity 0.6s ease;
}

#app-loading.done { opacity: 0; pointer-events: none; }

.loading-logo {
  font-family: 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--accent-bright), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse-logo 2s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.04); }
}

.loading-bar-wrap {
  width: 200px;
  height: 3px;
  background: var(--bg-raised);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright));
  border-radius: 2px;
  animation: loading-bar 2s ease-in-out;
}

@keyframes loading-bar {
  from { width: 0%; }
  to { width: 100%; }
}

/* ====== LIVE TV PAGE ====== */
.live-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

.live-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.live-sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--glass-border);
}

.live-search-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 10px var(--space-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--t-fast);
}

.live-search-input:focus { border-color: var(--accent-dim); }

.live-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.live-channel-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
  border: 1px solid transparent;
}

.live-channel-item:hover { background: var(--bg-raised); }
.live-channel-item.active {
  background: var(--accent-subtle);
  border-color: var(--accent-dim);
}

.live-channel-logo {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  object-fit: contain;
  background: var(--bg-void);
  flex-shrink: 0;
}

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

.live-channel-group {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.live-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
}

.live-player-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: #000;
}

.live-info-bar {
  background: var(--bg-surface);
  border-top: 1px solid var(--glass-border);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: live-pulse 1.5s ease infinite;
  flex-shrink: 0;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

@media (max-width: 900px) {
  .live-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  .live-main { min-height: 250px; }
  .live-sidebar { max-height: 60vh; }
}

/* ====== GLOBE ====== */
#globe-container {
  width: 100%;
  height: 70vh;
  min-height: 400px;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: radial-gradient(ellipse at center, #0c0c1a 0%, var(--bg-void) 70%);
}

#globe-canvas { display: block; width: 100%; height: 100%; }

.globe-tooltip {
  position: absolute;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: var(--space-md) var(--space-lg);
  pointer-events: none;
  font-size: 0.875rem;
  transform: translate(-50%, -110%);
  transition: opacity var(--t-fast);
  white-space: nowrap;
  z-index: 10;
}

.globe-country-panel {
  position: absolute;
  right: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: var(--space-lg);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 10;
  animation: slide-in-right 0.3s var(--t-spring) both;
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateY(-50%) translateX(30px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* ====== SETTINGS ====== */
.settings-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl);
}

.settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.settings-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--glass-border);
  color: var(--accent-bright);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.setting-row:last-child { border-bottom: none; }

.setting-label { font-size: 0.9rem; font-weight: 500; }
.setting-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px; height: 24px;
}

.toggle input { display: none; }

.toggle-track {
  position: absolute; inset: 0;
  background: var(--bg-raised);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--t-fast);
  border: 1px solid var(--glass-border);
}

.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform var(--t-fast);
}

.toggle input:checked + .toggle-track::after { transform: translateX(20px); }

/* ====== UPLOAD PAGE ====== */
.upload-dropzone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--r-xl);
  padding: var(--space-2xl);
  text-align: center;
  transition: all var(--t-med);
  cursor: pointer;
  background: var(--bg-surface);
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.upload-dropzone svg { width: 64px; height: 64px; color: var(--accent); margin: 0 auto var(--space-lg); }

.upload-dropzone h3 { font-size: 1.3rem; margin-bottom: var(--space-sm); }
.upload-dropzone p { color: var(--text-muted); font-size: 0.875rem; }

.url-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 14px var(--space-lg);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--t-fast);
  margin-bottom: var(--space-md);
}

.url-input:focus { border-color: var(--accent-dim); }

/* ====== MOVIES PAGE ====== */
.movies-header {
  padding: var(--space-xl) var(--space-xl) 0;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.page-subtitle { color: var(--text-muted); margin-bottom: var(--space-xl); }
