/* todo/todo.css */

:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.12);
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --warn: #f59e0b;
}

html[data-theme="light"]{
  --bg: #f6f7fb;
  --card: rgba(0,0,0,0.04);
  --border: rgba(0,0,0,0.12);
  --text: #0f172a;
  --muted: #475569;
  --accent: #0ea5e9;
  --accent-2: #7c3aed;
  --ok: #16a34a;
  --warn: #d97706;
}

*{ box-sizing:border-box; }

html, body{
  min-height: 100%;
  margin:0;
  padding:0;
  background: var(--bg);
}

body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 1200px at 20% -10%, var(--bg) 0%, transparent 70%),
    radial-gradient(1400px 1200px at 110% 30%, #0ea5e9 0%, transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg));
  pointer-events: none;
  z-index: 0;
}

#app{
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px);
  display: grid;
  gap: 18px;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}
.safe-paddings{ padding-bottom: max(18px, env(safe-area-inset-bottom)); }

.topbar{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.top-actions{ display:flex; align-items:center; gap:10px; }
.quick-links{ display:flex; gap:8px; }
.pill-link{
  display:inline-flex;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration:none;
  font-weight:600;
  font-size:14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.pill-link:active{ transform: translateY(1px); filter: brightness(.98); }

.brand{ display:flex; align-items:center; gap:12px; }
.brand .logo{
  width: 48px; height: 48px;
  border-radius: 12px;
  background:
    radial-gradient(100px 80px at 20% 10%, rgba(255,255,255,.2), transparent 60%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.15),
    0 10px 30px rgba(0,0,0,.25);
}
.brand-text h1{ margin:0 0 4px 0; font-size: clamp(20px, 4vw, 24px); letter-spacing:.3px; }
.subtitle{ margin:0; color:var(--muted); font-size:13px; }

.theme-toggle{
  appearance:none;
  border:1px solid var(--border);
  background: var(--card);
  color: var(--text);
  width:44px; height:44px; border-radius:12px;
  display:grid; place-items:center; cursor:pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .06s ease, background .2s ease;
}
.theme-toggle:active{ transform: translateY(1px); }

.card{
  backdrop-filter: blur(12px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 20px 60px rgba(0,0,0,.35);
}

.input-wrap{
  display:grid;
  grid-template-columns: auto 1fr;
  align-items:center;
  gap:10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow:
    inset 0 25px 50px -20px rgba(50,50,93,.25),
    inset 0 -2px 6px 0 rgba(10,37,64,.35);
}
html[data-theme="light"] .input-wrap{ background: rgba(0,0,0,.03); }

.task-wrap input{
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: clamp(18px, 4.5vw, 22px);
}
.bullet{ color: var(--accent); font-weight: 700; font-size: 18px; }

.primary{
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 16px;
  color: #071219;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    0 10px 20px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.25);
  cursor: pointer;
  transition: transform .06s ease, filter .2s;
}
.primary:active{ transform: translateY(1px); filter: brightness(.98); }

.status{ min-height: 20px; margin: 10px 2px 0 2px; color: var(--muted); font-size: 14px; }
.visually-hidden{
  position: absolute !important;
  width: 1px; height: 1px; padding:0; margin:-1px; overflow:hidden; clip: rect(0,0,0,0); white-space:nowrap; border:0;
}

.filters{ display:flex; gap:8px; flex-wrap:wrap; }
.filter-btn{
  appearance:none;
  border:1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  font-weight:600;
  cursor:pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-btn.active{ background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#071219; border-color: transparent; }

.list-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.counters{ display:flex; align-items:center; gap:8px; color: var(--muted); font-size:14px; }
.counters .dot{ color: var(--accent-2); }

.task-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.task-list-empty{
  padding: 14px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.task-item{
  display:grid;
  grid-template-columns: auto 1fr auto;
  gap:10px;
  align-items:center;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.task-item.done{ opacity:0.7; text-decoration: line-through; }
.task-title{ margin:0; font-weight:600; }
.task-meta{ color: var(--muted); font-size:12px; margin-top:4px; }
.task-text{ display:flex; flex-direction:column; gap:4px; }

.task-check{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border:1px solid var(--border);
  appearance:none;
  background: var(--card);
  display:grid; place-items:center;
  cursor:pointer;
}
.task-check:checked{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.delete-btn{
  border:0;
  background: transparent;
  color: var(--muted);
  cursor:pointer;
  font-weight:700;
  font-size:16px;
}
.delete-btn:hover{ color: #f87171; }

.list-actions{ display:flex; justify-content:space-between; align-items:center; margin-top:12px; gap:10px; flex-wrap:wrap; }
.ghost-button{
  appearance:none;
  border:1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  font-weight:600;
  cursor:pointer;
}
.ghost-button:active{ transform: translateY(1px); }

footer{ text-align:center; color:var(--muted); font-size:12px; opacity:.9; }

@media (max-width: 520px){
  #app{ padding-bottom: 28px; padding-top:50px; }
  .task-item{ grid-template-rows:auto auto; }
  .task-item .delete-btn{ justify-self: end; }
}
