/* =============================================
   WebPhim — Netflix-Inspired Premium Theme
   Version 3.0
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Dark cinematic palette */
  --bg-primary: #141414;
  --bg-secondary: #1a1a1a;
  --bg-elevated: #222;
  --bg-card: #181818;
  --bg-card-hover: #252525;
  --bg-overlay: rgba(20, 20, 20, 0.85);

  /* Accent — Netflix-style red */
  --accent: #e50914;
  --accent-hover: #f40612;
  --accent-dark: #b20710;
  --accent-glow: rgba(229, 9, 20, 0.35);

  /* Text */
  --text-primary: #fff;
  --text-secondary: #b3b3b3;
  --text-muted: #777;
  --text-dim: #555;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);

  /* Tags */
  --tag-blue: #2196f3;
  --tag-green: #4caf50;
  --tag-gold: #ffb300;
  --tag-purple: #9c27b0;

  /* Layout */
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --container-padding: clamp(16px, 4vw, 60px);
  --card-width: 185px;

  /* Timing */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --speed: 0.25s;
  --speed-slow: 0.45s;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
}

/* ==================================================================
   NAVBAR — Netflix-style transparent → solid on scroll
   ================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--container-padding);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 10%, transparent);
  transition: background var(--speed-slow) var(--ease);
}

.navbar.scrolled {
  background: rgba(20, 20, 20, 0.98);
  box-shadow: 0 1px 0 var(--border);
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  z-index: 2;
}

.brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
}

.nav-brand span {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* Center links */
.nav-center {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  padding-left: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-links a {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--speed) var(--ease);
  white-space: nowrap;
}

.nav-links a:hover {
  color: #e5e5e5;
}

.nav-links a.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Search */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 6px;
  transition: color var(--speed);
}

.search-toggle:hover {
  color: var(--accent);
}

.search-form {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--text-primary);
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.35s var(--ease);
  pointer-events: none;
}

.search-form.open {
  width: 260px;
  opacity: 1;
  padding: 4px 8px 4px 12px;
  pointer-events: all;
}

.search-form input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  padding: 6px 0;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  transition: color var(--speed);
}

.search-close:hover {
  color: var(--text-primary);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(16px);
  z-index: 999;
  padding: 16px;
  overflow-y: auto;
  animation: fadeUp 0.3s var(--ease);
}

.mobile-menu.open {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-search {
  margin-bottom: 16px;
}

.mobile-search form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.mobile-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
}

.mobile-search input::placeholder {
  color: var(--text-muted);
}

.mobile-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.mobile-menu>a {
  display: block;
  padding: 14px 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--speed);
}

.mobile-menu>a:hover,
.mobile-menu>a:active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.mobile-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ==================================================================
   HERO BANNER — Cinematic Netflix-style
   ================================================================== */
.hero {
  position: relative;
  width: 100%;
  height: 85vh;
  min-height: 500px;
  max-height: 800px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 1.2s var(--ease);
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(20, 20, 20, 0.95) 0%, rgba(20, 20, 20, 0.6) 25%, rgba(20, 20, 20, 0.1) 55%, rgba(20, 20, 20, 0) 100%),
    linear-gradient(to top, var(--bg-primary) 0%, rgba(20, 20, 20, 0.5) 20%, transparent 50%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 15%);
}

.hero-content {
  position: absolute;
  bottom: 22%;
  left: var(--container-padding);
  max-width: 520px;
  z-index: 5;
}

.hero-top-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-top-tag .n-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 900;
  border-radius: 3px;
  letter-spacing: 0;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 10px;
  letter-spacing: -1px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7);
}

.hero-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hero-info span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hero-info .match {
  color: var(--tag-green);
  font-weight: 700;
}

.hero-info .quality-tag {
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.hero-desc {
  font-size: 0.92rem;
  color: #ddd;
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Netflix-style buttons */
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  background: white;
  color: #141414;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-play:hover {
  background: #e0e0e0;
}

.btn-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  background: rgba(109, 109, 110, 0.7);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-info:hover {
  background: rgba(109, 109, 110, 0.5);
}

/* Dots */
.hero-dots {
  position: absolute;
  bottom: 20%;
  right: var(--container-padding);
  display: flex;
  gap: 3px;
  z-index: 10;
}

.hero-dot {
  width: 14px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all var(--speed);
}

.hero-dot.active {
  background: var(--text-primary);
  width: 24px;
}

/* ==================================================================
   SECTION LAYOUT
   ================================================================== */
.main-content {
  position: relative;
  z-index: 2;
  margin-top: -80px;
  padding: 0 var(--container-padding) 40px;
}

.section {
  margin-bottom: 32px;
  position: relative;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
  position: relative;
  z-index: 10;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-more {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color var(--speed);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.section-more:hover {
  color: var(--accent);
}

/* ==================================================================
   CATEGORY CHIPS
   ================================================================== */
.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
  scroll-snap-align: start;
}

.category-chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.03);
}

