/* ============================================
   base.css — Design Tokens & Global Reset
   Math Tutor | Glassmorphism UI
   ============================================ */

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

/* ─── Design Tokens ─────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:        #0a0a1a;
  --bg-secondary:      #0f0f2d;
  --bg-gradient:       linear-gradient(135deg, #0a0a1a 0%, #0f0f2d 50%, #1a0a2e 100%);

  /* Glass */
  --glass-bg:          rgba(255, 255, 255, 0.06);
  --glass-border:      rgba(255, 255, 255, 0.12);
  --glass-hover:       rgba(255, 255, 255, 0.10);
  --glass-blur:        blur(16px) saturate(180%);

  /* Accents */
  --accent-primary:    #7c6fff;
  --accent-secondary:  #00d9ff;
  --accent-gradient:   linear-gradient(135deg, #7c6fff, #00d9ff);

  /* Text */
  --text-primary:      rgba(255, 255, 255, 0.92);
  --text-muted:        rgba(255, 255, 255, 0.45);
  --text-accent:       #7c6fff;

  /* Status */
  --success:           #00ff88;
  --warning:           #ffaa00;
  --error:             #ff4466;

  /* Bubbles */
  --user-bubble:       rgba(124, 111, 255, 0.15);
  --ai-bubble:         rgba(255, 255, 255, 0.05);

  /* Typography */
  --font-display:  'Space Grotesk', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  /* Spacing */
  --header-height:   64px;
  --sidebar-width:   260px;
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       16px;
  --radius-xl:       24px;

  /* Transitions */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Global Reset ──────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-gradient);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Glass Panel Mixin (utility class) ─────── */
.glass {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ─── Scrollbar Styling ─────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 111, 255, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 111, 255, 0.5);
}

/* ─── Selection ─────────────────────────────── */
::selection {
  background: rgba(124, 111, 255, 0.35);
  color: var(--text-primary);
}

/* ─── Utility ───────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  outline: none;
  background: none;
}

textarea, input {
  font-family: var(--font-body);
  outline: none;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}
