/* Framework Playground — minimale stijl */

/* ── Theme tokens — light is default, dark via [data-theme="dark"] op <html> */
:root {
  --primary:        #2563eb;
  --primary-dk:     #1d4ed8;
  --primary-contrast:#ffffff;
  --green:          #16a34a;
  --orange:         #d97706;
  --red:            #dc2626;

  --bg:             #f8fafc;
  --surface:        #ffffff;
  --surface-2:      #f1f5f9;     /* iets donkerder voor inset/elev */
  --border:         #e2e8f0;
  --border-color:   var(--border);
  --text:           #1e293b;
  --text-muted:     #64748b;
  --input-bg:       #ffffff;

  --code-bg:        #f1f5f9;     /* inline <code> achtergrond */
  --code-fg:        var(--text);

  --sidebar-bg:     #0f172a;     /* sidebar blijft donker — beter readable als nav */
  --sidebar-fg:     #cbd5e1;
  --sidebar-muted:  #94a3b8;     /* group-labels — leesbaar op donker */
  --sidebar-border: #1e293b;

  --radius:         8px;
  --radius-sm:      4px;
  --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:             #0f172a;
  --surface:        #1e293b;
  --surface-2:      #0f172a;
  --border:         #334155;
  --border-color:   var(--border);
  --text:           #e2e8f0;
  --text-muted:     #94a3b8;
  --input-bg:       #1e293b;

  --code-bg:        rgba(148, 163, 184, .15);
  --code-fg:        #e2e8f0;

  /* Sidebar blijft consistent met body in dark mode */
  --sidebar-bg:     #0a0f1c;
  --sidebar-fg:     #cbd5e1;
  --sidebar-muted:  #94a3b8;
  --sidebar-border: #1e293b;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: .75rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.logo-mm {
  background: var(--primary);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}

.site-nav ul {
  display: flex;
  gap: 0;
  list-style: none;
  flex: 1;
}

.site-nav a {
  display: block;
  padding: .4rem .8rem;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: .9rem;
  transition: background .15s, color .15s;
}

.site-nav a:hover { background: var(--bg); color: var(--text); }
.site-nav a.active { background: #eff6ff; color: var(--primary); font-weight: 600; }

/* ── Content ──────────────────────────────────────────────────────────────── */

.page-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

h1 { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 .75rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; }
p  { color: var(--text-muted); margin-bottom: .75rem; }
p.lead { font-size: 1.1rem; color: var(--text); margin-bottom: 1.5rem; }

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

code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: .15em .35em;
  border-radius: 4px;
}

/* Op donkere panels (snippets, ref-cards, scratch) wisselt code naar dark */
.snippet code,
.snippet-output code,
.ref-class code,
.ref-toc code,
[style*="background:#0f172a"] code,
[style*="background:#1e293b"] code,
.snippet-desc code,
.page-intro code {
  background: rgba(148, 163, 184, .15);
  color: inherit;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: .85rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: .5rem 1.1rem;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all .15s;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dk); border-color: var(--primary-dk); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; line-height: 1.2; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ── Stats ────────────────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* ── Component grid ───────────────────────────────────────────────────────── */

.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.component-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.card-header h3 { margin: 0; font-size: 1rem; }

/* ── Badges ───────────────────────────────────────────────────────────────── */