/* ==================================================================
   MOVIE CARDS — Netflix hover expansion
   ================================================================== */
.movie-carousel-wrapper {
  position: relative;
  z-index: 5;
}

.movie-carousel {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 32px 0;
  margin: -8px 0 -16px;
}

.movie-carousel::-webkit-scrollbar {
  display: none;
}

/* Carousel arrows */
.carousel-btn {
  position: absolute;
  top: 0;
  bottom: 16px;
  width: 48px;
  background: rgba(20, 20, 20, 0.7);
  border: none;
  color: white;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  opacity: 0;
}

.movie-carousel-wrapper:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  background: rgba(20, 20, 20, 0.95);
}

.carousel-btn.prev {
  left: -4px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.carousel-btn.next {
  right: -4px;
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Card */
.movie-card {
  flex-shrink: 0;
  width: var(--card-width);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  position: relative;
  border-radius: var(--radius);
  overflow: visible;
  transition: transform 0.35s var(--ease), z-index 0s 0.35s;
}

.movie-card:hover {
  transform: scale(1.15);
  z-index: 30;
  transition: transform 0.35s var(--ease), z-index 0s;
}

.movie-card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.movie-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s;
}

.movie-card:hover .movie-card-poster img {
  filter: brightness(0.5);
}

/* Card overlay on hover */
.card-hover-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.3s;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
  border-radius: var(--radius);
}

.movie-card:hover .card-hover-info {
  opacity: 1;
}

.card-hover-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.card-hover-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.card-hover-meta .match {
  color: var(--tag-green);
  font-weight: 700;
}

.card-hover-buttons {
  display: flex;
  gap: 5px;
}

.card-hover-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: rgba(42, 42, 42, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.card-hover-btn.primary {
  background: white;
  color: #141414;
  border-color: white;
}

.card-hover-btn:hover {
  border-color: white;
  background: rgba(255, 255, 255, 0.15);
}

.card-hover-btn.primary:hover {
  background: #e0e0e0;
}

/* Badges on cards */
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  z-index: 3;
  letter-spacing: 0.5px;
}

.card-badge.episode {
  top: auto;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  font-size: 0.65rem;
}

.card-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  transition: transform 0.25s var(--ease-bounce);
}

.movie-card:hover .card-play-icon {
  transform: translate(-50%, -50%) scale(1);
}

.card-play-icon svg {
  width: 18px;
  height: 18px;
  color: #141414;
  margin-left: 2px;
}

/* Card info below poster (visible when NOT hovering) */
.movie-card-info {
  padding: 8px 2px 0;
  transition: opacity 0.3s;
}

.movie-card:hover .movie-card-info {
  opacity: 0;
}

.movie-card-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #e5e5e5;
}

.movie-card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.movie-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Movie Grid */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 8px;
}

.movie-grid .movie-card {
  width: 100%;
}

.movie-grid .movie-card:hover {
  transform: scale(1.05);
  z-index: 5;
}

.movie-grid .movie-card-info {
  padding: 8px 4px 4px;
}

.movie-grid .movie-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  height: 2.7em;
  /* Force exact 2-line height for uniformity */
  -webkit-line-clamp: 2;
  line-height: 1.35;
}


.movie-grid .movie-card-meta {
  display: flex;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ==================================================================
   MOVIE DETAIL PAGE
   ================================================================== */
.movie-detail {
  padding-top: 64px;
}

.detail-backdrop {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
}

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.detail-backdrop .vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg-primary) 0%, rgba(20, 20, 20, 0.6) 40%, transparent 70%),
    linear-gradient(to right, rgba(20, 20, 20, 0.8) 0%, transparent 40%);
}

.detail-main {
  max-width: 1100px;
  margin: -200px auto 0;
  padding: 0 var(--container-padding) 48px;
  position: relative;
  z-index: 2;
}

.detail-header {
  display: flex;
  gap: 32px;
  margin-bottom: 28px;
}

.detail-poster {
  flex-shrink: 0;
  width: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  aspect-ratio: 2/3;
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  flex: 1;
  min-width: 0;
}

