/* ================================================================
   PromptChief Design System  v1.0
   ----------------------------------------------------------------
   Single source of truth for colors, typography, radii, shadows.
   Imported by ALL pages (landing + app/*) AFTER fonts/fonts.css.

   Usage:  <link rel="stylesheet" href="/design-system.css">
   Pages must NOT redefine these tokens locally — page-specific
   styles build on top of them.

   Theming: set data-theme="dark" | "light" on <html>.
   Dark is the default (applies when attribute is missing).
   ================================================================ */

/* ── Brand constants (theme-independent) ───────────────────────── */
:root {
  /* Brand colors — THE one violet, everywhere (extension matches) */
  --accent:        #7c5cfc;
  --accent-h:      #9b7fff;            /* hover / bright variant   */
  --accent-deep:   #6d44f0;            /* pressed / light-mode use */
  --accent-dim:    rgba(124, 92, 252, 0.12);
  --accent-border: rgba(124, 92, 252, 0.30);

  --teal:          #00d4aa;
  --teal-dim:      rgba(0, 212, 170, 0.10);
  --gold:          #f5c542;
  --gold-dim:      rgba(245, 197, 66, 0.12);
  --danger:        #f87171;
  --danger-dim:    rgba(248, 113, 113, 0.10);
  --ok:            #34d399;
  --warn:          #fbbf24;

  /* Brand gradient — used for logo glow, gradient text, top bars  */
  --gradient:      linear-gradient(135deg, #9b7fff 0%, #00d4aa 55%, #f5c542 100%);
  --gradient-line: linear-gradient(90deg, #7c5cfc, #9b7fff 50%, #00d4aa);

  /* Typography */
  --font-display:  'Cabinet Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:     'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  /* Radius scale — pick from these five, nothing else */
  --r-sm:    8px;     /* chips, tags, small inputs        */
  --r-md:    12px;    /* buttons, inputs, list items      */
  --r-lg:    16px;    /* cards                            */
  --r-xl:    20px;    /* modals, large panels             */
  --r-pill:  999px;   /* pills, badges, round CTAs        */
  --radius:  var(--r-lg);   /* legacy alias used by older pages */

  /* Motion */
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --trans:   color .2s, background .2s, border-color .2s;

  color-scheme: dark;
}

/* ── Dark theme (default) ──────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:          #08080c;
  --bg2:         #0d0d12;
  --surface:     #0f1017;
  --surface2:    #141520;
  --surface3:    #1a1c2a;
  /* Glassy layers — translucent surfaces for overlays/cards on bg */
  --glass:       rgba(255, 255, 255, 0.035);
  --glass-2:     rgba(255, 255, 255, 0.06);
  --border:      rgba(255, 255, 255, 0.07);
  --border-b:    rgba(255, 255, 255, 0.13);
  --text:        #e8e6f0;
  --text-dim:    #8a8899;
  --text-faint:  #565470;
  --glow:        rgba(124, 92, 252, 0.18);

  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md:   0 10px 32px rgba(0, 0, 0, 0.40);
  --shadow-lg:   0 28px 80px rgba(0, 0, 0, 0.55), 0 0 60px -20px var(--glow);
}

/* ── Light theme ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f6f6fb;
  --bg2:         #ededf5;
  --surface:     #ffffff;
  --surface2:    #f2f2f8;
  --surface3:    #eaeaf2;
  --glass:       rgba(255, 255, 255, 0.75);
  --glass-2:     rgba(0, 0, 0, 0.035);
  --border:      rgba(0, 0, 0, 0.07);
  --border-b:    rgba(0, 0, 0, 0.14);
  --text:        #16142a;
  --text-dim:    #55536a;
  --text-faint:  #a09eb4;
  --glow:        rgba(124, 92, 252, 0.10);

  --shadow-sm:   0 2px 8px rgba(22, 20, 42, 0.06);
  --shadow-md:   0 10px 32px rgba(22, 20, 42, 0.09);
  --shadow-lg:   0 28px 80px rgba(22, 20, 42, 0.14), 0 0 60px -20px var(--glow);

  color-scheme: light;
}

/* ── Base polish (safe to apply everywhere) ─────────────────────── */
::selection { background: rgba(124, 92, 252, 0.35); }

* { scrollbar-width: thin; scrollbar-color: var(--surface3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Shared components (pc- prefix, collision-free) ────────────── */

/* Buttons */
.pc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--r-md); border: none; cursor: pointer;
  font-family: var(--font-body); font-size: .9rem; font-weight: 700;
  text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.pc-btn-primary { background: var(--accent); color: #fff; }
.pc-btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 6px 28px var(--glow); }
.pc-btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border-b); }
.pc-btn-secondary:hover { border-color: var(--accent); }
.pc-btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border-b); }
.pc-btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.pc-btn-danger { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.3); }

/* Card */
.pc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.pc-card:hover { border-color: var(--border-b); }
.pc-card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* Glass card — premium translucent surface with blur */
.pc-glass {
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border); border-radius: var(--r-lg);
}

/* Gradient border accent (use on hover or for highlighted cards) */
.pc-gradient-border { position: relative; }
.pc-gradient-border::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--gradient-line);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* Inputs */
.pc-input {
  width: 100%; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-body); font-size: .9rem;
  transition: var(--trans);
}
.pc-input::placeholder { color: var(--text-faint); }
.pc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Badge / pill */
.pc-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: .75rem; font-weight: 700;
  background: var(--accent-dim); color: var(--accent-h);
  border: 1px solid var(--accent-border);
}
.pc-badge-teal { background: var(--teal-dim); color: var(--teal); border-color: rgba(0, 212, 170, 0.25); }
.pc-badge-gold { background: var(--gold-dim); color: var(--gold); border-color: rgba(245, 197, 66, 0.25); }

/* Gradient text */
.pc-grad-text {
  background: var(--gradient); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
