/* ================================================
   Timer PWA – Stylesheet
   Mobile-first · Dark mode · Full-screen fill bar
   ================================================ */

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

/* ── Design tokens ─────────────────────────────── */
:root {
  --bg:           #0d0d1a;
  --surface:      rgba(255, 255, 255, 0.05);
  --surface-2:    rgba(255, 255, 255, 0.08);
  --border:       rgba(255, 255, 255, 0.1);
  --text:         #f0f0f5;
  --muted:        rgba(240, 240, 245, 0.45);

  /* Vul-balk kleurverloop: blauw → paars → rood */
  --fill-start:   #1e90ff;
  --fill-mid:     #a855f7;
  --fill-end:     #e94560;

  --accent:       #e94560;
  --radius-sm:    0.5rem;
  --radius-md:    1rem;
  --radius-lg:    1.75rem;
  --radius-full:  9999px;

  --font: 'Inter', system-ui, sans-serif;
  --transition-fill: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Schermen ──────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 1;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── SETUP SCHERM ──────────────────────────────── */
.setup-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 2rem;
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.app-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Tijdweergave */
.time-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.time-unit span {
  font-size: clamp(3.5rem, 15vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  min-width: 2ch;
  text-align: center;
  color: var(--text);
}

.time-colon {
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.adj-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 0.7rem;
  width: 2.8rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.adj-btn:hover  { background: rgba(255,255,255,0.14); }
.adj-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.18); }

/* Snelknoppen */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.preset-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  transition: all 0.2s;
}
.preset-btn:hover  { border-color: var(--accent); color: var(--text); }
.preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Start knop */
.start-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--fill-mid), var(--accent));
  border: none;
  border-radius: var(--radius-full);
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1rem 2.5rem;
  width: 100%;
  justify-content: center;
  box-shadow: 0 4px 32px rgba(233, 69, 96, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.start-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 40px rgba(233,69,96,0.5); }
.start-btn:active { transform: translateY(0); }

.start-icon { font-size: 0.9em; }

/* ── TIMER SCHERM ──────────────────────────────── */
#timer-screen { z-index: 2; }

/* Vul-balk: groeit van onder naar boven */
.fill-bar {
  position: fixed;
  inset: 0;
  transform-origin: bottom center;
  transform: scaleY(0);
  background-color: hsl(120, 85%, 42%); /* startwaarde groen, JS update dit */
  transition: transform 1s var(--transition-fill),
              background-color 1s ease;
  will-change: transform, background-color;
  z-index: 1;
}



/* Overlay boven de balk */
.timer-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  width: 100%;
  height: 100%;
  padding: 2rem;
}

.timer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  /* tekst zichtbaar over elke achtergrond */
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.6));
}

.timer-time {
  font-size: clamp(4rem, 20vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
}

.timer-percentage {
  font-size: clamp(1.1rem, 4vw, 1.8rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
}

/* Bedieningsknoppen */
.timer-controls {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.ctrl-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  color: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctrl-btn:hover  { background: rgba(255,255,255,0.22); }
.ctrl-btn:active { transform: scale(0.92); }

.ctrl-btn.pause {
  width: 5rem;
  height: 5rem;
  font-size: 1.5rem;
}

.ctrl-btn.reset {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.3rem;
}

/* ── Timer afgelopen puls ───────────────────────── */
@keyframes done-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.done-pulse {
  animation: done-pulse 0.8s ease-in-out infinite;
}

/* ── Responsief: grotere schermen ──────────────── */
@media (min-width: 768px) {
  .setup-card { padding: 3rem 3.5rem; gap: 2.25rem; }
}
