/* =============================================================================
   Wegwijs met AI — Design Tokens (Handoff)
   =============================================================================
   CANONIEKE BRON voor alle kleur-, typografie-, spacing- en motion-tokens.
   Laad dit als EERSTE CSS-bestand in index.html — vóór styles.css.

   Gebruik:
     <link rel="stylesheet" href="css/tokens.css">
     <link rel="stylesheet" href="css/components.css">
     <link rel="stylesheet" href="css/styles.css">  (zonder duplicate tokens)

   Wijzigingen t.o.v. oude styles.css :root block:
   - --fg2/fg3/fg4 donkerder (WCAG AA voor senior doelgroep)
   - Toegevoegd: --content-reading-max, --touch-target-min
   - Toegevoegd: lesson-type kleurcodes (video/text/quiz/live)
   - Toegevoegd: feedback-almost (amber) voor niet-bestraffende quiz-feedback
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ─── SURFACES ─────────────────────────────────────────────────────────── */
  --surface-bg:             #f1f5f9;
  --surface-card:           #ffffff;
  --surface-elevated:       #ffffff;
  --surface-input:          #ffffff;
  --surface-subtle:         #f8fafc;
  --surface-sidebar:        #0f172a;
  --surface-sidebar-hover:  #1e293b;
  --surface-sidebar-active: #334155;

  /* ─── BRAND ────────────────────────────────────────────────────────────── */
  --brand-primary:          #4f46e5;
  --brand-primary-hover:    #4338ca;
  --brand-primary-light:    #eef2ff;
  --brand-primary-muted:    #c7d2fe;
  --brand-primary-mid:      #6366f1;
  --brand-accent:           #f59e0b;
  --brand-accent-hover:     #d97706;
  --brand-accent-light:     #fef3c7;

  /* ─── SEMANTIC ─────────────────────────────────────────────────────────── */
  --color-success:          #10b981;
  --color-success-light:    #d1fae5;
  --color-error:            #ef4444;
  --color-error-light:      #fee2e2;
  --color-warning:          #f59e0b;
  --color-warning-light:    #fef3c7;
  --color-info:             #3b82f6;
  --color-info-light:       #dbeafe;

  /* ─── TEXT — WCAG AA voor senior doelgroep ─────────────────────────────── */
  --fg1: #0f172a;  /* Slate 900 — headings, primary text */
  --fg2: #334155;  /* Slate 700 — body (contrast 11:1) */
  --fg3: #475569;  /* Slate 600 — meta (contrast 7.5:1) */
  --fg4: #64748b;  /* Slate 500 — captions, placeholders (contrast 4.6:1) */
  --fg-inverse: #ffffff;
  --fg-link: var(--brand-primary);

  --text-primary:   var(--fg1);
  --text-secondary: var(--fg2);
  --text-muted:     var(--fg4);
  --text-inverse:   var(--fg-inverse);

  /* Legacy alias — mapping naar nieuwe waardes */
  --text-link: var(--brand-primary);

  /* ─── BORDERS ──────────────────────────────────────────────────────────── */
  --border-default: #e2e8f0;
  --border-strong:  #cbd5e1;
  --border-focus:   var(--brand-primary);

  /* ─── SHADOWS ──────────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* ─── SPACING — 8px grid (strict) ──────────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ─── RADIUS ───────────────────────────────────────────────────────────── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* ─── TYPOGRAPHY ───────────────────────────────────────────────────────── */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --font-size-xs:   11px;
  --font-size-sm:   13px;
  --font-size-base: 14px;
  --font-size-md:   15px;
  --font-size-lg:   18px;
  --font-size-xl:   20px;
  --font-size-2xl:  24px;
  --font-size-3xl:  30px;
  --font-size-4xl:  36px;
  --font-size-5xl:  48px;

  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  --font-weight-black:    800;

  --line-height-tight:   1.2;
  --line-height-snug:    1.35;
  --line-height-normal:  1.5;
  --line-height-relaxed: 1.75;

  --letter-spacing-tight:  -0.03em;
  --letter-spacing-snug:   -0.02em;
  --letter-spacing-normal:  0em;
  --letter-spacing-wide:    0.05em;

  /* ─── MOTION ───────────────────────────────────────────────────────────── */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ─── LAYOUT ───────────────────────────────────────────────────────────── */
  --sidebar-width:       260px;
  --sidebar-collapsed:   64px;
  --header-height:       64px;
  --content-max-width:   1200px;
  --content-reading-max: 680px;   /* Lestekst — principe #8 (één ding per scherm) */
  --mobile-bottom-nav:   56px;
  --touch-target-min:    48px;    /* WCAG-plus voor senior hands */

  /* ─── LEARNING — feedback & lesson types ───────────────────────────────── */
  /* Principe #3: amber i.p.v. rood voor "fout antwoord" — niet-bestraffend */
  --feedback-correct:       var(--color-success);
  --feedback-correct-light: var(--color-success-light);
  --feedback-almost:        var(--color-warning);
  --feedback-almost-light:  var(--color-warning-light);
  --feedback-info:          var(--brand-primary);
  --feedback-info-light:    var(--brand-primary-light);

  /* Principe #9: vaste kleur per lestype */
  --lesson-video: #4f46e5;
  --lesson-text:  #475569;
  --lesson-quiz:  #f59e0b;
  --lesson-live:  #ec4899;

  /* ─── Z-INDEX ─────────────────────────────────────────────────────────── */
  --z-dropdown:       100;
  --z-sticky:         200;
  --z-modal-backdrop: 300;
  --z-modal:          400;
  --z-toast:          500;
}

/* =============================================================================
   BASE ELEMENT STYLES — veilige defaults als tokens.css op zichzelf geladen wordt
   ============================================================================= */
body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--fg1);
  background: var(--surface-card);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 { font-size: var(--font-size-3xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; color: var(--fg1); }
h2 { font-size: var(--font-size-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em;  color: var(--fg1); }
h3 { font-size: var(--font-size-xl);  font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--fg1); }
h4 { font-size: var(--font-size-lg);  font-weight: 600; line-height: 1.3; color: var(--fg1); }

p { font-size: var(--font-size-md); line-height: 1.5; color: var(--fg2); }

a { color: var(--fg-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-primary-hover); text-decoration: underline; }

code {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--fg1);
}
