/*
Theme Name: MovieDB
Author: Your Name
Version: 1.3.7
Text Domain: moviedb
*/

/* ===== Root tokens ===== */
:root{
  --bg:#0c0d10;
  --panel:#131419;
  --panel-2:#1a1b22;
  --text:#f1f3f9;
  --muted:#a3a7b3;
  --accent:#7c4dff;
  --accent-2:#e50914;
  --card:#191b23;
  --glass:rgba(255,255,255,.06);
  --border:rgba(255,255,255,.08);
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

/* ===== Resets / base ===== */
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; background:var(--bg); color:var(--text); font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif; line-height:1.6; }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; height:auto; display:block; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:8px; }

/* ===== Layout containers ===== */
.container{ width:100%; max-width:1180px; margin:0 auto; padding:0 16px; }
@media (max-width:768px){ .container{ padding:0 12px; } }

/* ===== Header ===== */
.header{
  background:linear-gradient(180deg,rgba(0,0,0,.45),rgba(0,0,0,.2)), var(--panel);
  position:sticky; top:0; z-index:100; border-bottom:1px solid var(--border);
  backdrop-filter:saturate(140%) blur(6px);
}
.header-inner{ display:flex; gap:12px; align-items:center; padding:10px 0; }
.brand{ font-weight:800; letter-spacing:.4px; font-size:18px; }
.header-search-wrap{ padding-bottom:10px; }

