/* ============================================================
   MoviePortal — Public site styles
   Themes are set via <body class="t-dark|t-light|t-neon|t-retro|t-crimson|t-ocean">
   Each theme overrides the CSS variables defined on :root.
   The shell styles only use variables, so switching themes just
   swaps the variable set. A themed class can also add its own
   polish (glows for neon, grain for retro...).
   ============================================================ */

/* ---------- Base variable shell ---------- */
:root{
    --bg:#0b0b14; --bg2:#131320; --card:#1b1b2d;
    --accent:#e50914; --accent2:#ff7b00; --text:#f0f0f8;
    --muted:#9a9ab0; --border:#2c2c44;
    --radius:14px;
    --header-h:64px;
    --font:'Segoe UI',system-ui,-apple-system,Roboto,sans-serif;
}

/* ============================================================
   THEME 1 — Dark Cinema (default)
   ============================================================ */
body.t-dark{
    --bg:#0b0b14; --bg2:#131320; --card:#1b1b2d;
    --accent:#e50914; --accent2:#ff7b00; --text:#f0f0f8;
    --muted:#9a9ab0; --border:#2c2c44;
}
body.t-dark .hero-slide::after{ content:""; position:absolute; inset:0;
    background:linear-gradient(90deg, rgba(11,11,20,.92) 0%, rgba(11,11,20,.55) 45%, rgba(11,11,20,.1) 100%); }

/* ============================================================
   THEME 2 — Bright Light
   ============================================================ */
body.t-light{
    --bg:#f4f4fa; --bg2:#ecedf5; --card:#ffffff;
    --accent:#2563eb; --accent2:#0ea5e9; --text:#1c1c28;
    --muted:#6b6b85; --border:#dcdceb;
}
body.t-light .site-header{ background:rgba(255,255,255,.85); }
body.t-light .movie-card .mc-poster{ box-shadow:0 8px 22px rgba(15,23,42,.16); }
body.t-light .hero-slide::after{ content:""; position:absolute; inset:0;
    background:linear-gradient(90deg, rgba(244,244,250,.94) 0%, rgba(244,244,250,.7) 45%, rgba(244,244,250,.2) 100%); }
