/* ─── CSS VARIABLES ─────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary:      #08080f;
  --bg-secondary:    #0f0f1a;
  --bg-surface:      #13131f;
  --bg-surface-2:    #1a1a2e;
  --bg-surface-3:    #1f1f35;
  --bg-hover:        #22223a;

  --accent:          #6c63ff;
  --accent-dark:     #4f46e5;
  --accent-glow:     rgba(108, 99, 255, 0.35);
  --accent-2:        #00d4ff;
  --accent-2-glow:   rgba(0, 212, 255, 0.25);
  --accent-gradient: linear-gradient(135deg, #6c63ff 0%, #00d4ff 100%);

  --text-primary:    #f0f0ff;
  --text-secondary:  #9898b8;
  --text-muted:      #5a5a7a;
  --text-disabled:   #3a3a5a;

  --gold:            #ffd700;
  --gold-dim:        #c9a227;
  --danger:          #ff4d6d;
  --success:         #00e676;
  --warning:         #ff9800;
  --adult-color:     #ff4d6d;

  --card-border:     rgba(255,255,255,0.06);
  --card-shadow:     0 8px 32px rgba(0,0,0,0.5);
  --glow-shadow:     0 0 40px var(--accent-glow);

  /* Sizes */
  --navbar-h:        68px;
  --card-width:      170px;
  --border-radius:   12px;
  --border-radius-sm:8px;
  --border-radius-lg:20px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-med:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', 'Outfit', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; border: none; background: none; font-family: inherit; }

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

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

/* ─── NAVBAR ────────────────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  padding: 0 48px;
  gap: 32px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(to bottom, rgba(8,8,15,0.9) 0%, transparent 100%);
  backdrop-filter: blur(0px);
}

#navbar.scrolled {
  background: rgba(8,8,15,0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 10px 30px rgba(0,0,0,0.5);
  height: calc(var(--navbar-h) - 6px);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 850;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.nav-logo:hover .nav-logo-icon {
  transform: rotate(-10deg) scale(1.08);
  box-shadow: 0 0 35px rgba(108, 99, 255, 0.6), 0 0 60px rgba(0, 212, 255, 0.3);
}

.nav-logo:hover .logo-img {
  transform: rotate(10deg);
}

.nav-logo-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 16px; right: 16px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 99px;
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-link.active::after {
  transform: scaleX(1);
  background: var(--accent-gradient);
}

/* Search Box */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

#search-box {
  position: relative;
}

#search-input {
  width: 220px;
  height: 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 0 16px 0 42px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

#search-input:focus {
  width: 300px;
  background: rgba(8,8,15,0.85);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), inset 0 0 0 1px var(--accent);
}

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

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s ease;
}

#search-input:focus ~ .search-icon {
  color: var(--accent-2);
}

#search-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

#search-close:hover {
  background: var(--danger);
  color: white;
}

#search-input:not(:placeholder-shown) ~ #search-close {
  opacity: 1;
  pointer-events: auto;
}

/* Search Overlay */
#search-overlay {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 400px;
  max-height: 520px;
  background: rgba(12,12,22,0.85);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.02);
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

#search-overlay.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#search-results {
  max-height: 520px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--border-radius);
  cursor: pointer;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.search-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.05);
  transform: translateX(4px);
}

.search-card img {
  width: 46px;
  height: 69px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.search-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
  line-height: 1.25;
}

.search-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-card-year {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.search-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.star-rating { font-size: 0.78rem; color: var(--gold-dim); font-weight: 600; }

/* Settings & Icons Buttons */
#settings-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#settings-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  transform: rotate(45deg) scale(1.05);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.auth-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-weight: 700;
}

.auth-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

/* ─── AUTH / PROFILE ───────────────────────────────────────────────────── */
/* ─── PROFILE DASHBOARD ───────────────────────────────────────────────── */
.profile-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--card-border);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.profile-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--bg-surface-2);
  border-radius: var(--border-radius);
  padding: 4px;
}

.profile-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s ease;
  text-align: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.profile-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

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

.profile-header {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
}

