/* /public/home.css */

/* =========================
   THEME
========================= */
:root{
  --bg:#07070a;
  --panel:#0f1117;
  --panel2:#0b0c10;
  --text:#ffffff;
  --muted:#aeb6c2;
  --line:rgba(255,255,255,.08);
  --red:#e50914;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 30% -20%, rgba(229,9,20,.22), transparent 55%),
              radial-gradient(900px 700px at 90% 0%, rgba(85,120,255,.18), transparent 55%),
              var(--bg);
  color:var(--text);
}

/* =========================
   NAVBAR
========================= */
.navbar{
  position: sticky;
  top:0;
  z-index:50;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 16px;
  background: rgba(7,7,10,.72);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--line);
}

.brand{
  font-weight: 900;
  letter-spacing: .3px;
  color: var(--text);
  text-decoration:none;
  font-size: 16px;
}

.nav-links{
  display:flex;
  gap:16px;
  align-items:center;
}

.nav-links a{
  color:var(--muted);
  text-decoration:none;
  font-weight:800;
  font-size:14px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: .15s ease;
}
.nav-links a:hover{
  color:var(--text);
  background: rgba(255,255,255,.06);
}
.nav-links a.active{
  color:var(--text);
  background: rgba(229,9,20,.16);
  border: 1px solid rgba(229,9,20,.25);
}

/* =========================
   HERO
========================= */
.home-hero{
  position:relative;
  padding: 44px 16px 22px;
  overflow:hidden;
}
.hero-bg{
  position:absolute;
  inset:-120px -80px -80px -80px;
  background:
    radial-gradient(700px 420px at 20% 40%, rgba(229,9,20,.32), transparent 60%),
    radial-gradient(700px 420px at 80% 30%, rgba(85,120,255,.22), transparent 60%);
  filter: blur(18px);
  opacity:.9;
}
.hero-content{
  position:relative;
  max-width: 980px;
  margin: 0 auto;
  text-align:center;
}
.home-hero h1{
  margin: 0 0 10px;
  font-size: clamp(26px, 3.2vw, 46px);
  line-height: 1.06;
  font-weight: 950;
  letter-spacing: .2px;
  text-shadow: 0 8px 50px rgba(0,0,0,.55);
}
.home-hero p{
  margin: 0 auto 18px;
  max-width: 640px;
  color: var(--muted);
  font-weight: 650;
}

.hero-actions{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none;
  font-weight:900;
  border-radius: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  transition: .15s ease;
}
.btn.primary{
  background: linear-gradient(180deg, rgba(229,9,20,.95), rgba(180,7,16,.95));
  border-color: rgba(229,9,20,.35);
  color:#fff;
  box-shadow: 0 14px 40px rgba(229,9,20,.22);
}
.btn.primary:hover{ transform: translateY(-1px); }
.btn.ghost{
  color: var(--text);
  background: rgba(255,255,255,.05);
}
.btn.ghost:hover{
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}

/* =========================
   SECTIONS
========================= */
.home-section{
  padding: 10px 16px 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin: 10px 0 8px;
}
.section-head h2{
  margin:0;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: .2px;
}
.section-head .link{
  color: var(--muted);
  text-decoration:none;
  font-weight: 850;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.section-head .link:hover{
  color: var(--text);
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}

/* =========================
   RAIL WRAP + BUTTONS + FADES
========================= */
.rail-wrap{
  position:relative;
}

.home-rail{
  display:flex;
  gap: 12px;
  overflow-x:auto;
  padding: 10px 2px 14px;
  scroll-snap-type: x mandatory;
  scroll-behavior:smooth;
  -webkit-overflow-scrolling: touch;
}

.home-rail::-webkit-scrollbar{ height: 8px; }
.home-rail::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.14);
  border-radius: 999px;
}
.home-rail::-webkit-scrollbar-track{
  background: rgba(255,255,255,.05);
  border-radius: 999px;
}

