/* ================================================================
   styles.css — Poster Dashboard shared styles
   Design: deep-space dark, electric-violet accent, cinematic feel
   ================================================================ */

/* ── Tokens ── */
:root {
  --bg-base:      #0a0a0f;
  --bg-surface:   #111118;
  --bg-card:      #18181f;
  --bg-elevated:  #1f1f2a;
  --border:       rgba(255,255,255,.07);

  --accent:       #7c5cfc;
  --accent-dim:   #5a3fd6;
  --accent-glow:  rgba(124,92,252,.25);
  --accent-text:  #a88bff;

  --text-primary:   #f0eeff;
  --text-secondary: #9898b0;
  --text-muted:     #5a5a72;

  --success:  #22c87a;
  --danger:   #f04444;
  --warning:  #f5a623;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-card: 0 2px 20px rgba(0,0,0,.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }

/* ── Font import ── */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

/* ── Layout ── */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: .02em;
  border: none;
  transition: all .18s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-dim); box-shadow: 0 4px 20px var(--accent-glow); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card); border-color: var(--accent); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-movie  { background: rgba(124,92,252,.2); color: var(--accent-text); }
.badge-tv     { background: rgba(34,200,122,.15); color: var(--success); }
.badge-season { background: rgba(245,166,35,.15); color: var(--warning); }

/* ── Navigation ── */
.nav {
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand span { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.stat-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.stat-icon { font-size: 1.8rem; }
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Poster grid ── */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.poster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.poster-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.poster-img-wrap { position: relative; aspect-ratio: 2/3; background: var(--bg-elevated); overflow: hidden; }
.poster-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.poster-card:hover .poster-img-wrap img { transform: scale(1.04); }
.poster-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--text-muted); }
.poster-info { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.poster-title { font-size: 0.85rem; font-weight: 600; line-height: 1.3; color: var(--text-primary); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.poster-meta  { font-size: 0.75rem; color: var(--text-secondary); }
.poster-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }

/* ── Loading spinner ── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.pd-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  max-width: 340px;
  pointer-events: none;
}
.pd-toast--show   { opacity: 1; transform: translateY(0); }
.pd-toast--success { background: var(--success); color: #fff; }
.pd-toast--error   { background: var(--danger); color: #fff; }
.pd-toast--info    { background: var(--accent); color: #fff; }

/* ── Search bar ── */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.search-bar .form-input { flex: 1; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 0.9rem; }

/* ── Section heading ── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .nav { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .pd-toast { left: 16px; right: 16px; bottom: 16px; }
}
