@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --red: #E50914;
  --red-dark: #B20710;
  --red-hover: #F40612;
  --black: #000000;
  --dark: #141414;
  --dark2: #1a1a1a;
  --dark3: #222222;
  --card: #181818;
  --card-hover: #282828;
  --text: #ffffff;
  --text-muted: #808080;
  --text-dim: #b3b3b3;
  --border: #333;
  --gold: #f5c518;
  --font-main: 'Inter', sans-serif;
  --font-display: 'Bebas Neue', sans-serif;
  --nav-height: 68px;
  --radius: 6px;
  --shadow: 0 4px 30px rgba(0,0,0,0.8);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

button { cursor: pointer; font-family: var(--font-main); border: none; outline: none; }

input, select, textarea { font-family: var(--font-main); outline: none; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px;
  z-index: 1000;
  transition: background 0.4s ease;
}

.navbar.scrolled,
.navbar.solid {
  background: var(--black);
  box-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.navbar.transparent {
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--red);
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(229,9,20,0.4);
  flex-shrink: 0;
}

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

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.2s;
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-search-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: opacity 0.2s;
}
.nav-search-btn:hover { opacity: 0.7; }

.nav-avatar {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700;
  transition: opacity 0.2s;
}
.nav-avatar:hover { opacity: 0.8; }

/* HERO */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 160px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transform: scale(1.05);
  animation: heroZoom 20s ease infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1.05); }
  to { transform: scale(1.12); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    var(--dark) 0%,
    rgba(20,20,20,0.7) 40%,
    rgba(20,20,20,0.3) 70%,
    rgba(20,20,20,0.2) 100%
  );
}

.hero-overlay-side {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(20,20,20,0.9) 0%,
    transparent 60%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 60px;
  max-width: 650px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: 1px;
  margin-bottom: 18px;
  text-shadow: 2px 2px 20px rgba(0,0,0,0.8);
}

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

.hero-meta span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hero-meta .match { color: #46d369; font-weight: 700; }
.hero-meta .year, .hero-meta .dur { color: var(--text-dim); }
.hero-meta .rating {
  border: 1px solid var(--text-muted);
  padding: 1px 6px;
  font-size: 0.75rem;
  border-radius: 3px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-play {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: var(--black);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.btn-play:hover { background: rgba(255,255,255,0.85); transform: scale(1.02); }

.btn-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(109,109,110,0.7);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.2s;
}
.btn-info:hover { background: rgba(109,109,110,0.4); transform: scale(1.02); }

/* SECTIONS */
.section {
  padding: 0 60px;
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title a {
  font-size: 0.8rem;
  color: #54b3d6;
  font-weight: 500;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-title a:hover { text-decoration: underline; }

/* ROW / SLIDER */
.row-container {
  position: relative;
  overflow: hidden;
}

.row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 8px;
  transition: transform 0.3s ease;
}
.row::-webkit-scrollbar { display: none; }

.row-arrow {
  position: absolute;
  top: 0; bottom: 8px;
  width: 52px;
  background: rgba(20,20,20,0.7);
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.row-container:hover .row-arrow { opacity: 1; }
.row-arrow.left { left: -52px; border-radius: 0 var(--radius) var(--radius) 0; }
.row-arrow.right { right: -52px; border-radius: var(--radius) 0 0 var(--radius); }
.row-container:hover .row-arrow.left { left: 0; }
.row-container:hover .row-arrow.right { right: 0; }

/* CARD */
.card {
  flex: 0 0 200px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, z-index 0s 0.15s;
  background: var(--card);
}

.card:hover {
  transform: scale(1.25) translateY(-10px);
  z-index: 100;
  transition: transform 0.3s ease, z-index 0s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--dark3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(24,24,24,1) 0%, transparent 100%);
  padding: 30px 10px 10px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.card:hover .card-info { transform: translateY(0); }

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.card-meta span {
  font-size: 0.68rem;
  color: var(--text-dim);
}
.card-meta .match { color: #46d369; font-weight: 600; }

.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.card-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  background: rgba(42,42,42,0.6);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.card-btn:hover { border-color: white; background: rgba(255,255,255,0.1); }

.card-btn.play {
  background: white;
  color: black;
  border-color: white;
}
.card-btn.play:hover { background: rgba(255,255,255,0.8); }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card);
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  overflow: hidden;
  transform: translateY(30px);
  transition: transform 0.3s ease;
  position: relative;
  margin: auto;
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: rgba(24,24,24,0.9);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--dark3); }

.modal-hero {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--dark3);
}

.modal-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.modal-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--card) 0%, transparent 50%);
}

.modal-hero-content {
  position: absolute;
  bottom: 24px; left: 24px; right: 24px;
}

.modal-hero-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.modal-hero-btns { display: flex; gap: 10px; }

.modal-body {
  padding: 20px 24px 30px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 30px;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 16px;
}

.modal-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-meta span { font-size: 0.8rem; }
.modal-meta .label { color: var(--text-muted); }
.modal-meta .val { color: var(--text-dim); }

.modal-side { font-size: 0.82rem; }
.modal-side p { margin-bottom: 10px; color: var(--text-muted); }
.modal-side p span { color: var(--text-dim); }

/* EPISODES */
.episodes-section { padding: 0 24px 24px; }
.episodes-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--red);
}

.season-select {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
  cursor: pointer;
}

.episode-list { display: flex; flex-direction: column; gap: 10px; }

.episode-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.episode-item:hover { background: var(--card-hover); border-color: var(--border); }

.episode-num {
  font-size: 1.2rem;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.episode-thumb {
  width: 120px; height: 68px;
  background: var(--dark3);
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }

.episode-info { flex: 1; min-width: 0; }
.episode-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.episode-dur { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.episode-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-play-btn {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.episode-play-btn:hover { background: white; border-color: white; color: black; }

/* FOOTER */
.footer {
  padding: 60px 60px 40px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.footer-col h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-dim); }

.footer-bottom {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 20px;
}

/* PAGE HEADER (non-hero pages) */
.page-header {
  padding: calc(var(--nav-height) + 40px) 60px 30px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 1px;
}

/* GRID VIEW */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 0 60px;
}

/* SEARCH PAGE */
.search-hero {
  padding: calc(var(--nav-height) + 20px) 60px 30px;
}

.search-input-wrap {
  position: relative;
  max-width: 600px;
}

.search-input {
  width: 100%;
  background: var(--dark3);
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  padding: 14px 48px 14px 48px;
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--text-dim); }
.search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

/* TAGS / GENRES */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  padding: 6px 14px;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}
.tag:hover, .tag.active {
  background: var(--text);
  color: var(--black);
  border-color: var(--text);
}

/* PROGRESS BAR */
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.3s;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--black);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* MY LIST BTN */
.btn-mylist {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark3);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-mylist:hover { background: var(--card-hover); }

/* SPINNER */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-dim); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .navbar { padding: 0 30px; }
  .section { padding: 0 30px; }
  .page-header { padding: calc(var(--nav-height) + 30px) 30px 20px; }
  .content-grid { padding: 0 30px; }
  .hero-content { padding: 0 30px; }
  .footer { padding: 40px 30px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .nav-links { display: none; }
  .hero-title { font-size: 2rem; }
  .hero-content { padding: 0 16px; max-width: 100%; }
  .section { padding: 0 16px; }
  .card { flex: 0 0 150px; }
  .content-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 0 16px; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-side { display: none; }
  .footer { padding: 30px 16px; }
  .footer-links { grid-template-columns: 1fr 1fr; }
}