.detail-title {
  font-size: clamp(1.5rem, 3.5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.detail-origin {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 0.76rem;
  font-weight: 600;
}

.detail-tag.red {
  background: var(--accent);
  color: white;
}

.detail-tag.outlined {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.detail-tag.green {
  color: var(--tag-green);
  font-weight: 700;
}

.detail-tag.gold {
  color: var(--tag-gold);
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Description + metadata panel */
.detail-panel {
  background: rgba(35, 35, 35, 0.6);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
}

.detail-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 18px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.detail-meta-item {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-meta-item .label {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 80px;
}

.detail-meta-item .value {
  color: var(--text-secondary);
}

.detail-meta-item .value a {
  color: var(--text-primary);
  transition: color var(--speed);
}

.detail-meta-item .value a:hover {
  color: var(--accent);
}

/* ==================================================================
   EPISODES SECTION
   ================================================================== */
.episodes-box {
  margin-bottom: 28px;
}

.episodes-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.server-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.server-tab {
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: color var(--speed);
}

.server-tab:hover {
  color: var(--text-secondary);
}

.server-tab.active {
  color: var(--text-primary);
}

.server-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.episodes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.episode-btn {
  padding: 8px 0;
  width: 72px;
  text-align: center;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}

.episode-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.episode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ==================================================================
   PLAYER PAGE
   ================================================================== */
.player-page {
  padding-top: 64px;
  background: #000;
}

.player-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
}

.player-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.player-below {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px var(--container-padding);
}

.player-now-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.player-now-ep {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ==================================================================
   LISTING / SEARCH PAGES
   ================================================================== */
.listing-page {
  padding: 80px var(--container-padding) 40px;
  overflow-x: hidden;
}

.listing-header {
  margin-bottom: 20px;
}

.listing-header h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
}

.listing-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 32px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.page-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ==================================================================
   FOOTER
   ================================================================== */
.footer {
  padding: 36px var(--container-padding) 20px;
  background: #0a0a0a;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 3px 0;
  transition: color var(--speed);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ==================================================================
   LOADING
   ================================================================== */
.initial-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ==================================================================
   BACK TO TOP
   ================================================================== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid var(--border);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all var(--speed);
  z-index: 500;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ==================================================================
   RESPONSIVE
   ================================================================== */
@media (max-width: 1024px) {
  :root {
    --card-width: 160px;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
  }

  .detail-poster {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-center {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  :root {
    --card-width: 130px;
  }

  .movie-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 6px;
  }

  .hero {
    height: 60vh;
    min-height: 380px;
    max-height: 550px;
  }

  .hero-content {
    bottom: 16%;
    max-width: 80%;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-desc {
    font-size: 0.82rem;
    -webkit-line-clamp: 2;
    margin-bottom: 14px;
  }

  .hero-dots {
    bottom: 14%;
  }

  .main-content {
    margin-top: -48px;
  }

  .btn-play,
  .btn-info {
    padding: 8px 18px;
    font-size: 0.82rem;
  }

  .movie-card:hover {
    transform: none;
    z-index: auto;
  }

  .movie-card:hover .card-hover-info {
    opacity: 0;
  }

  .movie-card:hover .movie-card-poster img {
    filter: none;
  }

  .movie-card:hover .card-play-icon {
    transform: translate(-50%, -50%) scale(0);
  }

  .movie-card:hover .movie-card-info {
    opacity: 1;
  }

  .detail-backdrop {
    height: 40vh;
    min-height: 260px;
  }

  .detail-main {
    margin-top: -100px;
  }

  .detail-header {
    gap: 16px;
  }

  .detail-poster {
    width: 120px;
    border-radius: var(--radius-md);
  }

  .detail-title {
    font-size: 1.2rem;
  }

  .detail-origin {
    font-size: 0.82rem;
    margin-bottom: 10px;
  }

  .detail-tags {
    gap: 4px;
    margin-bottom: 12px;
  }

  .detail-tag {
    padding: 3px 8px;
    font-size: 0.7rem;
  }

  .detail-actions .btn-play,
  .detail-actions .btn-info {
    padding: 7px 16px;
    font-size: 0.8rem;
  }

  .detail-panel {
    padding: 16px;
  }

  .detail-desc {
    font-size: 0.85rem;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.05rem;
  }

  .footer {
    padding: 30px 16px 20px;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 12px;
  }

  .footer-brand {
    grid-column: 1 / -1;
    margin-bottom: -10px;
  }

  .footer-desc {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  .footer-col h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: #e5e5e5;
  }

  .footer-col a {
    font-size: 0.85rem;
    padding: 6px 0;
  }


  .episode-btn {
    width: 60px;
    padding: 7px 0;
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .navbar {
    height: 56px;
  }

  .hero {
    height: 55vh;
    min-height: 320px;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .hero-content {
    max-width: 90%;
  }

  .hero-info span {
    font-size: 0.78rem;
  }

  .hero-desc {
    -webkit-line-clamp: 2;
    font-size: 0.8rem;
  }

  .detail-poster {
    width: 100px;
  }

  .detail-title {
    font-size: 1.1rem;
  }
}

/* Categories / Countries index */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.index-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s var(--ease);
}

.index-card:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}