/* ══════════════════════════════════════════════
   CineVault — Production CSS
   Mobile-first, touch-optimised
   ══════════════════════════════════════════════ */

/* Google Fonts loaded in header */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --bg:        #080b10;
  --surface:   #0f1318;
  --surface2:  #161c24;
  --surface3:  #1e2630;
  --border:    #232d3a;
  --gold:      #f5c842;
  --gold-dim:  #c9a230;
  --red:       #e8453c;
  --green:     #2ecc71;
  --text:      #e8edf4;
  --muted:     #6b7d91;
  --muted2:    #4a5a6b;

  /* Typography */
  --font-display: 'Oswald', sans-serif;
  --font-body:    'Nunito', sans-serif;

  /* Layout */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;

  /* Touch target minimum */
  --touch: 44px;

  /* Transitions */
  --ease: cubic-bezier(.25,.46,.45,.94);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;   /* prevent iOS font scaling */
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: var(--gold); text-decoration: none; }
button, input, textarea, select { font-family: inherit; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(8,11,16,.9);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  height: 56px;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--gold);
  flex-shrink: 0;
}

/* Desktop nav */
.nav-links {
  display: none;
  align-items: center; gap: 6px;
}
@media (min-width: 640px) { .nav-links { display: flex; } }
.nav-links a {
  color: var(--muted);
  font-size: .88rem; font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface2); }
.nav-links .btn-nav {
  background: var(--gold); color: #080b10;
  padding: 8px 18px; border-radius: var(--radius-sm); font-weight: 700;
}
.nav-links .btn-nav:hover { background: var(--gold-dim); }