/* Desktop nav (center) */
.nav{ margin-left:auto; }
.nav-desktop{ display:flex; gap:10px; margin:0 14px; }
.nav-desktop > ul{ display:flex; gap:10px; margin:0; padding:0; list-style:none; }
.nav-desktop a{ color:var(--muted); padding:8px 12px; border-radius:10px; }
.nav-desktop a:hover{ background:var(--glass); color:#fff; }
@media (max-width:980px){ .nav-desktop{ display:none; } }

/* Header right controls */
.header-actions{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.auth-btn{
  background:var(--glass); color:#fff; border:1px solid var(--border);
  border-radius:10px; padding:8px 12px; font-weight:800; font-size:12px;
}
.auth-btn:hover{ background:#202230; }
.auth-primary{ background:var(--accent); border-color:var(--border); }
.auth-primary:hover{ filter:brightness(1.1); }

/* Hamburger (3-line) */
.hamburger{
  width:38px; height:34px; border-radius:10px; border:1px solid var(--border);
  background:var(--glass); display:flex; flex-direction:column; justify-content:center; align-items:center; gap:4px;
  cursor:pointer;
}
.hamburger span{ display:block; width:20px; height:2px; background:#fff; border-radius:2px; }

/* Off-canvas menu */
.offcanvas{
  position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:999; display:none;
}
.offcanvas.active{ display:block; }
.offcanvas-inner{
  position:absolute; top:0; right:0; height:100%; width:min(84vw, 360px);
  background:var(--panel-2); border-left:1px solid var(--border); box-shadow:-12px 0 30px rgba(0,0,0,.35);
  display:flex; flex-direction:column;
}
.offcanvas-head{
  display:flex; align-items:center; justify-content:space-between; padding:12px; border-bottom:1px solid var(--border);
}
.offcanvas-close{
  width:36px; height:36px; border-radius:10px; border:1px solid var(--border);
  background:var(--glass); color:#fff; cursor:pointer;
}
.offcanvas-menu{ padding:10px; }
.off-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.off-list > li > a{
  display:block; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--glass); color:#fff;
}
.off-list > li > a:hover{ background:#202230; }
.off-auth{ display:flex; gap:10px; margin-top:12px; }

/* Collapse auth on tiny screens */
@media (max-width:520px){
  .auth-btn{ display:none; }
}

/* ===== Buttons & chips ===== */
.btn{ display:inline-flex; align-items:center; gap:8px; border:none; cursor:pointer; border-radius:10px; padding:10px 14px; font-weight:700; }
.btn-cta{ background:var(--accent-2); color:#fff; box-shadow:var(--shadow); }
.btn-ghost{ background:var(--glass); color:#fff; border:1px solid var(--border); }
.chip{ background:var(--accent); color:#fff; font-weight:800; font-size:12px; padding:6px 10px; border-radius:999px; display:inline-block; }

/* ===== Section header ===== */
.section{ margin:26px 0; }
.section-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.section-title{ font-size:18px; font-weight:900; letter-spacing:.2px; }
.section-action{ font-size:12px; background:var(--glass); padding:6px 10px; border-radius:10px; color:#cfd3df; border:1px solid var(--border); }
.section-action:hover{ background:#202230; }

/* ===== Hero ===== */
.hero{ position:relative; overflow:hidden; border-radius:16px; background:#000; box-shadow:var(--shadow); }
.hero-slide{ display:none; position:relative; aspect-ratio:16/6; min-height:280px; background:#000 center/cover no-repeat; }
.hero-slide.active{ display:block; }
.hero-caption{ position:absolute; inset:auto 0 0 0; padding:18px 16px; background:linear-gradient(180deg,transparent,rgba(0,0,0,.78)); }
.hero-title{ font-weight:900; font-size:22px; margin:0 0 8px; }
.hero-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
@media (max-width:520px){ .hero-title{ font-size:19px; } }

/* ===== Carousels ===== */
.moviedb-carousel{ position:relative; }
.moviedb-carousel-title{ display:none; }
.moviedb-carousel-track{
  display:flex; overflow:auto; gap:12px; scroll-behavior:smooth;
  scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; padding:2px 2px 6px;
}
.moviedb-card{
  flex:0 0 165px; border-radius:14px; overflow:hidden; background:var(--card);
  border:1px solid var(--border); box-shadow:0 6px 18px rgba(0,0,0,.3); position:relative; scroll-snap-align:start;
  min-width:160px;
}
.moviedb-card-poster{ width:100%; padding-top:145%; background:#222 center/cover no-repeat; position:relative; }
.badge{ position:absolute; top:8px; left:8px; background:rgba(0,0,0,.6); color:#fff; border:1px solid var(--border); border-radius:10px; font-size:11px; padding:4px 6px; }
.moviedb-card-meta{ padding:8px 9px 10px; min-height:58px; }
.moviedb-card-title{
  font-size:13px; font-weight:800; margin:0 0 4px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.moviedb-card-sub{ font-size:11px; color:#c7cada; display:flex; gap:6px; }
@media (max-width:520px){ .moviedb-card{ flex-basis:42vw; } }
.moviedb-carousel-prev,.moviedb-carousel-next{
  position:absolute; top:40%; transform:translateY(-50%); width:36px; height:36px; border-radius:12px; border:1px solid var(--border);
  background:var(--glass); color:#fff; cursor:pointer; backdrop-filter:blur(6px);
}
.moviedb-carousel-prev{ left:-6px; } .moviedb-carousel-next{ right:-6px; }
@media (max-width:768px){ .moviedb-carousel-prev,.moviedb-carousel-next{ display:none; } }

/* ===== Grids & cards ===== */
.grid{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; }
@media (max-width:1180px){ .grid{ grid-template-columns:repeat(5,1fr); } }
@media (max-width:980px){ .grid{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:760px){ .grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:520px){ .grid{ grid-template-columns:repeat(2,1fr); } }

.card{ border-radius:14px; overflow:hidden; background:var(--card); border:1px solid var(--border); box-shadow:0 6px 18px rgba(0,0,0,.3); }
.card-poster{ padding-top:145%; background:#222 center/cover no-repeat; position:relative; }
.card-body{ padding:10px; }
.card-title{ font-size:14px; font-weight:900; margin:0 0 2px; }
.card-sub{ color:#c7cada; font-size:12px; display:flex; gap:8px; }

/* ===== Filters ===== */
.browse-filters{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.browse-filters select,.browse-filters input{ background:var(--panel-2); color:var(--text); border:1px solid var(--border); border-radius:12px; padding:8px 12px; }
.btn{ background:var(--accent); color:#fff; border:none; padding:9px 12px; border-radius:12px; font-weight:800; }

/* ===== Single hero ===== */
.single-hero{ position:relative; background:#000 center/cover no-repeat; min-height:320px; border-radius:14px; overflow:hidden; box-shadow:var(--shadow); }
.single-hero::after{ content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent,rgba(0,0,0,.82)); }
.single-hero-inner{ position:relative; z-index:2; padding:18px; display:flex; gap:16px; align-items:flex-end; }
.poster{ width:210px; border-radius:14px; overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,.5); border:1px solid var(--border); }
.meta{ flex:1; }
.meta h1{ margin:0 0 6px; font-size:26px; font-weight:900; }
.tags{ display:flex; gap:8px; flex-wrap:wrap; font-size:12px; color:#c7cada; }
.tags .pill{ background:var(--glass); border:1px solid var(--border); border-radius:999px; padding:4px 10px; }
.numbers{ margin-top:6px; color:#ffd966; font-weight:900; }
@media (max-width:780px){ .single-hero-inner{ flex-direction:column; align-items:flex-start; } .poster{ width:170px; } .meta h1{ font-size:22px; } }

/* ===== Trailer embed ===== */
.trailer-embed{ margin:14px 0; aspect-ratio:16/9; background:#000; border-radius:12px; overflow:hidden; box-shadow:var(--shadow); }
.trailer-embed iframe{ width:100%; height:100%; border:0; }

/* ===== Watch logos (legacy; kept if you bring back) ===== */
.watch-logos{ display:flex; gap:10px; flex-wrap:wrap; margin:12px 0; }
.watch-logos .moviedb-ott{ background:#fff; padding:6px 10px; border-radius:10px; color:#000; display:flex; align-items:center; gap:8px; border:1px solid #e9e9ef; }
.moviedb-ott-logo{ height:22px; width:auto; }

/* ===== People ===== */
.cast-grid,.crew-grid{ display:grid; grid-template-columns:repeat(6,1fr); gap:12px; }
@media (max-width:980px){ .cast-grid,.crew-grid{ grid-template-columns:repeat(5,1fr); } }
@media (max-width:760px){ .cast-grid,.crew-grid{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:560px){ .cast-grid,.crew-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:420px){ .cast-grid,.crew-grid{ grid-template-columns:repeat(2,1fr); } }
.person{ background:var(--panel-2); border:1px solid var(--border); border-radius:14px; padding:10px; text-align:center; }
.person .img{ width:100%; padding-top:100%; background:#222 center/cover no-repeat; border-radius:999px; margin:0 auto 8px; border:2px solid var(--border); }
.person .name{ font-weight:900; font-size:13px; }
.person .role{ color:var(--muted); font-size:11px; }

/* ===== Gallery grid (single) ===== */
.gallery{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:12px 0; }
@media (max-width:900px){ .gallery{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:600px){ .gallery{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:420px){ .gallery{ grid-template-columns:1fr; } }
.gallery .img{ padding-top:62%; background:#222 center/cover no-repeat; border-radius:12px; border:1px solid var(--border); cursor:pointer; }

/* ===== Footer ===== */
.footer{ background:var(--panel); margin-top:36px; border-top:1px solid var(--border); }
.footer-inner{ display:flex; gap:22px; padding:18px 0; flex-wrap:wrap; }
.widget-area{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; width:100%; }
@media (max-width:760px){ .widget-area{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .widget-area{ grid-template-columns:1fr; } }
.muted{ color:var(--muted); }

/* ===== Header Search ===== */
.mdbs-search-form{ position:relative; display:flex; align-items:center; gap:8px; }
.mdbs-search-input{ flex:1; background:var(--glass); color:var(--text); border:1px solid var(--border); border-radius:12px; padding:10px 12px; outline:none; }
.mdbs-search-input::placeholder{ color:var(--muted); }
.mdbs-search-btn{ background:var(--accent); color:#fff; border:1px solid var(--border); border-radius:12px; padding:10px 12px; cursor:pointer; font-weight:800; }
.mdbs-search-results{
  position:absolute; left:0; right:0; top:calc(100% + 8px);
  background:var(--card); border:1px solid var(--border); border-radius:14px;
  box-shadow:0 18px 40px rgba(0,0,0,.45); padding:8px; max-height:60vh; overflow:auto; z-index:120;
}
.mdbs-item{ display:flex; gap:10px; align-items:stretch; padding:8px; border-radius:10px; border:1px solid transparent; }
.mdbs-item:hover{ background:var(--glass); border-color:var(--border); }
.mdbs-thumb{ width:52px; height:78px; border-radius:8px; background:#222 center/cover no-repeat; flex:0 0 52px; }
.mdbs-meta{ display:flex; flex-direction:column; gap:4px; min-width:0; flex:1; }
.mdbs-title{ font-weight:800; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mdbs-sub{ font-size:12px; color:var(--muted); display:flex; gap:8px; align-items:center; }
.mdbs-badge{ background:var(--accent); color:#fff; font-weight:800; font-size:11px; padding:3px 8px; border-radius:999px; }
.mdbs-more{ display:block; text-align:center; padding:8px; color:#cfd3df; font-size:13px; border-top:1px solid var(--border); }

/* ===== Lightbox / Slider for Gallery ===== */
.mdb-lightbox{ position:fixed; inset:0; z-index:1000; display:none; background:rgba(0,0,0,.9); }
.mdb-lightbox.active{ display:flex; align-items:center; justify-content:center; }
.mdb-lightbox-inner{ position:relative; width:100%; height:100%; display:flex; align-items:center; justify-content:center; padding:20px; }
.mdb-slide{ max-width:92vw; max-height:82vh; border-radius:14px; overflow:hidden; box-shadow:0 22px 60px rgba(0,0,0,.6); background:#000; }
.mdb-slide img{ width:auto; height:auto; max-width:92vw; max-height:82vh; display:block; }
.mdb-close, .mdb-prev, .mdb-next, .mdb-download{
  position:absolute; top:20px; width:40px; height:40px; border-radius:12px; border:1px solid var(--border);
  background:var(--glass); color:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer; backdrop-filter:blur(6px);
}
.mdb-close{ right:20px; }
.mdb-download{ right:70px; }
.mdb-prev, .mdb-next{ top:50%; transform:translateY(-50%); }
.mdb-prev{ left:20px; } .mdb-next{ right:20px; }
.mdb-counter{
  position:absolute; bottom:16px; left:50%; transform:translateX(-50%);
  background:var(--glass); border:1px solid var(--border); color:#fff; padding:6px 10px; border-radius:10px; font-weight:700;
}
@media (max-width:560px){
  .mdb-close,.mdb-download{ top:12px; }
  .mdb-prev{ left:8px; } .mdb-next{ right:8px; }
}

/* ===== Networks (CPT) ===== */
.networks-grid{
  display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px;
}
@media (max-width:1180px){ .networks-grid{ grid-template-columns:repeat(5,1fr); } }
@media (max-width:980px){  .networks-grid{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:760px){  .networks-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:520px){  .networks-grid{ grid-template-columns:repeat(2,1fr); } }

.network-chip{
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  background:var(--card); border:1px solid var(--border);
  border-radius:14px; box-shadow:0 6px 18px rgba(0,0,0,.3);
}
.network-logo{
  width:28px; height:28px; border-radius:8px; background:#222 center/cover no-repeat;
  border:1px solid var(--border);
}
.network-badge{
  width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  background:var(--accent); color:#fff; font-weight:900; border:1px solid var(--border);
}
.network-name{ font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ===== Toast notifications ===== */
.mdb-toast-wrap{
  position:fixed; right:16px; bottom:16px; z-index:1100; display:flex; flex-direction:column; gap:8px; max-width:min(92vw, 320px);
}
.mdb-toast{
  background:var(--panel-2); color:#fff; border:1px solid var(--border);
  border-radius:12px; padding:10px 12px; box-shadow:0 18px 40px rgba(0,0,0,.45);
  display:flex; align-items:center; gap:10px; opacity:0; transform:translateY(10px); animation:toast-in .2s ease forwards;
}
.mdb-toast .icon{ width:22px; height:22px; border-radius:6px; background:var(--glass); display:flex; align-items:center; justify-content:center; border:1px solid var(--border); }
.mdb-toast.success .icon{ background:#0d6e3a; border-color:#0d6e3a; }
.mdb-toast.warn .icon{ background:#7c4dff; }
.mdb-toast .msg{ font-weight:800; font-size:13px; }
.mdb-toast .close{ margin-left:auto; background:var(--glass); border:1px solid var(--border); color:#fff; border-radius:8px; width:28px; height:28px; cursor:pointer; }

@keyframes toast-in{
  to{ opacity:1; transform:translateY(0); }
}