body.t-light .search-box input{ background:#fff; }

/* ============================================================
   THEME 3 — Neon Nights
   ============================================================ */
body.t-neon{
    --bg:#0b0221; --bg2:#150a33; --card:#1d0f45;
    --accent:#00f5ff; --accent2:#ff2bd6; --text:#f2eefc;
    --muted:#a99ad0; --border:#3a2270;
}
body.t-neon .site-header{ box-shadow:0 0 18px rgba(0,245,255,.18); }
body.t-neon .movie-card{ border:1px solid rgba(0,245,255,.16); }
body.t-neon .movie-card:hover{ box-shadow:0 0 26px rgba(0,245,255,.35); }
body.t-neon .mc-overlay .watch-btn{ background:var(--accent); color:#0b0221; text-shadow:none;
    box-shadow:0 0 16px rgba(0,245,255,.8); }
body.t-neon .hero-slide::after{ content:""; position:absolute; inset:0;
    background:linear-gradient(90deg, rgba(11,2,33,.92) 0%, rgba(11,2,33,.55) 45%, rgba(11,2,33,.05) 100%); }

/* ============================================================
   THEME 4 — Retro VHS
   ============================================================ */
body.t-retro{
    --bg:#1c1205; --bg2:#291a09; --card:#33200b;
    --accent:#ffb703; --accent2:#fb8500; --text:#fdf3e0;
    --muted:#c9a86a; --border:#5a3d18;
    --font:'Georgia',serif;
}
body.t-retro .movie-card{ border:1px solid #5a3d18; }
body.t-retro .movie-card:hover{ box-shadow:0 8px 22px rgba(255,183,3,.18); }
body.t-retro .site-header{ background:rgba(28,18,5,.9); }
body.t-retro .hero-slide::after{ content:""; position:absolute; inset:0;
    background:linear-gradient(90deg, rgba(28,18,5,.92) 0%, rgba(28,18,5,.6) 45%, rgba(28,18,5,.1) 100%); }
body.t-retro .btn-primary{ text-transform:uppercase; letter-spacing:.08em; font-weight:700; }

/* ============================================================
   THEME 5 — Crimson Dark
   ============================================================ */
body.t-crimson{
    --bg:#170303; --bg2:#240808; --card:#2e0c0c;
    --accent:#ff3b3b; --accent2:#ff9f1c; --text:#f8e8e8;
    --muted:#b07a7a; --border:#521c1c;
}
body.t-crimson .site-header{ box-shadow:0 4px 24px rgba(255,59,59,.15); }
body.t-crimson .hero-slide::after{ content:""; position:absolute; inset:0;
    background:linear-gradient(90deg, rgba(23,3,3,.92) 0%, rgba(23,3,3,.55) 45%, rgba(23,3,3,.08) 100%); }

/* ============================================================
   THEME 6 — Deep Ocean
   ============================================================ */
body.t-ocean{
    --bg:#041020; --bg2:#091c33; --card:#0b2845;
    --accent:#38bdf8; --accent2:#22d3ee; --text:#e5f3ff;
    --muted:#7f9dba; --border:#1d3f63;
}
body.t-ocean .movie-card{ border:1px solid #16314f; }
body.t-ocean .hero-slide::after{ content:""; position:absolute; inset:0;
    background:linear-gradient(90deg, rgba(4,16,32,.92) 0%, rgba(4,16,32,.55) 45%, rgba(4,16,32,.1) 100%); }

/* ============================================================
   Layout shell (theme-agnostic)
   ============================================================ */
*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
    background:var(--bg); color:var(--text); font-family:var(--font);
    font-size:15px; line-height:1.55; min-height:100vh;
    background-image:radial-gradient(circle at 15% -5%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 40%);
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
.container{ max-width:1240px; margin:0 auto; padding:0 20px; }

/* ---------- Header ---------- */
.site-header{
    position:sticky; top:0; z-index:100; height:var(--header-h);
    background:color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter:blur(10px); border-bottom:1px solid var(--border);
}
.header-inner{ height:var(--header-h); display:flex; align-items:center; gap:22px; }
.logo{ display:flex; align-items:center; gap:9px; font-size:1.15rem; font-weight:800; letter-spacing:.02em; }
.logo-badge{
    width:30px;height:30px;border-radius:9px;background:var(--accent);
    display:flex;align-items:center;justify-content:center;color:#fff;font-size:1rem;
    box-shadow:0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
}
.main-nav{ display:flex; gap:4px; margin-left:6px; }
.nav-link{
    padding:8px 13px; border-radius:8px; font-weight:600; font-size:.92rem;
    color:var(--muted); transition:.15s;
}
.nav-link:hover, .nav-link.active{ color:var(--text); background:var(--card); }
.nav-link.active{ color:var(--accent); }
.nav-groups:hover .genre-menu{ display:grid; }
.genre-menu{
    display:none; position:absolute; top:calc(var(--header-h) - 6px); left:0;
    background:var(--card); border:1px solid var(--border); border-radius:12px;
    grid-template-columns:repeat(4, 150px); gap:2px; padding:10px; z-index:200;
    box-shadow:0 18px 40px rgba(0,0,0,.35);
}
.genre-menu a{ padding:7px 11px; border-radius:7px; font-size:.85rem; color:var(--text); }
.genre-menu a:hover{ background:var(--bg2); color:var(--accent); }

.header-right{ margin-left:auto; display:flex; align-items:center; gap:12px; }
.search-box{ display:flex; align-items:center; background:var(--card); border:1px solid var(--border);
    border-radius:99px; padding:3px 5px 3px 14px; }
.search-box input{ background:transparent;border:none;outline:none;color:var(--text);width:190px;font-size:.9rem; }
.search-box input::placeholder{ color:var(--muted); }
.search-btn{ background:var(--accent); color:#fff; border:none;border-radius:99px;padding:7px 14px;font-weight:700;cursor:pointer; }

/* ---------- Hero / slider ---------- */
.hero{ position:relative; overflow:hidden; border-radius:0 0 22px 22px; margin-bottom:34px; }
.hero-slider{ position:relative; height:min(60vh, 560px); }
.hero-slide{ position:absolute; inset:0; opacity:0; transition:opacity .8s ease; background-size:cover; background-position:center top; }
.hero-slide.active{ opacity:1; z-index:1; }
.hero-slide::before{ content:""; position:absolute; inset:0; }
.hero-content{ position:absolute; z-index:2; bottom:14%; left:0; right:0; }
.hero-inner{ max-width:1240px; margin:0 auto; padding:0 20px; }
.hero-tag{ display:inline-block; background:var(--accent); color:#fff; font-size:.72rem; font-weight:800;
    text-transform:uppercase; letter-spacing:.1em; padding:4px 11px; border-radius:99px; margin-bottom:14px; }
.hero-title{ font-size:clamp(1.6rem, 4.2vw, 3rem); font-weight:800; max-width:640px; line-height:1.12; text-shadow:0 3px 20px rgba(0,0,0,.5); }
.hero-meta{ margin:12px 0 16px; display:flex; gap:14px; align-items:center; font-size:.9rem; color:var(--text); flex-wrap:wrap; }
.hero-meta .sep{ opacity:.4; }
.hero-desc{ max-width:560px; margin-bottom:20px; color:var(--text); opacity:.85; display:-webkit-box;
    -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.hero-actions{ display:flex; gap:12px; flex-wrap:wrap; }
.btn{ display:inline-flex; align-items:center; gap:8px; padding:11px 22px; border-radius:99px;
    font-weight:700; font-size:.92rem; border:none; cursor:pointer; transition:.18s; }
.btn-primary{ background:var(--accent); color:#fff; }
.btn-primary:hover{ transform:translateY(-2px); box-shadow:0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn-ghost{ background:rgba(0,0,0,.35); color:#fff; border:1px solid rgba(255,255,255,.35); }
.btn-ghost:hover{ background:rgba(255,255,255,.14); transform:translateY(-2px); }

.hero-dots{ position:absolute; bottom:16px; left:50%; transform:translateX(-50%); z-index:3; display:flex; gap:8px; }
.hero-dot{ width:9px; height:9px; border-radius:99px; background:rgba(255,255,255,.4); cursor:pointer; border:none; transition:.25s; }
.hero-dot.active{ background:var(--accent); width:26px; }

/* ---------- Section rows ---------- */
.section{ margin-bottom:38px; }
.section-head{ display:flex; align-items:baseline; gap:14px; margin-bottom:16px; }
.section-title{ font-size:1.3rem; font-weight:800; }
.section-title::before{ content:""; display:inline-block; width:5px; height:16px; background:var(--accent);
    border-radius:3px; margin-right:9px; vertical-align:-2px; }
.section-more{ margin-left:auto; color:var(--muted); font-size:.85rem; font-weight:600; }
.section-more:hover{ color:var(--accent); }

.h-scroll{ display:flex; gap:16px; overflow-x:auto; padding:6px 2px 14px; scroll-snap-type:x proximity; }
.h-scroll::-webkit-scrollbar{ height:8px; }
.h-scroll::-webkit-scrollbar-thumb{ background:var(--border); border-radius:9px; }

/* ---------- Movie card ---------- */
.movie-card{ position:relative; flex:0 0 178px; width:178px; scroll-snap-align:start; border-radius:var(--radius);
    background:var(--card); border:1px solid var(--border); overflow:hidden; transition:.2s; }
.movie-card:hover{ transform:translateY(-5px); box-shadow:0 14px 30px rgba(0,0,0,.35);
    border-color:color-mix(in srgb, var(--accent) 55%, transparent); }
.mc-poster{ position:relative; aspect-ratio:2/3; overflow:hidden; }
.mc-poster img{ width:100%; height:100%; object-fit:cover; }
.mc-overlay{ position:absolute; inset:0; background:linear-gradient(transparent 45%, rgba(0,0,0,.82));
    opacity:0; transition:.2s; display:flex; flex-direction:column; justify-content:flex-end; padding:12px; gap:8px; }
.movie-card:hover .mc-overlay{ opacity:1; }
.mc-overlay .watch-btn{ background:var(--accent); color:#fff; padding:7px 0; text-align:center; border-radius:8px; font-weight:700; font-size:.82rem; }
.mc-overlay .rate-chip{ color:#ffcf3f; font-weight:700; font-size:.82rem; }
.mc-body{ padding:10px 11px 13px; }
.mc-title{ font-weight:700; font-size:.9rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mc-sub{ color:var(--muted); font-size:.78rem; margin-top:2px; display:flex; gap:8px; }
.mc-badge{ position:absolute; top:10px; left:10px; z-index:1; background:var(--accent); color:#fff;
    font-size:.65rem; font-weight:800; text-transform:uppercase; padding:3px 8px; border-radius:6px; letter-spacing:.06em; }

/* ---------- Grid (browse / category / search) ---------- */
.grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(178px, 1fr)); gap:20px 14px; }
.grid .movie-card{ flex:auto; width:auto; }

/* ---------- Genre chips ---------- */
.genre-chips{ display:flex; gap:10px; flex-wrap:wrap; }
.genre-chip{ background:var(--card); border:1px solid var(--border); padding:9px 18px; border-radius:99px;
    font-weight:600; font-size:.86rem; color:var(--muted); transition:.15s; }
.genre-chip:hover{ color:var(--accent); border-color:var(--accent); transform:translateY(-2px); }

.keyword-cloud{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
.keyword{ font-size:.78rem; background:var(--card); border:1px solid var(--border); padding:7px 14px; border-radius:99px; color:var(--muted); text-decoration:none; }
.keyword:hover{ color:var(--accent); border-color:var(--accent); transform:translateY(-1px); }
.seo-block{ text-align:center; padding:36px 0 8px; }
.seo-block .sec-label{ font-size:.72rem; text-transform:uppercase; letter-spacing:.18em; color:var(--muted); margin-bottom:12px; }
.seo-para{ max-width:760px; margin:22px auto 0; color:var(--muted); font-size:.9rem; line-height:1.75; text-align:center; }

/* ---------- Page hero for inner pages ---------- */
.page-head{ padding:34px 0 8px; }
.page-head h1{ font-size:1.9rem; font-weight:800; }
.page-head p{ color:var(--muted); margin-top:4px; }
.breadcrumb{ color:var(--muted); font-size:.85rem; margin-bottom:8px; }
.breadcrumb a:hover{ color:var(--accent); }

/* ---------- Movie detail page ---------- */
.movie-hero{ position:relative; margin-bottom:28px; border-radius:18px; overflow:hidden; min-height:420px; }
.movie-hero .mh-bg{ position:absolute; inset:0; background-size:cover; background-position:center 20%; }
.movie-hero::after{ content:""; position:absolute; inset:0;
    background:linear-gradient(0deg, var(--bg) 4%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.25) 100%); }
.mh-inner{ position:relative; z-index:2; display:flex; gap:30px; padding:70px 0 26px; align-items:flex-end; }
.mh-poster{ flex:0 0 220px; }
.mh-poster img{ border-radius:14px; box-shadow:0 18px 44px rgba(0,0,0,.55); }
.mh-info{ flex:1; }
.mh-info h1{ font-size:clamp(1.6rem, 3.2vw, 2.5rem); font-weight:800; }
.mh-tagline{ color:var(--muted); font-style:italic; margin-top:2px; }
.mh-meta{ display:flex; flex-wrap:wrap; gap:16px; margin:14px 0; color:var(--muted); font-size:.92rem; align-items:center; }
.mh-meta .rating{ color:#ffcf3f; font-weight:800; }
.mh-genres{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.mh-genres a{ background:var(--card); border:1px solid var(--border); border-radius:99px; padding:5px 13px; font-size:.8rem; font-weight:600; color:var(--text); }
.mh-genres a:hover{ color:var(--accent); border-color:var(--accent); }
.mh-actions{ display:flex; gap:12px; flex-wrap:wrap; }

.movie-tabs{ display:flex; gap:4px; margin-bottom:22px; overflow-x:auto; }
.tab{ padding:9px 18px; border-radius:9px; font-weight:700; color:var(--muted); cursor:pointer; border:none; background:none; font-size:.92rem; text-decoration:none; }
.tab.active{ background:var(--accent); color:#fff; }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; animation:fadeIn .3s ease; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }

.prose{ color:var(--text); opacity:.9; max-width:780px; line-height:1.7; }
.cast{ display:flex; gap:14px; overflow-x:auto; padding-bottom:8px; }
.cast-card{ flex:0 0 120px; text-align:center; }
.cast-avatar{ width:120px; height:120px; border-radius:50%; object-fit:cover; background:var(--bg2); border:2px solid var(--border); }
.cast-name{ margin-top:8px; font-weight:700; font-size:.82rem; }

/* ---------- Watch page ---------- */
.video-wrap{ position:relative; aspect-ratio:16/9; background:#000; border-radius:16px; overflow:hidden;
    border:1px solid var(--border); box-shadow:0 16px 40px rgba(0,0,0,.4); }
.video-wrap iframe{ position:absolute; inset:0; width:100%; height:100%; border:none; }
.video-fallback{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
    flex-direction:column; gap:14px; color:var(--muted); }

/* ---------- Player modal (from movie card) ---------- */
.player-modal{ position:fixed; inset:0; z-index:500; display:none; align-items:center; justify-content:center;
    background:rgba(0,0,0,.86); backdrop-filter:blur(6px); padding:20px; }
.player-modal.open{ display:flex; }
.player-frame{ width:100%; max-width:920px; background:#000; border-radius:16px; overflow:hidden; position:relative; }
.player-frame .aspect{ position:relative; aspect-ratio:16/9; }
.player-frame iframe{ position:absolute; inset:0; width:100%; height:100%; border:none; }
.pm-close{ position:absolute; top:-38px; right:0; background:var(--accent); color:#fff; border:none;
    width:34px; height:34px; border-radius:99px; cursor:pointer; font-size:1.1rem; }

/* ---------- News/featured strip ---------- */
.highlight-now{ background:linear-gradient(90deg, color-mix(in srgb,var(--accent) 14%, transparent), transparent);
    border:1px solid color-mix(in srgb, var(--accent) 32%, transparent); border-radius:14px;
    padding:18px 20px; display:flex; align-items:center; gap:18px; margin-bottom:34px; flex-wrap:wrap; }
.highlight-now .hn-label{ background:var(--accent); color:#fff; font-size:.7rem; font-weight:800;
    padding:5px 12px; border-radius:99px; text-transform:uppercase; letter-spacing:.1em; }

/* ---------- Footer ---------- */
.site-footer{ border-top:1px solid var(--border); margin-top:50px; padding:34px 0 26px; }
.footer-inner{ display:flex; flex-wrap:wrap; gap:24px; justify-content:space-between; align-items:center; }
.footer-col h4{ font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:8px; }
.footer-links{ display:flex; gap:16px; flex-wrap:wrap; }
.footer-links a{ color:var(--muted); font-size:.88rem; }
.footer-links a:hover{ color:var(--accent); }
.footer-copy{ color:var(--muted); font-size:.78rem; margin-top:20px; text-align:center; }

/* ---------- Empty state ---------- */
.empty{ text-align:center; padding:70px 0; color:var(--muted); }
.empty .big{ font-size:3rem; margin-bottom:10px; }

/* ---------- Pagination ---------- */
.pagination{ display:flex; gap:8px; justify-content:center; margin:30px 0; flex-wrap:wrap; }
.page-btn{ padding:9px 15px; border-radius:9px; border:1px solid var(--border); background:var(--card);
    color:var(--text); font-weight:600; font-size:.9rem; }
.page-btn.active{ background:var(--accent); border-color:var(--accent); color:#fff; }
.page-btn.disabled{ opacity:.4; pointer-events:none; }
.page-btn:hover:not(.disabled){ border-color:var(--accent); color:var(--accent); }

/* ---------- Notices ---------- */
.notice{ padding:14px 18px; border-radius:12px; margin:14px 0; font-size:.9rem; border:1px solid; }
.notice.info{ background:color-mix(in srgb,var(--accent) 12%, transparent); border-color:color-mix(in srgb,var(--accent) 35%, transparent); color:var(--text); }
.notice .n-strong{ font-weight:700; }

/* ---------- Responsive ---------- */
@media(max-width:900px){
    .main-nav{ display:none; }
    .search-box input{ width:120px; }
    .movie-hero{ min-height:auto; }
    .mh-inner{ flex-direction:column; align-items:center; text-align:center; padding-top:40px; }
    .mh-meta, .mh-genres, .mh-actions{ justify-content:center; }
    .mh-poster{ flex-basis:auto; width:190px; }
    .hero-slider{ height:56vh; }
}
@media(max-width:560px){
    .header-right .search-box{ display:none; }
    .grid{ grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); }
    .movie-card{ flex-basis:150px; width:150px; }
}