/***********************
 * ROOT VARIABLES      *
 ***********************/
:root {
  --bg: #0b0b0f;
  --bg-soft: #12121a;
  --text: #f3f4f6;
  --muted: #a1a1aa;
  --accent: #e50914;
  --card: #16161f;
  --chip: #1f1f2b;
  --ring: #2a2a3b;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --header-height: 64px;
  --container-padding: 16px;
}

.light {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --accent: #e50914;
  --card: #ffffff;
  --chip: #eef2ff;
  --ring: #e5e7eb;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

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

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

/***********************
 * HEADER & NAV       *
 ***********************/
header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  border-bottom: 1px solid var(--ring);
  height: var(--header-height);
  width: 100%;
}

.nav {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--container-padding);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  flex-shrink: 0;
}

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
}

/***********************
 * MOBILE MENU BUTTON *
 ***********************/
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 50;
  position: relative;
}

.mobile-menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
  position: absolute;
}

.mobile-menu-btn span:nth-child(1) {
  top: 0px;
}

.mobile-menu-btn span:nth-child(2) {
  top: 8px;
}

.mobile-menu-btn span:nth-child(3) {
  top: 16px;
}

.mobile-menu-btn.active span:nth-child(1) {
  top: 8px;
  transform: rotate(135deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  left: -24px;
}

.mobile-menu-btn.active span:nth-child(3) {
  top: 8px;
  transform: rotate(-135deg);
}

/***********************
 * MOBILE MENU OVERLAY *
 ***********************/
.mobile-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-soft);
  z-index: 45;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  border-top: 1px solid var(--ring);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--accent);
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.mobile-menu-item:hover,
.mobile-menu-item.active {
  background: var(--chip);
  border-color: var(--ring);
  color: var(--accent);
}

.mobile-menu-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/***********************
 * TABS NAVIGATION    *
 ***********************/
.tabs {
  display: flex;
  gap: 8px;
  margin-left: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 1;
  min-width: 0;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a {
  padding: 8px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.9rem;
}

.tabs a.active,
.tabs a:hover {
  color: var(--text);
  background: var(--chip);
}

/***********************
 * SEARCH             *
 ***********************/
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--ring);
  border-radius: 14px;
  min-width: 0;
}

.search svg {
  flex-shrink: 0;
}

.search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
}

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

.kbd {
  display: none;
}

.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-soft);
  border: 1px solid var(--ring);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: none;
  max-height: min(420px, 70vh);
  overflow-y: auto;
  z-index: 45;
}

.suggest.show {
  display: block;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}

.suggest-item:hover {
  background: var(--chip);
}

.suggest-item img {
  width: 38px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #222;
  flex-shrink: 0;
}

.suggest-empty {
  padding: 12px;
  color: var(--muted);
  text-align: center;
}

/***********************
 * BUTTONS & CONTROLS *
 ***********************/
.btn {
  border: 1px solid var(--ring);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--chip);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.btn.primary:hover {
  opacity: 0.9;
}

/***********************
 * MAIN LAYOUT        *
 ***********************/
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--container-padding);
  min-height: calc(100vh - var(--header-height));
}

/***********************
 * HERO SECTION       *
 ***********************/
.hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(100deg, rgba(0,0,0,.8) 10%, rgba(0,0,0,.4)), var(--bg-soft);
  min-height: 580px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 24px;
}

.hero-inner {
  padding: 24px;
  width: 100%;
  max-width: 600px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.2;
}

.hero p {
  margin: 0;
  color: #e5e7eb;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/***********************
 * VIDEO PLAYER       *
 ***********************/
.player-wrap {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

@media (min-width: 900px) {
  .player-wrap {
    grid-template-columns: 2.2fr 1fr;
  }
}

.player {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.player-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.player-container.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: #fff;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.9rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.controls-primary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.controls-secondary {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/***********************
 * SELECT GROUPS      *
 ***********************/
.select-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.select-group label {
  font-size: 0.8rem;
  color: var(--muted);
}

.episode-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.select {
  background: var(--bg);
  border: 1px solid var(--ring);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 120px;
}

.select:hover {
  border-color: var(--accent);
}

/***********************
 * GRID & CARDS       *
 ***********************/
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  align-items: start;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-2px);
}

.thumb {
  position: relative;
  padding-top: 150%;
  background: #111;
}

.thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta {
  padding: 12px;
}

.title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rating {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,.85);
  color: #fff;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
}

.hover {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,.3));
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  color: #fff;
}

.card:hover .hover {
  opacity: 1;
}

/***********************
 * SEASON CARDS       *
 ***********************/
.seasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.season-card {
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.season-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.season-card-inner {
  padding: 16px;
  text-align: center;
}

.season-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.episode-count {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/***********************
 * CAST SECTION       *
 ***********************/
.cast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.actor {
  display: flex;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--ring);
  border-radius: 12px;
  padding: 12px;
  align-items: center;
}

.actor img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}

/***********************
 * LOADING STATES     *
 ***********************/
.skeleton {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.12),
    rgba(255,255,255,0.06)
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/***********************
 * TOAST NOTIFICATIONS*
 ***********************/
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--ring);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/***********************
 * RESPONSIVE STYLES  *
 ***********************/
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .kbd {
    display: block;
    font-size: .75rem;
    border: 1px solid var(--ring);
    padding: 2px 6px;
    border-radius: 8px;
    color: var(--muted);
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  /* Hide desktop tabs and show mobile menu button */
  .desktop-tabs {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
    order: -1;
  }
  
  .nav {
    gap: 8px;
  }
  
  .brand span:not(.brand-badge) {
    display: none;
  }
  
  /* Adjust search on mobile */
  .search-wrap {
    order: 1;
  }
  
  .actions {
    order: 2;
  }
}

@media (max-width: 640px) {
  :root {
    --container-padding: 12px;
  }
  
  .controls-primary {
    flex-direction: column;
  }
  
  .episode-controls {
    flex-direction: column;
  }
  
  .select {
    width: 100%;
    min-width: 0;
  }
  
  .controls {
    gap: 6px;
  }
  
  .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

/***********************
 * UTILITY CLASSES    *
 ***********************/
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.no-scroll {
  overflow: hidden;
}

.sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 16px;
}

.section {
  margin: 24px 0;
}

.section h2 {
  font-size: 1.25rem;
  margin: 0 0 16px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chip {
  background: var(--chip);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--ring);
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  user-select: none;
}

.chip:hover {
  color: var(--text);
  background: var(--bg);
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
    }
/* Add these styles to your existing .hero styles */
.hero {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

@media (max-width: 768px) {
  .hero {
    min-height: 480px; /* Adjust this value as needed */
    background-position: top center;
  }
  
  .hero-inner {
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0.3) 100%);
  }
  }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.pagination .page-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.pagination .btn {
  min-width: 100px;
  text-align: center;
  }
.section-footer {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.section-footer .btn {
  min-width: 150px;
  text-align: center;
}
.btn.download {
  background-color: #ff5722; /* orange */
  color: #fff;
}
