/* -------------------------
   Base / Theme variables
   ------------------------- */

:root{
  --bg-grad-1: linear-gradient(135deg, #e6eefc 0%, #f5f7ff 100%);
  --soft-bg: #f5f8ff;
  --card-bg: rgba(255,255,255,0.65);
  --text: #111827;
  --muted: #6b7280;
  --accent: linear-gradient(135deg,#7b61ff,#00c2ff);
  --accent-solid: #5b3bff;
  --glass-blur: 8px;
  --shadow: 0 8px 28px rgba(12,15,20,0.12);
  --select-bg: rgba(255,255,255,0.35);
  --select-border: rgba(0,0,0,0.1);
}

/* Dark theme */
body.theme-dark {
  --bg-grad-1: linear-gradient(135deg,#0f1724 0%, #0b1020 100%);
  --soft-bg: #0b1220;
  --card-bg: rgba(255,255,255,0.03);
  --text: #e6eef6;
  --muted: #94a3b8;
  --accent: linear-gradient(135deg,#ff9a4d,#ff5d9e);
  --accent-solid: #ff7b3a;
  --glass-blur: 6px;
  --shadow: 0 10px 30px rgba(0,0,0,0.6);
  --select-bg: rgba(255,255,255,0.1);
  --select-border: rgba(255,255,255,0.2);
}

/* Neon theme */
body.theme-neon {
  --bg-grad-1: linear-gradient(135deg,#081229 0%, #0b1226 50%, #051024 100%);
  --soft-bg: #07122b;
  --card-bg: rgba(255,255,255,0.03);
  --text: #e7f9ff;
  --muted: #9bdcff;
  --accent: linear-gradient(135deg,#7effb2,#68a9ff);
  --accent-solid: #5ef0b3;
  --glass-blur: 4px;
  --shadow: 0 8px 30px rgba(0,255,200,0.06);
  --select-bg: rgba(255,255,255,0.1);
  --select-border: rgba(255,255,255,0.2);
}

/* Page basics */
* { box-sizing: border-box; }
html,body { height:100%; }
body {
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg-grad-1);
  color: var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* App container */
.app {
  width: 960px;
  max-width: 95%;
  margin: 36px auto;
  padding: 28px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
}

/* Header */
.app-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}

.title h1 { margin:0; font-weight:700; font-size:1.6rem; }
.subtitle { margin-top:6px; color:var(--muted); font-size:0.95rem; }

/* Theme icon button */
.icon-btn {
  border:none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  font-size:20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Stats grid */
.stats {
  display:grid;
  grid-template-columns: repeat(4,1fr);
  gap:14px;
}

.card {
  padding:14px;
  border-radius:12px;
  background: var(--card-bg);
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  border: 1px solid rgba(255,255,255,0.06);
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:72px;
}

.card-label { font-size:0.78rem; color:var(--muted); margin:0; }
.card h3 { margin:0; font-size:1.35rem; }

/* Progress card */
.progress-row {
  display:flex;
  align-items:center;
  gap:12px;
}

.progress-bar {
  flex:1;
  height:10px;
  background: rgba(255,255,255,0.06);
  border-radius:999px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,0.06);
}

.progress-fill {
  height:100%;
  width:0%;
  background: linear-gradient(90deg,#72e0ff,#7b61ff);
  transition: width 350ms ease;
}

/* Controls */
.controls {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.task-input {
  display:flex;
  gap:10px;
  flex:1 1 60%;
}

.task-input input[type="text"]{
  flex:1;
  padding:12px 14px;
  border-radius:10px;
  border:none;
  outline:none;
  font-size:1rem;
  background: rgba(255,255,255,0.035);
  color:var(--text);
}

.task-input input[type="date"]{
  width:190px;
  padding:10px;
  border-radius:10px;
  border:none;
  background: rgba(255,255,255,0.03);
  color:var(--text);
}

/* Add button */
.add-btn {
  background: var(--accent);
  color: #fff;
  border:none;
  padding:0 16px;
  border-radius:10px;
  width:48px;
  height:48px;
  font-size:1.6rem;
  cursor:pointer;
  box-shadow: 0 8px 22px rgba(59, 40, 230, 0.12);
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Filters - Custom dropdowns */
.filters {
  display:flex;
  gap:10px;
  align-items:center;
  flex: 0 0 auto;
}

/* Custom dropdown */
.custom-select {
  position: relative;
  min-width: 140px;
  background: var(--select-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
  border: 1px solid var(--select-border);
  transition: all 0.2s ease;
}

.custom-select .selected {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-select .selected::after {
  content: "▼";
  font-size: 0.6rem;
  margin-left: 8px;
  color: var(--muted);
}

.custom-select .options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 8px;
  margin-top: 4px;
  list-style: none;
  padding: 0;
  box-shadow: var(--shadow);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.custom-select.open .options {
  display: block;
}

.custom-select .options li {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.custom-select .options li:hover {
  background: var(--accent-solid);
  color: #fff;
}

/* Scrollbar */
.custom-select .options::-webkit-scrollbar {
  width: 6px;
}
.custom-select .options::-webkit-scrollbar-thumb {
  background: var(--accent-solid);
  border-radius: 3px;
}
.custom-select .options::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
}

/* Task list */
.task-list {
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Single task */
.task {
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border-radius:10px;
  background: var(--card-bg);
  border:1px solid rgba(255,255,255,0.04);
  transition: transform 150ms ease, box-shadow 150ms;
}

.task:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }

.complete-btn {
  width:36px;
  height:36px;
  border-radius:50%;
  border:2px solid rgba(0,0,0,0.25);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  background: transparent;
  font-size:18px;
}

/* when done */
.task.completed .title { text-decoration:line-through; opacity:0.7; }
.task.completed .complete-btn {
  background: var(--accent);
  color:#fff;
  border-color: transparent;
}

/* Task content */
.title {
  font-size:1rem;
  color:var(--text);
}

.meta {
  font-size:0.82rem;
  color:var(--muted);
  margin-left:8px;
}

/* action buttons */
.actions { margin-left:auto; display:flex; gap:8px; align-items:center; }
.action-btn {
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:18px;
}

/* footer */
.app-footer { text-align:center; color:var(--muted); }

/* Accessibility helper */
.sr { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }

/* Responsive */
@media (max-width:720px){
  .stats { grid-template-columns: repeat(2,1fr); }
  .task-input { flex-basis:100%; }
}
