/* PRESERVE: Do NOT replace this file with write_file. Use edit_file to ADD your styles below the CUSTOM STYLES marker. */
/* This file contains essential utility classes: glass-nav, nav-logo, card-hero, card-tinted, badge-frosted, */
/* animate-in, animate-in-delay-*, animate-float, hero-glow, btn, card, list, modal, form controls. */
/* Overwriting these will break your app's visual foundation. Add new styles at the bottom. */

:root {
  /* "Iris" design system — one signature blue-violet hue (~248) with hue-tinted
     neutrals, a tokenized gradient story, and a WCAG-AA status ramp. Re-theme by
     overriding these tokens; never hardcode raw color values in the markup. */
  --color-bg: hsl(0 0% 100%);
  --color-surface: hsl(248 20% 96.5%);
  --color-text: hsl(248 28% 9%);
  --color-muted: hsl(248 9% 42%);
  --color-primary: hsl(248 84% 58%);
  --color-primary-hover: hsl(248 84% 48%);
  --color-border: hsl(248 18% 90%);
  --color-success: hsl(160 84% 27%);
  --color-warning: hsl(36 100% 32%);
  --color-info: hsl(205 92% 38%);
  --color-danger: hsl(356 76% 48%);
  /* Gradient tokens — hero/logo surfaces read these three stops. */
  --gradient-from: hsl(236 86% 58%);
  --gradient-via: hsl(252 82% 60%);
  --gradient-to: hsl(268 78% 52%);
  --font-sans: system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --max-width: 900px;
  /* Motion tokens — shared easing + durations for hover/entrance motion. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 450ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: hsl(248 24% 7%);
    --color-surface: hsl(248 16% 15%);
    --color-text: hsl(248 25% 96%);
    --color-muted: hsl(248 12% 70%);
    --color-primary: hsl(249 92% 70%);
    --color-primary-hover: hsl(249 92% 78%);
    --color-border: hsl(248 16% 18%);
    --color-success: hsl(158 64% 50%);
    --color-warning: hsl(42 96% 60%);
    --color-info: hsl(203 94% 62%);
    --color-danger: hsl(356 82% 62%);
    --gradient-from: hsl(238 90% 64%);
    --gradient-via: hsl(252 88% 66%);
    --gradient-to: hsl(270 84% 60%);
  }
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; width: 100%; }

header { border-bottom: 1px solid var(--color-border); padding: 0.75rem 0; }
.glass-nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: rgba(255,255,255,0.8); border-bottom: 1px solid rgba(0,0,0,0.08); }
@media (prefers-color-scheme: dark) { .glass-nav { background: rgba(15,23,42,0.8); border-bottom-color: rgba(255,255,255,0.06); } }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 0.75rem; }
.nav-logo { width: 2rem; height: 2rem; border-radius: 0.5rem; background: linear-gradient(135deg, var(--gradient-from), var(--gradient-to)); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(82, 58, 238, 0.25); }
.logo { font-weight: 600; font-size: 1.125rem; text-decoration: none; color: var(--color-text); letter-spacing: -0.01em; }

main { flex: 1; }
.hero { padding: 4rem 0; text-align: center; }
.hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.hero p { color: var(--color-muted); margin-bottom: 2rem; font-size: 1.125rem; }
.hero code { background: var(--color-border); padding: 0.2em 0.5em; border-radius: 4px; font-size: 0.875em; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem; background: var(--color-primary);
  color: #fff; border: none; border-radius: var(--radius); font-size: 1rem;
  cursor: pointer; transition: background var(--duration-fast) var(--ease-out); text-decoration: none;
}
.btn:hover { background: var(--color-primary-hover); }
.btn-ghost {
  background: transparent; color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { background: var(--color-surface); }

/* ── Form controls ────────────────────────────────── */
.input, .textarea, .select {
  width: 100%; padding: 0.5rem 0.75rem;
  background: var(--color-bg); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  font-size: 0.875rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(82, 58, 238, 0.15);
}
.textarea { min-height: 80px; resize: vertical; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1rem; }
.form-label { font-size: 0.875rem; font-weight: 500; }
.form-error { font-size: 0.75rem; color: var(--color-danger); }

/* ── Card ─────────────────────────────────────────── */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card-tinted {
  background: linear-gradient(135deg, rgba(82,58,238,0.06), rgba(82,58,238,0.12));
  border: 1px solid rgba(82,58,238,0.15); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-hero {
  background: linear-gradient(135deg, var(--gradient-from), var(--gradient-via), var(--gradient-to));
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  color: #fff; border-radius: 1rem; padding: 2rem; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(82,58,238,0.25);
}
.card-hero::before {
  content: ""; position: absolute; top: -50%; right: -20%; width: 200px; height: 200px;
  background: rgba(255,255,255,0.05); border-radius: 50%;
}

/* ── Animations ──────────────────────────────────── */
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
@keyframes gradientShift { 0%,100% { background-position:0% 50%; } 50% { background-position:100% 50%; } }
@keyframes glowPulse { 0%,100% { opacity:0.3; } 50% { opacity:0.6; } }
@keyframes growWidth { from { width:0%; } to { width:var(--target-width); } }
@keyframes growHeight { from { height:0%; } to { height:var(--target-height); } }
@keyframes float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
.animate-in { animation: fadeUp 0.5s ease-out both; }
.animate-in-delay-1 { animation: fadeUp 0.5s ease-out 0.1s both; }
.animate-in-delay-2 { animation: fadeUp 0.5s ease-out 0.2s both; }
.animate-in-delay-3 { animation: fadeUp 0.5s ease-out 0.3s both; }
.animate-in-delay-4 { animation: fadeUp 0.5s ease-out 0.4s both; }
.animate-float { animation: float 3s ease-in-out infinite; }
.hero-glow { position:absolute; inset:-4px; border-radius:1rem; background:inherit; opacity:0.3; filter:blur(20px); animation:glowPulse 3s ease-in-out infinite; z-index:-1; }

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(107,114,128,0.2); border-radius:999px; }
::-webkit-scrollbar-thumb:hover { background:rgba(107,114,128,0.35); }

/* ── List ─────────────────────────────────────────── */
.list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  transition: border-color 0.15s;
}
.list-item:hover { border-color: var(--color-primary); }

