/* ==========================================================================
   FIMONLINE v2.0 — Noir Velvet Cinema Design System
   Ultra-fast, GPU-accelerated, mobile-first cinema UI
   ========================================================================== */

:root {
  --bg-obsidian: #08090c;
  --bg-surface: #111319;
  --bg-elevated: #181b24;
  --bg-glass: rgba(12, 14, 20, 0.78);
  --bg-glass-strong: rgba(8, 9, 12, 0.92);

  --accent-crimson: #e50914;
  --accent-crimson-bright: #ff2a36;
  --accent-crimson-glow: rgba(229, 9, 20, 0.35);
  --accent-gold: #f5c451;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-sky: #38bdf8;

  --text-primary: #f5f6fa;
  --text-secondary: #a1a7b8;
  --text-muted: #676e82;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 28px 80px rgba(0, 0, 0, 0.85);

  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --header-h: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --bottom-nav-h: 62px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(229, 9, 20, 0.11), transparent 60%),
    var(--bg-obsidian);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-obsidian);
}
::-webkit-scrollbar-thumb {
  background: #272c3a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3d4459;
}

/* ==========================================================================
   HEADER NAVIGATION
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 4% 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 900;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0.94) 0%, rgba(8, 9, 12, 0) 100%);
  transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled,
.site-header.solid {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border-subtle);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
  min-width: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 800;
  font-size: 1.38rem;
  letter-spacing: 0.06em;
  user-select: none;
  flex-shrink: 0;
}

.brand-logo .brand-fim {
  background: linear-gradient(135deg, #ff2a36 0%, #e50914 60%, #b80610 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-logo .brand-online {
  color: #ffffff;
}

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-crimson);
  box-shadow: 0 0 10px var(--accent-crimson);
  margin-left: 3px;
  margin-bottom: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.main-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.main-nav a.active {
  color: #fff;
  font-weight: 600;
  background: rgba(229, 9, 20, 0.16);
  box-shadow: inset 0 0 0 1px rgba(229, 9, 20, 0.35);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0 14px;
  height: 38px;
  width: 240px;
  transition: width 0.25s var(--ease-out), border-color 0.2s, background 0.2s;
}

.header-search:focus-within {
  width: 300px;
  border-color: rgba(229, 9, 20, 0.6);
  background: rgba(17, 19, 25, 0.95);
}

.header-search input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.88rem;
  color: #fff;
  padding-right: 8px;
}

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

.header-search button {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.header-search button:hover {
  color: #fff;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.18s var(--ease-out), background 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-crimson-bright), var(--accent-crimson));
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-crimson-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff3d48, #f00b17);
  box-shadow: 0 12px 30px rgba(229, 9, 20, 0.5);
  transform: translateY(-1px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

/* Language / Audio Badges (High-contrast solid pills for bright & dark posters) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.badge-dual {
  background: #059669;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.badge-lt {
  background: #d97706;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.badge-tm {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.badge-vs {
  background: #d90b16;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.badge-quality {
  background: rgba(8, 10, 16, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-family: var(--font-mono);
}

.badge-rating {
  background: rgba(18, 15, 8, 0.92);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 196, 81, 0.55);
  font-family: var(--font-mono);
}

.badge-ep {
  background: rgba(8, 10, 16, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

/* Subtle PWA Install Buttons & Slim Top Banner (Sạp Truyện Khuya style) */
.btn-install-subtle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e4e7f0;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn-install-subtle svg {
  color: var(--accent-gold);
  flex-shrink: 0;
}

.btn-install-subtle:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(245, 196, 81, 0.45);
  color: #fff;
}

