/* fireroad.ai — design system tokens */

:root {
  /* Dark theme (default) */
  --bg: #0D0F12;
  --surface: #161A20;
  --surface-2: #1C2129;
  --surface-3: #232932;
  --border: #252A32;
  --border-strong: #2F3540;
  --accent: #A31F34;
  --accent-hover: #BC2440;
  --accent-soft: rgba(163, 31, 52, 0.12);
  --text: #F0F2F5;
  --text-secondary: #8A8F9A;
  --text-tertiary: #5A6068;
  --success: #22C55E;
  --warning: #F59E0B;
  --info: #3B82F6;

  /* Course area colors */
  --course-cs: #4A8FE8;       /* Course 6 */
  --course-math: #F59E0B;     /* Course 18 */
  --course-hass: #14B8A6;     /* HASS */
  --course-physics: #A78BFA;  /* Course 8 */
  --course-bio: #34D399;      /* Course 7 */
  --course-other: #94A3B8;

  /* Type */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Spacing */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadows (mostly used in light mode) */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
}

[data-theme="light"] {
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #F2F2EE;
  --surface-3: #EAEAE5;
  --border: #E4E4DE;
  --border-strong: #D4D4CC;
  --accent: #A31F34;
  --accent-hover: #8C1A2C;
  --accent-soft: rgba(163, 31, 52, 0.08);
  --text: #1A1C20;
  --text-secondary: #5A6068;
  --text-tertiary: #8A8F9A;
  --success: #15803D;
  --warning: #B45309;
  --info: #1D4ED8;

  --course-cs: #2B6CB0;
  --course-math: #B45309;
  --course-hass: #0F766E;
  --course-physics: #6D28D9;
  --course-bio: #047857;
  --course-other: #64748B;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv01';
}

body { min-width: 1100px; }

#root {
  min-height: 100vh;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

input::placeholder, textarea::placeholder {
  color: var(--text-tertiary);
}

a { color: inherit; text-decoration: none; }

/* Utility */
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; letter-spacing: -0.01em; }
.display { font-family: var(--font-display); letter-spacing: -0.02em; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Reusable */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

/* Match score bar */
.match-bar {
  position: relative;
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.match-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.match-bar.green > span  { background: var(--success); }
.match-bar.orange > span { background: #F97316; }
.match-bar.yellow > span { background: #EAB308; }
.match-bar.red > span    { background: #EF4444; }

/* Page transitions */
.fade-in {
  animation: fadeIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Section labels */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.chat-markdown p {
  margin: 0;
}

.chat-markdown p + p,
.chat-markdown ul + p,
.chat-markdown p + ul,
.chat-markdown h1 + p,
.chat-markdown h2 + p,
.chat-markdown h3 + p,
.chat-markdown h4 + p {
  margin-top: 8px;
}

.chat-markdown h1,
.chat-markdown h2,
.chat-markdown h3,
.chat-markdown h4 {
  margin: 10px 0 6px;
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.25;
}

.chat-markdown h1 { font-size: 19px; }
.chat-markdown h2 { font-size: 17px; }
.chat-markdown h3 { font-size: 16px; }
.chat-markdown h4 { font-size: 15px; }

.chat-markdown h1:first-child,
.chat-markdown h2:first-child,
.chat-markdown h3:first-child,
.chat-markdown h4:first-child {
  margin-top: 0;
}

.chat-markdown ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.chat-markdown li {
  margin: 3px 0;
}

.chat-list-detail {
  margin-top: 3px;
  color: var(--text-secondary);
}

.chat-markdown strong {
  font-weight: 700;
}

.chat-markdown em {
  font-style: italic;
}

.chat-markdown code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.chat-markdown a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-stream-text {
  overflow-wrap: anywhere;
}

.chat-course-mention {
  padding: 0 2px;
  border-radius: 4px;
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: background 120ms ease, color 120ms ease, text-decoration-color 120ms ease;
}

.chat-course-mention:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.chat-course-popover {
  max-width: 88%;
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.chat-course-popover-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.chat-course-popover-title {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-course-popover-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
