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

:root {
  --red: #e50914;
  --red-dark: #b20710;
  --bg: #141414;
  --surface: #1f1f1f;
  --surface2: #2a2a2a;
  --text: #e5e5e5;
  --muted: #999;
  --nav-h: 68px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 4%;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
  transition: background 0.3s;
  gap: 32px;
}
nav.scrolled { background: rgba(20,20,20,0.97); }

.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  letter-spacing: 1px;
  color: var(--red);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 400;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-search {
  position: relative;
}

.search-mobile-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-mobile-toggle svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 3px 2px 10px;
}

.search-form input {
  width: 210px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  outline: none;
}

.search-form input::placeholder {
  color: rgba(255,255,255,0.7);
}

.search-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, 90vw);
  max-height: 66vh;
  overflow-y: auto;
  background: rgba(18, 18, 18, 0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  display: none;
}

.search-results.visible {
  display: block;
}

.search-empty {
  color: #bbb;
  font-size: 13px;
  padding: 10px;
}

.search-item {
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  padding: 7px;
}

.search-item:hover {
  background: rgba(255,255,255,0.08);
}

.search-thumb,
.search-thumb-fallback {
  width: 54px;
  height: 80px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.search-thumb {
  object-fit: cover;
}

.search-thumb-fallback {
  background: linear-gradient(135deg,#1f0d37,#6b2fa0,#2e0d6b);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
}

.search-meta {
  min-width: 0;
}

.search-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}

.search-sub {
  font-size: 12px;
  color: #bfbfbf;
  margin-bottom: 4px;
}

.search-overview {
  color: #a0a0a0;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-login {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-login:hover { background: var(--red-dark); }

/* HERO */
.hero {
  position: relative;
  height: 85vh;
  min-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 0 4% 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.85) 35%, transparent 70%),
    linear-gradient(to top, rgba(20,20,20,1) 0%, rgba(20,20,20,0.1) 30%),
    var(--hero-backdrop, linear-gradient(180deg, #151515 0%, #0e0e0e 100%));
  background-size: cover;
  background-position: center top;
}

.hero-face {
  display: none;
}

.hero-content { position: relative; z-index: 2; max-width: 520px; }

.hero-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
}

.hero-loading[hidden] {
  display: none !important;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(52px, 7vw, 90px);
  letter-spacing: 4px;
  line-height: 0.9;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 2px 4px 20px rgba(0,0,0,0.6);
}

.hero-desc {
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,0.85);
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 420px;
}

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

.btn-play {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-play:hover { background: rgba(255,255,255,0.85); }
.btn-play svg { width: 18px; height: 18px; fill: #000; }

.btn-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(109,109,110,0.7);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-info:hover { background: rgba(109,109,110,0.5); }
.btn-info svg { width: 18px; height: 18px; fill: #fff; }

/* ROWS */
.content { padding: 0 4% 60px; }

.row { margin-bottom: 40px; }

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

.row-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.row-arrows {
  display: flex;
  gap: 6px;
}
.arrow-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}
.arrow-btn:hover { background: rgba(255,255,255,0.18); }

.posters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.posters::-webkit-scrollbar { display: none; }

.poster {
  flex: 0 0 calc(14.28% - 7px);
  min-width: 140px;
  aspect-ratio: 2/3;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s;
}

.poster.loading {
  display: block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.poster-loading {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster.loading:hover {
  transform: none;
  box-shadow: none;
}
.poster:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  z-index: 10;
}

.poster-main {
  display: block;
  height: calc(100% - 56px);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
}

.poster-continue {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  background: rgba(255, 255, 255, 0.03);
  overflow: visible;
}

.poster-continue:hover {
  transform: none;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.42);
}

.poster-continue-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  padding: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2));
}

.continue-title {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 3px;
}

.continue-sub {
  color: #cbcbcb;
  font-size: 11px;
}

.poster-menu {
  margin-top: auto;
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.poster-menu.menu-open .menu-toggle {
  background: rgba(229, 9, 20, 0.22);
  border-color: rgba(229, 9, 20, 0.5);
}

.title-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 6px;
  min-width: 210px;
  max-width: calc(100vw - 16px);
  background: rgba(14, 14, 14, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(6px);
  transform-origin: bottom right;
  animation: menuDropdownIn 0.14s ease-out;
  z-index: 20;
}

.title-menu[hidden] {
  display: none !important;
}

.menu-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.04);
  color: #e9e9e9;
  text-align: left;
  padding: 8px 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.13);
}

.poster-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.poster-bg {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
  position: relative;
}

.poster-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.9);
  text-align: right;
  text-shadow: 1px 1px 8px rgba(0,0,0,0.8);
  line-height: 1.2;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
}

