/* ============================================================
   PhaFlix — Neon Cinema Theme
   Deep navy + Electric cyan + Amber CTA
   Space Grotesk (headings) + DM Sans (body)
   ============================================================ */

/* ===== TOKENS ===== */
:root {
  --bg-deep: #060a14;
  --bg-body: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2340;
  --bg-elevated: #151d33;
  --border: #1e293b;
  --border-glow: #eab30833;

  --cyan: #eab308;
  --cyan-dim: #eab30899;
  --cyan-glow: #eab30822;
  --amber: #ff6b35;
  --amber-dim: #ff6b3599;
  --amber-glow: #ff6b3522;
  --green: #22c55e;
  --red: #ef4444;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: all 0.25s var(--ease);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

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

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 10, 20, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.header.scrolled {
  background: rgba(6, 10, 20, 0.92);
  border-bottom-color: var(--border);
}
.header__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ===== LOGO ===== */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo__icon { width: 32px; height: 32px; }
.logo__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo__accent { color: var(--cyan); }
.logo__img { height: 36px; width: auto; object-fit: contain; border-radius: 6px; }
.logo__fallback { display: flex; align-items: center; gap: 10px; }

/* ===== LOGIN BUTTON ===== */
.btn--login {
  background: linear-gradient(135deg, var(--cyan), #0088cc);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 7px 18px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.btn--login:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== NAV ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav__link {
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.25s var(--ease), left 0.25s var(--ease);
  border-radius: 1px;
}
.nav__link:hover, .nav__link.active {
  color: var(--text-primary);
}
.nav__link:hover::after, .nav__link.active::after {
  width: 60%;
  left: 20%;
}

/* ===== DROPDOWN ===== */
.nav__dropdown { position: relative; }
.nav__dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 200;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.nav__dropdown:hover .nav__dropdown-menu,
.nav__dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav__dropdown-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.nav__dropdown-menu a:hover {
  background: var(--cyan-glow);
  color: var(--cyan);
}

/* ===== HEADER ACTIONS ===== */
.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
}
.search-toggle:hover {
  background: var(--cyan-glow);
  color: var(--cyan);
}

/* ===== MOBILE MENU ===== */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== SEARCH BAR ===== */
.search-bar {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.search-bar.open {
  max-height: 80px;
}
.search-bar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-bar__input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}
.search-bar__input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}
.search-bar__kbd {
  font-size: 0.6875rem;
  padding: 3px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* ===== MAIN ===== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: calc(100vh - 60px - 200px);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}
.hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(2px) brightness(0.4);
  transform: scale(1.05);
  transition: transform 8s linear;
}
.hero:hover .hero__backdrop {
  transform: scale(1.08);
}
.hero__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-body) 0%,
    rgba(10, 14, 26, 0.8) 40%,
    rgba(10, 14, 26, 0.3) 100%
  );
}
.hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  z-index: 2;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--cyan);
  color: var(--bg-deep);
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-style: italic;
}
.hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.hero__meta-item svg { color: var(--amber); }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Hero carousel */
.hero__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--ease);
}
.hero__slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}
.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
}
.hero__arrow:hover { background: var(--cyan); color: var(--bg-deep); transform: translateY(-50%) scale(1.1); }
.hero__arrow--prev { left: 16px; }
.hero__arrow--next { right: 16px; }
.hero__dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.hero__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}
.hero__dot.active { background: var(--cyan); border-color: var(--cyan); transform: scale(1.3); }
.hero__dot:hover { border-color: #fff; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: var(--cyan);
  color: var(--bg-deep);
}
.btn--primary:hover {
  background: #33dfff;
  box-shadow: 0 0 20px var(--cyan-glow), 0 4px 12px rgba(0,212,255,0.3);
  transform: translateY(-1px);
}
.btn--ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.14);
  border-color: var(--text-muted);
}

