/* =============================================================
   VOD CMS — Frontend Theme
   Dark cinematic. Modern type. Heavy on contrast.
   ============================================================= */

:root {
  --bg-0: #07080b;
  --bg-1: #0e1014;
  --bg-2: #15181f;
  --bg-3: #1c2029;
  --line: #242833;
  --line-2: #2f3340;
  --text: #f5f6f8;
  --text-2: #b6bac5;
  --text-3: #7c8294;
  --primary: #e50914;
  --primary-2: #ff2c3a;
  --accent: #ffb800;
  --gold: #f5c518;
  --success: #2ecc71;
  --danger: #ff4757;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-glow: 0 18px 60px rgba(229, 9, 20, 0.32);
  --nav-h: 72px;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv01";
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(229,9,20,0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(255,184,0,0.06), transparent 60%),
    var(--bg-0);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--primary-2); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }

h1,h2,h3,h4 { font-family: 'Outfit', 'Inter', sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.display-1, .display-2, .display-3 { font-family: 'Bebas Neue', 'Outfit', sans-serif; letter-spacing: .01em; }

.site-main { min-height: 70vh; padding-top: var(--nav-h); }

/* ----------------------  Nav  ---------------------- */
.site-nav {
  height: var(--nav-h);
  background: rgba(7, 8, 11, 0.7);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background .25s;
}
.site-nav.scrolled { background: rgba(7, 8, 11, 0.92); }

.site-nav .container-fluid { height: 100%; }

.site-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 22px;
  color: var(--text) !important;
}
.site-brand .brand-logo {
  max-height: 44px; max-width: 220px;
  width: auto; height: auto;
  object-fit: contain;
  display: block;
}
.site-brand .brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #b00710);
  border-radius: 10px;
  color: #fff; font-size: 18px;
  box-shadow: 0 6px 20px rgba(229,9,20,0.4);
}
.site-brand .brand-text {
  background: linear-gradient(90deg, #fff 30%, #b6bac5);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-nav .nav-link {
  color: var(--text-2) !important;
  font-weight: 500;
  padding: 8px 14px !important;
  border-radius: 8px;
  transition: all .2s;
}
.site-nav .nav-link:hover { color: var(--text) !important; background: rgba(255,255,255,0.04); }
.site-nav .nav-link.active { color: var(--text) !important; }

.navbar-toggler {
  border: 1px solid var(--line) !important;
  padding: 6px 10px;
}
.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23f5f6f8' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); }

.nav-actions { gap: 6px; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  padding: 0;
  transition: all .2s;
}
.btn-icon:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,0.04); }

.btn {
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  transition: all .2s;
  letter-spacing: 0.01em;
}
.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-primary {
  background: linear-gradient(90deg, var(--primary), #b00710);
  border: 0;
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(229,9,20,0.4);
}
.btn-glow::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(229,9,20,0.4);
  transition: box-shadow .3s;
  pointer-events: none;
}
.btn-glow:hover::after { box-shadow: 0 0 0 6px rgba(229,9,20,0); }

.btn-outline-light {
  color: var(--text);
  border-color: var(--line-2);
}
.btn-outline-light:hover { background: var(--text); color: var(--bg-0); border-color: var(--text); }

/* Tier badge */
.tier-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--badge, #6c757d);
  color: var(--badge, #6c757d);
}
.tier-badge i { font-size: 10px; }

