/* ============ StreamFlix ============ */
:root {
  --bg: #0b0e14;
  --bg-2: #121724;
  --card: #171d2e;
  --card-hover: #1e2740;
  --text: #eef1f8;
  --muted: #8b93a7;
  --accent: #e50914;
  --accent-2: #ff3d47;
  --gold: #ffc531;
  --radius: 12px;
  --nav-h: 64px;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family:'Inter',system-ui,sans-serif;
  background:var(--bg); color:var(--text);
  min-height:100vh;
}
img { max-width:100%; display:block; }
.hidden { display:none !important; }
.accent { color:var(--accent); }
.muted { color:var(--muted); }

/* ============ NAVBAR ============ */
.navbar {
  position:fixed; top:0; left:0; right:0; z-index:100;
  height:var(--nav-h);
  background:linear-gradient(180deg, rgba(11,14,20,.95), rgba(11,14,20,.75));
  backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.nav-inner {
  max-width:1300px; margin:0 auto; height:100%;
  display:flex; align-items:center; gap:24px; padding:0 20px;
}
.brand {
  font-size:1.35rem; font-weight:800; text-decoration:none; color:var(--text);
  display:flex; align-items:center; gap:8px; letter-spacing:-.5px; white-space:nowrap;
}
.brand-icon {
  background:var(--accent); color:#fff; width:30px; height:30px; border-radius:8px;
  display:inline-flex; align-items:center; justify-content:center; font-size:.85rem;
}
.nav-links { display:flex; gap:4px; flex:1; }
.nav-link {
  color:var(--muted); text-decoration:none; font-weight:500; font-size:.925rem;
  padding:8px 14px; border-radius:8px; transition:.2s;
}
.nav-link:hover { color:var(--text); background:rgba(255,255,255,.06); }
.nav-link.active { color:var(--text); background:rgba(229,9,20,.15); }
.badge {
  background:var(--accent); color:#fff; font-size:.7rem; font-weight:700;
  border-radius:10px; padding:1px 7px; margin-left:4px; vertical-align:middle;
}
.nav-search { position:relative; width:260px; }
.nav-search input {
  width:100%; padding:9px 12px 9px 36px;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.1);
  border-radius:24px; color:var(--text); font-size:.9rem; outline:none; transition:.2s;
}
.nav-search input:focus { border-color:var(--accent); background:rgba(255,255,255,.12); }
.nav-search input::placeholder { color:var(--muted); }
.search-icon {
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  font-size:.85rem; opacity:.7; pointer-events:none;
}
.hamburger { display:none; background:none; border:none; cursor:pointer; padding:8px; }
.hamburger span {
  display:block; width:22px; height:2px; background:var(--text);
  margin:5px 0; border-radius:2px; transition:.3s;
}