/* Mobile hamburger */
.hamburger {
  display: flex; flex-direction: column; gap: 5px;
  width: var(--touch); height: var(--touch);
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 640px) { .hamburger { display: none; } }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  display: none;
  position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
  background: rgba(8,11,16,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 199;
  padding: 24px 20px;
  flex-direction: column; gap: 6px;
  animation: slideDown .25s var(--ease);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
.mobile-nav a {
  display: flex; align-items: center; gap: 12px;
  color: var(--text); font-size: 1.1rem; font-weight: 600;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  min-height: var(--touch);
  transition: background .15s;
}
.mobile-nav a:hover, .mobile-nav a.active { background: var(--surface2); border-color: var(--border); }
.mobile-nav .nav-sep { height: 1px; background: var(--border); margin: 8px 0; }
.mobile-nav .btn-gold {
  background: var(--gold); color: #080b10;
  border-color: var(--gold); margin-top: 8px;
  font-weight: 700;
}

/* ── HERO ── */
.hero {
  position: relative; overflow: hidden;
  min-height: clamp(280px, 55vw, 520px);
  display: flex; align-items: flex-end;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 20%;
  filter: brightness(.3) saturate(1.3);
}
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(8,11,16,.6) 50%, transparent 100%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 24px 0 32px;
  width: 100%;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--red); color: #fff;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px; margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .01em;
  margin-bottom: 10px;
}
.hero-meta { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.hero-overview {
  font-size: .9rem; color: #a0b0c0; line-height: 1.6;
  max-width: 540px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 20px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--touch);
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 700;
  cursor: pointer; border: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-gold    { background: var(--gold); color: #080b10; }
.btn-gold:hover { box-shadow: 0 6px 20px rgba(245,200,66,.3); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger  { background: var(--red); color: #fff; }
.btn-ghost   { background: rgba(255,255,255,.07); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-sm      { min-height: 36px; padding: 0 14px; font-size: .82rem; border-radius: 7px; }
.btn-block   { width: 100%; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: .78rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 7px;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 0 14px;
  height: var(--touch);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,200,66,.12);
}
textarea.form-control {
  height: auto; min-height: 110px;
  padding: 12px 14px; resize: vertical;
  line-height: 1.6;
}
.form-control::placeholder { color: var(--muted2); }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.form-error { font-size: .82rem; color: var(--red); margin-top: 5px; }

/* ── ALERTS ── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: .9rem; margin-bottom: 18px;
}
.alert-success { background: rgba(46,204,113,.1); border: 1px solid rgba(46,204,113,.25); color: #2ecc71; }
.alert-error   { background: rgba(232,69,60,.1);  border: 1px solid rgba(232,69,60,.3);  color: #f07070; }
.alert-info    { background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.2); color: var(--gold); }

/* ── SECTION TITLES ── */
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-title  { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: .04em; }
.section-sub    { font-size: .82rem; color: var(--muted); }

/* ── MOVIE GRID ── */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}
@media (min-width: 480px) { .movie-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (min-width: 768px) { .movie-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; } }

.movie-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .2s var(--ease), box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.movie-card:hover  { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.movie-card:active { transform: scale(.98); }
.poster-wrap {
  position: relative; aspect-ratio: 2/3;
  background: var(--surface2); overflow: hidden;
}
.poster-wrap img { width:100%; height:100%; object-fit:cover; transition: transform .3s; }
.movie-card:hover .poster-wrap img { transform: scale(1.04); }
.poster-placeholder { width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:2.5rem;color:var(--border); }
.rating-pill {
  position:absolute;top:8px;right:8px;
  background:rgba(8,11,16,.85); border:1px solid var(--gold);
  color:var(--gold);font-size:.72rem;font-weight:800;
  padding:2px 7px;border-radius:20px;
}
.card-body { padding: 10px 12px 14px; }
.card-title {
  font-weight: 700; font-size: .88rem; line-height: 1.3;
  margin-bottom: 4px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.card-meta { color:var(--muted);font-size:.76rem; }

/* ── MOVIE DETAIL ── */
.movie-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
@media (min-width: 640px) {
  .movie-detail { grid-template-columns: 220px 1fr; gap: 32px; }
}
@media (min-width: 900px) {
  .movie-detail { grid-template-columns: 280px 1fr; gap: 48px; }
}
.detail-poster-wrap { display:flex; justify-content:center; }
.detail-poster-wrap img { border-radius:var(--radius); box-shadow:0 20px 60px rgba(0,0,0,.6); max-width:260px; width:100%; }
@media (min-width:640px) { .detail-poster-wrap { justify-content:flex-start; } }
.detail-title { font-family:var(--font-display);font-size:clamp(1.6rem,4vw,2.8rem);font-weight:700;line-height:1.1;margin-bottom:10px; }
.detail-meta  { display:flex;flex-wrap:wrap;gap:14px;color:var(--muted);font-size:.85rem;margin-bottom:16px; }
.genres { display:flex;flex-wrap:wrap;gap:7px;margin-bottom:18px; }
.genre-tag { background:var(--surface2);border:1px solid var(--border);color:var(--muted);font-size:.76rem;padding:4px 12px;border-radius:20px; }
.detail-overview { color:#a8b8c8;line-height:1.75;font-size:.95rem;margin-bottom:24px; }

/* Overall Rating Box */
.rating-box {
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:20px 24px;margin-bottom:28px;
  display:flex;align-items:center;gap:20px;
}
.big-score { font-family:var(--font-display);font-size:3.5rem;color:var(--gold);line-height:1;flex-shrink:0; }
.score-meta .score-label { color:var(--muted);font-size:.8rem;margin-bottom:6px; }
.stars-row { display:flex;gap:3px;margin-bottom:5px; }
.star      { font-size:1.1rem; }
.star.on   { color:var(--gold); }
.star.off  { color:var(--border); }
.review-count { color:var(--muted);font-size:.8rem; }

/* ── STAR PICKER ── */
.star-picker { display:flex;gap:5px;margin-bottom:6px;flex-wrap:wrap; }
.sp {
  font-size:1.7rem; color:var(--border); cursor:pointer;
  transition:color .12s,transform .12s;
  -webkit-tap-highlight-color:transparent;
  user-select:none; -webkit-user-select:none;
  min-width:var(--touch); min-height:var(--touch);
  display:flex;align-items:center;justify-content:center;
}
.sp.on { color:var(--gold); transform:scale(1.1); }

/* ── REVIEWS ── */
.review-card {
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:18px;margin-bottom:14px;
  animation:fadeUp .3s var(--ease) both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.review-top { display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:10px; }
.reviewer   { display:flex;align-items:center;gap:10px; }
.avatar     { width:38px;height:38px;border-radius:50%;background:var(--surface2);border:2px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:1.2rem;flex-shrink:0; }
.reviewer-name { font-weight:700;font-size:.92rem; }
.review-date   { color:var(--muted);font-size:.76rem; }
.review-score  { background:var(--gold);color:#080b10;font-weight:800;font-size:.82rem;padding:3px 9px;border-radius:5px;flex-shrink:0; }
.review-text   { color:#a8b8c8;font-size:.9rem;line-height:1.7; }
.like-btn {
  display:inline-flex;align-items:center;gap:5px;
  color:var(--muted);font-size:.8rem;font-weight:600;
  background:none;border:1px solid var(--border);
  padding:5px 12px;border-radius:20px;cursor:pointer;
  margin-top:12px;transition:color .15s,border-color .15s;
  -webkit-tap-highlight-color:transparent;
  min-height:34px;
}
.like-btn:hover,.like-btn.liked { color:var(--red);border-color:var(--red); }

/* ── REVIEW FORM BOX ── */
.review-form-box {
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:20px;margin-bottom:28px;
}
.review-form-title { font-family:var(--font-display);font-size:1.3rem;letter-spacing:.04em;margin-bottom:18px; }

/* ── AUTH PAGES ── */
.auth-page { min-height:calc(100dvh - 56px);display:flex;align-items:center;justify-content:center;padding:24px 16px; }
.auth-box { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:clamp(24px,5vw,40px);width:100%;max-width:420px; }
.auth-title { font-family:var(--font-display);font-size:1.8rem;margin-bottom:5px; }
.auth-sub   { color:var(--muted);font-size:.88rem;margin-bottom:26px; }
.auth-switch { text-align:center;color:var(--muted);font-size:.88rem;margin-top:20px; }

/* ── PROFILE ── */
.profile-header {
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:24px;margin-bottom:28px;
  display:flex;align-items:center;gap:18px;flex-wrap:wrap;
}
.profile-avatar { width:72px;height:72px;border-radius:50%;background:var(--surface2);border:3px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:2.2rem;flex-shrink:0; }
.profile-name   { font-family:var(--font-display);font-size:1.6rem; }
.profile-meta   { color:var(--muted);font-size:.85rem;margin-top:4px; }

/* ── ADMIN ── */
.admin-layout { display:grid;grid-template-columns:1fr;gap:20px;padding:20px 0; }
@media (min-width:768px) { .admin-layout { grid-template-columns:220px 1fr; } }
.admin-sidebar {
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:20px;height:fit-content;position:sticky;top:72px;
}
.admin-logo { font-family:var(--font-display);font-size:1.3rem;color:var(--gold);margin-bottom:20px;letter-spacing:.04em; }
.admin-nav a {
  display:flex;align-items:center;gap:10px;
  color:var(--muted);padding:10px 12px;border-radius:var(--radius-sm);
  font-size:.88rem;font-weight:600;margin-bottom:3px;
  transition:background .15s,color .15s;min-height:var(--touch);
}
.admin-nav a:hover,.admin-nav a.active { background:var(--surface2);color:var(--text); }
.admin-nav hr { border:none;border-top:1px solid var(--border);margin:10px 0; }
.admin-card { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:22px;margin-bottom:20px; }
.admin-card-title { font-family:var(--font-display);font-size:1.3rem;letter-spacing:.04em;margin-bottom:18px; }
.stats-grid { display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-bottom:24px; }
@media (min-width:640px) { .stats-grid { grid-template-columns:repeat(4,1fr); } }
.stat-card { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px; }
.stat-num   { font-family:var(--font-display);font-size:2rem;color:var(--gold); }
.stat-label { color:var(--muted);font-size:.78rem;margin-top:3px; }

/* Admin table — horizontal scroll on mobile */
.table-wrap { overflow-x:auto;-webkit-overflow-scrolling:touch; }
.admin-table { width:100%;border-collapse:collapse;font-size:.85rem;min-width:500px; }
.admin-table th { text-align:left;color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;padding:8px 12px;border-bottom:1px solid var(--border);white-space:nowrap; }
.admin-table td { padding:11px 12px;border-bottom:1px solid rgba(255,255,255,.04);vertical-align:middle; }
.admin-table tr:last-child td { border-bottom:none; }
.admin-table tr:hover td { background:var(--surface2); }

/* ── BADGES ── */
.badge { display:inline-block;font-size:.7rem;font-weight:800;letter-spacing:.04em;padding:2px 8px;border-radius:4px; }
.badge-on  { background:rgba(46,204,113,.12);color:var(--green);border:1px solid rgba(46,204,113,.25); }
.badge-off { background:rgba(107,125,145,.1);color:var(--muted);border:1px solid var(--border); }

/* ── PAGINATION ── */
.pagination { display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin:0 0 40px; }
.pagination a,.pagination span {
  width:38px;height:38px;display:flex;align-items:center;justify-content:center;
  border-radius:var(--radius-sm);font-size:.85rem;
  background:var(--surface);border:1px solid var(--border);color:var(--muted);
}
.pagination a:hover { border-color:var(--gold);color:var(--gold); }
.pagination .cur    { background:var(--gold);color:#080b10;border-color:var(--gold);font-weight:800; }

/* ── EMPTY STATE ── */
.empty-state { text-align:center;padding:48px 20px;color:var(--muted); }
.empty-state .icon { font-size:2.8rem;margin-bottom:14px; }
.empty-state p  { margin-bottom:16px;font-size:.95rem; }

/* ── FOOTER ── */
.site-footer {
  border-top:1px solid var(--border);
  padding:28px 0;margin-top:40px;
  text-align:center;color:var(--muted);font-size:.82rem;
}
.site-footer a { color:var(--muted); }
.site-footer a:hover { color:var(--gold); }

/* ── UTILITIES ── */
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.text-muted{color:var(--muted)}.text-gold{color:var(--gold)}.text-red{color:var(--red)}
.fw-bold{font-weight:700}
.d-flex{display:flex}.align-center{align-items:center}.gap-1{gap:8px}.gap-2{gap:14px}
.flex-wrap{flex-wrap:wrap}