.profile-avatar-wrap {
  flex-shrink: 0;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.profile-header-info {
  flex: 1;
  min-width: 0;
}

.profile-display-name {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.profile-username {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.profile-email {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-bio {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface-2);
  border-radius: var(--border-radius);
  padding: 20px 16px;
  text-align: center;
  border: 1px solid var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.stat-card-accent {
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(0,212,255,0.1));
  border-color: var(--accent);
}

.stat-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-card-accent .stat-value {
  -webkit-text-fill-color: unset;
  -webkit-background-clip: unset;
  background: unset;
  background-clip: unset;
  color: var(--accent-2);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.profile-action-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  background: var(--bg-surface-2);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: center;
}

.profile-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.profile-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.profile-edit-avatar-row {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.profile-avatar-edit {
  width: 100px;
  height: 100px;
}

.profile-edit-avatar-actions {
  display: flex;
  gap: 10px;
}

.profile-edit-field {
  margin-bottom: 20px;
}

.profile-edit-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
  outline: none;
}

.profile-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.profile-textarea {
  min-height: 80px;
  resize: vertical;
}

.profile-char-count {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-edit-actions {
  display: flex;
  align-items: center;
  margin-top: 24px;
}

.profile-divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 24px 0;
}

.profile-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

.profile-member-since {
  font-size: 0.8rem;
  color: var(--text-disabled);
}

@media (max-width: 600px) {
  .profile-card {
    padding: 20px;
    border-radius: var(--border-radius);
  }
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-tabs {
    flex-direction: column;
  }
  .profile-edit-avatar-row {
    flex-direction: column;
    text-align: center;
  }
  .profile-actions {
    flex-direction: column;
  }
  .profile-bottom-bar {
    flex-direction: column;
    gap: 12px;
  }
}

/* ─── AUTH PAGES ──────────────────────────────────────────────────────── */
.auth-page
  padding: 96px 24px 48px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell {
  width: min(900px, 100%);
}

.auth-card {
  background: linear-gradient(145deg, rgba(19,19,31,0.95), rgba(10,10,18,0.95));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.auth-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.auth-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-2);
  margin-bottom: 8px;
  font-weight: 700;
}

.auth-card h1 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-family: 'Outfit', sans-serif;
}

.auth-badge {
  background: rgba(108,99,255,0.18);
  border: 1px solid rgba(108,99,255,0.35);
  color: #d9d5ff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.auth-copy {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-tab {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
}

.auth-tab.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.auth-field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.auth-status {
  color: var(--text-secondary);
  font-size: 0.92rem;
  min-height: 1.2em;
}

.auth-status.success { color: var(--success); }
.auth-status.error { color: var(--danger); }

.auth-submit {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-gradient);
  color: white;
  font-weight: 700;
}

