/*
Theme Name: CimaStation
Theme URI: https://cimastation.local
Author: CimaStation
Description: Premium streaming platform inspired by Netflix, Shahid & Disney+. Arabic-first RTL design with full responsive support.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GPL v2 or later
Text Domain: cimastation
*/

:root {
  --bg-primary: #000000;
  --bg-surface: #0a0a12;
  --bg-elevated: #111118;
  --bg-card: #0f0f18;
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.2);
  --accent-secondary: #0ea5e9;
  --rating: #22C55E;
  --imdb: #FACC15;
  --border-color: #1a1a28;
  --overlay: rgba(0, 0, 0, 0.94);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.6);
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --navbar-blur: rgba(0, 0, 0, 0.88);
  --surface-overlay: rgba(255,255,255,0.06);
  --hover-bg: rgba(56,189,248,0.1);
  --border-subtle: rgba(255,255,255,0.08);
  --border-subtle-2: rgba(255,255,255,0.12);
  --text-on-overlay: #fff;
  --btn-ghost-hover: rgba(255,255,255,0.15);
  --card-overlay-bg: rgba(0,0,0,0.65);
  --gradient-scrolled: rgba(0,0,0,0.96);
  --glow-red: rgba(229,9,20,0.3);
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #555570;
  --text-muted: #9494a6;
  --accent: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.15);
  --accent-secondary: #38bdf8;
  --border-color: #e2e2ec;
  --overlay: rgba(250, 250, 250, 0.95);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.08);
  --navbar-blur: rgba(250, 250, 250, 0.88);
  --surface-overlay: rgba(0,0,0,0.03);
  --hover-bg: rgba(14,165,233,0.08);
  --border-subtle: rgba(0,0,0,0.06);
  --border-subtle-2: rgba(0,0,0,0.1);
  --text-on-overlay: #000;
  --btn-ghost-hover: rgba(0,0,0,0.08);
  --card-overlay-bg: rgba(0,0,0,0.45);
  --gradient-scrolled: rgba(250,250,250,0.96);
  --glow-red: rgba(229,9,20,0.15);
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar { width: 6px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
/* ===== TOP BAR ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg-primary);
  padding-top: constant(safe-area-inset-top, 0px);
  padding-top: env(safe-area-inset-top, 0px);
  min-height: 72px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s ease;
}
.topbar.scrolled { background: var(--gradient-scrolled); border-bottom-color: transparent; }

/* Safari force-fix: topbar must stick to top edge, no gap */
@supports (-webkit-touch-callout: none) {
  .topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }
}

.topbar-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 clamp(12px, 3vw, 48px);
  gap: 12px;
}

/* Account Icon */
.account-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent);
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease; flex-shrink: 0;
  font-size: 1rem;
}
.account-btn:hover { outline: 2px solid var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
.account-btn.has-avatar { background: transparent; }
.account-btn.has-avatar:hover { outline: none; box-shadow: none; }
.account-btn.has-avatar .account-avatar { width: 100%; height: 100%; }

/* Search */
.search-wrap {
  flex: 1; max-width: 520px; position: relative; margin: 0 8px;
}
.search-wrap input {
  width: 100%;
  background: var(--surface-overlay);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 50px;
  padding: 10px 48px 10px 20px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--accent);
  background: var(--surface-overlay);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap .search-icon {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-wrap { position: relative; }
.search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: rgba(15, 15, 25, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px; max-height: 480px; overflow-y: auto; z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.search-dropdown.active { display: block; }
.search-dropdown-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  text-decoration: none; color: var(--text-primary); cursor: pointer;
  transition: background 0.15s;
}
.search-dropdown-item:hover,
.search-dropdown-item.highlighted { background: var(--surface-overlay); }
.search-dropdown-item + .search-dropdown-item { border-top: 1px solid var(--border-subtle); }
.search-dropdown-img {
  width: 40px; height: 60px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: var(--surface-overlay);
}
.search-dropdown-info { flex: 1; min-width: 0; }
.search-dropdown-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.search-dropdown-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.search-dropdown-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Hamburger */
.menu-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--surface-overlay);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease; flex-shrink: 0;
}
.menu-btn:hover { outline: 2px solid var(--accent); }

/* ===== DRAWER ===== */
/* Covers the whole screen; the topbar sits above it (z-index 1000) so the
   header is never dimmed, while everything else is. */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; touch-action: none; }
/* While the drawer is open the main page must be fully inert */
body.drawer-open { overflow: hidden !important; touch-action: none; }
html.drawer-open { overflow: hidden !important; }
/* Header stays visible (not dimmed) but is not clickable while the drawer is open */
body.drawer-open .topbar { pointer-events: none; }

.drawer {
  position: fixed; top: 72px; bottom: 0; right: 0;
  width: 100%; max-width: 340px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 201;
  padding: 20px 0;
  /* The nav is the primary scroller, so a long menu never pushes the footer past
     the fold. If the fixed stack (header + user area + footer) is taller than the
     drawer itself - very short window, or large page zoom - the drawer falls back
     to scrolling so the theme/language switchers stay reachable instead of being
     clipped and unclickable. */
  overflow-x: hidden; overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
}
.drawer > .drawer-header,
.drawer > .drawer-user-area,
.drawer > .drawer-footer { flex: 0 0 auto; }
.drawer.open { transform: translateX(0); }
/* English (LTR): open the drawer from the LEFT */
html[dir="ltr"] .drawer {
  right: auto; left: 0;
  border-left: none; border-right: 1px solid var(--border-color);
  transform: translateX(-100%);
}
html[dir="ltr"] .drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-logo { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.drawer-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-overlay);
  border: none; color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.drawer-close:hover { outline: 2px solid var(--accent); }

.drawer-nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 12px 12px;
}
.drawer-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  color: var(--text-primary); text-decoration: none;
  transition: all 0.2s ease; cursor: pointer;
  font-size: 0.9rem; font-weight: 500;
}
.drawer-nav-item:hover, .drawer-nav-item.active {
  background: var(--hover-bg); color: var(--accent);
}
.drawer-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.drawer-nav-group { padding: 0; }
.drawer-nav-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  color: var(--text-primary); text-decoration: none;
  transition: all 0.2s ease; cursor: pointer;
  font-size: 0.9rem; font-weight: 500;
}
.drawer-nav-toggle:hover, .drawer-nav-toggle.open { background: var(--hover-bg); color: var(--accent); }
.drawer-nav-toggle svg { width: 20px; height: 20px; flex-shrink: 0; }
.drawer-nav-toggle .drawer-chevron { margin-right: auto; transition: transform 0.25s ease; }
.drawer-nav-toggle.open .drawer-chevron { transform: rotate(180deg); }
.drawer-submenu { overflow: hidden; max-height: 0; transition: max-height 0.35s ease; }
.drawer-submenu.open { max-height: 600px; }
.drawer-submenu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px 8px 48px; border-radius: var(--radius-sm);
  color: var(--text-primary); text-decoration: none;
  transition: all 0.2s ease; cursor: pointer;
  font-size: 0.82rem; font-weight: 400;
}
.drawer-submenu-item:hover, .drawer-submenu-item.active { background: var(--hover-bg); color: var(--accent); }
.drawer-footer {
  padding: 16px 20px; border-top: 1px solid var(--border-color);
  background: var(--bg-surface); flex: 0 0 auto;
}
.lang-switcher {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--surface-overlay);
  border: 1px solid var(--border-color);
  cursor: pointer; font-size: 0.85rem; font-weight: 500;
  transition: all 0.2s; color: var(--text-primary);
}
.lang-switcher:hover { outline: 2px solid var(--accent); border-color: transparent; }
#themeToggle svg { flex-shrink: 0; }
.lang-wrap { position: relative; }
.lang-chevron { margin-right: auto; flex-shrink: 0; transition: transform 0.25s ease; }
.lang-switcher.open .lang-chevron { transform: rotate(180deg); }
.lang-menu { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.lang-menu.open {
  /* the switcher sits in the pinned drawer footer, so the list opens upward */
  max-height: 220px; margin-bottom: 6px; padding: 4px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-surface); box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.lang-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 48px; margin-top: 2px; border-radius: var(--radius-sm);
  color: var(--text-primary); cursor: pointer;
  font-size: 0.82rem; font-weight: 400;
  transition: all 0.2s ease;
}
.lang-menu-item .lang-check { flex-shrink: 0; opacity: 0; }
.lang-menu-item:hover { background: var(--hover-bg); color: var(--accent); }
.lang-menu-item.active { color: var(--accent); font-weight: 600; }
.lang-menu-item.active .lang-check { opacity: 1; }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  padding-top: 72px;
}

.hero-bg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover; background-position: center 20%;
}
.hero-top-gradient { top: 0; }

