/* =============================================================================
   Hear The Youth — Tool UI design system
   Brand tokens, fonts en standaard componenten.
   Bron: brand-book.heartheyouth.com — NIET per tool aanpassen.
   Tool-specifieke styling hoort in app.css.
   ============================================================================= */

/* ── Brand fonts (Suisse) ── */
@font-face {
  font-family: 'Suisse Intl';
  src: url('../assets/fonts/Suisse/SuisseIntl-Regular-WebXL.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Suisse Intl';
  src: url('../assets/fonts/Suisse/SuisseIntl-Book-WebXL.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Suisse Intl';
  src: url('../assets/fonts/Suisse/SuisseIntl-Medium-WebXL.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Suisse Intl';
  src: url('../assets/fonts/Suisse/SuisseIntl-SemiBold-WebXL.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Suisse Intl Mono';
  src: url('../assets/fonts/Suisse/SuisseIntlMono-Regular-WebXL.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── Brand tokens (dark mode) ── */
:root {
  --page-bg: #191919;
  --island-bg: #000000;
  --surface: #262626;
  --surface-input: #333333;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-subtle: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.12);
  --accent: #ffffff;
  --accent-fg: #0f0f12;
  --error: #ffb4b4;
  --control-track: rgba(255, 255, 255, 0.35);
  --control-thumb: #ffffff;
  --radius: 24px;
  --radius-sm: 12px;
  --font-sans: 'Suisse Intl', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Suisse Intl Mono', 'Courier New', Courier, monospace;
  --tool-section-gap: 28px;
  --tool-control-gap: 10px;

  font-feature-settings: 'ss01' 1;
  color-scheme: dark;
}

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

body {
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--page-bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* mono-caps label idiom (losse labels/meta) */
.mono { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: -0.02em; }

/* ── Sidebar (settings island) ── */
#sidebar {
  width: 320px;
  min-width: 320px;
  background: var(--island-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  gap: var(--tool-section-gap);
  margin: 12px;
  border-radius: var(--radius);
  clip-path: inset(0 round var(--radius));
}

h1 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
}
h2 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.section { display: flex; flex-direction: column; gap: var(--tool-control-gap); }

/* Upload zones */
.upload-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  clip-path: inset(0 round var(--radius-sm));
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 0.6875rem;
  color: var(--text-muted);
  position: relative;
}
.upload-zone:hover { border-color: rgba(255,255,255,.4); background: var(--surface); color: var(--text); }
.upload-zone.loaded { border-style: solid; border-color: var(--accent); color: var(--accent); background: rgba(255,255,255,.08); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone .hint { font-size: 0.625rem; color: var(--text-subtle); margin-top: 4px; }
.upload-zone.loaded .hint { color: rgba(255,255,255,.6); }

/* Sliders (brand "kerning" stijl: dunne lijn + witte ronde thumb) */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 0.6875rem;
}
.slider-row label {
  align-items: center;
  align-self: center;
  color: var(--text-muted);
  display: flex;
  flex-shrink: 0;
  min-height: 24px;
  white-space: nowrap;
  width: 58px;
}
.slider-row input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 24px;
  margin: 0;
  padding: 0;
  background: linear-gradient(var(--control-track), var(--control-track))
    no-repeat center / 100% 1px;
  border-radius: 0;
  outline: none;
  cursor: pointer;
  touch-action: none;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--control-thumb);
  border: none;
  cursor: pointer;
}
.slider-row input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--control-thumb);
  border: none;
  cursor: pointer;
}
.slider-row input[type=range]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--text-subtle);
  outline-offset: 3px;
}
.slider-row .val,
.export-val-pill {
  align-items: center;
  background: var(--surface-input);
  border-radius: 99px;
  box-sizing: border-box;
  color: var(--text);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  justify-content: center;
  line-height: 1;
  outline: none;
  padding: 5px 10px;
  text-align: center;
  text-transform: uppercase;
  width: auto;
}