.auth-logged-in {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-feature-list {
  display: grid;
  gap: 10px;
}

.auth-feature-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.auth-logout {
  max-width: 220px;
}

/* ─── HERO ──────────────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  max-height: 900px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transform: scale(1.05);
  transition: background-image 0.8s ease, transform 8s ease;
  animation: heroBreath 12s ease-in-out infinite;
}

@keyframes heroBreath {
  0%, 100% { transform: scale(1.05); }
  50%       { transform: scale(1.10); }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(8,8,15,0.97) 0%,
    rgba(8,8,15,0.80) 40%,
    rgba(8,8,15,0.40) 65%,
    rgba(8,8,15,0.15) 100%
  ),
  linear-gradient(
    to top,
    rgba(8,8,15,1) 0%,
    rgba(8,8,15,0.6) 30%,
    transparent 70%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 64px 80px;
  max-width: 640px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(108, 99, 255, 0.2);
  border: 1px solid rgba(108, 99, 255, 0.4);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  animation: fadeUp 0.6s ease 0.1s both;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  animation: fadeUp 0.6s ease 0.2s both;
}

.hero-rating {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
}

.hero-genre-badge {
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255,255,255,0.1);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
}

.hero-overview {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 28px;
  animation: fadeUp 0.6s ease 0.3s both;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  animation: fadeUp 0.6s ease 0.4s both;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--border-radius);
  background: var(--accent-gradient);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.01em;
  box-shadow: 0 0 30px var(--accent-glow), 0 4px 20px rgba(0,0,0,0.4);
  transition: all var(--transition-med);
  border: none;
}

.btn-play:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 50px var(--accent-glow), 0 8px 32px rgba(0,0,0,0.5);
}

.btn-play:active { transform: translateY(0) scale(0.99); }

.btn-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--border-radius);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all var(--transition-med);
}

.btn-info:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}

/* Hero indicators */
.hero-indicators {
  position: absolute;
  bottom: 32px;
  right: 48px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

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

.hero-dot.active {
  width: 24px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Skeleton hero */
.hero-skeleton-title {
  width: 60%;
  height: 52px;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  margin-bottom: 16px;
  animation: shimmer 1.5s infinite;
}

.hero-skeleton-meta, .hero-skeleton-desc {
  height: 16px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 12px;
  animation: shimmer 1.5s infinite;
}
.hero-skeleton-meta { width: 40%; }
.hero-skeleton-desc { width: 90%; }

.hero-skeleton-btns {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.hero-skeleton-btns::before, .hero-skeleton-btns::after {
  content: '';
  height: 50px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  animation: shimmer 1.5s infinite;
}
.hero-skeleton-btns::before { width: 150px; }
.hero-skeleton-btns::after { width: 120px; }

/* ─── CONTENT ROWS ──────────────────────────────────────────────────────── */
.content-rows {
  padding: 40px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.content-row {
  position: relative;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  margin-bottom: 20px;
}

.row-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.row-see-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-2);
  background: none;
  border: 1px solid rgba(0,212,255,0.25);
  padding: 5px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.row-see-all:hover {
  background: rgba(0,212,255,0.1);
  border-color: var(--accent-2);
}

/* Row track with arrows */
.row-track-wrap {
  position: relative;
}

.row-track {
  display: flex;
  gap: 14px;
  padding: 8px 48px 16px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.row-track::-webkit-scrollbar { display: none; }

.row-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 80px;
  border-radius: var(--border-radius-sm);
  border: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  background: rgba(8,8,15,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  opacity: 0;
}

.row-track-wrap:hover .row-arrow { opacity: 1; }

.row-arrow:hover {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.row-arrow-left { left: 4px; }
.row-arrow-right { right: 4px; }

/* ─── MEDIA CARDS ───────────────────────────────────────────────────────── */
.media-card {
  flex-shrink: 0;
  width: var(--card-width);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform var(--transition-med);
  position: relative;
}

.media-card:hover { transform: translateY(-6px) scale(1.03); z-index: 5; }

.card-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: linear-gradient(160deg, var(--bg-surface-3) 0%, var(--bg-surface-2) 100%);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

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

/* Hover overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 15, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px var(--accent-glow);
  transform: translateY(15px) scale(0.8);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  border: none;
}

.media-card:hover .card-play-btn {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Card rating badge */
.card-rating {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rating-high { background: rgba(0,230,118,0.18); color: var(--success); border: 1px solid rgba(0,230,118,0.25); box-shadow: 0 4px 12px rgba(0,230,118,0.15); }
.rating-mid  { background: rgba(255,152,0,0.18); color: var(--warning); border: 1px solid rgba(255,152,0,0.25); box-shadow: 0 4px 12px rgba(255,152,0,0.15); }
.rating-low  { background: rgba(255,77,109,0.18); color: var(--danger);  border: 1px solid rgba(255,77,109,0.25); box-shadow: 0 4px 12px rgba(255,77,109,0.15); }

/* Favorite button */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(8, 8, 15, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.media-card:hover .fav-btn { opacity: 1; }

.fav-btn:hover, .fav-btn.active {
  color: var(--danger);
  background: rgba(255, 77, 109, 0.15);
  border-color: rgba(255, 77, 109, 0.3);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.25);
  transform: scale(1.05);
}

/* Type badge */
.card-type-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(8, 8, 15, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Card info */
.card-info {
  padding: 10px 4px 0;
}

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

.card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── SKELETON LOADING ──────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-card .card-poster-wrap,
.skeleton-poster {
  background: linear-gradient(90deg,
    var(--bg-surface) 25%,
    var(--bg-surface-2) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  border-radius: 6px;
  background: linear-gradient(90deg,
    var(--bg-surface) 25%,
    var(--bg-surface-2) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-title-line { width: 80%; height: 12px; }
.skeleton-meta-line  { width: 50%; height: 10px; }

/* ─── CONTINUE WATCHING PROGRESS ────────────────────────────────────────── */
.continue-card .progress-bar-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
}

.continue-card .progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 0 2px 2px 0;
  transition: width 0.5s ease;
}

/* ─── BADGES ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-type { background: rgba(108,99,255,0.2); color: var(--accent); border: 1px solid rgba(108,99,255,0.3); }

/* ─── GRID VIEW ─────────────────────────────────────────────────────────── */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
  padding: 24px 48px;
}

.grid-view .media-card {
  width: 100%;
}

/* ─── PAGE HEADER ───────────────────────────────────────────────────────── */
.page-header {
  padding: calc(var(--navbar-h) + 32px) 48px 32px;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.load-more-wrap {
  padding: 32px 48px;
  display: flex;
  justify-content: center;
}

.btn-load-more {
  padding: 14px 40px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-med);
}

.btn-load-more:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ─── DETAIL MODAL ──────────────────────────────────────────────────────── */
#detail-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  background: rgba(4,4,8,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

#detail-modal.active {
  opacity: 1;
  pointer-events: auto;
}

#detail-modal-inner {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 60px auto;
  background: rgba(13, 13, 22, 0.94);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: var(--border-radius-lg);
  overflow: visible;
  box-shadow: 0 32px 80px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.06);
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 400px;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  clip-path: inset(0 round var(--border-radius-lg));
}

#detail-modal.active #detail-modal-inner {
  transform: translateY(0) scale(1);
}

#detail-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(8, 8, 15, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#detail-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 77, 109, 0.4);
}

/* Detail modal body */
.detail-backdrop {
  position: relative;
  width: 100%;
  height: 340px;
  background-size: cover;
  background-position: center 20%;
}

.detail-backdrop-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-secondary) 100%);
}