/* ===== FILTER BAR (Home) ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-bar select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 32px 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s;
}
.filter-bar select:focus { border-color: var(--cyan); }

/* ===== EXPLORE PILL FILTERS ===== */
.filter-pills { margin-bottom: 20px; }
.filter-pills__group { margin-bottom: 14px; }
.filter-pills__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}
.filter-pills__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--cyan); color: var(--cyan); }
.filter-pill.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
  font-weight: 600;
}
.filter-pill--more {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.filter-pill--more:hover { border-color: var(--cyan); color: var(--cyan); }

/* ===== LOGIN / REGISTER PAGE (60/40 split — FULL SCREEN) ===== */
.login-page {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  background: var(--bg-body);
}
.login-page__left {
  flex: 0 0 60%;
  background: url('/images/background.png') center/cover no-repeat;
  background-color: var(--bg-card);
  position: relative;
  overflow: hidden;
}
.login-page__left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.12) 0%, rgba(10,14,26,0.6) 100%);
}
.login-page__left-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  color: #fff;
  padding: 48px;
  background: linear-gradient(to top, rgba(10,14,26,0.85) 0%, transparent 100%);
}
.login-page__left-content h2 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}
.login-page__left-content p {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  max-width: 420px;
}
.login-page__right {
  flex: 0 0 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow-y: auto;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-card__logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-card__logo img {
  height: 44px;
  margin: 0 auto 12px;
}
.login-card__tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  padding: 3px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
}
.login-card__tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: calc(var(--radius-xs) - 2px);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  font-family: var(--font-body);
}
.login-card__tab.active {
  background: var(--cyan);
  color: #fff;
}
.login-card__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}
.login-card__subtitle {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 24px;
  text-align: center;
}
.login-card .form-group {
  margin-bottom: 16px;
}
.login-card .form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.login-card .form-group input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 11px 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}
.login-card .form-group input:focus { border-color: var(--cyan); }
.login-card .form-group input::placeholder { color: var(--text-muted); }
.login-card .form-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.login-card .form-check a { color: var(--cyan); }
.login-card .btn--submit {
  width: 100%;
  background: linear-gradient(135deg, var(--cyan), #0088cc);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-family: var(--font-body);
}
.login-card .btn--submit:hover { opacity: 0.9; transform: translateY(-1px); }
.login-card .btn--submit:active { transform: translateY(0); }
.login-card__footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.login-card__footer a { color: var(--cyan); font-weight: 600; cursor: pointer; }
.login-card__error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  margin-bottom: 16px;
  display: none;
}
.login-card__error.show { display: block; }
.login-card__success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #22c55e;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  margin-bottom: 16px;
  display: none;
}
.login-card__success.show { display: block; }

/* ===== SECTION HEADER ===== */
.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 14px;
}
.section__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  background: var(--cyan);
  border-radius: 2px;
}
.section__more {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.section__more:hover { color: var(--cyan); }

/* ===== MOVIE GRID ===== */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

/* ===== CARD FADE-IN ANIMATION ===== */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.movie-card {
  animation: cardFadeIn 0.45s var(--ease) both;
}
.movie-card:nth-child(6n+1) { animation-delay: 0ms; }
.movie-card:nth-child(6n+2) { animation-delay: 40ms; }
.movie-card:nth-child(6n+3) { animation-delay: 80ms; }
.movie-card:nth-child(6n+4) { animation-delay: 120ms; }
.movie-card:nth-child(6n+5) { animation-delay: 160ms; }
.movie-card:nth-child(6n+6) { animation-delay: 200ms; }

/* newly appended cards get a slightly longer animation */
.movie-card.new-card {
  animation: cardFadeIn 0.55s var(--ease) both;
}

/* ===== SCROLL MOTION BLUR ===== */
@keyframes blurFadeUp {
  from { opacity: 0; transform: translateY(40px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.section.fade-in {
  animation: blurFadeUp 0.5s var(--ease) both;
}

/* ===== INFINITE SCROLL SENTINEL ===== */

/* ===== MOVIE CARD ===== */
.movie-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  cursor: pointer;
}
.movie-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px var(--cyan-glow);
}
.movie-card__poster {
  aspect-ratio: 2/3;
  background: var(--bg-elevated);
  overflow: hidden;
  position: relative;
}
.movie-card__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.movie-card:hover .movie-card__poster img {
  transform: scale(1.08);
}
.movie-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.movie-card:hover .movie-card__overlay { opacity: 1; }
.movie-card__play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.7);
  opacity: 0;
  transition: all 0.3s var(--ease-bounce);
}
.movie-card:hover .movie-card__play {
  transform: scale(1);
  opacity: 1;
}
.movie-card__info {
  padding: 12px;
}
.movie-card__title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.movie-card__origin {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

/* ===== BADGES ===== */
.badge {
  position: absolute;
  top: 8px;
  z-index: 3;
  padding: 3px 8px;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge--new {
  left: 8px;
  background: var(--green);
  color: #fff;
}
.badge--hot {
  right: 8px;
  background: var(--red);
  color: #fff;
}
.badge--year {
  left: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: var(--text-secondary);
}
.badge--rating {
  right: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ===== HEART BUTTON ===== */
.movie-card__heart {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s, color 0.25s, transform 0.2s, background 0.25s;
}
.movie-card:hover .movie-card__heart { opacity: 1; }
.movie-card__heart.active {
  opacity: 1;
  color: #ef4444;
  background: rgba(239,68,68,0.15);
}
.movie-card__heart:hover {
  background: rgba(239,68,68,0.3);
  color: #ef4444;
}
.movie-card__heart.active:hover {
  background: rgba(239,68,68,0.4);
}
.detail-hero__heart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}
.detail-hero__heart:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}
.detail-hero__heart.active {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  color: #ef4444;
}

/* ===== DETAIL PAGE ===== */
.detail-hero {
  position: relative;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}
.detail-hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(0.3);
}
.detail-hero__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-body) 0%, rgba(10,14,26,0.7) 50%, rgba(10,14,26,0.2) 100%);
}
.detail-hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  display: flex;
  gap: 24px;
  align-items: flex-end;
  z-index: 2;
}
.detail-hero__poster {
  width: 140px;
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  border: 2px solid var(--border);
}
.detail-hero__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-hero__info { flex: 1; min-width: 0; }
.detail-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}
.detail-hero__origin {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 8px;
}
.detail-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.detail-tag {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  transition: var(--transition);
}
.detail-tag:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-glow);
}