.user-menu .user-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
}
.user-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 12px;
}
.dropdown-menu {
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  border-radius: 12px;
  padding: 8px;
  min-width: 240px;
}
.dropdown-item {
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.dropdown-header { color: var(--text-3); font-size: 12px; padding: 8px 12px; line-height: 1.4; }
.dropdown-divider { border-color: var(--line); }

/* Search overlay */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: grid; place-items: start center;
  padding-top: 18vh;
}
.search-overlay[hidden] { display: none; }
.search-form {
  display: flex; align-items: center; gap: 10px;
  width: min(640px, 90vw);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.search-form i { color: var(--text-3); font-size: 18px; }
.search-form input {
  flex: 1; background: transparent; border: 0; color: var(--text);
  font-size: 18px; outline: none; font-family: inherit;
}
.search-form input::placeholder { color: var(--text-3); }

/* Flash messages */
.container-flash { position: fixed; top: 84px; left: 0; right: 0; z-index: 900; pointer-events: none; }
.container-flash .alert {
  max-width: 540px; margin: 0 auto 8px;
  pointer-events: all;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.alert-success { border-color: var(--success) !important; color: #b5f0c8 !important; }
.alert-danger  { border-color: var(--danger)  !important; color: #ffc1c7 !important; }
.alert-warning { border-color: var(--accent)  !important; color: #ffe5a3 !important; }

/* ----------------------  Hero  ---------------------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center;
  overflow: hidden;
  padding: 60px 0 80px;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 80% 30%, rgba(229,9,20,0.18), transparent 60%),
    radial-gradient(700px 400px at 0% 80%, rgba(255,184,0,0.10), transparent 60%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin: 0 0 20px;
}
.hero h1 .gradient {
  background: linear-gradient(120deg, #fff 0%, #b6bac5 60%, #e50914 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p.lead {
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--text-2);
  max-width: 620px;
  line-height: 1.6;
  margin-bottom: 32px;
}
.hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .hero-cta .btn { padding: 14px 26px; font-size: 15px; }

.hero-stats {
  display: flex; gap: 32px; flex-wrap: wrap;
  margin-top: 48px;
  color: var(--text-3);
}
.hero-stats .stat strong { display: block; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 28px; color: var(--text); }
.hero-stats .stat small { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }

.hero-collage {
  position: relative;
  height: 480px;
}
.hero-collage .poster {
  position: absolute;
  border-radius: var(--radius-lg);
  background-size: cover; background-position: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.hero-collage .poster:hover { transform: translateY(-8px) scale(1.02); }
.hero-collage .p1 { top: 0;   right: 0;   width: 240px; height: 360px; transform: rotate(-4deg); }
.hero-collage .p2 { top: 60px; left: 0;   width: 200px; height: 300px; transform: rotate(5deg); }
.hero-collage .p3 { bottom: 0; right: 80px; width: 220px; height: 320px; transform: rotate(3deg); }
.hero-collage .p4 { top: 200px; right: 200px; width: 160px; height: 240px; transform: rotate(-6deg); }

/* ----------------------  Section  ---------------------- */
.section { padding: 80px 0; position: relative; }
.section-sm { padding: 50px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 32px; gap: 16px; flex-wrap: wrap; }
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  margin: 0;
  letter-spacing: -0.03em;
}
.section-head p { color: var(--text-3); margin: 4px 0 0; }
.section-head a { font-size: 14px; }

/* ----------------------  Movie card  ---------------------- */
.movie-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
  height: 100%;
  color: var(--text);
  position: relative;
}
.movie-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-2);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  color: var(--text);
}
.movie-card .poster-wrap {
  position: relative;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #1a1a25 0%, #0c0d12 100%);
  overflow: hidden;
}
.movie-card .poster-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.movie-card:hover .poster-wrap img { transform: scale(1.05); }
.movie-card .poster-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}
.movie-card .rating {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}
.movie-card .rating i { color: var(--gold); }
.movie-card .tier-pill {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--badge, var(--primary));
  color: var(--badge, var(--primary));
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  z-index: 2;
}
.movie-card .play-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity .25s;
  z-index: 1;
}
.movie-card:hover .play-overlay { opacity: 1; }
.movie-card .play-overlay .play-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: grid; place-items: center;
  color: #fff;
  font-size: 28px;
  transform: scale(0.8);
  transition: transform .25s;
  box-shadow: 0 14px 40px rgba(229,9,20,0.6);
}
.movie-card:hover .play-overlay .play-btn { transform: scale(1); }

.movie-card .meta {
  padding: 14px 14px 16px;
}
.movie-card .meta h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.movie-card .meta .small { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; }
.movie-card .meta .small .dot { opacity: 0.4; }

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty i { font-size: 48px; opacity: 0.4; }

