/* ---------------- THEME VARIABLES ---------------- */

:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --button: #2563eb;
  --surface: #f1f5f9;
}

.dark {
  --bg: #0f172a;
  --card: #020617;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --button: #3b82f6;
  --surface: #1e293b;
}

/* ---------------- RESET ---------------- */

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------------- LAYOUT ---------------- */

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: var(--text);
}

.app {
  background: var(--card);
  width: 100%;
  max-width: 360px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ---------------- TYPOGRAPHY ---------------- */

#time {
  font-size: 48px;
  text-align: center;
  margin: 10px 0;
}

p {
  text-align: center;
  color: var(--muted);
}

h2 {
  margin-top: 20px;
  font-size: 18px;
}

/* ---------------- INPUT ---------------- */

input[type="number"] {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid var(--surface);
  background: var(--surface);
  color: var(--text);
}

/* ---------------- BUTTONS ---------------- */

button {
  width: 100%;
  padding: 12px;
  margin: 6px 0;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: var(--button);
  color: white;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Accent buttons */

#pause {
  background: #f59e0b;
}

#reset {
  background: #ef4444;
}

#distract {
  background: #6b7280;
}

#clearHistory {
  background: #111827;
}

/* ---------------- HISTORY ---------------- */

#history {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

#history li {
  background: var(--surface);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}


/* Button group layout */
.controls {
  display: flex;
  gap: 8px;
}

.controls button {
  flex: 1;
}

/* Primary action */
#start {
  background: var(--button);
}

/* Secondary actions */
#pause {
  background: #f59e0b;
}

#reset {
  background: #ef4444;
}

/* Tertiary action */
#distract {
  margin-top: 10px;
  background: #6b7280;
}

button:hover:not(:disabled) {
  opacity: 0.9;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.6;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--button);
  outline-offset: 3px;
}

button {
  transition: transform 0.1s ease, opacity 0.1s ease;
}