/* ===== PLAYER ===== */
.player-section {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.player-wrapper {
  position: relative;
  padding-top: 56.25%;
  background: #000;
}
.player-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

/* ===== SERVER TABS ===== */
.server-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.server-tabs::-webkit-scrollbar { display: none; }
.server-tab {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.server-tab .server-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.server-dot--vsmov { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-dim); }
.server-dot--kkphim { background: var(--amber); box-shadow: 0 0 6px var(--amber-dim); }
.server-tab:hover { border-color: var(--text-muted); color: var(--text-primary); }
.server-tab.active {
  background: var(--cyan);
  color: var(--bg-deep);
  border-color: var(--cyan);
}
.server-tab.active .server-dot { background: var(--bg-deep); box-shadow: none; }

/* ===== EPISODE GRID ===== */
.episodes-section { margin-bottom: 40px; }
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.ep-btn {
  padding: 8px 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: var(--transition);
  color: var(--text-secondary);
}
.ep-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-glow);
}
.ep-btn.active {
  background: var(--cyan);
  color: var(--bg-deep);
  border-color: var(--cyan);
  font-weight: 700;
}

/* ===== ARC GROUPING (One Piece) ===== */
.ep-view-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--border);
}
.ep-view-btn {
  padding: 6px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.ep-view-btn:hover { color: var(--text-primary); }
.ep-view-btn.active {
  background: var(--cyan);
  color: var(--bg-deep);
}
.arc-saga-divider {
  margin-bottom: 8px;
}
.arc-saga-divider h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  border-left: 4px solid var(--cyan);
  margin-bottom: 12px;
}
.arc-group {
  margin-bottom: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 16px;
}
.arc-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.arc-group__name {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
}
.arc-group__range {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.arc-group__episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 4px;
}