/* ============ HERO ============ */
.hero {
  position:relative; min-height:82vh; display:flex; align-items:flex-end;
  padding:calc(var(--nav-h) + 40px) 5vw 70px; overflow:hidden;
}
.hero-bg {
  position:absolute; inset:0; background-size:cover; background-position:center 20%;
  transition:opacity .6s ease, background-image .6s ease;
}
.hero-bg::after {
  content:""; position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(11,14,20,.35) 0%, rgba(11,14,20,.65) 60%, var(--bg) 100%),
    linear-gradient(90deg, rgba(11,14,20,.85) 0%, transparent 60%);
}
.hero-content { position:relative; max-width:640px; z-index:2; }
.hero-tag {
  display:inline-block; background:var(--accent); color:#fff; font-size:.7rem;
  font-weight:700; letter-spacing:2px; padding:5px 12px; border-radius:6px; margin-bottom:14px;
}
.hero h1 { font-size:clamp(2rem, 5vw, 3.6rem); font-weight:800; line-height:1.05; margin-bottom:12px; }
.hero-meta { display:flex; flex-wrap:wrap; gap:14px; color:var(--muted); font-size:.9rem; margin-bottom:14px; align-items:center; }
.hero-meta .star { color:var(--gold); font-weight:700; }
.hero p { color:#c6ccdb; line-height:1.6; font-size:1rem; margin-bottom:22px;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.hero-actions { display:flex; flex-wrap:wrap; gap:12px; }
.hero-dots { position:absolute; bottom:24px; right:5vw; display:flex; gap:8px; z-index:3; }
.hero-dots button {
  width:10px; height:10px; border-radius:50%; border:none; cursor:pointer;
  background:rgba(255,255,255,.3); transition:.25s;
}
.hero-dots button.active { background:var(--accent); transform:scale(1.25); }

/* ============ BUTTONS ============ */
.btn {
  border:none; cursor:pointer; font-family:inherit; font-weight:600;
  font-size:.95rem; padding:12px 26px; border-radius:8px; transition:.2s;
  display:inline-flex; align-items:center; gap:8px;
}
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-2); transform:translateY(-1px); }
.btn-ghost {
  background:rgba(255,255,255,.12); color:var(--text);
  border:1px solid rgba(255,255,255,.15);
}
.btn-ghost:hover { background:rgba(255,255,255,.2); }
.btn-ghost.in-list { background:rgba(229,9,20,.2); border-color:var(--accent); color:#ff9da2; }
.btn-small { padding:8px 16px; font-size:.85rem; }

/* ============ SECTIONS ============ */
.section { max-width:1300px; margin:0 auto; padding:44px 20px 10px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.section-head h2 { font-size:1.5rem; font-weight:700; }
.result-count { color:var(--muted); font-size:.9rem; }

/* ============ FEATURED ROW ============ */
.row-scroll {
  display:flex; gap:16px; overflow-x:auto; padding:4px 2px 18px;
  scroll-snap-type:x mandatory;
}
.row-scroll::-webkit-scrollbar { height:8px; }
.row-scroll::-webkit-scrollbar-thumb { background:rgba(255,255,255,.15); border-radius:8px; }
.row-scroll .movie-card { min-width:210px; max-width:210px; scroll-snap-align:start; }

/* ============ GENRE FILTERS ============ */
.genre-filters { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.genre-chip {
  background:var(--card); border:1px solid rgba(255,255,255,.1); color:var(--muted);
  padding:8px 18px; border-radius:22px; cursor:pointer; font-size:.875rem;
  font-weight:500; font-family:inherit; transition:.2s;
}
.genre-chip:hover { color:var(--text); border-color:rgba(255,255,255,.3); }
.genre-chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }

.sort-bar { display:flex; align-items:center; gap:10px; margin-bottom:22px; color:var(--muted); font-size:.9rem; }
.sort-bar select {
  background:var(--card); color:var(--text); border:1px solid rgba(255,255,255,.12);
  padding:8px 12px; border-radius:8px; font-family:inherit; font-size:.875rem; outline:none; cursor:pointer;
}

/* ============ MOVIE GRID / CARDS ============ */
.movie-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
  gap:20px; padding-bottom:30px;
}
.movie-card {
  background:var(--card); border-radius:var(--radius); overflow:hidden; cursor:pointer;
  transition:transform .25s, box-shadow .25s, background .25s;
  position:relative; border:1px solid rgba(255,255,255,.05);
}
.movie-card:hover { transform:translateY(-6px); box-shadow:var(--shadow); background:var(--card-hover); }
.card-poster { position:relative; aspect-ratio:2/3; overflow:hidden; }
.card-poster .poster-art {
  width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  font-size:3rem; transition:transform .4s;
}
.movie-card:hover .poster-art { transform:scale(1.06); }
.card-rating {
  position:absolute; top:10px; left:10px; background:rgba(0,0,0,.75);
  backdrop-filter:blur(4px); color:var(--gold); font-weight:700; font-size:.8rem;
  padding:4px 9px; border-radius:8px; display:flex; gap:4px; align-items:center;
}
.card-wl {
  position:absolute; top:10px; right:10px; width:34px; height:34px; border-radius:50%;
  border:none; cursor:pointer; font-size:1rem; line-height:1;
  background:rgba(0,0,0,.7); color:#fff; backdrop-filter:blur(4px); transition:.2s;
}
.card-wl:hover { background:var(--accent); transform:scale(1.1); }
.card-wl.in-list { background:var(--accent); }
.card-play {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.45); opacity:0; transition:.25s;
}
.movie-card:hover .card-play { opacity:1; }
.card-play span {
  width:54px; height:54px; border-radius:50%; background:var(--accent);
  display:flex; align-items:center; justify-content:center; font-size:1.2rem; color:#fff;
  box-shadow:0 6px 20px rgba(229,9,20,.5);
}
.card-body { padding:12px 14px 14px; }
.card-title { font-weight:600; font-size:.95rem; margin-bottom:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card-sub { color:var(--muted); font-size:.8rem; display:flex; justify-content:space-between; }
.stars { color:var(--gold); font-size:.8rem; letter-spacing:1px; }

/* ============ EMPTY STATE ============ */
.empty-state { text-align:center; padding:70px 20px; color:var(--muted); }
.empty-icon { font-size:3.2rem; margin-bottom:14px; }
.empty-state h3 { color:var(--text); margin-bottom:6px; }

/* ============ MODAL ============ */
.modal-overlay {
  position:fixed; inset:0; z-index:200; background:rgba(5,7,12,.8);
  backdrop-filter:blur(6px); display:flex; align-items:center; justify-content:center; padding:20px;
  animation:fadeIn .25s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal {
  background:var(--bg-2); border-radius:18px; max-width:860px; width:100%;
  max-height:90vh; overflow-y:auto; position:relative; box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,.08); animation:slideUp .3s ease;
}
@keyframes slideUp { from{transform:translateY(30px);opacity:0} to{transform:none;opacity:1} }
.modal-close {
  position:absolute; top:14px; right:14px; z-index:5; width:38px; height:38px;
  border-radius:50%; border:none; background:rgba(0,0,0,.6); color:#fff;
  font-size:1rem; cursor:pointer; transition:.2s;
}
.modal-close:hover { background:var(--accent); }
.modal-backdrop { height:200px; background-size:cover; background-position:center; position:relative; }
.modal-backdrop::after {
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg, transparent, var(--bg-2));
}
.modal-body { display:flex; gap:26px; padding:0 30px 30px; margin-top:-70px; position:relative; }
.modal-poster {
  min-width:180px; width:180px; aspect-ratio:2/3; border-radius:12px;
  display:flex; align-items:center; justify-content:center; font-size:4rem;
  box-shadow:var(--shadow); border:1px solid rgba(255,255,255,.1);
}
.modal-info { padding-top:78px; flex:1; }
.modal-info h2 { font-size:1.8rem; margin-bottom:8px; }
.modal-meta { color:var(--muted); font-size:.9rem; display:flex; flex-wrap:wrap; gap:12px; margin-bottom:10px; }
.modal-rating { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.modal-rating .big-score { font-size:1.4rem; font-weight:800; color:var(--gold); }
.modal-genres { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.modal-genres span {
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12);
  padding:4px 12px; border-radius:14px; font-size:.78rem; color:#c6ccdb;
}
.modal-desc { color:#c6ccdb; line-height:1.65; margin-bottom:16px; }
.modal-extra { color:var(--muted); font-size:.88rem; line-height:1.7; margin-bottom:20px; }
.modal-extra strong { color:var(--text); }
.modal-actions { display:flex; flex-wrap:wrap; gap:12px; }

/* ============ TOAST ============ */
.toast {
  position:fixed; bottom:28px; left:50%; transform:translate(-50%, 80px);
  background:var(--card); color:var(--text); padding:13px 24px; border-radius:12px;
  border:1px solid rgba(255,255,255,.12); box-shadow:var(--shadow);
  font-size:.9rem; font-weight:500; z-index:300; opacity:0; transition:.35s; pointer-events:none;
}
.toast.show { transform:translate(-50%, 0); opacity:1; }

/* ============ FOOTER ============ */
.footer { border-top:1px solid rgba(255,255,255,.07); margin-top:50px; padding:36px 20px; }
.footer-inner { max-width:1300px; margin:0 auto; text-align:center; color:var(--muted); font-size:.88rem; }
.footer .brand { justify-content:center; margin-bottom:10px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav-search { width:180px; }
  .modal-body { flex-direction:column; align-items:center; text-align:center; }
  .modal-info { padding-top:0; }
  .modal-meta, .modal-genres, .modal-rating, .modal-actions { justify-content:center; }
}
@media (max-width: 720px) {
  .hamburger { display:block; }
  .nav-links {
    position:fixed; top:var(--nav-h); left:0; right:0;
    background:var(--bg-2); flex-direction:column; padding:12px 20px 18px;
    border-bottom:1px solid rgba(255,255,255,.08);
    transform:translateY(-140%); transition:.3s; z-index:99;
  }
  .nav-links.open { transform:none; }
  .nav-inner { gap:12px; }
  .nav-search { flex:1; width:auto; }
  .hero { min-height:70vh; padding-bottom:56px; }
  .movie-grid { grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:14px; }
  .row-scroll .movie-card { min-width:160px; max-width:160px; }
  .btn { padding:11px 20px; font-size:.88rem; }
}
@media (max-width: 420px) {
  .movie-grid { grid-template-columns:repeat(2, 1fr); }
  .brand { font-size:1.15rem; }
}