.rail-btn{
  position:absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 40px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.45);
  color:#fff;
  font-size: 28px;
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 3;
  backdrop-filter: blur(8px);
  transition: .15s ease;
}
.rail-btn:hover{ background: rgba(0,0,0,.62); }
.rail-btn.left{ left: 6px; }
.rail-btn.right{ right: 6px; }

.rail-fade{
  position:absolute;
  top:0;
  bottom: 6px;
  width: 60px;
  pointer-events:none;
  z-index:2;
}
.rail-fade.left{
  left:0;
  background: linear-gradient(90deg, rgba(7,7,10,.96), rgba(7,7,10,0));
}
.rail-fade.right{
  right:0;
  background: linear-gradient(270deg, rgba(7,7,10,.96), rgba(7,7,10,0));
}

/* Show scroll buttons on desktop */
@media (min-width: 900px){
  .rail-btn{ display:flex; }
  .rail-fade{ width: 80px; }
}

/* =========================
   CARDS
========================= */
.home-card{
  width: 154px;
  scroll-snap-align: start;
  cursor:pointer;
  user-select:none;
  outline:none;
}

.poster-wrap{
  position:relative;
  border-radius: var(--radius);
  overflow:hidden;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 34px rgba(0,0,0,.45);
  transform: translateZ(0);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-card img{
  display:block;
  width:100%;
  height: 230px;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .25s ease, filter .25s ease;
}

.home-card:hover .poster-wrap{
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(229,9,20,.25);
  box-shadow: 0 18px 60px rgba(0,0,0,.65);
}
.home-card:hover img{
  transform: scale(1.06);
  filter: saturate(1.15) contrast(1.05);
}

.badge{
  position:absolute;
  left:10px;
  top:10px;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}

.title{
  margin-top: 8px;
  font-size: 13px;
  font-weight: 850;
  color: rgba(255,255,255,.92);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

/* =========================
   SKELETONS
========================= */
.skeleton{
  background: linear-gradient(90deg,
    rgba(255,255,255,.05) 25%,
    rgba(255,255,255,.10) 37%,
    rgba(255,255,255,.05) 63%);
  background-size: 400% 100%;
  animation: sk 1.35s ease infinite;
}
@keyframes sk{
  0%{ background-position: 100% 0; }
  100%{ background-position: -100% 0; }
}

.skeleton-card .poster{
  width: 100%;
  height: 230px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
}
.skeleton-card .line{
  margin-top: 10px;
  height: 12px;
  border-radius: 999px;
  width: 85%;
}

/* =========================
   EMPTY STATE
========================= */
.rail-empty{
  padding: 18px 10px;
  color: var(--muted);
  font-weight: 800;
}

/* =========================
   VALUE STRIP
========================= */
.home-value{
  max-width: 980px;
  margin: 10px auto 30px;
  padding: 0 16px;
  display:flex;
  gap: 10px;
  justify-content:center;
  flex-wrap:wrap;
}
.value-chip{
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  font-weight: 900;
  font-size: 13px;
}

/* =========================
   PLAYER OVERLAY
========================= */
.movie-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.82);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 9999;
  padding: 18px;
}
.movie-overlay[hidden]{ display:none; }

.player-dialog{
  width: min(1100px, 96vw);
  aspect-ratio: 16 / 9;
  background:#000;
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  position:relative;
}

.player-dialog iframe{
  width:100%;
  height:100%;
  border:0;
}

.player-close{
  position:absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.55);
  color:#fff;
  font-weight: 950;
  cursor:pointer;
  z-index:2;
  backdrop-filter: blur(8px);
}
.player-close:hover{
  background: rgba(0,0,0,.75);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 520px){
  .home-card{ width: 140px; }
  .home-card img{ height: 210px; }
  .skeleton-card .poster{ height: 210px; }
  .home-hero{ padding-top: 36px; }
}