.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg-primary) 0%, rgba(0,0,0,0.5) 35%, rgba(0,0,0,0.15) 65%, transparent 100%);
}
[data-theme="light"] .hero-gradient {
  background: linear-gradient(to top, var(--bg-primary) 0%, rgba(0,0,0,0.08) 35%, rgba(0,0,0,0.03) 65%, transparent 100%);
}
.hero-top-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--bg-primary) 0%, transparent 30%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 60px clamp(16px, 4vw, 60px) 120px;
  max-width: 700px;
}
.hero-badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 8px;
  font-size: 0.75rem; font-weight: 600;
}
.hero-badge-imdb { background: var(--imdb); color: #000; }
.hero-badge-rating { background: var(--rating); color: #fff; }
.hero-badge-hd { background: var(--accent); color: #fff; }
.hero-badge-year { background: var(--surface-overlay); color: var(--text-secondary); }
.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 10px;
}
.hero-desc {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 560px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; }
.btn-watch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.85rem; font-family: inherit;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  transition: all 0.25s ease; text-decoration: none;
  position: relative; overflow: hidden;
  flex-shrink: 1; min-width: 0;
}
.btn-watch:hover { outline: 2px solid var(--accent); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-watch:active { transform: scale(0.97); }

.btn-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.8rem; font-family: inherit;
  background: rgba(255,255,255,0.08); color: #fff;
  border: 1px solid rgba(255,255,255,0.2); cursor: pointer;
  transition: all 0.25s ease; backdrop-filter: blur(4px);
  flex-shrink: 1; min-width: 0;
}
.btn-add:hover { outline: 2px solid var(--accent); background: rgba(255,255,255,0.12); }
/* When added: only the text and the plus icon turn blue (no border/bg change). */
.btn-add.active { color: #3b82f6; }
.btn-add.active svg { stroke: #3b82f6; }

.btn-trailer {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.8rem; font-family: inherit;
  background: transparent;
  border: 1px solid var(--border-subtle-2);
  color: var(--text-primary); cursor: pointer; text-decoration: none;
  transition: all 0.25s ease;
  flex-shrink: 1; min-width: 0;
}
.btn-trailer:hover { outline: 2px solid var(--accent); background: var(--surface-overlay); }

/* ===== CAROUSEL DOTS ===== */
.hero-dots {
  display: flex; gap: 8px; margin-top: 24px; align-items: center;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); cursor: pointer;
  transition: all 0.3s ease; border: none; padding: 0;
}
.hero-dot.active { width: 32px; border-radius: 4px; background: var(--accent); }
.hero-dot:hover { background: var(--text-secondary); }

/* ===== SECTIONS ===== */
.content-section { padding: 24px 0 8px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 clamp(12px, 3vw, 48px);
}
.section-title {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px; height: 22px; border-radius: 2px;
  background: var(--accent); display: inline-block;
}
.section-link {
  color: var(--text-muted); font-size: 0.8rem;
  cursor: pointer; transition: color 0.2s;
  text-decoration: none;
}
.section-link:hover { color: var(--accent); }

/* ===== CAROUSEL ===== */
.carousel-wrap { position: relative; padding: 0 clamp(12px, 3vw, 48px); }
.carousel {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 4px 0 12px;
}
.carousel::-webkit-scrollbar { height: 3px; }
.carousel::-webkit-scrollbar-track { background: transparent; }
.carousel::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }

/* ===== CARD ===== */
/* Actor Cards */
.actor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.actor-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 8px 12px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  cursor: pointer; transition: all 0.3s ease;
  text-decoration: none; color: inherit;
  border: 1px solid var(--border-color);
}
.actor-card:hover {
  outline: 2px solid #38bdf8; outline-offset: -2px;
  box-shadow: var(--shadow-card);
}
.actor-card-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: filter 0.3s ease;
}
.actor-card:hover .actor-card-avatar { filter: brightness(0.6); }
.actor-card-initial {
  font-size: 2rem; font-weight: 700; color: var(--text-muted);
}
.actor-card-name {
  font-size: 0.82rem; font-weight: 600; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.actor-card-count {
  font-size: 0.72rem; color: var(--text-muted);
}

/* Actor Detail Page */
.actor-detail { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.actor-header {
  display: flex; align-items: center; gap: 24px;
}
.actor-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  background-size: cover; background-position: center;
  flex-shrink: 0; border: 3px solid var(--border-color);
}
.actor-name { font-size: 1.4rem; font-weight: 700; margin: 0; }
@media (max-width: 480px) {
  .actor-header { flex-direction: column; text-align: center; }
  .actor-avatar { width: 100px; height: 100px; }
  .actor-name { font-size: 1.2rem; }
}
.movie-card {
  flex-shrink: 0; scroll-snap-align: start;
  width: 160px; border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: var(--bg-card);
}
@media (min-width: 1024px) {
  .movie-card { border-radius: var(--radius-lg); }
}
.movie-card:hover {
  box-shadow: var(--shadow-card);
}
.movie-card::after {
  content: ''; position: absolute;
  inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 2;
  transition: box-shadow 0.3s ease;
}
.movie-card:hover::after {
  box-shadow: inset 0 0 0 2px #38bdf8;
}
.movie-card:hover .movie-card-poster {
  filter: brightness(0.6);
}
.movie-card-poster {
  width: 100%; height: auto; aspect-ratio: 2/3;
  object-fit: cover; display: block;
  background: var(--bg-elevated);
  transition: transform 0.5s ease, filter 0.3s ease;
}

.movie-card-body { padding: 10px 10px 12px; }
.movie-card-title {
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.movie-card-meta {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px; font-size: 0.7rem; color: var(--text-muted);
  min-width: 0;
}
.movie-card-sep { color: var(--text-muted); opacity: 0.3; }
.movie-card-genre {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 80px; flex-shrink: 1; min-width: 0;
}
.movie-card-badge { margin-right: auto; flex-shrink: 0; }

/* Card Badges */
.movie-card-badge {
  padding: 1px 6px; border-radius: 4px;
  font-size: 0.6rem; font-weight: 700;
  white-space: nowrap; line-height: 1.4;
}
.movie-card-badge.imdb {
  background: var(--imdb); color: #000;
}

/* Grid card override — movie-card fills the grid cell */
.watch-episodes-list .movie-card,
.movie-grid .movie-card { width: 100%; }

/* Page grid layout */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(12px, 1.5vw, 20px);
  padding: 16px clamp(12px, 3vw, 48px) 48px;
}
@media (max-width: 500px) {
  .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px 12px 48px; }
}

.user-lists-empty { display: none; text-align: center; color: var(--text-muted); padding: 40px 0; font-size: 1rem; }

/* Card action buttons (favorite / watch later) */