/* Slim Top Banner: HIDDEN on PC/Desktop (header already has Cài App button), shown ONLY on Mobile */
.pwa-top-banner {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 880;
  background: rgba(17, 20, 28, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 4%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 0.84rem;
  color: #d6dae6;
}

.pwa-banner-left svg {
  color: var(--accent-gold);
  flex-shrink: 0;
}

.pwa-banner-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pwa-banner-cta {
  padding: 6px 14px;
  border-radius: 7px;
  background: #e9ae58;
  color: #12141a;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}

.pwa-banner-cta:hover {
  background: #f5be6b;
}

.pwa-banner-close {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.pwa-banner-close:hover {
  color: #fff;
}

/* Mobile-only top padding when banner is visible */

/* ==========================================================================
   HERO BILLBOARD
   ========================================================================== */
.hero-billboard {
  position: relative;
  width: 100%;
  min-height: 76vh;
  max-height: 780px;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + var(--safe-top) + 40px) 4% 64px;
  overflow: hidden;
  background: var(--bg-obsidian);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: brightness(0.62) saturate(1.1);
  transform: scale(1.02);
  transition: opacity 0.6s ease;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 9, 12, 0.96) 0%, rgba(8, 9, 12, 0.72) 45%, rgba(8, 9, 12, 0.15) 100%),
    linear-gradient(0deg, var(--bg-obsidian) 0%, rgba(8, 9, 12, 0.45) 32%, transparent 65%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 660px;
  animation: heroReveal 0.65s var(--ease-out) both;
}

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

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-crimson-bright);
  margin-bottom: 12px;
}

.hero-kicker::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent-crimson);
}

.hero-title {
  font-size: clamp(1.9rem, 4.1vw, 3.2rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.7);
}

.hero-origin {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 14px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 0.96rem;
  color: #cfd4e2;
  line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-dots {
  position: absolute;
  right: 4%;
  bottom: 28px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  transition: width 0.25s, background 0.25s;
}

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

/* ==========================================================================
   MOVIE ROWS & CAROUSEL
   ========================================================================== */
.main-container {
  position: relative;
  z-index: 3;
  padding: 20px 4% 80px;
}

.page-main {
  padding: calc(var(--header-h) + var(--safe-top) + 22px) 4% 90px;
  min-height: calc(100vh - 76px);
}

.movie-row {
  margin-bottom: 40px;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.row-title {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-title::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--accent-crimson);
}

.row-more {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.row-more:hover {
  color: var(--accent-crimson-bright);
}

.carousel-wrap {
  position: relative;
}

.movie-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 2px 14px;
  scrollbar-width: none;
}

.movie-carousel::-webkit-scrollbar {
  display: none;
}

.movie-carousel .movie-card {
  flex: 0 0 192px;
  scroll-snap-align: start;
}

.carousel-nav {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(8, 9, 12, 0.85);
  border: 1px solid var(--border-hover);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}

.carousel-wrap:hover .carousel-nav {
  opacity: 1;
}

.carousel-nav:hover {
  background: var(--accent-crimson);
  border-color: var(--accent-crimson);
}

.carousel-nav.prev { left: -14px; }
.carousel-nav.next { right: -14px; }

/* Movie Grid (Genres, Search, My List) */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* ==========================================================================
   MOVIE CARD
   ========================================================================== */
.movie-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.28s var(--ease-out), border-color 0.25s, box-shadow 0.28s;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(229, 9, 20, 0.45);
  box-shadow: var(--shadow-card);
}

.card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #141720;
  overflow: hidden;
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease-out);
}

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

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0.45) 0%, transparent 35%, rgba(8, 9, 12, 0.88) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}

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

.card-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-crimson);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.6);
  transform: scale(0.85);
  transition: transform 0.25s var(--ease-out);
}

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

.card-badges-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

.card-badges-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

.card-body {
  padding: 11px 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
  z-index: 3;
}

.card-progress-bar {
  height: 100%;
  background: var(--accent-crimson);
}

