/* Streamz Social Studio — gedeelde shell
   Design tokens, generieke UI-primitieven en de topbar met tool-tabs.
   Tool-specifieke CSS hoort in de tool zelf, niet hier.
   LET OP: alle asset-paden absoluut (/assets/...) — dit bestand wordt
   vanuit /shared/ geladen, relatieve paden zouden daartegen resolven. */

@font-face { font-family: 'Gilroy'; src: url('/assets/fonts/Gilroy-Light.woff2')    format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('/assets/fonts/Gilroy-Regular.woff2')  format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('/assets/fonts/Gilroy-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('/assets/fonts/Gilroy-Bold.woff2')     format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

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

/* --- Tokens ---
   Eén set lichte waarden + één set donkere. De :not([data-theme="light"])
   in de media query maakt een apart [data-theme="light"] blok overbodig. */
:root {
  --bg: #f4f4f6; --surface: #fff; --border: #e2e2e8;
  --accent: #ff4b00; --accent-light: #fff2ec;
  --text: #020022; --muted: #6b6b85; --danger: #cc0243; --danger-bg: #fee2e2;
  --input-bg: #fafafa; --track-bg: #f0f0f0;
  --radius: 8px; --shadow: 0 1px 4px rgba(2,0,34,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f1a; --surface: #1c1c2e; --border: #2e2e45;
    --text: #e4e4f0; --muted: #8888a8; --accent-light: #2d1500;
    --danger: #ff5c8a; --danger-bg: #3f1020;
    --input-bg: #16162a; --track-bg: #252540;
    --shadow: 0 1px 4px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f1a; --surface: #1c1c2e; --border: #2e2e45;
  --text: #e4e4f0; --muted: #8888a8; --accent-light: #2d1500;
  --danger: #ff5c8a; --danger-bg: #3f1020;
  --input-bg: #16162a; --track-bg: #252540;
  --shadow: 0 1px 4px rgba(0,0,0,.3);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }

/* --- Topbar met tool-tabs --- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.topbar-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tool-tabs { display: flex; gap: 4px; }
.tool-tab { padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.tool-tab:hover { background: var(--accent-light); color: var(--accent); }
.tool-tab.active { background: var(--accent); color: #fff; }
.tool-tab.active:hover { background: var(--accent); color: #fff; }

.logo-mark { width: 32px; height: 32px; border-radius: 7px; background: #000; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-mark img { width: 22px; height: 22px; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text span:first-child { font-size: 13px; font-weight: 800; color: var(--text); letter-spacing: .01em; }
.logo-text span:nth-child(2) { font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.logo-version { font-size: 10px; color: var(--muted); letter-spacing: .02em; }
.changelog-btn { background: none; border: 1px solid var(--border); border-radius: 99px; font-size: 10px; color: var(--muted); padding: 1px 7px; cursor: pointer; margin-left: 4px; }
.changelog-btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.theme-btn { background: none; border: 1px solid var(--border); border-radius: 99px; width: 24px; height: 24px; font-size: 13px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; transition: all .15s; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* --- Secties / kaarten ---
   .section-scope reset de teller; in de Branding-tool doet .sidebar dat. */
.section-scope { counter-reset: section-num; }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); counter-increment: section-num; }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-title > .badge::before, details > summary.section-title > .badge::before { content: counter(section-num); }
details > summary.section-title { margin-bottom: 0; cursor: pointer; list-style: none; }
details > summary.section-title::-webkit-details-marker { display: none; }
details[open] > summary.section-title { margin-bottom: 14px; }
details > summary.section-title::after { content: '▸'; font-size: 15px; color: var(--accent); margin-left: auto; }
details[open] > summary.section-title::after { content: '▾'; }
.badge { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-check { width: 16px; height: 16px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 10px; font-weight: 700; display: none; align-items: center; justify-content: center; flex-shrink: 0; }
.section-check.on { display: flex; }

/* --- Formulierprimitieven --- */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
input[type=file] { width: 100%; font-size: 12px; color: var(--muted); cursor: pointer; }
input[type=file]::file-selector-button { background: var(--accent-light); border: 1px solid var(--accent); color: var(--accent); font-size: 12px; padding: 4px 10px; border-radius: 4px; cursor: pointer; margin-right: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
input[type=text], input[type=number], input[type=url], input[type=password], textarea, select { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; background: var(--input-bg); color: var(--text); transition: border .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button:focus-visible, input[type=file]:focus-visible, input[type=range]:focus-visible, input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Segmented control ---
   Echte radio-inputs, visueel verborgen: pijltjestoetsen en screenreaders
   blijven werken, de <span> is enkel de skin. Elke groep heeft een eigen
   name nodig. */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; background: var(--input-bg); padding: 2px; gap: 2px; flex-wrap: wrap; }
.segmented label { display: block; margin: 0; position: relative; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 5px 14px; border-radius: 99px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.segmented label:hover span { color: var(--accent); }
.segmented input:checked + span { background: var(--accent); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented input:disabled + span { opacity: .45; cursor: not-allowed; }
.segmented input:disabled { cursor: not-allowed; }

/* --- Tekenteller --- */
.char-count { font-size: 11px; color: var(--muted); }
.char-count.over { color: var(--danger); font-weight: 600; }

/* --- Knoppen --- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; } .btn-primary:hover:not(:disabled) { opacity: .9; }
.btn-secondary { background: var(--border); color: var(--text); } .btn-secondary:hover:not(:disabled) { background: var(--track-bg); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* --- Kleine bouwstenen --- */
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--accent-light); color: var(--accent); font-weight: 500; }
.status { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 6px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s; }
.file-name { font-size: 11px; color: var(--accent); margin-top: 3px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.or-divider { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.format-note { font-size: 11px; border-radius: 4px; padding: 4px 8px; margin-top: 6px; }
.note-green { color: #059669; background: #d1fae5; }
.note-amber { color: #92400e; background: #fef3c7; }

/* --- Modal --- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(2,0,34,.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 12px; padding: 24px; max-width: 420px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.3); position: relative; }
.modal h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; padding-right: 28px; }
.modal .modal-sub { font-size: 11px; color: var(--muted); margin-bottom: 16px; }
.modal-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: none; border-radius: 99px; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; }
.modal-close:hover { background: var(--accent-light); color: var(--accent); }

/* Changelog-entries — badge-styling zit hier, niet meer in build.js */
.cl-version { margin-bottom: 14px; }
.cl-version-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cl-version-date { font-size: 11px; color: var(--muted); }
.cl-current { font-size: 10px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 99px; }
.cl-items { list-style: none; padding: 0; }
.cl-items li { font-size: 12px; color: var(--text); padding: 3px 0 3px 14px; position: relative; border-bottom: 1px solid var(--border); }
.cl-items li::before { content: '·'; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }
.cl-type { font-size: 9px; padding: 1px 5px; border-radius: 99px; font-weight: 700; margin-right: 4px; background: var(--track-bg); color: var(--muted); }
.cl-type-feat { background: var(--accent-light); color: var(--accent); }
.cl-type-fix  { background: #fef3c7; color: #92400e; }
.cl-type-docs { background: #e0f2fe; color: #0369a1; }

/* --- Toasts --- */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 16px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: 420px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: auto; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--danger); }

/* --- Drag & drop --- */
.drop-zone { transition: box-shadow .15s, border-color .15s; }
.drop-zone.drag-over { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-light); }

/* --- Wachtwoordpoort --- */
.pw-gate { position: fixed; inset: 0; background: var(--bg); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.pw-gate h2 { font-size: 20px; font-weight: 600; color: var(--text); margin: 0; text-transform: none; letter-spacing: normal; }
.pw-gate-sub { font-size: 13px; color: var(--muted); }
.pw-gate-row { display: flex; gap: 8px; }
.pw-gate-row input { width: 220px; padding: 8px 12px; }
.pw-gate-error { font-size: 12px; color: var(--danger); display: none; }
