/* ==========================================================
   KidsTimer.nl – gedeelde basisstijl (alle pagina's)
   Bevat: kleuren, header, footer, knoppen, panelen, cookiebanner
   ========================================================== */

/* Lettertypes staan op de eigen server (geen verzoek naar Google, sneller en AVG-vriendelijk).
   Variabele fonts: één bestand voor alle diktes. Licentie: assets/fonts/OFL-*.txt */
@font-face { font-family: 'Nunito'; src: url('/assets/fonts/nunito-latin.woff') format('woff'); font-weight: 200 1000; font-style: normal; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('/assets/fonts/baloo2-latin.woff') format('woff'); font-weight: 400 800; font-style: normal; font-display: swap; }

:root {
  --text: #24324a;
  --muted: #64748b;
  --purple: #7c3aed;
  --purple-dark: #602bd8;
  --pink: #ec4899;
  --blue: #38bdf8;
  --blue-dark: #0ea5e9;
  --green: #34d399;
  --green-dark: #059669;
  --yellow: #fbbf24;
  --coral: #fb7185;
  --shadow: 0 20px 50px rgba(72, 48, 122, 0.15);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --max: 1180px;

  /* Accentkleur per pagina (zie .theme-* hieronder) */
  --accent: var(--purple);
  --accent-2: var(--pink);
  --accent-soft: rgba(124, 58, 237, .10);
  --accent-glow: rgba(124, 58, 237, .20);
}
body.theme-purple { --accent: var(--purple);     --accent-2: var(--pink);      --accent-soft: rgba(124,58,237,.10); --accent-glow: rgba(124,58,237,.20); }
body.theme-blue   { --accent: var(--blue-dark);  --accent-2: var(--blue);     --accent-soft: rgba(14,165,233,.12); --accent-glow: rgba(14,165,233,.22); }
body.theme-green  { --accent: var(--green-dark); --accent-2: var(--green);    --accent-soft: rgba(5,150,105,.10);  --accent-glow: rgba(5,150,105,.20); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fcf5ff 0%, #f8fbff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img, svg { max-width: 100%; }

.page-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 10% 15%, rgba(124,58,237,.14), transparent 18%),
    radial-gradient(circle at 85% 20%, rgba(56,189,248,.16), transparent 17%),
    radial-gradient(circle at 30% 80%, rgba(236,72,153,.10), transparent 16%);
}
.site-header, main, .site-footer { position: relative; z-index: 1; }
.container { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }

/* ---------- Toegankelijkheid ---------- */
.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; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; transition: top .2s; }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(255,255,255,.62); border-bottom: 1px solid rgba(124,58,237,.08); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; font-size: 1.7rem; font-weight: 700; color: var(--purple); }
.logo-mark { width: 48px; height: 48px; display: grid; place-items: center; background: linear-gradient(135deg, #f3e8ff 0%, #e0f2fe 100%); border-radius: 16px; box-shadow: var(--shadow); }
.logo-text span { color: var(--pink); }
.nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 0; font-weight: 700; color: var(--muted); }
.nav-wrap .logo { flex: none; }
.nav-links a { padding: 8px 12px; border-radius: 999px; white-space: nowrap; transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.nav-links a:hover, .nav-links a:focus-visible { background: rgba(124,58,237,.08); color: var(--purple); transform: translateY(-1px); }
.nav-links a[aria-current="page"] { background: rgba(124,58,237,.12); color: var(--purple); }

/* ---------- Kopjes en labels ---------- */
h1, h2, h3 { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; margin: 0; line-height: 1.05; }
.eyebrow, .section-label, .card-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .95rem; font-weight: 800;
}
.card-badge-blue { background: rgba(14,165,233,.12); color: #0284c7; }
.card-badge-green { background: rgba(5,150,105,.12); color: var(--green-dark); }
.section-head { max-width: 760px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(2rem, 3.5vw, 3rem); margin-top: 10px; }
.section-head p, .muted { color: var(--muted); line-height: 1.7; }

/* ---------- Knoppen ---------- */
.btn {
  border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; padding: 15px 24px; cursor: pointer; color: #fff; min-height: 52px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 14px 30px var(--accent-glow);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}
.btn:hover:not(:disabled), .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 18px 34px var(--accent-glow); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%); box-shadow: 0 14px 30px rgba(124,58,237,.16); }
.btn-secondary { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.btn-secondary:hover:not(:disabled) { box-shadow: none; background: var(--accent-glow); }
.btn-small { padding: 12px 18px; min-height: 44px; }
.btn[aria-pressed="false"] { opacity: .75; }

/* ---------- Panelen en pagina-opbouw (timerpagina's) ---------- */
.page { padding: 8px 0 44px; }
.page-head { padding: 40px 0 22px; max-width: 760px; }
.page-head h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); margin-top: 12px; }
.page-head p { color: var(--muted); line-height: 1.7; font-size: 1.08rem; margin: 12px 0 0; }
.panel {
  background: rgba(255,255,255,.84); border: 1px solid rgba(124,58,237,.08); border-radius: var(--radius-xl);
  box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); padding: 24px;
}
.controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: 18px; }
.tip { text-align: center; color: var(--muted); font-size: .95rem; margin: 18px 0 0; }
.time-big { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; line-height: .95; color: var(--accent); font-variant-numeric: tabular-nums; }
.progress-bar { height: 12px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s linear; }