.slider-row .val[contenteditable='true'],
.export-val-pill[contenteditable='true'] {
  cursor: text;
}

.slider-row .val:focus,
.export-val-pill:focus,
.num-row input:focus {
  background: var(--surface);
  outline: none;
}

/* Number / text inputs */
.num-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 0.6875rem;
}
.num-row label { width: 58px; color: var(--text-muted); flex-shrink: 0; }
.num-row input[type=number],
.num-row input[type=text] {
  flex: 1;
  background: var(--surface-input);
  border: none;
  border-radius: var(--radius-sm);
  clip-path: inset(0 round var(--radius-sm));
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  height: 42px;
}
/* Kleur-swatches */
.color-presets {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, 28px);
  width: 100%;
}

.color-presets.bw-only .color-swatch:not([data-bw]) {
  display: none;
}

.color-swatch {
  border: none;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: pointer;
  height: 28px;
  padding: 0;
  position: relative;
  transition: transform .12s;
  width: 28px;
}

.color-swatch:hover { transform: scale(1.08); }

.color-swatch.active::after {
  align-items: center;
  color: var(--check, #000);
  content: '\2713';
  display: flex;
  font-size: 0.8rem;
  font-weight: 700;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.color-swatch:focus-visible {
  outline: 2px solid var(--text-subtle);
  outline-offset: 2px;
}

/* Buttons (CTA — mono caps) */
.btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  clip-path: inset(0 round var(--radius-sm));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter .3s ease-in-out, opacity .3s ease-in-out;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:not(:disabled):hover { filter: brightness(0.9); }
.btn-primary { background: var(--text); color: var(--accent-fg); }
.btn-danger { background: var(--error); color: var(--accent-fg); }
.btn-neutral { background: var(--surface); color: var(--text); }

/* Progress */
#progress-wrap { display: none; flex-direction: column; gap: 8px; }
#progress-wrap.visible { display: flex; }
#progress-bar-bg { background: var(--control-track); border-radius: 99px; height: 6px; overflow: hidden; }
#progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width .1s; border-radius: 99px; }
#progress-label {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: -0.02em;
  font-size: 0.625rem; color: var(--text-muted);
}

/* Status */
#status {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: -0.02em;
  font-size: 0.625rem; color: var(--text-subtle); min-height: 14px;
}
#status.ok { color: var(--accent); }
#status.err { color: var(--error); }

/* ── Result area (rechterkant) ── */
#result-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--page-bg);
  overflow: hidden;
  position: relative;
}

/* Omkadering van het resultaat (canvas/afbeelding/preview) */
.result-frame {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border), 0 8px 40px rgba(0,0,0,.6);
}
.result-frame > * { display: block; border-radius: var(--radius-sm); }

.upload-landing {
  align-items: center;
  background: var(--island-bg);
  color: var(--text);
  display: flex;
  font-size: 28px;
  height: 100%;
  justify-content: center;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  white-space: pre;
  width: 100%;
}

.result-hint {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: -0.02em;
  font-size: 0.625rem;
  color: var(--text-subtle);
}

/* Secundaire control-rij onder het resultaat (bv. playback) */
.control-bar { display: flex; gap: 8px; align-items: center; }
.pb-btn {
  background: var(--island-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  clip-path: inset(0 round var(--radius-sm));
  padding: 8px 16px;
  min-height: 38px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 0.6875rem;
  cursor: pointer;
  transition: filter .3s ease-in-out, opacity .3s;
}
.pb-btn:not(:disabled):hover { filter: brightness(1.4); }
.pb-btn:disabled { opacity: .35; cursor: default; }

/* Responsief: sidebar bovenaan op smal scherm */
@media (max-width: 640px) {
  body { flex-direction: column; height: auto; min-height: 100vh; overflow: auto; }
  #sidebar { width: auto; min-width: 0; }
  #result-area { min-height: 60vh; }
}