/* ----------------------  Category pill  ---------------------- */
.category-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.category-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  transition: all .2s;
}
.category-pill:hover { background: var(--bg-3); color: var(--text); border-color: var(--line-2); }
.category-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.category-pill .count { opacity: 0.7; font-size: 11px; }

/* ----------------------  Watch / Detail  ---------------------- */
.movie-hero {
  position: relative;
  min-height: 70vh;
  background-size: cover; background-position: center;
  display: flex; align-items: end;
  padding: 80px 0 60px;
}
.movie-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,8,11,0.4) 0%, rgba(7,8,11,0.9) 70%, var(--bg-0) 100%);
}
.movie-hero .container { position: relative; z-index: 1; }
.movie-hero h1 { font-size: clamp(36px, 5vw, 64px); margin-bottom: 12px; }
.movie-hero .meta-bar { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-2); align-items: center; margin-bottom: 16px; font-size: 14px; }
.movie-hero .meta-bar .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }
.movie-hero .description { max-width: 720px; color: var(--text-2); font-size: 16px; line-height: 1.7; }
.movie-hero .hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* ----------------------  Upgrade page  ---------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 1000px; margin: 0 auto; }
.pricing-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  transition: all .25s;
}
.pricing-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(229,9,20,0.10), var(--bg-2));
  transform: scale(1.02);
}
.pricing-card.featured::before {
  content: 'Most popular';
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.pricing-card h3 { font-size: 22px; margin-bottom: 8px; }
.pricing-card .price { font-family: 'Outfit', sans-serif; font-size: 48px; font-weight: 800; }
.pricing-card .price small { font-size: 14px; color: var(--text-3); font-weight: 500; }
.pricing-card ul { list-style: none; padding: 0; margin: 24px 0; }
.pricing-card ul li { padding: 8px 0; color: var(--text-2); display: flex; gap: 10px; align-items: center; }
.pricing-card ul li i { color: var(--success); }

/* ----------------------  Footer  ---------------------- */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding: 60px 0 30px;
  margin-top: 80px;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 22px;
  color: var(--text) !important;
  margin-bottom: 12px;
}
.footer-tagline { color: var(--text-3); font-size: 14px; max-width: 320px; }
.site-footer h6 { color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 16px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 6px 0; }
.footer-links a { color: var(--text-2); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
  flex: 1; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; font-size: 13px;
}
.newsletter-form input:focus { outline: none; border-color: var(--primary); }
.newsletter-form button {
  background: var(--primary); color: #fff; border: 0;
  padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 13px;
}
.site-footer hr { border-color: var(--line); margin: 36px 0 20px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-2); }

/* ----------------------  Movies browse page  ---------------------- */
.browse-hero {
  padding: 120px 0 40px;
  text-align: center;
  position: relative;
}
.browse-hero h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 8px; }
.browse-hero p { color: var(--text-3); }

.browse-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding-bottom: 60px; }
@media (max-width: 900px) { .browse-layout { grid-template-columns: 1fr; } }

.filter-side {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  position: sticky; top: 96px;
}
.filter-side h6 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin: 16px 0 10px; }
.filter-side h6:first-child { margin-top: 0; }
.filter-side a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; margin-bottom: 2px;
}
.filter-side a:hover { background: var(--bg-3); color: var(--text); }
.filter-side a.active { background: var(--primary); color: #fff; }

/* ----------------------  Misc  ---------------------- */
::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border: 3px solid var(--bg-1); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

/* Hide header until scripts ready? Nope. */

/* Page-level helpers */
.text-secondary { color: var(--text-3) !important; }
.text-muted { color: var(--text-3) !important; }
.bg-dark-2 { background: var(--bg-2); }
.border-dark-2 { border-color: var(--line) !important; }

/* Responsive helpers */
@media (max-width: 768px) {
  .hero-collage { display: none; }
  .hero { padding: 40px 0 60px; min-height: auto; }
  .section { padding: 60px 0; }
  :root { --nav-h: 64px; }
}