.detail-content {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  padding: 0 48px 48px;
  margin-top: -140px;
  position: relative;
  z-index: 2;
}

.detail-poster-col {}

.detail-poster {
  width: 220px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.75);
  border: 2px solid rgba(255,255,255,0.08);
  background: var(--bg-surface-2);
}

.detail-info-col {
  padding-top: 80px;
  min-width: 0;
}

.detail-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-rating { font-weight: 700; color: var(--gold); font-size: 1rem; }
.detail-year, .detail-runtime { color: var(--text-secondary); font-size: 0.875rem; }

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-genre {
  padding: 4px 14px;
  border-radius: 99px;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-2);
}

.detail-director {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.detail-overview {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 680px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.btn-fav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--border-radius);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-fav:hover {
  background: rgba(255,77,109,0.12);
  border-color: rgba(255,77,109,0.3);
  color: var(--danger);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,77,109,0.2);
}

.btn-fav.active {
  background: rgba(255,77,109,0.15);
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: 0 4px 16px rgba(255,77,109,0.25);
}

/* Cast */
.detail-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.cast-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scrollbar-width: none;
}
.cast-row::-webkit-scrollbar { display: none; }

.cast-member {
  flex-shrink: 0;
  text-align: center;
  width: 84px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cast-member:hover {
  transform: translateY(-4px);
}

.cast-member img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.06);
  margin: 0 auto 8px;
  background: var(--bg-surface-2);
  box-shadow: 0 8px 16px rgba(0,0,0,0.35);
  transition: border-color 0.3s ease;
}

.cast-member:hover img {
  border-color: var(--accent-2);
}

.cast-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.cast-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recommendations */
.detail-recommendations { margin-top: 36px; }

.reco-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scrollbar-width: none;
}
.reco-row::-webkit-scrollbar { display: none; }

