:root {
  --bg: #f5f4f1;
  --surface: #fff;
  --text: #1a1822;
  --muted: #6b6877;
  --line: #e3e0e8;
  --gold: #d9a21b;
  --goldink: #1a1822;
  --nav: rgba(245, 244, 241, 0.85);
  --shadow: 0 10px 30px rgba(30, 20, 50, 0.12);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0d14;
    --surface: #181622;
    --text: #f1eff7;
    --muted: #9a96ab;
    --line: #2a2638;
    --nav: rgba(14, 13, 20, 0.85);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0e0d14;
  --surface: #181622;
  --text: #f1eff7;
  --muted: #9a96ab;
  --line: #2a2638;
  --nav: rgba(14, 13, 20, 0.85);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
* { box-sizing: border-box; }
html {
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 80px);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  line-height: 1.5;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}
/* =========================================
   PREMIUM NAVIGATION BAR 
========================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
}
.nav .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.logo {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 2rem;
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--text);
  line-height: 1;
}
.logo span {
  color: var(--gold);
}
.links {
  display: flex;
  gap: 6px;
}
.links button {
  background: none;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s ease;
}
.links button:hover, .links button[aria-current="true"] {
  color: var(--text);
  background: var(--line);
}
/* Header Utilities */
.mobile-only {
  display: none !important;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
/* Premium Search Bar */
.search {
  flex: 1;
  max-width: 460px;
  position: relative;
  margin-left: auto;
}
.search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 46px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(217, 162, 27, 0.15);
  outline: none;
}
.search svg {
  position: absolute;
  left: 16px;
  top: 13px;
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke 0.3s ease;
}
.search:focus-within svg {
  stroke: var(--gold);
}
/* Premium Floating Icon Buttons */
.iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.iconbtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}
/* =========================================
   MEGA MENU DROPDOWN (DESKTOP)
========================================= */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropbtn {
  background: none;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropdown:hover .dropbtn {
  color: var(--gold);
}
.dropdown-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #0e0d14;
  min-width: 600px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 100;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
}
.dropdown:hover .dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.mega-row {
  display: flex;
  gap: 20px;
}
.mega-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mega-col a {
  color: #9a96ab;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.mega-col a:hover {
  color: var(--gold);
}
/* =========================================
   MOBILE SIDEBAR MENU 
========================================= */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  z-index: 99;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
}
.sidebar-overlay.active {
  opacity: 1; visibility: visible;
}
.sidebar {
  position: fixed;
  top: 0; left: -320px;
  width: 300px; height: 100vh;
  background: #0a0a0a; 
  z-index: 1000;
  overflow-y: auto;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 5px 0 25px rgba(0,0,0,0.8);
}
.sidebar.active {
  left: 0;
}
.sidebar-header {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #111;
  border-bottom: 1px solid #222;
}
.close-sidebar {
  background: none; border: none;
  color: #ff0000; 
  font-size: 1.5rem; font-weight: bold;
  cursor: pointer; padding: 0; margin-right: 15px;
}
.sidebar-content {
  padding: 20px;
}
.sidebar h3 {
  color: #fff;
  font-size: 1.2rem;
  margin: 0 0 15px;
  font-weight: 500;
  border-bottom: 1px solid #222;
  padding-bottom: 5px;
}
.sidebar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
  margin-bottom: 30px;
}
.sidebar-grid a {
  color: #9a96ab;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.sidebar-grid a:hover {
  color: var(--gold);
}
/* =========================================
   HERO / SLIDER SECTION 
========================================= */
.hero {
  position: relative;
  color: #fff;
  overflow: hidden;
  min-height: min(78vh, 560px);
  display: flex;
  align-items: flex-end;
  transition: background .6s;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 6, 14, 0.88), rgba(8, 6, 14, 0.1) 65%); }