/* Badge Netflix style */
.badge-n {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  font-family: 'Outfit', sans-serif;
}

/* Poster gradient backgrounds */
.g1  { background: linear-gradient(135deg,#0f0c29,#302b63,#24243e); }
.g2  { background: linear-gradient(135deg,#1a0533,#4a0e0e,#1a0533); }
.g3  { background: linear-gradient(135deg,#0d1b2a,#1e3a5f,#2d5f8a); }
.g4  { background: linear-gradient(135deg,#1a2a0a,#2d5a14,#1a3a0a); }
.g5  { background: linear-gradient(135deg,#2a1a0a,#6b3a0a,#3a200a); }
.g6  { background: linear-gradient(135deg,#0a0a2a,#1a1a5a,#0a0a3a); }
.g7  { background: linear-gradient(135deg,#2a0a1a,#6b1a3a,#3a0a20); }
.g8  { background: linear-gradient(135deg,#0a2a1a,#1a5a3a,#0a3a20); }
.g9  { background: linear-gradient(135deg,#2a2a0a,#5a5a0a,#3a3a0a); }
.g10 { background: linear-gradient(135deg,#1a0a0a,#4a1a1a,#2a0a0a); }
.g11 { background: linear-gradient(135deg,#0a1a2a,#0a2a4a,#0a1a3a); }
.g12 { background: linear-gradient(135deg,#1f0d37,#6b2fa0,#2e0d6b); }
.g13 { background: linear-gradient(135deg,#0d2b1a,#1a6b3a,#0d3a20); }
.g14 { background: linear-gradient(135deg,#3a0d0d,#8a2020,#4a0d0d); }
.g15 { background: linear-gradient(135deg,#0d1f3a,#1a3a8a,#0d2a4a); }
.g16 { background: linear-gradient(135deg,#1f1f0d,#5a5a1a,#2a2a0d); }
.g17 { background: linear-gradient(135deg,#1a0d2a,#4a1a7a,#2a0d3a); }
.g18 { background: linear-gradient(135deg,#0d2a2a,#1a6b6b,#0d3a3a); }
.g19 { background: linear-gradient(135deg,#2a1a0d,#6b4a1a,#3a200d); }
.g20 { background: linear-gradient(135deg,#0a0a0a,#2a2a2a,#1a1a1a); }

/* GENRE FILTER */
.genre-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  padding-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.genre-bar::-webkit-scrollbar { display: none; }

.genre-pill {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Outfit', sans-serif;
}
.genre-pill:hover,
.genre-pill.active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}
.genre-pill.active { font-weight: 600; }

/* FOOTER */
footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 40px 4%;
  color: var(--muted);
  font-size: 13px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy { color: #555; font-size: 12px; }

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

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

/* SCROLLBAR for page */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .poster { min-width: 110px; flex: 0 0 calc(25% - 6px); }
  .hero-title { font-size: 52px; }
}

@media (max-width: 600px) {
  .poster { min-width: 90px; flex: 0 0 calc(33% - 6px); }
  .hero { padding-bottom: 60px; }
  .nav-right { gap: 8px; }
  .btn-login { padding: 8px 12px; font-size: 12px; }
}

@media (max-width: 760px) {
  .search-mobile-toggle {
    display: inline-flex;
  }

  .nav-search {
    position: static;
  }

  .nav-search .search-form {
    display: none;
  }

  .nav-search.mobile-open .search-form {
    position: fixed;
    top: calc(var(--nav-h) + 8px);
    left: 10px;
    right: 10px;
    z-index: 140;
    display: flex;
    background: rgba(10, 10, 10, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.24);
    padding: 6px 6px 6px 12px;
  }

  .nav-search.mobile-open .search-form input {
    width: 100%;
    font-size: 14px;
  }

  .nav-search .search-results {
    right: 10px;
    left: 10px;
    width: auto;
    top: calc(var(--nav-h) + 62px);
    max-height: min(58vh, 460px);
    border-radius: 12px;
    z-index: 145;
  }

  .search-item {
    padding: 10px;
  }

  .search-thumb,
  .search-thumb-fallback {
    width: 62px;
    height: 92px;
  }

  .poster-menu {
    padding: 10px;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 22px;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
  }

  .title-menu {
    position: absolute;
    left: 0;
    right: auto;
    bottom: calc(100% + 8px);
    min-width: 180px;
    max-width: min(260px, calc(100vw - 24px));
    border-radius: 12px;
    padding: 8px;
    gap: 6px;
    z-index: 40;
    animation: menuDropdownIn 0.14s ease-out;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.58);
  }

  .menu-item {
    min-height: 44px;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
  }
}