/* ── Sidebar layout ───────────────────────────────── */
.layout {
  display: flex; gap: 1.5rem; align-items: flex-start;
  flex: 1; padding: 1.5rem 0;
}
.layout-sidebar {
  flex: 0 0 220px; min-width: 0;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 1rem;
  position: sticky; top: 1rem;
}
.layout-main { flex: 1; min-width: 0; }
@media (max-width: 640px) { .layout { flex-direction: column; } .layout-sidebar { flex: none; width: 100%; position: static; } }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--color-muted); font-size: 1.25rem; line-height: 1; padding: 0.25rem; }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ── Badge / Tag ──────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2em 0.6em;
  font-size: 0.75rem; font-weight: 500; border-radius: 999px;
  background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text);
}
.badge-frosted {
  display: inline-block; padding: 0.25em 0.75em;
  font-size: 0.8rem; font-weight: 500; border-radius: 999px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.9); border: 1px solid rgba(255,255,255,0.1);
}

footer { border-top: 1px solid var(--color-border); padding: 1.5rem 0; text-align: center; color: var(--color-muted); font-size: 0.875rem; }

/* === CUSTOM STYLES: Add your domain-specific styles below this line === */

.hidden { display: none !important; }

/* ── Timer hero ───────────────────────────────────── */
#timer-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.timer-ring-wrap { position: relative; width: 260px; height: 260px; margin: 0 auto; }
.timer-ring-svg { display: block; }
#progress-ring { transition: stroke-dashoffset 1s linear; }
.timer-ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.25rem;
}
#time-display { font-size: 2.75rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.timer-sub { font-size: 0.8rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.05em; }

.timer-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.75rem; }
.timer-btn-primary {
  background: #fff; color: var(--color-primary); font-weight: 600;
  padding: 0.75rem 2rem; font-size: 1.05rem; box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.timer-btn-primary:hover { background: rgba(255,255,255,0.9); }
.timer-btn-secondary {
  width: 3rem; height: 3rem; padding: 0; justify-content: center;
  border-radius: 999px; background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}
.timer-btn-secondary:hover { background: rgba(255,255,255,0.22); }

#timer-hero.mode-break { }

/* ── Stat grid ────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card {
  display: flex; align-items: center; gap: 0.875rem;
  border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem 1.25rem;
}
.stat-icon { width: 2.5rem; height: 2.5rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.75rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Cycle dots ───────────────────────────────────── */
.cycle-dots-wrap {
  display: flex; align-items: center; gap: 0.875rem; flex-wrap: wrap;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 0.875rem 1.25rem;
}
.cycle-dots-label { font-size: 0.8125rem; color: var(--color-muted); font-weight: 500; }
.cycle-dots { display: flex; gap: 0.5rem; }
.cycle-dot {
  width: 0.85rem; height: 0.85rem; border-radius: 999px;
  background: var(--color-border); transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.cycle-dot.filled { background: var(--color-primary); transform: scale(1.1); }

/* ── Settings panel ───────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .settings-grid { grid-template-columns: repeat(2, 1fr); } }
.settings-toggles { display: flex; flex-direction: column; gap: 0.625rem; margin-top: 0.25rem; }
.toggle-row { display: flex; align-items: center; gap: 0.625rem; font-size: 0.875rem; cursor: pointer; }
.toggle-row input { width: 1.05rem; height: 1.05rem; accent-color: var(--color-primary); cursor: pointer; }
.settings-saved-msg { display: inline-block; font-size: 0.8125rem; color: var(--color-success); margin-left: 0.75rem; opacity: 0; transition: opacity 0.3s ease; }
.settings-saved-msg.show { opacity: 1; }

@media (max-width: 480px) {
  .timer-ring-wrap { width: 220px; height: 220px; }
  .timer-ring-svg { width: 220px; height: 220px; }
  #time-display { font-size: 2.25rem; }
}

/* ── Reduced motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .card-hero, .hero-glow {
    animation: none;
  }
}