.hero .wrap { position: relative; z-index: 1; padding-bottom: 44px; padding-top: 80px; width: 100%; }
.hero h1 { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 400; font-size: clamp(3rem, 9vw, 6.5rem); line-height: .92; margin: 10px 0; letter-spacing: .02em; max-width: 800px; }
.hero p { max-width: 560px; color: #e4e0ee; margin: 0 0 20px; font-size: 1.05rem; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; color: #e4e0ee; font-size: .95rem; }
.pill { background: var(--gold); color: #1a1822; font-weight: 700; border-radius: 8px; padding: 2px 10px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 10px; padding: 12px 24px; font-weight: 600; font-size: 1rem; }
.btn.main { background: var(--gold); color: #1a1822; }
.dots { display: flex; gap: 8px; margin-top: 26px; }
.dots button { width: 34px; height: 5px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .35); padding: 0; }
.dots button[aria-current="true"] { background: var(--gold); }
/* =========================================
   SECTIONS & GRIDS 
========================================= */
section { padding-top: 38px; }
.sh { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
h2 { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 400; font-size: 2rem; letter-spacing: .04em; margin: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
select { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.row { display: flex; gap: 16px; overflow-x: auto; padding: 4px 20px 14px; margin: 0 -20px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row .card { flex: 0 0 clamp(150px, 22vw, 200px); scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px 18px; }
/* =========================================
   MOVIE CARDS
========================================= */
.card { background: none; border: 0; padding: 0; text-align: left; position: relative; }
.poster { aspect-ratio: 2/3; border-radius: 14px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 14px; color: #fff; box-shadow: var(--shadow); transition: transform .25s; }
.card:hover .poster { transform: translateY(-6px); }
.poster b { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 400; font-size: 1.9rem; line-height: .95; letter-spacing: .03em; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); position: relative; }
.rate { position: absolute; top: 10px; left: 10px; background: rgba(10, 8, 16, .8); backdrop-filter: blur(6px); color: #fff; border-radius: 8px; padding: 3px 9px; font-weight: 700; font-size: .88rem; z-index: 1; }
.rate i { color: var(--gold); font-style: normal; }
.info { padding: 10px 2px 0; }
.info h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.info p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 70px 0; }
/* =========================================
   MODAL / POPUP
========================================= */
dialog { border: 0; border-radius: 18px; padding: 0; width: calc(100% - 28px); max-width: 680px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
dialog::backdrop { background: rgba(5, 4, 10, .7); backdrop-filter: blur(3px); }
.mh { height: 210px; padding: 22px; display: flex; align-items: flex-end; color: #fff; position: relative; }
.mh h2 { font-size: 3rem; line-height: .95; position: relative; }
.mb { padding: 20px 24px 26px; }
.mb .big { font-size: 1.7rem; font-weight: 700; }
.mb .big i { color: var(--gold); font-style: normal; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.tags span { border: 1px solid var(--line); border-radius: 99px; padding: 2px 12px; font-size: .85rem; color: var(--muted); }
.mb dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 14px 0; font-size: .95rem; }
.mb dt { color: var(--muted); }
.mb dd { margin: 0; }
.x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(10, 8, 16, .7); color: #fff; font-size: 1.2rem; }
/* =========================================
   FOOTER
========================================= */
footer { margin-top: 70px; border-top: 1px solid var(--line); padding: 34px 0 40px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; margin-right: 16px; }
/* =========================================
   PERFECTED MOBILE RESPONSIVENESS
========================================= */
@media (max-width: 760px) {
  .mobile-only { display: grid !important; }
  .desktop-only { display: none !important; }
  .nav .wrap {
    justify-content: space-between;
    position: relative;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.8rem;
  }
  .iconbtn {
    width: 38px;
    height: 38px;
  }
  .search {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: var(--nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: none;
    border-bottom: 1px solid var(--line);
    margin: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  }
  .search.active {
    display: block;
    animation: slideDown 0.3s ease forwards;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .search input {
    height: 48px;
  }
  .hero h1 { font-size: 2.8rem; }
  .hero { min-height: 420px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .mh { height: 170px; }
  .mh h2 { font-size: 2.3rem; }
  .btn { padding: 11px 18px; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
/* =========================================
   MOVIE POPUP ACTION BUTTONS (WATCH & DOWNLOAD)
========================================= */
.modal-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}
.action-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-width: 150px;
}
.btn-watch {
  background: var(--gold);
  color: #1a1822;
  box-shadow: 0 4px 15px rgba(217, 162, 27, 0.3);
}
.btn-watch:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(217, 162, 27, 0.5);
  background: #f0b726;
}
.btn-download {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-download:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.4);
}
/* =========================================
   PRELOADER ANIMATION (PREMIUM APP STYLE)
========================================= */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #050505;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}
.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.loader-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.loader-icon {
  background: #e50914; 
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
}
.loader-text-logo {
  font-family: 'Bebas Neue', Impact, sans-serif;
  color: #fff;
  font-size: 2.8rem;
  letter-spacing: 0.1em;
  margin-top: 5px;
}
.loader-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: #555;
  text-transform: uppercase;
  animation: blinkText 1.5s infinite;
}
.loader-bar-container {
  width: 180px;
  height: 2px;
  background: #222;
  margin-top: -5px;
  border-radius: 2px;
  overflow: hidden;
}
.loader-bar {
  width: 0%;
  height: 100%;
  background: #e50914;
  animation: fillProgress 2.5s ease-in-out forwards;
}
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes blinkText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes fillProgress {
  0% { width: 0%; }
  40% { width: 60%; }
  80% { width: 90%; }
  100% { width: 100%; }
}
.preloader-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
}