.badge {
  font-size: .72rem;
  font-weight: 600;
  padding: .2em .6em;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-orange { background: #fef3c7; color: #b45309; }
.badge-red    { background: #fee2e2; color: #b91c1c; }

/* ── Demo blokken ─────────────────────────────────────────────────────────── */

.demo-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.demo-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: .75rem;
}

@media (max-width: 768px) {
  .demo-cols { grid-template-columns: 1fr; }
  .component-grid { grid-template-columns: 1fr; }
}

.demo-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

.demo-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  min-height: 40px;
}

/* ── Compare blokken ──────────────────────────────────────────────────────── */

.compare-block {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.demo-old pre { border-left: 3px solid var(--red); }
.demo-new pre { border-left: 3px solid var(--green); }

/* ── Info blokken ─────────────────────────────────────────────────────────── */

.info-block {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.info-block ol { margin-left: 1.5rem; }
.info-block li { color: var(--text); margin-bottom: .4rem; }

.callout {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: .95rem;
}
.callout-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }

/* ── Tables ───────────────────────────────────────────────────────────────── */

.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.demo-table th {
  text-align: left;
  padding: .6rem .9rem;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.demo-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.demo-table tr:last-child td { border-bottom: none; }

.text-green { color: var(--green); font-weight: 600; }
.text-red   { color: var(--red);   font-weight: 600; }

/* ── Routing ──────────────────────────────────────────────────────────────── */

.route-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

/* ── Suggestions ──────────────────────────────────────────────────────────── */

.suggestions-list { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.suggestions-list li { margin-bottom: .5rem; color: var(--text-muted); }
.suggestions-list strong { color: var(--text); }

/* ── Highlight ────────────────────────────────────────────────────────────── */

.highlight {
  background: #eff6ff;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
  background: var(--surface);
}

/* ── Form Builder ─────────────────────────────────────────────────────────── */

.demo-cols--form {
  align-items: flex-start;
  gap: 2rem;
}
.form-col, .code-col { flex: 1; min-width: 0; }
.code-col .demo-block { margin-top: 1.5rem; }
.code-col .demo-block:first-child { margin-top: 0; }

/* form-col is een container — children mogen reageren op deze breedte i.p.v.
   de viewport. Zo werken FieldRows correct in een 2-kolom-layout, modal,
   sidebar, etc. zonder dat we media queries moeten dupliceren. */
.form-col {
  container-type: inline-size;
  container-name: form-col;
}

/* Form row — side-by-side fields using CSS Grid */
.form-row {
  display: grid;
  gap: 1rem;
  margin-bottom: 0; /* individual .form-field wrappers carry the margin */
}

/* Grid-items hebben default min-width: auto → ze kunnen niet kleiner dan
   hun content. Dat veroorzaakt overflow op smalle containers. Met min-width: 0
   mogen ze krimpen, en de inline grid-template-columns blijft de verhouding
   sturen tot de container query 'm overschrijft. */
.form-row > * {
  min-width: 0;
}

/* Stapelen op smalle viewport (mobiel) of in een smalle container.
   Container query is de echte: hij weet niets van de viewport, maar volgt
   de breedte van .form-col — dat klopt voor sidebars, modals, splits.
   De media query blijft als fallback voor browsers zonder @container, maar
   dat is in 2026 vrijwel nul. */
@container form-col (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr !important;
  }
}

/* The .form-field inside a row needs no bottom margin — the row gap handles spacing */
.form-row > .form-field {
  margin-bottom: 0;
}

/* Form fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.25rem;
}
.form-field[hidden] { display: none; }

.form-label {
  font-weight: 600;
  font-size: .925rem;
  color: var(--text);
}
.form-label__required { color: var(--red); margin-left: .15rem; }

.form-input {
  display: block;
  width: 100%;
  padding: .55rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-input--textarea { resize: vertical; }
.form-input--select   { cursor: pointer; }

/* Error state */
.form-field--error .form-input {
  border-color: var(--red);
}
.form-field__error {
  color: var(--red);
  font-size: .875rem;
}
.form-field__hint {
  color: var(--text-muted);
  font-size: .85rem;
}

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.form-checkbox__input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.form-checkbox__label { cursor: pointer; }

/* Radio group */
.form-radio-group {
  border: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.form-radio-group legend {
  font-weight: 600;
  font-size: .925rem;
  margin-bottom: .5rem;
}
.form-radio {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .4rem;
}
.form-radio__input { accent-color: var(--primary); cursor: pointer; }
.form-radio__label { cursor: pointer; }

/* Submit */
.form-actions { margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-dk); }

/* Alerts */
.alert {
  padding: .9rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.alert--success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* JSON debug list */
.json-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.json-list li { font-size: .85rem; }
.json-list code { background: var(--surface); border: 1px solid var(--border); padding: .15rem .4rem; border-radius: 4px; word-break: break-all; }

/* ── Debug (pr / prd / Debug::dump) ──────────────────────────────────────── */

pre.debug {
  font-family:    var(--font-mono);
  font-size:      .8rem;
  line-height:    1.5;
  background:     #0f172a;
  color:          #e2e8f0;
  border:         1px solid #1e293b;
  border-left:    4px solid #6366f1;
  border-radius:  var(--radius);
  padding:        .75rem 1rem;
  margin:         .75rem 0;
  overflow-x:     auto;
  white-space:    pre;
}

pre.debug .debug__location {
  font-size:   .75rem;
  color:       #94a3b8;
  display:     block;
  margin-bottom: .1rem;
}

pre.debug .debug__type {
  font-size:   .75rem;
  color:       #818cf8;
  font-weight: 600;
}

pre.debug--trace {
  border-left-color: #f59e0b;
}

/* ── DynamicQuery demo ──────────────────────────────────────────────────────── */

.lead {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.db-banner {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.db-banner--warn { background: #fef9c3; border: 1px solid #fbbf24; color: #78350f; }
.db-banner--ok   { background: #dcfce7; border: 1px solid #86efac; color: #14532d; }

.query-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.query-block h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary);
}
.query-block h3 {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 1rem 0 .4rem;
}

pre.sql {
  font-family:    var(--font-mono);
  font-size:      .8rem;
  background:     #0f172a;
  color:          #e2e8f0;
  padding:        1rem 1.25rem;
  border-radius:  var(--radius);
  overflow-x:     auto;
  line-height:    1.6;
  white-space:    pre;
}
.sql-kw { color: #818cf8; font-weight: 600; }

.param-list {
  list-style: none;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
}
.param-list li {
  background: #f1f5f9;
  padding: .2rem .5rem;
  border-radius: 4px;
}

.table-wrap { overflow-x: auto; margin-top: .5rem; }
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.result-table th, .result-table td {
  padding: .4rem .75rem;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.result-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
}
.result-table tr:hover td { background: #f8fafc; }

.muted { color: var(--text-muted); font-size: .9rem; }
.error { color: var(--red); font-size: .9rem; }

/* 404 — gerenderd door Layout::notFound() */
.not-found {
  text-align: center;
  padding: 4rem 1rem 5rem;
  max-width: 36rem;
  margin: 0 auto;
}
.not-found__code {
  font: 800 9rem/1 system-ui;
  background: linear-gradient(135deg, var(--primary, #6366f1) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}
.not-found__title {
  font: 700 1.6rem/1.2 system-ui;
  margin-bottom: .75rem;
  color: var(--text);
}
.not-found__lead {
  color: var(--text-muted, #64748b);
  font: 1rem/1.6 system-ui;
  margin-bottom: 1.5rem;
}
.not-found__url {
  display: inline-block;
  padding: .6rem 1rem;
  background: var(--bg, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  margin-bottom: 2rem;
  font: .9rem/1.5 system-ui;
}
.not-found__url-label {
  color: var(--text-muted, #64748b);
  margin-right: .25rem;
}
.not-found__url code {
  font: .9rem/1.5 ui-monospace, monospace;
  color: var(--text);
}
.not-found__actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