/* ===== BREADCRUMBS ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 0.8125rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb__sep { color: var(--text-muted); opacity: 0.5; }
.breadcrumb__current { color: var(--text-secondary); }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.skeleton--poster { aspect-ratio: 2/3; }
.skeleton--text { height: 14px; margin-bottom: 8px; }
.skeleton--title { height: 20px; width: 60%; margin-bottom: 12px; }

/* ===== ERROR STATE ===== */
.empty {
  text-align: center;
  padding: 80px 20px;
}
.empty__icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.empty__text {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.pagination__btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  transition: var(--transition);
}
.pagination__btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.pagination__btn.active {
  background: var(--cyan);
  color: var(--bg-deep);
  border-color: var(--cyan);
}
.pagination__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pagination__info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 4px;
}
.pagination__input {
  width: 52px;
  height: 36px;
  text-align: center;
  font-size: 0.8125rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.pagination__input::-webkit-inner-spin-button,
.pagination__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pagination__input:focus { border-color: var(--cyan); }

/* ===== SCROLL TO TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover {
  background: var(--cyan);
  color: var(--bg-deep);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 48px 20px 24px;
}
.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
}
.footer__brand { margin-bottom: 32px; }
.footer__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 400px;
  margin-top: 12px;
  line-height: 1.6;
}
.footer__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer__col h4 {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.footer__col a {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 3px 0;
  transition: color 0.2s;
}
.footer__col a:hover { color: var(--cyan); }
.footer__social {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.footer__social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer__social a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-glow);
  transform: translateY(-2px);
}
.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== RECENTLY WATCHED ===== */
.recent-section { margin-bottom: 40px; }
.recent-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.recent-scroll::-webkit-scrollbar { display: none; }
.recent-item {
  flex-shrink: 0;
  width: 120px;
  cursor: pointer;
}
.recent-item__poster {
  width: 120px;
  height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 6px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.recent-item:hover .recent-item__poster { border-color: var(--cyan); }
.recent-item__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-item__title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.4s var(--ease) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== FOCUS STATES ===== */
*:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.movie-card:focus-visible,
.ep-btn:focus-visible,
.nav__link:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== DASHBOARD ===== */
.dashboard {
  display: flex;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.dash-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 16px;
  height: fit-content;
  position: sticky;
  top: 80px;
}
.dash-user {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}
.dash-user__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg-body);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.dash-user__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.dash-user__email {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.dash-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}
.dash-tab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.dash-tab.active {
  background: var(--cyan);
  color: var(--bg-body);
}
.dash-tab svg { flex-shrink: 0; }
.dash-logout {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.dash-content {
  flex: 1;
  min-width: 0;
}
.dash-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-section__header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}
.dash-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.dash-empty svg {
  margin-bottom: 16px;
  opacity: 0.4;
}
.dash-empty p {
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.dash-form {
  max-width: 400px;
}
.dash-form h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.dash-form__group {
  margin-bottom: 16px;
}
.dash-form__group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.dash-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.dash-input:focus {
  outline: none;
  border-color: var(--cyan);
}
.dash-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dash-form__divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 24px 0;
}
.dash-settings {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.dash-setting__label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.dash-setting__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.dash-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.dash-toggle input { opacity: 0; width: 0; height: 0; }
.dash-toggle__slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  transition: 0.3s;
}
.dash-toggle__slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: 0.3s;
}
.dash-toggle input:checked + .dash-toggle__slider {
  background: var(--cyan);
}
.dash-toggle input:checked + .dash-toggle__slider::before {
  transform: translateX(20px);
}
.btn--sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}
.login-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg-body);
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 6px;
  vertical-align: middle;
}
.nav__link--fav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav__link--fav svg {
  color: #ef4444;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .movie-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .hero { height: 350px; }
  .detail-hero__content { flex-direction: column; align-items: flex-start; }
  .detail-hero__poster { width: 110px; }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 4px;
    z-index: 150;
  }
  .nav.open .nav__link { padding: 10px 14px; }
  .nav__dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    max-height: 200px;
    background: var(--bg-card);
    box-shadow: none;
    border: none;
  }
  .menu-toggle { display: flex; }
  .hero { height: 300px; }
  .hero__content { padding: 20px; }
  .movie-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .footer__links { grid-template-columns: 1fr 1fr; }
  .dashboard { flex-direction: column; }
  .dash-sidebar { width: 100%; position: static; }
  .dash-tabs { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .dash-tab { flex: none; }
  .login-page { flex-direction: column; }
  .login-page__left { display: none; }
  .login-page__right { flex: 1; padding: 24px; }
  .login-card { max-width: 100%; }
}
@media (max-width: 480px) {
  .movie-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .movie-card__info { padding: 8px; }
  .movie-card__title { font-size: 0.8125rem; }
  .hero { height: 260px; }
  .hero__title { font-size: 1.25rem; }
  .detail-hero { height: 280px; }
  .detail-hero__poster { width: 90px; }
  .episode-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .login-page__right { padding: 16px; }
  .login-card__logo { margin-bottom: 16px; }
}