/* Terug naar overzicht onderaan elke timerpagina */
.more-timers { margin-top: 34px; }
.more-timers h2 { font-size: 1.6rem; margin-bottom: 14px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.more-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-lg); background: rgba(255,255,255,.82); border: 1px solid rgba(124,58,237,.08); box-shadow: var(--shadow); font-weight: 800; transition: transform .2s ease; }
.more-link:hover, .more-link:focus-visible { transform: translateY(-3px); }
.more-link span.ico { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: rgba(124,58,237,.08); }
.more-link small { display: block; color: var(--muted); font-weight: 600; }

/* ---------- Dialoog (eindscherm) ---------- */
.finish-dialog { width: min(calc(100% - 36px), 460px); overflow: hidden; padding: 45px 35px 35px; border: 0; border-radius: 27px; text-align: center; color: var(--text); box-shadow: 0 30px 100px rgba(28,25,56,.35); }
.finish-dialog::backdrop { background: rgba(33,34,71,.6); backdrop-filter: blur(5px); }
.finish-star { display: block; font-size: 58px; animation: finishPop .7s cubic-bezier(.2,.8,.2,1); }
.finish-dialog h2 { margin: 10px 0 5px; font-size: 2.3rem; }
.finish-dialog p { margin: 0 0 25px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.confetti i { position: absolute; width: 8px; height: 18px; border-radius: 3px; background: var(--coral); transform: rotate(20deg); }
.confetti i:nth-child(1) { left: 12%; top: 18%; } .confetti i:nth-child(2) { left: 23%; top: 8%; background: var(--yellow); transform: rotate(-30deg); }
.confetti i:nth-child(3) { right: 20%; top: 11%; background: var(--green); transform: rotate(45deg); } .confetti i:nth-child(4) { right: 9%; top: 26%; background: var(--purple); }
.confetti i:nth-child(5) { left: 9%; top: 48%; background: var(--blue); transform: rotate(65deg); } .confetti i:nth-child(6) { right: 8%; top: 52%; background: var(--yellow); transform: rotate(-65deg); }
@keyframes finishPop { 0% { opacity: 0; transform: scale(.4) rotate(-30deg); } 70% { transform: scale(1.15) rotate(8deg); } }

/* ---------- Footer ---------- */
.site-footer { padding: 22px 0 40px; margin-top: 20px; }
.site-footer p { color: var(--muted); line-height: 1.7; margin: 0; }
.footer-wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.footer-links a, .footer-link-btn { background: none; border: 0; padding: 4px 0; color: var(--purple); font-weight: 800; cursor: pointer; }
.footer-links a:hover, .footer-link-btn:hover { text-decoration: underline; }
.site-footer .made-by { font-size: .8rem; margin-top: 10px; }
.site-footer .made-by a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer .made-by a:hover { color: var(--purple); }

/* ---------- Cookiebanner (wordt door site.js geplaatst) ---------- */
.cookie-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90; }
.cookie-card { max-width: 880px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-radius: 20px; background: rgba(31,41,55,.96); color: #fff; box-shadow: 0 24px 56px rgba(15,23,42,.38); }
.cookie-card p { color: rgba(255,255,255,.86); margin: 0; line-height: 1.5; font-size: .95rem; }
.cookie-card a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 12px; flex-wrap: wrap; }
/* Weigeren en accepteren zijn even prominent (AVG: weigeren moet even makkelijk zijn) */
.cookie-actions .btn-secondary, .cookie-actions .btn-primary { color: var(--text); background: #fff; box-shadow: none; }
.cookie-actions .btn:hover:not(:disabled) { background: #f3e8ff; box-shadow: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  /* Op mobiel scrolt de header mee weg, zodat de timer meer ruimte heeft */
  .site-header { position: relative; }
  .nav-wrap { min-height: auto; padding: 10px 0 8px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .logo { font-size: 1.4rem; gap: 10px; }
  .logo-mark { width: 38px; height: 38px; border-radius: 12px; }
  /* Alle menu-items zichtbaar: doorlopen naar een tweede regel in plaats van zijwaarts scrollen */
  .nav-links { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 2px; font-size: .86rem; }
  .nav-links a { padding: 7px 8px; }
  .nav-links a[href="#hoe-werkt-het"] { display: none; }
  .page-head { padding: 16px 0 14px; }
  .page-head h1 { font-size: clamp(1.8rem, 7.5vw, 2.4rem); margin-top: 8px; }
  .page-head p { font-size: 1rem; line-height: 1.55; margin-top: 8px; }
  .eyebrow { padding: 6px 12px; font-size: .88rem; }
  .panel { padding: 16px; border-radius: 22px; }
  .cookie-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .cookie-card p { font-size: .88rem; }
  .cookie-actions { gap: 8px; flex-wrap: nowrap; }
  .cookie-actions .btn { flex: 1; min-height: 40px; padding: 8px 10px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Affiliate-tip (subtiel, boven de footer) ---------- */
.affiliate-tip { text-align: center; margin: 0 0 18px; padding: 10px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: .95rem; font-weight: 700; line-height: 1.5; }
.affiliate-tip a { color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.affiliate-tip a:hover { text-decoration-thickness: 2px; }
.affiliate-note { color: var(--muted); font-weight: 600; font-size: .8rem; }
.tip-panel p.affiliate-note, p.affiliate-note { margin: 10px 0 0; }

/* ---------- Deelknop (link met huidige instellingen kopiëren) ---------- */
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.share-btn { border: 0; background: none; padding: 6px 0; color: var(--accent); font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.share-btn:hover { text-decoration-thickness: 2px; }
.share-msg { color: var(--muted); font-size: .9rem; font-weight: 700; }

/* ---------- Tekstpagina's (privacy, over, 404) ---------- */
.text-page { max-width: 780px; }
.text-page .panel { margin-top: 8px; }
.text-page h2 { font-size: 1.6rem; margin: 26px 0 8px; }
.text-page h2:first-child { margin-top: 0; }
.text-page p, .text-page li { line-height: 1.7; }
.text-page ul { padding-left: 1.2em; }
.text-page a:not(.btn) { color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.text-page .updated { color: var(--muted); font-size: .95rem; }

/* ---------- Tip-blok met aanbeveling (bijv. bol.com), herbruikbaar op elke pagina ---------- */
.tip-panel { display: flex; align-items: flex-start; gap: 18px; margin-top: 34px; }
.tip-panel-ico { flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.9rem; background: var(--accent-soft); }
.tip-panel-body { min-width: 0; }
.tip-panel h2 { font-size: 1.35rem; margin: 2px 0 10px; }
.tip-panel p { max-width: 820px; margin: 0 0 12px; line-height: 1.6; }
.tip-panel ul { max-width: 820px; margin: 0 0 14px; padding-left: 1.2em; line-height: 1.6; }
.tip-panel li + li { margin-top: 4px; }
.tip-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
@media (max-width: 760px) {
  .tip-panel { flex-direction: column; gap: 12px; }
  .tip-actions .btn { width: 100%; }
}