.reco-card {
  flex-shrink: 0;
  width: 105px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.reco-card:hover {
  transform: translateY(-4px) scale(1.02);
}

.reco-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--border-radius);
  background: var(--bg-surface-2);
  margin-bottom: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
  transition: border-color 0.3s ease;
}

.reco-card:hover img {
  border-color: rgba(255,255,255,0.15);
}

.reco-card span {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── EPISODE LIST ──────────────────────────────────────────────────────── */
.episodes-section { margin-top: 36px; }

.season-selector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.season-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239898b8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.season-select:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

.season-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.episode-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.episode-card:hover {
  background: rgba(108, 99, 255, 0.06);
  border-color: rgba(108, 99, 255, 0.2);
  transform: translateY(-2px) translateX(4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}

.episode-still-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-surface-2);
}

.episode-still-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.episode-card:hover .episode-still-wrap img {
  transform: scale(1.06);
}

.episode-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 15, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

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

.episode-play-overlay svg {
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.episode-card:hover .episode-play-overlay svg {
  transform: scale(1);
}

.episode-info {
  padding: 14px 18px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.episode-num-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.episode-num {
  font-size: 0.74rem;
  font-weight: 750;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Outfit', sans-serif;
}

.episode-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.2;
}

.episode-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.episode-overview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
}

.no-episodes {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

/* ─── PLAYER OVERLAY ────────────────────────────────────────────────────── */
#player-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

#player-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.player-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

#player-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

#player-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(8, 8, 15, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#player-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 77, 109, 0.4);
}

#player-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #000;
}

/* ─── SETTINGS PANEL ────────────────────────────────────────────────────── */
#clear-history-btn {
  margin-top: 8px;
}

#settings-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  height: 100vh;
  z-index: 2500;
  background: rgba(12, 12, 22, 0.88);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 32px 28px;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: -10px 0 40px rgba(0,0,0,0.6);
}

#settings-panel.active { right: 0; }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.settings-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 850;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#settings-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#settings-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  transform: rotate(90deg);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.3);
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section-title {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.settings-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255,255,255,0.08);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.settings-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 6px 28px 6px 12px;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%239898b8'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.settings-select:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

.settings-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.settings-select option {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

/* ─── EMPTY STATE & ERRORS ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 32px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.detail-error {
  padding: 48px;
  text-align: center;
  color: var(--danger);
}

/* ─── ANIMATIONS ────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50%       { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px rgba(0,212,255,0.15); }
}

/* ─── FOOTER ────────────────────────────────────────────────────────────── */
footer {
  padding: 40px 48px;
  border-top: 1px solid rgba(255,255,255,0.05);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

/* ─── INITIAL LOADER ────────────────────────────────────────────────────── */
.initial-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--bg-primary);
}

.loader-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loader-icon {
  animation: pulse 1.5s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-icon svg {
  color: var(--accent);
  filter: drop-shadow(0 0 15px var(--accent-glow));
}

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

.loader-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.loader-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 32px;
}

.loader-bars span {
  display: block;
  width: 5px;
  border-radius: 99px;
  background: var(--accent-gradient);
  animation: barBounce 1s ease-in-out infinite;
}

.loader-bars span:nth-child(1) { animation-delay: 0.0s; }
.loader-bars span:nth-child(2) { animation-delay: 0.1s; }
.loader-bars span:nth-child(3) { animation-delay: 0.2s; }
.loader-bars span:nth-child(4) { animation-delay: 0.3s; }
.loader-bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes barBounce {
  0%, 100% { height: 8px; opacity: 0.4; }
  50%       { height: 32px; opacity: 1; }
}

/* ─── PLAYER BACK BUTTON ─────────────────────────────────────────────────── */
.player-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.player-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--border-radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.player-back-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.player-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.player-server-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
  padding: 8px 32px 8px 16px;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239898b8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.player-server-select:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.15);
}

.player-server-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.player-server-select option {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

/* ─── COLOR SWATCHES (SETTINGS) ─────────────────────────────────────────── */
.color-picker-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
  transform: scale(1.1);
}

