/* ============================================================================
   KIDS AI VIDEO WIZARD — theme styles
   ========================================================================== */

:root {
  --bs-primary: #6366f1;
  --bs-primary-dark: #4f46e5;
  --bs-secondary: #a855f7;
  --bs-success: #16a34a;
  --bs-info: #0891b2;
  --bs-warning: #f59e0b;
  --bs-danger: #ef4444;
  --bs-purple: #8b5cf6;
  --bs-pink: #ec4899;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --border: #e7eaf2;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 8px 24px rgba(16,24,40,.07);
  --font-head: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); font-weight: 600; }

a { color: var(--bs-primary); text-decoration: none; }
a:hover { color: var(--bs-primary-dark); }

.app-navbar {
  background: linear-gradient(120deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
  box-shadow: 0 2px 12px rgba(79,70,229,.25);
  padding-top: .6rem; padding-bottom: .6rem;
}
.brand-badge {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,.18);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; flex: none;
}
.brand-badge-lg { width: 68px; height: 68px; font-size: 1.9rem; border-radius: 18px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: #fff; display: block; line-height: 1.1; }
.brand-tagline { font-size: .72rem; color: rgba(255,255,255,.75); }
.app-navbar .nav-link { color: rgba(255,255,255,.85); font-weight: 600; border-radius: 10px; padding: .45rem .8rem; }
.app-navbar .nav-link:hover { color: #fff; background: rgba(255,255,255,.12); }
.app-navbar .nav-link.active { color: #fff; background: rgba(255,255,255,.2); }
.app-navbar .nav-link i { width: 1rem; }

.app-main { min-height: calc(100vh - 130px); }
.app-footer { background: #1f2937; padding: 1rem 0; margin-top: 2rem; }

.page-hero { padding: 1.6rem 0 1.1rem; background: #fff; border-bottom: 1px solid var(--border); }
.page-title { font-size: 1.6rem; margin: 0; }
.page-subtitle { color: var(--muted); margin-top: .15rem; }
.section-title { margin: 1.4rem 0 .8rem; }

.btn { border-radius: 12px; font-weight: 700; }
.btn-lg { border-radius: 14px; }
.btn-primary { background: var(--bs-primary); border-color: var(--bs-primary); }
.btn-primary:hover { background: var(--bs-primary-dark); border-color: var(--bs-primary-dark); }
.btn-soft { background: #eef0ff; color: var(--bs-primary-dark); border: 1px solid #dfe3ff; }
.btn-soft:hover { background: #e0e4ff; color: var(--bs-primary-dark); }

.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; display: flex; align-items: center; gap: .9rem; box-shadow: var(--shadow-sm);
  height: 100%; transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  background: #eef0ff;
}
.stat-value { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); font-size: .85rem; }

.cat-shortcut {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem .6rem; color: var(--ink); font-weight: 700; font-size: .85rem; text-align: center;
  height: 100%; transition: transform .15s ease, box-shadow .15s ease;
}
.cat-shortcut i { font-size: 1.5rem; color: var(--cat, var(--bs-primary)); }
.cat-shortcut:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }

.project-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; height: 100%; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .6rem;
}
.project-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cat-pill {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 700;
  color: var(--cat, var(--bs-primary)); background: color-mix(in srgb, var(--cat, #6366f1) 12%, white);
  padding: .25rem .6rem; border-radius: 999px;
}
.project-card-title { margin: 0; font-size: 1.05rem; }
.project-card-meta { display: flex; gap: 1rem; color: var(--muted); font-size: .82rem; flex-wrap: wrap; }
.project-card-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; }

.status-badge { font-size: .72rem; }
.status-draft { background: #fef3c7; color: #b45309; }
.status-ready { background: #e0e7ff; color: #4338ca; }
.status-brief_generated { background: #d1fae5; color: #047857; }
.status-in_production { background: #cffafe; color: #0e7490; }
.status-completed { background: #dcfce7; color: #15803d; }

.empty-state {
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 3rem 1.5rem; text-align: center; color: var(--muted);
}
.empty-state i { font-size: 2.6rem; color: #cbd5e1; margin-bottom: .7rem; }

/* Auth ------------------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 22px; padding: 2.2rem;
  box-shadow: 0 20px 60px rgba(79,70,229,.15); border: 1px solid var(--border);
}
.auth-card .input-group-text { background: #f6f7fb; border: 1px solid var(--border); }

/* Wizard ----------------------------------------------------------------- */
.wizard-shell {
  max-width: 980px; margin: 1.4rem auto 3rem; padding: 0 1rem;
}
.wizard-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: .8rem 1rem; box-shadow: var(--shadow-sm); margin-bottom: 1rem;
}
.wizard-progress-wrap { display: flex; align-items: center; gap: .8rem; flex: 1; }
.wizard-step-indicator { font-family: var(--font-head); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.wizard-progress { flex: 1; height: 9px; border-radius: 999px; background: #e9ecf5; }
.wizard-progress .progress-bar { background: linear-gradient(90deg, #6366f1, #a855f7); border-radius: 999px; transition: width .3s ease; }

.wizard-body { min-height: 320px; }
.wizard-step-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.6rem; box-shadow: var(--shadow-sm);
}
.wizard-step-head { display: flex; gap: .9rem; align-items: center; margin-bottom: 1.3rem; }
.wizard-step-icon {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  background: linear-gradient(135deg, #eef2ff, #faf5ff); color: var(--bs-primary);
}
.wizard-step-title { margin: 0; font-size: 1.3rem; }
.wizard-step-subtitle { margin: 0; color: var(--muted); font-size: .9rem; }

.wizard-fields { display: flex; flex-direction: column; gap: 1.4rem; }
.field-block { }
.field-label { font-weight: 700; margin-bottom: .55rem; font-size: .95rem; }

.wizard-footer {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 16px; padding: .9rem 1rem; margin-top: 1rem;
  box-shadow: 0 -4px 24px rgba(16,24,40,.06);
}
.wizard-footer-center { flex: 1; text-align: center; }
.clips-badge {
  display: inline-flex; align-items: center; background: #eef2ff; color: var(--bs-primary-dark);
  font-weight: 700; font-size: .9rem; padding: .5rem 1rem; border-radius: 999px;
}

/* Option cards ----------------------------------------------------------- */
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.option-card {
  position: relative; background: #fff; border: 2px solid var(--border); border-radius: 14px;
  padding: .9rem .8rem; cursor: pointer; text-align: center; user-select: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.option-card:hover { border-color: #c7cbf5; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.option-card.selected { border-color: var(--bs-primary); background: #f5f6ff; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.option-icon {
  width: 40px; height: 40px; margin: 0 auto .5rem; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  background: #eef0ff; color: var(--cat, var(--bs-primary));
}
.option-label { font-weight: 700; font-size: .88rem; line-height: 1.2; }
.option-desc { font-size: .74rem; color: var(--muted); margin-top: .25rem; }
.option-check {
  position: absolute; top: .45rem; right: .45rem; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bs-primary); color: #fff; font-size: .65rem;
  display: flex; align-items: center; justify-content: center;
}

/* Chips ------------------------------------------------------------------ */
.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  border: 1.5px solid var(--border); background: #fff; color: var(--ink);
  border-radius: 999px; padding: .4rem .8rem; font-weight: 700; font-size: .82rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
  transition: all .15s ease;
}
.chip i { color: var(--bs-primary); }
.chip:hover { border-color: #c7cbf5; }
.chip.active { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.chip.active i { color: #fff; }

/* Character editor ------------------------------------------------------- */
.char-editor { background: #fbfcff; border: 1px solid var(--border); border-radius: 14px; }
.char-editor .form-label { font-weight: 700; }
.char-editor h6 { font-family: var(--font-head); }

/* Forms ------------------------------------------------------------------ */
.form-group { margin-bottom: .2rem; }
.form-label { font-weight: 700; }
.form-control, .form-select { border-radius: 12px; border-color: var(--border); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

/* Toasts ----------------------------------------------------------------- */
.app-toast {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 2000;
  display: flex; align-items: center; gap: .6rem;
  background: #1f2937; color: #fff; padding: .8rem 1.1rem; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.22); font-weight: 600; font-size: .9rem;
  opacity: 0; transform: translateY(12px); transition: all .25s ease; max-width: 340px;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast i { font-size: 1.1rem; }
.app-toast-success i { color: #4ade80; }
.app-toast-danger i { color: #f87171; }
.app-toast-warning i { color: #fbbf24; }
.app-toast-info i { color: #60a5fa; }

/* Review page ------------------------------------------------------------ */
.review-section { margin-bottom: 1.2rem; }
.review-section > .review-head {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  margin-bottom: .6rem;
}
.review-section > .review-head h5 { margin: 0; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.review-item {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem;
}
.review-item .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.review-item .v { font-weight: 600; font-size: .92rem; }

/* Brief page ------------------------------------------------------------- */
.brief-toolbar {
  position: sticky; top: 70px; z-index: 20; display: flex; flex-wrap: wrap; gap: .5rem;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem;
  box-shadow: var(--shadow-sm); margin-bottom: 1rem;
}
.brief-box {
  background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 1.4rem 1.5rem;
  font-family: 'Consolas', 'Menlo', monospace; font-size: .84rem; line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word; overflow-x: auto; max-height: 75vh;
}

/* Tables & lists --------------------------------------------------------- */
.data-table { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.data-table thead th {
  background: #f8fafc; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--border); padding: .8rem 1rem; white-space: nowrap;
}
.data-table tbody td { padding: .8rem 1rem; vertical-align: middle; border-bottom: 1px solid #f1f4f9; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbff; }

.list-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem;
  height: 100%; display: flex; flex-direction: column; gap: .5rem; box-shadow: var(--shadow-sm);
}
.list-card .avatar {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; color: #fff; flex: none;
}
.list-card-title { margin: 0; font-size: 1.05rem; }
.list-card-sub { color: var(--muted); font-size: .82rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }

/* Responsive tweaks ------------------------------------------------------ */
@media (max-width: 768px) {
  .wizard-shell { margin-top: .8rem; padding: 0 .6rem; }
  .wizard-step-panel { padding: 1rem .8rem; }
  .wizard-footer { flex-wrap: wrap; }
  .wizard-footer-center { order: 3; flex-basis: 100%; text-align: center; }
  .option-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .review-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.3rem; }
}