/* ===== CONTAINER ===== */
.container-custom { max-width: 1440px; margin: 0 auto; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.anim-fade-up { animation: fadeInUp 0.6s ease forwards; }
.anim-fade { animation: fadeIn 0.5s ease forwards; }
.anim-scale { animation: scaleIn 0.4s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { width: 160px; aspect-ratio: 2/3; border-radius: var(--radius); flex-shrink: 0; }
@media (min-width: 1024px) { .skeleton-card { width: 260px; } }
@media (min-width: 1400px) { .skeleton-card { width: 320px; } }

/* ===== RIPPLE ===== */
.ripple { position: relative; overflow: hidden; }
.ripple::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--x,50%) var(--y,50%), rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.ripple:hover::after { opacity: 1; }

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

/* TV /超大 (1920+) */
@media (min-width: 1400px) {
  html { font-size: 15px; }
  .movie-card { width: 190px; }
  .movie-card-title { font-size: 0.9rem; }
  .movie-card-body { padding: 8px 8px 10px; }
  .movie-card-meta { font-size: 0.75rem; }
  .movie-card { border-radius: var(--radius); }
  .hero { min-height: 75vh; }
  .hero-bg, .hero-top-gradient { top: 0; }
  .hero-content { max-width: 750px; padding: 70px clamp(12px,3vw,48px) 100px; }
  .hero-title { font-size: clamp(2rem, 4vw, 3rem); }
  .hero-desc { font-size: 0.95rem; max-width: 560px; }
  .search-wrap { max-width: 520px; }
  .search-wrap input { padding: 10px 48px 10px 20px; font-size: 0.9rem; }
  .search-wrap .search-icon { width: 18px; height: 18px; right: 18px; }
  .topbar { min-height: 64px; }
  .topbar-logo { font-size: 1.2rem; }
  .account-btn, .menu-btn { width: 36px; height: 36px; }
  .account-btn svg, .menu-btn svg { width: 18px; height: 18px; }
  .carousel { gap: 14px; }
  .content-section { padding: 24px 0 12px; }
  .section-header { margin-bottom: 14px; }
  .section-title { font-size: 1.2rem; }
  .container-custom { max-width: 100%; }
  .movie-card-badge { padding: 1px 6px; font-size: 0.6rem; border-radius: 4px; }
  .movie-card-genre { max-width: 70px; }
  .btn-watch { padding: 8px 18px; font-size: 0.85rem; gap: 6px; border-radius: var(--radius-sm); }
  .btn-watch svg { width: 18px; height: 18px; }
  .btn-add, .btn-trailer { padding: 8px 16px; font-size: 0.8rem; gap: 6px; border-radius: var(--radius-sm); }
  .drawer { max-width: 320px; top: 64px; }
  .drawer-nav-item { padding: 10px 14px; font-size: 0.85rem; gap: 10px; }
  .drawer-nav-item svg { width: 18px; height: 18px; }
  .drawer-logo { font-size: 1.2rem; }
  .drawer-header { padding: 0 18px 14px; }
  .drawer-close { width: 30px; height: 30px; }
  .drawer-close svg { width: 16px; height: 16px; }
  .hero-dots { gap: 8px; margin-top: 20px; }
  .hero-dot { width: 8px; height: 8px; }
  .hero-dot.active { width: 28px; }
  .watch-hero { padding: 48px 0 32px; }
  .watch-main-right { width: 200px; }
  .watch-hero-title { font-size: 1.5rem; }
  .watch-hero-desc-full { font-size: 0.9rem; }
  .watch-btn-fav { width: 40px; height: 40px; }
  .watch-btn-fav svg { width: 18px; height: 18px; }
  .watch-btn-watchlist { padding: 10px 22px; font-size: 0.85rem; gap: 6px; }
  .watch-btn-watch { padding: 10px 26px; font-size: 0.85rem; gap: 6px; }
  .watch-section-title { font-size: 1.1rem; }
}

/* Desktop (1024-1399) */
@media (min-width: 1024px) and (max-width: 1399px) {
  html { font-size: 14px; }
  .movie-card { width: 175px; }
  .movie-card-title { font-size: 0.85rem; }
  .movie-card-body { padding: 8px 8px 10px; }
  .movie-card-meta { font-size: 0.72rem; }
  .movie-card { border-radius: var(--radius); }
  .hero { min-height: 65vh; }
  .hero-bg, .hero-top-gradient { top: 0; }
  .hero-content { padding: 60px clamp(12px,3vw,48px) 90px; max-width: 700px; }
  .hero-title { font-size: clamp(1.8rem, 4vw, 2.5rem); }
  .hero-desc { font-size: 0.9rem; max-width: 520px; }
  .carousel { gap: 12px; }
  .section-title { font-size: 1.1rem; }
  .container-custom { max-width: 100%; }
  .topbar { min-height: 60px; }
  .topbar-logo { font-size: 1.15rem; }
  .search-wrap { max-width: 440px; }
  .search-wrap input { padding: 8px 40px 8px 18px; font-size: 0.85rem; }
  .drawer-nav-item { padding: 10px 14px; font-size: 0.85rem; }
  .drawer { max-width: 320px; top: 60px; }
  .content-section { padding: 20px 0 10px; }
  .btn-watch { padding: 8px 18px; font-size: 0.85rem; }
  .watch-main-right { width: 180px; }
}

/* Small Desktop / Large Tablet (1024-1279) */
@media (min-width: 1024px) and (max-width: 1279px) {
  .movie-card { width: 175px; }
  .hero { min-height: 55vh; }
  .hero-content { padding: 50px clamp(20px, 3vw, 40px) 80px; }
}

/* Tablet (768-1023) */
@media (min-width: 768px) and (max-width: 1023px) {
  .topbar { min-height: 64px; }
  .topbar-inner { padding: 0 clamp(16px, 3vw, 32px); }
  .account-btn, .menu-btn { width: 36px; height: 36px; }
  .search-wrap { max-width: 360px; }
  .search-wrap input { padding: 8px 40px 8px 16px; font-size: 0.85rem; }
  .movie-card { width: 170px; }
  .hero { min-height: 50vh; padding-top: 64px; }
  .hero-bg, .hero-top-gradient { top: 0; }
  .hero-content { padding: 40px clamp(16px, 3vw, 32px) 60px; max-width: 560px; }
  .hero-title { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
  .hero-desc { font-size: 0.85rem; }
  .btn-watch { padding: 6px 12px; font-size: 0.75rem; gap: 4px; }
  .btn-watch svg { width: 14px; height: 14px; }
  .btn-add, .btn-trailer { padding: 6px 10px; font-size: 0.7rem; gap: 4px; }
  .btn-add svg, .btn-trailer svg { width: 14px; height: 14px; }
  .carousel { gap: 10px; }
  .drawer { top: 64px; }
}

/* Large Phone / Small Tablet (640-767) */
@media (min-width: 640px) and (max-width: 767px) {
  .topbar { min-height: 60px; }
  .topbar-inner { padding: 0 20px; gap: 12px; }
  .account-btn, .menu-btn { width: 38px; height: 38px; }
  .account-btn svg, .menu-btn svg { width: 19px; height: 19px; }
  .search-wrap { max-width: 300px; }
  .search-wrap input { font-size: 0.88rem; padding: 8px 40px 8px 16px; }
  .search-wrap .search-icon { right: 16px; width: 18px; height: 18px; }
  .movie-card { width: 175px; }
  .hero { min-height: 55vh; padding-top: 60px; }
  .hero-bg, .hero-top-gradient { top: 0; }
  .hero-content { padding: 20px 20px 24px; }
  .hero-title { font-size: clamp(1.2rem, 5vw, 1.8rem); }
  .hero-desc { font-size: 0.78rem; -webkit-line-clamp: 2; margin-bottom: 12px; }
  .hero-actions { gap: 10px; }
  .btn-watch { padding: 6px 12px; font-size: 0.72rem; }
  .btn-add, .btn-trailer { padding: 6px 10px; font-size: 0.68rem; }
  .hero-dots { margin-top: 12px; }
  .content-section { padding: 18px 0 6px; }
  .section-title { font-size: 1.05rem; }
  .section-header { margin-bottom: 12px; }
  .carousel { gap: 12px; }
  .drawer { top: 60px; }
}

/* Phone (480-639) */
@media (min-width: 480px) and (max-width: 639px) {
  .topbar { min-height: 56px; }
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .account-btn, .menu-btn { width: 36px; height: 36px; }
  .account-btn svg, .menu-btn svg { width: 18px; height: 18px; }
  .search-wrap { max-width: 260px; }
  .search-wrap input { font-size: 0.85rem; padding: 8px 38px 8px 16px; }
  .search-wrap .search-icon { right: 16px; width: 17px; height: 17px; }
  .movie-card { width: 170px; border-radius: 12px; }
  .hero { min-height: 55vh; padding-top: 56px; }
  .hero-bg, .hero-top-gradient { top: 0; }
  .hero-content { padding: 16px 16px 20px; }
  .hero-title { font-size: clamp(1rem, 5vw, 1.4rem); margin-bottom: 6px; }
  .hero-desc { font-size: 0.72rem; -webkit-line-clamp: 2; margin-bottom: 10px; }
  .hero-actions { gap: 8px; }
  .btn-watch { padding: 6px 14px; font-size: 0.68rem; }
  .btn-add, .btn-trailer { padding: 6px 10px; font-size: 0.62rem; }
  .hero-dots { margin-top: 10px; gap: 6px; }
  .hero-dot { width: 6px; height: 6px; }
  .hero-dot.active { width: 22px; }
  .content-section { padding: 14px 0 6px; }
  .section-title { font-size: 1rem; }
  .section-title::before { width: 3px; height: 14px; }
  .carousel { gap: 12px; }
  .drawer { max-width: 300px; top: 56px; }
  .drawer-nav-item { padding: 10px 16px; font-size: 0.88rem; gap: 10px; }
  .drawer-logo { font-size: 1.3rem; }
  .watch-page { padding-top: 56px; }
  .watch-hero { padding: 40px 0 30px; }
  .watch-hero-content { padding: 0 16px; }
  .watch-main-right { width: 190px; }
  .watch-hero-title { font-size: clamp(1.4rem, 5vw, 1.8rem); }
  .watch-hero-desc-full { font-size: 0.88rem; margin-bottom: 28px; }
  .watch-cast-card { width: 100px; }
  .watch-cast-avatar { width: 60px; height: 60px; }
  .watch-episode-thumb { width: 110px; }
}

/* Small Phone (<480) */
@media (max-width: 479px) {
  .topbar { min-height: 52px; }
  .topbar-inner { padding: 0 14px; gap: 8px; }
  .account-btn, .menu-btn { width: 34px; height: 34px; }
  .account-btn svg, .menu-btn svg { width: 16px; height: 16px; }
  .search-wrap { max-width: 200px; }
  .search-wrap input { font-size: 0.78rem; padding: 7px 32px 7px 14px; }
  .search-wrap .search-icon { right: 14px; width: 15px; height: 15px; }
  .movie-card { width: 150px; border-radius: 10px; }
  .hero { min-height: 55vh; padding-top: 52px; }
  .hero-bg, .hero-top-gradient { top: 0; }
  .hero-content { padding: 12px 14px 16px; }
  .hero-title { font-size: clamp(0.88rem, 5vw, 1.2rem); margin-bottom: 4px; }
  .hero-desc { font-size: 0.65rem; -webkit-line-clamp: 2; margin-bottom: 8px; }
  .hero-actions { gap: 6px; }
  .btn-watch { padding: 5px 12px; font-size: 0.62rem; }
  .btn-add, .btn-trailer { padding: 5px 8px; font-size: 0.58rem; }
  .hero-dots { margin-top: 8px; gap: 5px; }
  .hero-dot { width: 5px; height: 5px; }
  .hero-dot.active { width: 18px; }
  .content-section { padding: 10px 0 4px; }
  .section-title { font-size: 0.9rem; }
  .section-title::before { width: 3px; height: 13px; }
  .section-header { padding: 0 14px; }
  .carousel-wrap { padding: 0 14px; }
  .carousel { gap: 10px; }
  .drawer { max-width: 280px; top: 52px; }
  .drawer-logo { font-size: 1.2rem; }
  .drawer-nav-item { padding: 8px 14px; font-size: 0.82rem; gap: 8px; }
  .drawer-nav-item svg { width: 16px; height: 16px; }
  .watch-page { padding-top: 52px; }
  .watch-hero { padding: 28px 0 22px; }
  .watch-hero-content { padding: 0 14px; }
  .watch-main-right { width: 160px; }
  .watch-hero-title { font-size: clamp(1.2rem, 5.5vw, 1.5rem); margin-bottom: 8px; }
  .watch-hero-desc-full { font-size: 0.82rem; margin-bottom: 22px; }
  .watch-stats-bar { gap: 22px; }
  .watch-stat svg { width: 16px; height: 16px; }
  .watch-btn-watchlist { padding: 8px 18px; font-size: 0.8rem; }
  .watch-btn-watch { padding: 8px 20px; font-size: 0.82rem; }
  .watch-btn-fav { width: 38px; height: 38px; }
  .watch-btn-fav svg { width: 17px; height: 17px; }
  .watch-mode-btn { padding: 6px 16px; font-size: 0.78rem; }
  .watch-section-title { font-size: 0.88rem; }
  .watch-cast-card { width: 88px; }
  .watch-cast-avatar { width: 50px; height: 50px; }
  .watch-cast-name { font-size: 0.68rem; }
  .watch-cast-role { font-size: 0.6rem; }
  .watch-episode-card { padding: 10px; gap: 10px; }
  .watch-episode-thumb { width: 90px; }
  .watch-episode-number { font-size: 0.65rem; }
  .watch-episode-name { font-size: 0.8rem; }
  .player-page { padding-top: 52px; }
  .cine-player { max-height: 40vh; }
  .cine-play-btn { width: 56px; height: 56px; }
  .cine-play-btn svg { width: 30px; height: 30px; }
  .cine-controls { padding: 12px 14px 10px; gap: 10px; }
  .player-title { font-size: 1.2rem; }
  .p-tag-year, .p-tag, .p-tag-imdb { font-size: 0.72rem; }
  .player-synopsis { font-size: 0.85rem; }
  .p-section-title { font-size: 0.9rem; }
  .p-cast-card { width: 82px; }
  .p-cast-avatar { width: 56px; height: 56px; }
  .p-cast-name { font-size: 0.65rem; }
  .p-cast-role { font-size: 0.58rem; }
}

/* ===== PLAYER PAGE ===== */
.player-page { padding-top: 72px; min-height: 100vh; }

/* Cinematic Player */
.cine-player {
  width: 100%; background: #000; position: relative;
  aspect-ratio: 16/9; max-height: 80vh; overflow: hidden;
}
.cine-screen {
  width: 100%; height: 100%; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #000; overflow: hidden;
}
.cine-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #000;
}
.cine-play-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  cursor: pointer; position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; padding-right: 2px;
  backdrop-filter: blur(2px);
}
.cine-play-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
  transform: scale(1.05);
}
.cine-play-btn:active { transform: scale(0.95); }
.cine-controls {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 16px 20px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  display: flex; align-items: center; gap: 16px;
  transition: opacity 0.35s ease;
  direction: ltr;
}
.cine-player:not(.show-ui) .cine-controls,
.cine-player:not(.show-ui) .cine-play-btn { opacity: 0; pointer-events: none; }
.cine-left { display: flex; align-items: center; gap: 12px; }
.cine-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.cine-btn {
  background: none; border: none; color: rgba(255,255,255,0.6);
  cursor: pointer; padding: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cine-btn:hover { color: #fff; }
.cine-progress { flex: 1; position: relative; cursor: pointer; padding: 8px 0; }
.cine-progress-track {
  width: 100%; height: 2px; border-radius: 1px;
  background: rgba(255,255,255,0.15); position: relative;
}
.cine-progress-fill {
  height: 100%; background: #fff; border-radius: 1px;
  position: relative; transition: width 0.1s;
}
.cine-progress-thumb {
  position: absolute; top: 50%; width: 10px; height: 10px;
  border-radius: 50%; background: #fff;
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.2s;
}
.cine-progress:hover .cine-progress-thumb { opacity: 1; }
.cine-progress:hover .cine-progress-track { height: 3px; }
.cine-progress:hover .cine-progress-fill { height: 3px; }

/* ── Full Control Bar (9-button spec) ── */
.cine-controls { gap: 2px; padding: 8px 10px 10px; }
.cine-btn { width: 40px; height: 40px; flex: none; }
.cine-btn svg { transition: transform 0.15s ease; }
.cine-btn:hover { color: #fff; }
.cine-btn:hover svg { transform: scale(1.08); }
.cine-btn:active svg { transform: scale(0.92); }
.cine-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.cine-btn.active { color: #38bdf8; }

/* Volume slider popover */
.cine-vol-wrap { position: relative; display: flex; align-items: center; }
.cine-vol-slider {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  width: 28px; height: 0; background: rgba(0,0,0,0.92);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
  margin-bottom: 4px; overflow: hidden; transition: height 0.2s ease;
  cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center;
}
.cine-vol-wrap:hover .cine-vol-slider,
.cine-vol-slider:hover { height: 100px; padding: 8px 0; }
.cine-vol-track {
  position: relative; width: 4px; height: 100%;
  background: rgba(255,255,255,0.15); border-radius: 2px;
}
.cine-vol-fill {
  position: absolute; bottom: 0; left: 0; width: 100%;
  background: #38bdf8; border-radius: 2px; transition: height 0.1s;
}
.cine-vol-thumb {
  position: absolute; left: 50%; transform: translate(-50%, 50%);
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
  opacity: 0; transition: opacity 0.2s;
}
.cine-vol-slider:hover .cine-vol-thumb { opacity: 1; }

/* Buffered progress bar */
.cine-progress-track { height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; position: relative; overflow: hidden; }
.cine-progress-buffered { position: absolute; top: 0; left: 0; height: 100%; background: rgba(255,255,255,0.2); border-radius: 2px; transition: width 0.3s; }
.cine-progress-fill { position: absolute; top: 0; left: 0; height: 100%; background: #38bdf8; border-radius: 2px; z-index: 1; }
.cine-progress-thumb {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); z-index: 2;
  opacity: 0; transition: opacity 0.2s, width 0.15s, height 0.15s;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}
.cine-progress:hover .cine-progress-thumb { opacity: 1; width: 14px; height: 14px; }
.cine-progress:active .cine-progress-thumb { width: 18px; height: 18px; }

/* Preview tooltip */
.cine-preview {
  position: absolute; bottom: 100%; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); color: #fff; font-size: 12px;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
  pointer-events: none; z-index: 10; margin-bottom: 6px;
}

/* Time display */
.cine-time {
  display: flex; align-items: center; gap: 3px;
  font-size: 12.5px; font-family: monospace; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.7); line-height: 40px;
  padding: 0 4px; white-space: nowrap;
}
.cine-time-sep { color: rgba(255,255,255,0.35); }

/* Settings menu */
.cine-settings-wrap { position: relative; }
.cine-settings-menu {
  position: absolute; bottom: 100%; right: 0; margin-bottom: 6px;
  min-width: 160px; background: rgba(18,18,22,0.96);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 10px;
  padding: 4px; z-index: 20;
}
.cine-settings-item {
  padding: 6px 14px; font-size: 12.5px; color: rgba(255,255,255,0.7);
  border-radius: 6px; cursor: pointer; transition: background 0.15s;
  white-space: nowrap;
}
.cine-settings-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.cine-settings-item[aria-checked="true"] { color: #38bdf8; font-weight: 600; }

/* PiP visible */
.cine-btn#cinePiP { display: flex; }

/* Trim overlay */
#cineTrimOverlay { animation: trimSlideIn 0.25s ease-out; }
@keyframes trimSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Control bar overlay spinner */
.cine-player .show-ui { transition: opacity 0.35s ease; }

/* Focus within for keyboard nav */
.cine-controls *:focus { outline: 2px solid rgba(255,255,255,0.7); outline-offset: 2px; border-radius: 4px; }
.cine-controls *:focus:not(:focus-visible) { outline: none; }
.cine-controls *:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* Responsive: narrow < 480px */
@media (max-width: 479px) {
  .cine-controls { padding: 6px 6px 8px; gap: 1px; }
  .cine-btn { width: 36px; height: 36px; }
  .cine-btn svg { width: 18px; height: 18px; }
  .cine-time { font-size: 11px; line-height: 36px; }
  .cine-vol-wrap:hover .cine-vol-slider { height: 80px; }
  .cine-progress-track { height: 3px; }
  .cine-player .cine-play-btn { width: 56px; height: 56px; }
  .cine-player .cine-play-btn svg { width: 28px; height: 28px; }
}

/* Responsive: tablet 480-767px */
@media (min-width: 480px) and (max-width: 767px) {
  .cine-btn { width: 38px; height: 38px; }
  .cine-btn svg { width: 19px; height: 19px; }
  .cine-progress-track { height: 4px; }
}

/* Responsive: large tablet / small desktop 768-1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  .cine-btn { width: 42px; height: 42px; }
  .cine-btn svg { width: 21px; height: 21px; }
  .cine-time { font-size: 13px; }
}

/* Responsive: TV / large screens > 1400px */
@media (min-width: 1400px) {
  .cine-controls { padding: 12px 16px 14px; gap: 4px; }
  .cine-btn { width: 48px; height: 48px; }
  .cine-btn svg { width: 26px; height: 26px; }
  .cine-time { font-size: 15px; line-height: 48px; }
  .cine-progress-track { height: 5px; }
  .cine-progress-thumb { width: 16px; height: 16px; }
  .cine-progress:hover .cine-progress-thumb { width: 20px; height: 20px; }
  .cine-vol-wrap:hover .cine-vol-slider { height: 130px; width: 32px; }
  .cine-vol-track { width: 5px; }
  .cine-vol-thumb { width: 14px; height: 14px; }
}

/* Touch device adjustments */
@media (hover: none) and (pointer: coarse) {
  .cine-progress-thumb { opacity: 1; width: 14px; height: 14px; }
  .cine-progress-track { height: 5px; }
  .cine-btn { min-width: 44px; min-height: 44px; }
  .cine-vol-slider { height: 0; }
  .cine-vol-wrap:active .cine-vol-slider,
  .cine-vol-slider:active { height: 100px; }
}

/* Accessibility: high contrast */
@media (forced-colors: active) {
  .cine-progress-fill { background: Highlight; }
  .cine-progress-thumb { background: ButtonText; }
  .cine-btn:focus-visible { outline: 3px solid Highlight; }
}

.player-body {
  max-width: 1200px; margin: 0 auto;
  padding: 24px clamp(12px,3vw,48px) 0;
}
.player-meta-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.player-title {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 800; line-height: 1.2; margin-bottom: 6px;
}
.player-tags {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.p-tag-year, .p-tag {
  padding: 2px 10px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
  background: var(--surface-overlay); color: var(--text-secondary);
}
.p-tag-year { background: var(--accent); color: #fff; }
.p-tag-imdb {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700;
  background: var(--imdb); color: #000;
}
.player-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pa-outline {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-overlay); border: 1px solid var(--border-color);
  color: var(--text-primary); cursor: pointer; transition: all 0.2s;
}
.pa-outline:hover { outline: 2px solid var(--accent); border-color: transparent; background: var(--hover-bg); }
.pa-outline svg { width: 16px; height: 16px; }
.player-synopsis {
  font-size: 0.88rem; line-height: 1.7; color: var(--text-secondary);
  margin-bottom: 24px; max-width: 720px;
}
.p-section { margin-bottom: 8px; }
.p-section-title {
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.p-section-title::before {
  content: ''; width: 3px; height: 18px; border-radius: 2px;
  background: var(--accent); display: inline-block;
}
.p-cast-scroll {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 4px 0 16px; justify-content: center;
}
.p-cast-card {
  flex-shrink: 0; text-align: center; width: 90px;
  cursor: pointer; transition: all 0.25s ease;
}
.p-cast-card:hover { outline: 2px solid var(--accent); }
.p-cast-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background-size: cover; background-position: center;
  margin: 0 auto 6px; border: 2px solid var(--border-color);
  transition: border-color 0.25s; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.p-cast-card:hover .p-cast-avatar { border-color: var(--accent); }
.p-cast-name { display: block; font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-cast-role { display: block; font-size: 0.64rem; color: var(--text-muted); margin-top: 1px; }

@media (max-width: 767px) {
  .cine-player { max-height: 55vh; }
  .cine-play-btn { width: 64px; height: 64px; }
  .cine-play-btn svg { width: 34px; height: 34px; }
  .cine-controls { padding: 16px 18px 14px; gap: 14px; }
  .cine-left, .cine-right { gap: 12px; }
  .cine-btn svg { width: 18px; height: 18px; }
  .player-meta-row { flex-direction: column; gap: 14px; }
  .player-actions { width: 100%; }
  .p-cast-card { width: 90px; }
  .p-cast-avatar { width: 62px; height: 62px; }
  .p-cast-name { font-size: 0.7rem; }
  .p-cast-role { font-size: 0.62rem; }
}
@media (max-width: 479px) {
  .player-page { padding-top: 52px; }
  .cine-player { max-height: 42vh; }
  .cine-play-btn { width: 56px; height: 56px; }
  .cine-play-btn svg { width: 30px; height: 30px; }
  .cine-controls { padding: 12px 14px 10px; gap: 10px; }
  .cine-btn svg { width: 16px; height: 16px; }
  .cine-progress { padding: 10px 0; }
  .player-body { padding: 20px 14px 0; }
  .player-title { font-size: 1.2rem; }
  .player-tags { gap: 6px; }
  .p-tag-year, .p-tag, .p-tag-imdb { font-size: 0.72rem; padding: 2px 8px; }
  .player-synopsis { font-size: 0.85rem; }
  .pa-outline { width: 38px; height: 38px; }
  .pa-outline svg { width: 16px; height: 16px; }
  .p-section-title { font-size: 0.9rem; }
  .p-cast-card { width: 80px; }
  .p-cast-avatar { width: 56px; height: 56px; border-width: 2px; }
  .p-cast-name { font-size: 0.65rem; }
  .p-cast-role { font-size: 0.58rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .player-page { padding-top: 64px; }
  .cine-player { max-height: 60vh; }
  .p-cast-avatar { width: 60px; height: 60px; }
  .p-cast-card { width: 82px; }
}
@media (min-width: 1920px) {
  .cine-player { max-height: 70vh; }
  .player-body { max-width: 1200px; }
  .cine-play-btn { width: 72px; height: 72px; }
  .cine-play-btn svg { width: 40px; height: 40px; }
  .cine-controls { padding: 16px 20px 14px; gap: 16px; }
  .cine-btn svg { width: 18px; height: 18px; }
  .p-cast-card { width: 90px; }
  .p-cast-avatar { width: 68px; height: 68px; }
  .p-cast-name { font-size: 0.72rem; }
  .p-cast-role { font-size: 0.64rem; }
}

/* Footer (shared across pages) */
.site-footer {
  margin-top: 24px; padding: 0;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px; padding: 0 clamp(12px, 3vw, 48px);
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.footer-col a { font-size: 0.8rem; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
/* Footer "تابعنا" — horizontal row of social icons */
.footer-social-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 84px;
  padding: 0 clamp(12px, 3vw, 48px); text-align: center;
}
.footer-social-wrap h4 {
  font-size: 0.8rem; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1.2;
}
.footer-social {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.footer-social-link {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-overlay); border: 1px solid var(--border-subtle);
  color: var(--text-primary); transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.footer-social-link svg { width: 15px; height: 15px; }
.footer-social-link:hover,
.footer-social-link:active {
  color: var(--accent); border-color: var(--accent);
  background: var(--hover-bg); outline: 2px solid var(--accent);
}
@media (max-width: 480px) {
  .footer-social-link { width: 32px; height: 32px; }
  .footer-social-link svg { width: 14px; height: 14px; }
}
.footer-bottom {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 84px; padding: 0 clamp(12px, 3vw, 48px); margin-top: 0;
  border-top: 1px solid var(--border-color); text-align: center;
}
.footer-logo { font-size: 1.1rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); line-height: 1.2; }

/* ===== WATCH PAGE ===== */
.watch-page {
  background: var(--bg-primary);
  min-height: 100vh;
  padding-top: 80px;
}
.watch-page .watch-body {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 48px);
}
/* The watch body already provides side padding — strip the nested section padding so "You may also like" hugs the edges like the rest */
.watch-page .section-header,
.watch-page .carousel-wrap { padding-left: 0; padding-right: 0; }

/* Hero */
.watch-hero {
  position: relative; padding: 60px 0 40px;
  background: var(--bg-primary);
}
.watch-hero-content { position: relative; z-index: 2; width: 100%; padding: 0; }
.watch-hero-inner { max-width: 1320px; margin: 0 auto; padding: 0 clamp(12px,3vw,48px); }

/* Stats Bar */
.watch-stats-bar {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 32px; margin-top: 40px; flex-wrap: wrap;
  direction: ltr;
}
.watch-stat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--text-muted); cursor: pointer;
  transition: color 0.2s;
}
.watch-stat:hover { color: var(--text-secondary); }
.watch-stat svg { flex-shrink: 0; }

/* Like / Dislike */
.watch-like-bar {
  display: flex; gap: 12px; align-items: center; justify-content: flex-end;
  margin-top: 20px; direction: ltr;
}
.watch-like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; color: var(--text-muted); padding: 6px 14px;
  border-radius: 999px; transition: all 0.25s ease;
}
.watch-like-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.watch-like-btn[data-type="like"].active { color: #22c55e; background: rgba(34,197,94,0.12); }
.watch-like-btn[data-type="dislike"].active { color: #ef4444; background: rgba(239,68,68,0.12); }
.watch-like-btn svg { flex-shrink: 0; }
.watch-like-count { min-width: 12px; text-align: center; font-variant-numeric: tabular-nums; }

.watch-btn-fav.active svg { fill: #ef4444; stroke: #ef4444; }
.watch-btn-watchlist.active svg { stroke: #3b82f6; }

/* Inactive sidebar items */
.drawer-nav-item.inactive { opacity: 0.4; cursor: default; pointer-events: none; }

/* User Area in Drawer */
.drawer-user-area { padding: 0 16px 12px; border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.06)); margin-bottom: 8px; flex: 0 0 auto; }
.drawer-user-card { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.drawer-user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.drawer-user-info { display: flex; flex-direction: column; min-width: 0; }
.drawer-user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-user-email { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-logout-btn { display: block; text-align: center; font-size: 0.8rem; color: #ef4444; padding: 6px 0; border-radius: 8px; transition: all 0.2s; text-decoration: none; }
.drawer-logout-btn:hover { color: #ef4444; background: rgba(239,68,68,0.08); }

/* Google Sign-In Button */
.google-login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px; margin: 8px 0;
  background: #fff; border: none; border-radius: 24px;
  font-size: 0.85rem; font-weight: 500; color: #333;
  cursor: pointer; transition: box-shadow 0.2s; text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.google-login-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.google-login-btn svg { flex-shrink: 0; }
.account-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }

/* Account Dropdown */
.account-dropdown-wrap { position: relative; }
.account-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 1000;
  background: #1e1e2a; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  min-width: 200px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); overflow: hidden;
  direction: rtl;
}
.account-dropdown.open { display: block; }
/* In LTR the account button sits at the right edge of the header, so the dropdown
   must grow leftwards. Anchored with left:0 it ran off-screen and
   html{overflow-x:hidden} clipped the part that stuck out. */
html[dir="ltr"] .account-dropdown {
  left: auto; right: 0;
  direction: ltr;
}
.account-dropdown-user {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.account-dd-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.account-dd-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.account-dd-email { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.account-dd-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  text-decoration: none; color: var(--text-primary); font-size: 0.85rem;
  transition: background 0.2s;
}
.account-dd-item:hover { background: rgba(255,255,255,0.06); }
.account-dd-logout { color: #ef4444; }
.account-dd-logout:hover { color: #ef4444; background: rgba(239,68,68,0.12); }
.account-dd-google { justify-content: center; font-weight: 500; }

/* Main Row */
.watch-main-row {
  display: flex; gap: 40px; align-items: flex-start;
  margin-bottom: 28px;
}
.watch-main-left { flex: 1; min-width: 0; }
.watch-main-right { flex-shrink: 0; width: 180px; }

.watch-poster-img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block;
  border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.watch-hero-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 800; line-height: 1.2;
  margin-bottom: 12px;
}

.watch-imdb-row { margin-bottom: 0; }
.watch-age-rating {
  display: inline-block; margin: 8px 0 12px;
  font-size: 0.82rem; color: var(--text-muted);
}
.watch-age-rating strong { color: var(--text-primary); font-weight: 700; }
.watch-imdb-badge-lg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 5px; font-weight: 700; font-size: 0.85rem;
  background: var(--imdb); color: #000;
  line-height: 1.4;
}
.watch-imdb-score {
  font-size: 0.85rem; font-weight: 800; color: #000;
}

.watch-meta-row {
  display: flex; align-items: center;
  gap: 8px; font-size: 0.85rem; color: var(--text-secondary);
  margin-bottom: 6px; flex-wrap: wrap;
}
.watch-meta-sep { color: var(--text-muted); font-size: 0.6rem; }

.watch-duration-row {
  font-size: 0.85rem; color: var(--text-muted);
}
.watch-stat-views {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--text-muted); cursor: pointer;
  transition: color 0.2s;
}
.watch-stat-views:hover { color: var(--text-secondary); }

.watch-hero-desc-full {
  font-size: 0.9rem; line-height: 1.8; color: var(--text-secondary);
  text-align: right; max-width: 800px; margin: 0 0 32px auto;
}
/* English (LTR): description on the LEFT, action icons under it on the LEFT
   Order left->right: Watch, Watch later, Favorite */
html[dir="ltr"] .watch-hero-desc-full {
  text-align: left; margin-left: 0; margin-right: auto;
}
html[dir="ltr"] .watch-hero-actions-row {
  flex-direction: row-reverse; justify-content: flex-end;
}
html[dir="ltr"] .watch-actions-left { flex-direction: row-reverse; }
html[dir="ltr"] .watch-like-bar { justify-content: flex-start; }

/* Action Buttons Row */
.watch-hero-actions-row {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 16px; flex-wrap: wrap;
  direction: ltr;
}
.watch-btn-watchlist {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.85rem; font-family: inherit;
  background: rgba(255,255,255,0.08); color: #fff;
  border: 1px solid rgba(255,255,255,0.2); cursor: pointer;
  transition: all 0.25s ease; backdrop-filter: blur(4px);
}
.watch-btn-watchlist:hover {
  outline: 2px solid var(--accent);
  background: rgba(255,255,255,0.12);
}
.watch-actions-left {
  display: flex; align-items: center; gap: 12px;
}
.watch-btn-fav {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-secondary); cursor: pointer; transition: all 0.25s ease;
  backdrop-filter: blur(4px); flex-shrink: 0;
}
.watch-btn-fav:hover {
  color: #ef4444; background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  outline: 2px solid rgba(239,68,68,0.4);
}
.watch-btn-fav.active {
  color: #ef4444; fill: #ef4444;
  background: rgba(239,68,68,0.15);
  border-color: #ef4444;
}
.watch-btn-watch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.9rem; font-family: inherit;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.25s ease; box-shadow: 0 4px 24px var(--accent-glow);
}
.watch-btn-watch:hover {
  outline: 2px solid var(--accent);
  box-shadow: 0 8px 40px var(--accent-glow);
  filter: brightness(1.1);
}

.watch-btn-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; cursor: pointer; transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}
.watch-btn-icon:hover {
  outline: 2px solid var(--accent);
  background: rgba(255,255,255,0.15);
}
.watch-btn-icon svg { width: 18px; height: 18px; }

/* Mode bar */
.watch-mode-bar {
  display: flex; gap: 4px; margin: 24px 0 0;
  background: var(--bg-surface); border-radius: var(--radius-sm);
  padding: 4px; width: fit-content; border: 1px solid var(--border-color);
}
.watch-mode-btn {
  padding: 8px 24px; border-radius: 8px; font-weight: 600;
  font-size: 0.85rem; font-family: inherit; background: transparent;
  border: none; color: var(--text-muted); cursor: pointer;
  transition: all 0.2s ease; white-space: nowrap;
}
.watch-mode-btn.active { background: var(--accent); color: #fff; }
.watch-mode-btn:not(.active):hover { color: var(--text-primary); }

.watch-mode-content { display: none; }
.watch-mode-content.active { display: block; }

/* Sections */
.watch-section { padding: 28px 0 8px; }
.watch-section-title {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.watch-section-title::before {
  content: ''; width: 4px; height: 22px; border-radius: 2px;
  background: var(--accent); display: inline-block;
}

/* Info Grid */
.watch-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.watch-info-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border-color);
}
.watch-info-label {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.watch-info-value { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

/* Servers */
.watch-servers {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.watch-server-btn {
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.85rem; font-family: inherit;
  background: var(--bg-surface); border: 1px solid var(--border-color);
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.2s ease;
}
.watch-server-btn:hover {
  border-color: var(--accent); color: var(--accent);
  outline: 2px solid var(--accent);
}
.watch-server-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.watch-play-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 40px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 1rem; font-family: inherit;
  background: var(--accent); color: #fff; border: none; cursor: pointer; text-decoration: none;
  transition: all 0.25s ease; box-shadow: 0 4px 24px var(--accent-glow);
}
.watch-play-btn:hover {
  outline: 2px solid var(--accent);
  box-shadow: 0 8px 40px var(--accent-glow);
  filter: brightness(1.1);
}

/* Season Tabs */
.watch-season-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.watch-season-btn {
  padding: 8px 20px; border-radius: 50px; font-weight: 600;
  font-size: 0.83rem; font-family: inherit;
  background: var(--bg-surface); border: 1px solid var(--border-color);
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.2s ease;
}
.watch-season-btn:hover {
  border-color: var(--accent); color: var(--accent);
  outline: 2px solid var(--accent);
}
.watch-season-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Episodes */
.watch-episodes-list {
  display: flex; flex-direction: column; gap: 10px;
}
.watch-episode-card {
  display: flex; gap: 14px; align-items: center; position: relative;
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border-color);
  transition: all 0.25s ease; cursor: pointer;
}
.watch-episode-card:hover {
  border-color: var(--accent); background: var(--hover-bg);
  outline: 2px solid var(--accent);
}
.watch-episode-card.is-watched .watch-episode-watched { display: flex; }
.watch-episode-thumb {
  position: relative; flex-shrink: 0; width: 120px; aspect-ratio: 16/9;
  border-radius: 8px; overflow: hidden; display: block; background: var(--bg-elevated);
}
.watch-episode-img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; background: var(--bg-elevated);
}
.watch-episode-watched {
  position: absolute; inset: 0; display: none; z-index: 3;
  border-radius: inherit;
  background-color: rgba(56,189,248,0.35);
  background-image:
    linear-gradient(to top right, transparent calc(50% - 2px), rgba(2,132,199,0.5) calc(50% - 2px), rgba(2,132,199,0.5) calc(50% + 2px), transparent calc(50% + 2px)),
    linear-gradient(to bottom right, transparent calc(50% - 2px), rgba(2,132,199,0.5) calc(50% - 2px), rgba(2,132,199,0.5) calc(50% + 2px), transparent calc(50% + 2px));
}
.watch-episode-info { flex: 1; min-width: 0; }
.watch-episode-header {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px;
}
.watch-episode-number {
  font-size: 0.75rem; color: var(--accent); font-weight: 700; white-space: nowrap;
}
.watch-episode-name {
  font-size: 0.88rem; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.watch-ep-rating {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 3px; font-weight: 700; font-size: 0.65rem;
  background: var(--imdb); color: #000; white-space: nowrap; line-height: 1.3;
}
.watch-episode-meta {
  font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px;
}
.watch-episode-desc {
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.watch-episode-play {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: none; color: #fff; cursor: pointer;
  transition: all 0.25s ease; box-shadow: 0 0 16px var(--accent-glow);
}
.watch-episode-play:hover {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

/* Cast */
.watch-cast-scroll {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 4px 0 16px; justify-content: center;
}

.watch-cast-card {
  flex-shrink: 0; text-align: center; width: 100px;
  cursor: pointer; transition: all 0.25s ease;
  padding: 12px 8px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border-color);
}
.watch-cast-card:hover {
  box-shadow: inset 0 0 0 2px #38bdf8;
  border-color: transparent;
}
.watch-cast-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background-size: cover; background-position: center;
  margin: 0 auto 8px; border: 3px solid var(--border-color);
  transition: border-color 0.25s, filter 0.3s ease;
}
.watch-cast-card:hover .watch-cast-avatar {
  border-color: var(--border-color);
  filter: brightness(0.6);
}
.watch-cast-name { display: block; font-size: 0.75rem; font-weight: 400; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-cast-role { display: block; font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

/* ===== WATCH PAGE RESPONSIVE ===== */

/* Desktop (min 1024) */
@media (min-width: 1024px) {
  .watch-hero { padding: 80px 0 50px; }
  .watch-main-right { width: 220px; }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .watch-page { padding-top: 72px; }
  .watch-hero { padding: 60px 0 40px; }
  .watch-main-right { width: 180px; }
  .watch-hero-title { font-size: clamp(1.3rem, 3.5vw, 2rem); }
}

/* Large Phone */
@media (min-width: 640px) and (max-width: 767px) {
  .watch-page { padding-top: 68px; }
  .watch-hero { padding: 50px 0 36px; }
  .watch-hero-content { padding: 0 18px; }
  .watch-main-row { gap: 28px; }
  .watch-main-right { width: 180px; }
  .watch-hero-title { font-size: clamp(1.3rem, 4.5vw, 1.7rem); margin-bottom: 10px; }
  .watch-imdb-badge-lg { font-size: 0.8rem; padding: 4px 12px; gap: 6px; }
  .watch-imdb-score { font-size: 0.82rem; }
  .watch-meta-row { font-size: 0.82rem; }
  .watch-duration-row { font-size: 0.82rem; }
  .watch-hero-desc-full { font-size: 0.85rem; margin-bottom: 28px; }
  .watch-btn-watchlist { padding: 10px 22px; font-size: 0.82rem; }
  .watch-btn-watch { padding: 10px 24px; font-size: 0.85rem; }
  .watch-btn-fav { width: 42px; height: 42px; }
  .watch-btn-fav svg { width: 19px; height: 19px; }
  .watch-hero-actions-row { gap: 12px; }
  .watch-stats-bar { gap: 28px; margin-top: 32px; }
  .watch-stat { font-size: 0.82rem; }
  .watch-stat svg { width: 17px; height: 17px; }
  .watch-stat-views { font-size: 0.82rem; }
  .watch-cast-card { width: 90px; padding: 10px 6px; }
  .watch-cast-avatar { width: 52px; height: 52px; }
  .watch-cast-name { font-size: 0.68rem; }
  .watch-cast-role { font-size: 0.6rem; }
  .watch-episode-card { padding: 10px; gap: 12px; }
  .watch-episode-thumb { width: 90px; }
  .watch-episode-number { font-size: 0.65rem; }
  .watch-episode-name { font-size: 0.78rem; }
  .watch-episode-meta { font-size: 0.62rem; }
  .watch-episode-desc { font-size: 0.7rem; }
  .watch-section-title { font-size: 0.85rem; }
  .watch-season-btn { padding: 5px 12px; font-size: 0.72rem; }
  .watch-mode-btn { padding: 6px 16px; font-size: 0.75rem; }
}

/* Phone */
@media (min-width: 480px) and (max-width: 639px) {
  .watch-page { padding-top: 64px; }
  .watch-hero { padding: 36px 0 28px; }
  .watch-hero-content { padding: 0 14px; }
  .watch-main-row { gap: 20px; }
  .watch-main-right { width: 150px; }
  .watch-hero-title { font-size: clamp(1.1rem, 5vw, 1.5rem); margin-bottom: 8px; }
  .watch-imdb-badge-lg { font-size: 0.78rem; padding: 3px 10px; gap: 5px; }
  .watch-imdb-score { font-size: 0.8rem; }
  .watch-meta-row { font-size: 0.78rem; gap: 6px; }
  .watch-duration-row { font-size: 0.78rem; }
  .watch-hero-desc-full { font-size: 0.8rem; margin-bottom: 24px; }
  .watch-stats-bar { gap: 24px; margin-top: 24px; }
  .watch-stat { font-size: 0.8rem; }
  .watch-stat svg { width: 16px; height: 16px; }
  .watch-stat-views { font-size: 0.78rem; }
  .watch-btn-watchlist { padding: 8px 18px; font-size: 0.78rem; gap: 6px; }
  .watch-btn-watch { padding: 8px 20px; font-size: 0.8rem; }
  .watch-btn-fav { width: 38px; height: 38px; }
  .watch-btn-fav svg { width: 17px; height: 17px; }
  .watch-hero-actions-row { gap: 10px; }
  .watch-cast-card { width: 80px; padding: 8px 5px; }
  .watch-cast-avatar { width: 46px; height: 46px; }
  .watch-cast-name { font-size: 0.62rem; }
  .watch-cast-role { font-size: 0.55rem; }
  .watch-episode-card { padding: 8px; gap: 10px; }
  .watch-episode-thumb { width: 75px; }
  .watch-episode-number { font-size: 0.6rem; }
  .watch-episode-name { font-size: 0.72rem; }
  .watch-episode-meta { font-size: 0.58rem; }
  .watch-episode-desc { font-size: 0.65rem; }
  .watch-section-title { font-size: 0.78rem; }
  .watch-season-btn { padding: 4px 10px; font-size: 0.68rem; }
  .watch-mode-btn { padding: 5px 14px; font-size: 0.72rem; }
}

/* Small Phone */
@media (max-width: 479px) {
  .watch-page { padding-top: 60px; }
  .watch-hero { padding: 24px 0 20px; }
  .watch-hero-content { padding: 0 12px; }
  .watch-main-row { gap: 16px; }
  .watch-main-right { width: 120px; }
  .watch-hero-title { font-size: clamp(0.95rem, 5.5vw, 1.3rem); margin-bottom: 6px; }
  .watch-imdb-badge-lg { font-size: 0.7rem; padding: 3px 8px; gap: 4px; }
  .watch-imdb-score { font-size: 0.72rem; }
  .watch-meta-row { font-size: 0.7rem; gap: 5px; }
  .watch-duration-row { font-size: 0.7rem; }
  .watch-hero-desc-full { font-size: 0.75rem; margin-bottom: 20px; line-height: 1.7; }
  .watch-stats-bar { gap: 18px; margin-top: 20px; }
  .watch-stat { font-size: 0.7rem; gap: 5px; }
  .watch-stat svg { width: 14px; height: 14px; }
  .watch-stat-views { font-size: 0.7rem; }
  .watch-btn-watchlist { padding: 7px 16px; font-size: 0.7rem; gap: 5px; }
  .watch-btn-watchlist svg { width: 14px; height: 14px; }
  .watch-btn-watch { padding: 7px 18px; font-size: 0.72rem; gap: 5px; }
  .watch-btn-watch svg { width: 14px; height: 14px; }
  .watch-btn-fav { width: 34px; height: 34px; }
  .watch-btn-fav svg { width: 15px; height: 15px; }
  .watch-hero-actions-row { gap: 8px; }
  .watch-mode-bar { margin-top: 8px; }
  .watch-mode-btn { padding: 5px 12px; font-size: 0.68rem; }
  .watch-section { padding: 12px 0 4px; }
  .watch-section-title { font-size: 0.75rem; margin-bottom: 12px; }
  .watch-section-title::before { width: 3px; height: 12px; }
  .watch-info-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .watch-info-item { padding: 8px 10px; }
  .watch-info-label { font-size: 0.58rem; }
  .watch-info-value { font-size: 0.72rem; }
  .watch-server-btn { padding: 6px 12px; font-size: 0.65rem; }
  .watch-play-btn { padding: 10px 22px; font-size: 0.75rem; }
  .watch-play-btn svg { width: 14px; height: 14px; }
  .watch-season-btn { padding: 5px 10px; font-size: 0.65rem; }
  .watch-episode-card { padding: 8px; gap: 8px; border-radius: 10px; }
  .watch-episode-thumb { width: 70px; border-radius: 6px; }
  .watch-episode-number { font-size: 0.6rem; }
  .watch-episode-name { font-size: 0.7rem; }
  .watch-episode-meta { font-size: 0.55rem; }
  .watch-episode-desc { display: none; }
  .watch-episode-play { width: 28px; height: 28px; }
  .watch-episode-play svg { width: 12px; height: 12px; }
  .watch-cast-card { width: 75px; padding: 6px 4px; }
  .watch-cast-avatar { width: 40px; height: 40px; border-width: 2px; }
  .watch-cast-name { font-size: 0.58rem; }
  .watch-cast-role { font-size: 0.52rem; }
}

/* TV (min 1920) */
@media (min-width: 1920px) {
  .watch-hero { padding: 48px 0 32px; }
  .watch-hero-inner { max-width: 1320px; }
  .watch-main-row { gap: 32px; }
  .watch-main-right { width: 200px; }
  .watch-hero-title { font-size: clamp(1.5rem, 3vw, 2rem); }
  .watch-imdb-badge-lg { font-size: 0.8rem; padding: 3px 10px; gap: 5px; }
  .watch-imdb-score { font-size: 0.8rem; }
  .watch-meta-row { font-size: 0.8rem; }
  .watch-duration-row { font-size: 0.8rem; }
  .watch-hero-desc-full { font-size: 0.85rem; max-width: 580px; }
  .watch-stats-bar { gap: 24px; margin-top: 24px; }
  .watch-stat { font-size: 0.8rem; }
  .watch-btn-watchlist { padding: 10px 22px; font-size: 0.8rem; }
  .watch-btn-watch { padding: 10px 26px; font-size: 0.85rem; }
  .watch-info-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .watch-episode-thumb { width: 110px; }
  .watch-cast-card { width: 90px; padding: 10px 6px; }
  .watch-cast-avatar { width: 56px; height: 56px; }
  .watch-cast-name { font-size: 0.7rem; }
  .watch-cast-role { font-size: 0.6rem; }
  .watch-episode-card { padding: 10px; gap: 12px; }
}

/* Light theme overrides for watch page */
[data-theme="light"] .watch-btn-secondary {
  background: rgba(0,0,0,0.04); color: var(--text-primary);
  border-color: var(--border-color);
}
[data-theme="light"] .watch-btn-secondary:hover {
  background: rgba(0,0,0,0.08);
}
[data-theme="light"] .watch-btn-icon {
  background: rgba(0,0,0,0.04); color: var(--text-primary);
  border-color: var(--border-color);
}
[data-theme="light"] .watch-btn-icon:hover {
  background: rgba(0,0,0,0.08);
}
[data-theme="light"] .watch-btn-primary {
  background: var(--accent);
}
[data-theme="light"] .watch-btn-watchlist {
  background: rgba(0,0,0,0.05); color: var(--text-primary);
  border-color: var(--border-color);
}
[data-theme="light"] .watch-btn-watchlist:hover {
  background: rgba(0,0,0,0.08);
}
[data-theme="light"] .watch-btn-watchlist.active svg { stroke: #3b82f6; }
[data-theme="light"] .watch-btn-watch {
  background: var(--accent); color: #fff;
}
[data-theme="light"] .watch-play-btn {
  background: var(--accent);
}
[data-theme="light"] .watch-age-badge {
  background: var(--accent); color: #fff;
}

/* Light theme overrides — fix white-on-white card names */
[data-theme="light"] .watch-cast-name {
  color: var(--text-primary);
}
[data-theme="light"] .watch-cast-role {
  color: var(--text-secondary);
}
[data-theme="light"] .watch-btn-fav {
  background: rgba(0,0,0,0.05); color: var(--text-secondary);
  border-color: var(--border-color);
}
[data-theme="light"] .watch-btn-fav:hover {
  background: rgba(239,68,68,0.08); color: #ef4444;
  border-color: rgba(239,68,68,0.3);
}
[data-theme="light"] .watch-btn-fav.active {
  background: rgba(239,68,68,0.12); color: #ef4444;
  border-color: #ef4444;
}
/* Light theme: the account dropdown must not stay dark (text would vanish) */
[data-theme="light"] .account-dropdown {
  background: #ffffff; border-color: var(--border-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
[data-theme="light"] .account-dropdown-user { border-bottom-color: var(--border-color); }
[data-theme="light"] .account-dd-item { color: var(--text-primary); }
[data-theme="light"] .account-dd-item:hover { background: rgba(0,0,0,0.05); }
[data-theme="light"] .account-dd-logout { color: #ef4444; }

/* ===== Immediate tap feedback (mobile) for poster / cast / star cards =====
   The :hover frame was delayed on touch devices; :active fires on the first
   touch and box-shadow follows border-radius, so the frame is rounded. */
.movie-card,
.actor-card,
.watch-cast-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* Poster cards */
.movie-card:active::after { box-shadow: inset 0 0 0 2px #38bdf8; }
.movie-card:active .movie-card-poster { filter: brightness(0.6); }
/* Actor cards — use an inset shadow (rounded) instead of a sharp outline */
.actor-card:hover,
.actor-card:active {
  outline: none;
  box-shadow: var(--shadow-card), inset 0 0 0 2px #38bdf8;
}
.actor-card:active .actor-card-avatar { filter: brightness(0.6); }
/* Cast / stars cards */
.watch-cast-card:active {
  box-shadow: inset 0 0 0 2px #38bdf8;
  border-color: transparent;
}
.watch-cast-card:active .watch-cast-avatar {
  border-color: var(--border-color);
  filter: brightness(0.6);
}

/* JS-driven press state (fires on the first tap on iOS too) */
.movie-card.cima-pressed::after { box-shadow: inset 0 0 0 2px #38bdf8; }
.movie-card.cima-pressed .movie-card-poster { filter: brightness(0.6); }
.actor-card.cima-pressed {
  outline: none;
  box-shadow: var(--shadow-card), inset 0 0 0 2px #38bdf8;
}
.actor-card.cima-pressed .actor-card-avatar { filter: brightness(0.6); }
.watch-cast-card.cima-pressed {
  box-shadow: inset 0 0 0 2px #38bdf8;
  border-color: transparent;
}
.watch-cast-card.cima-pressed .watch-cast-avatar {
  border-color: var(--border-color);
  filter: brightness(0.6);
}

.watch-btn-watchlist.active,
.watch-btn-watchlist.active svg { color: #3b82f6 !important; stroke: #3b82f6 !important; }

/* ===== Header search legibility ============================================
   The generic tokens made this bar washed out in BOTH themes: the fill was
   --surface-overlay (6% white on black, 3% black on white), the border
   --border-subtle (8% / 6%), and the placeholder + icon used --text-muted
   (#555570 on black, #9494a6 on white) -- roughly 2.5:1 contrast, so the bar
   read as a ghost. Sizes and behaviour are untouched; only the colours of the
   field, its border and the hint text change.

   Scoped to .search-wrap on purpose: --surface-overlay / --border-subtle /
   --text-muted are shared with cards, dropdowns, buttons and the footer, so
   changing the variables would have restyled the whole site.

   The :focus rules re-state the background because the generic :focus rule up
   in the file resets it to --surface-overlay, and they keep the accent ring.
   Same specificity as the light-theme rules but later, so focus wins. */
.search-wrap input {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.20);
}
.search-wrap input::placeholder { color: #8f8fae; }
.search-wrap .search-icon { color: #a3a3c0; }
.search-wrap input:hover { border-color: rgba(255,255,255,0.30); }
.search-wrap input:focus {
  background: rgba(255,255,255,0.11);
  border-color: var(--accent);
}
[data-theme="light"] .search-wrap input {
  background: #ffffff;
  border-color: rgba(0,0,0,0.22);
}
[data-theme="light"] .search-wrap input::placeholder { color: #6a6a82; }
[data-theme="light"] .search-wrap .search-icon { color: #5a5a72; }
[data-theme="light"] .search-wrap input:hover { border-color: rgba(0,0,0,0.34); }
[data-theme="light"] .search-wrap input:focus {
  background: #ffffff;
  border-color: var(--accent);
}