/* ─── ABOUT STATS (SETTINGS) ────────────────────────────────────────────── */
.settings-about {
  display: flex;
  gap: 16px;
  padding: 16px 0 12px;
}

.about-stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--border-radius-sm);
}

.about-num {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.about-credit {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
}

.about-credit a { color: var(--accent-2); }
.about-credit a:hover { text-decoration: underline; }

/* ─── DETAIL SKELETON ────────────────────────────────────────────────────── */
.detail-skeleton { min-height: 500px; overflow: hidden; }

.detail-skeleton-backdrop {
  width: 100%;
  height: 320px;
  background: linear-gradient(90deg,
    var(--bg-surface-2) 25%,
    var(--bg-surface-3) 50%,
    var(--bg-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Mobile bottom navigation default hidden */
.mobile-nav {
  display: none;
}

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  :root {
    --card-width: 150px;
  }

  .hero-content { padding: 0 40px 72px; }
  .row-header, .grid-view { padding-left: 32px; padding-right: 32px; }
  .row-track { padding-left: 32px; padding-right: 32px; }
  #navbar { padding: 0 24px; }
}

@media (max-width: 768px) {
  :root {
    --card-width: 130px;
    --navbar-h: 60px;
  }

  /* Add padding to prevent bottom navigation bar from covering content */
  body {
    padding-bottom: 80px;
  }

  #navbar { padding: 0 16px; gap: 12px; }
  .nav-links { display: none; }

  /* Mobile Bottom Navigation Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(13, 13, 22, 0.88);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.5);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex: 1;
    height: 100%;
    padding: 6px 0;
  }

  .mobile-nav-item svg {
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-nav-item.active {
    color: var(--accent-2);
  }

  .mobile-nav-item.active svg {
    color: var(--accent-2);
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--accent-glow));
  }

  /* Mobile Hero Optimizations */
  .hero-content { padding: 0 24px 60px; max-width: 100%; }
  .hero-title { font-size: 1.8rem; }
  .hero-buttons { flex-direction: column; gap: 10px; }
  .btn-play, .btn-info { width: 100%; justify-content: center; }

  /* Stack gradient vertically over background image on mobile for better text contrast */
  .hero-gradient {
    background: linear-gradient(
      to top,
      rgba(8,8,15,1) 0%,
      rgba(8,8,15,0.85) 50%,
      rgba(8,8,15,0.3) 100%
    );
  }

  /* Hide desktop-only row scroll arrows on touch-screens */
  .row-arrow {
    display: none !important;
  }

  .row-header { padding: 0 20px; }
  .row-track { padding: 8px 20px 16px; gap: 10px; }

  /* Modal responsive sizing */
  #detail-modal-inner {
    margin: 20px 12px;
    border-radius: var(--border-radius);
    clip-path: inset(0 round var(--border-radius));
    box-shadow: 0 16px 40px rgba(0,0,0,0.8);
  }

  .detail-content {
    grid-template-columns: 1fr;
    padding: 0 20px 40px;
    margin-top: -60px;
  }

  .detail-poster-col { display: flex; justify-content: center; }
  .detail-poster { width: 150px; height: 225px; }
  .detail-info-col { padding-top: 16px; }

  .grid-view {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 16px 20px;
  }

  .page-header { padding: calc(var(--navbar-h) + 20px) 20px 20px; }

  #search-input { width: 140px; }
  #search-input:focus { width: 180px; }
  #search-overlay { width: calc(100vw - 32px); right: -50px; }

  .episode-card { grid-template-columns: 120px 1fr; }

  #settings-panel { width: 100%; right: -100%; }
}

@media (max-width: 480px) {
  :root {
    --card-width: 115px;
  }

  /* Hide text brand name on tiny screens to avoid search bar overlap */
  .nav-logo-text {
    display: none;
  }

  .hero-section { height: 80vh; }
  .hero-title { font-size: 1.5rem; }
  .hero-overview { display: none; }

  .row-title { font-size: 1rem; }
  .row-track { gap: 8px; padding: 8px 16px 12px; }
  .row-header { padding: 0 16px; }
  .grid-view { padding: 12px 16px; gap: 10px; }
}