/* ==========================================================================
   SHIMMER SKELETON
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, #13161f 25%, #1d2230 50%, #13161f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

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

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
  max-width: 560px;
  margin: 60px auto;
  padding: 48px 32px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

.empty-state h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 22px;
}

/* ==========================================================================
   MOVIE DETAIL MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(8px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.movie-modal {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  animation: modalUp 0.28s var(--ease-out);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(8, 9, 12, 0.8);
  border: 1px solid var(--border-hover);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--accent-crimson);
}

.modal-hero {
  position: relative;
  height: 320px;
  background: #0d0f14;
  overflow: hidden;
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.modal-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-surface) 0%, rgba(17, 19, 25, 0.35) 55%, transparent 100%);
}

.modal-hero-info {
  position: absolute;
  bottom: 20px;
  left: 28px;
  right: 28px;
  z-index: 2;
}

.modal-hero-info h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-body {
  padding: 20px 28px 28px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-synopsis {
  color: #cfd4e2;
  font-size: 0.94rem;
  line-height: 1.65;
  margin-bottom: 20px;
}

.modal-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 22px;
}

.modal-details-grid span {
  color: var(--text-muted);
}

.modal-server-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.server-tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.server-tab.active,
.server-tab:hover {
  background: rgba(229, 9, 20, 0.18);
  border-color: var(--accent-crimson);
  color: #fff;
}

.modal-ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.ep-pill {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-align: center;
  transition: all 0.18s;
}

.ep-pill:hover {
  background: var(--accent-crimson);
  border-color: var(--accent-crimson);
  color: #fff;
}

/* ==========================================================================
   FILTER BAR (GENRES / SEARCH)
   ========================================================================== */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.filter-select,
.filter-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.88rem;
  color: #fff;
  outline: none;
  min-width: 155px;
  transition: border-color 0.2s;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--accent-crimson);
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 600;
  transition: all 0.2s;
}

.chip:hover,
.chip.active {
  background: rgba(229, 9, 20, 0.16);
  border-color: var(--accent-crimson);
  color: #fff;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 82px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(20, 23, 32, 0.96);
  border: 1px solid var(--border-hover);
  border-left: 4px solid var(--accent-crimson);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  animation: toastIn 0.25s var(--ease-out);
}

.toast.success { border-left-color: var(--accent-emerald); }
.toast.warning { border-left-color: var(--accent-amber); }
.toast.error { border-left-color: #ef4444; }

.toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   FOOTER & MOBILE BOTTOM NAV
   ========================================================================== */
.site-footer {
  padding: 22px 4%;
  border-top: 1px solid var(--border-subtle);
  background: #06070a;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.mobile-bottom-nav {
  display: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 960px) {
  .main-nav {
    display: none;
  }
  .header-search {
    width: 190px;
  }
  .header-search:focus-within {
    width: 220px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 58px;
  }

  body {
    padding-bottom: calc(var(--bottom-nav-h) + max(16px, env(safe-area-inset-bottom, 16px)));
  }

  .header-search {
    display: none;
  }

  .header-install-btn {
    display: none !important;
  }

  .pwa-top-banner {
    display: flex;
  }

  body.has-pwa-banner .page-main {
    padding-top: calc(var(--header-h) + var(--safe-top) + 64px);
  }

  body.has-pwa-banner .hero-billboard {
    padding-top: calc(var(--header-h) + var(--safe-top) + 64px);
  }

  .page-header {
    margin-bottom: 14px;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    margin-bottom: 16px;
  }

  .filter-select {
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .filter-select:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .site-footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding-bottom: 24px;
  }

  .hero-billboard {
    min-height: 62vh;
    padding: calc(var(--header-h) + var(--safe-top) + 24px) 4% 40px;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-desc {
    -webkit-line-clamp: 2;
    font-size: 0.88rem;
  }

  .carousel-nav {
    display: none !important;
  }

  .movie-carousel .movie-card {
    flex: 0 0 41vw;
    max-width: 170px;
  }

  .movie-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Bottom Sheet Modal on Mobile */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .movie-modal {
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }

  .modal-hero {
    height: 220px;
  }

  .modal-hero-info {
    left: 18px;
    right: 18px;
  }

  .modal-body {
    padding: 16px 18px 28px;
  }

  .site-footer {
    padding-bottom: 24px;
  }

  /* Native Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(10, 12, 18, 0.94);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-top: 1px solid var(--border-subtle);
    padding: 8px 6px max(16px, env(safe-area-inset-bottom, 16px));
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    transition: color 0.2s;
  }

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

  .bottom-nav-item.active {
    color: var(--accent-crimson-bright);
  }
}
