* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #0d0d0f;
  --card: #17171c;
  --input: #1f1f26;
  --primary: #8b91ff;
  --text: #f0eff5;
  --secondary: #6b6a7d;
  --border: rgba(255, 255, 255, 0.07);
  --destructive: #ff6b6b;
}
body {
  font-family: "DM Sans", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
.logo {
  width: 70px;
  height: auto;
  border-radius: 50%;
}
.header {
  width: 100%;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a,
.nav-links button {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--secondary);
  transition: color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-links a:hover,
.nav-links button:hover {
  color: var(--text);
}

/* ── Main ── */
main {
  display: flex;
  justify-content: center;
  padding: 4rem 1rem 4rem;
}
.todo-section {
  width: 100%;
  max-width: 512px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Heading ── */
.heading {
  margin-bottom: 0.5rem;
}
.label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}
#count-heading {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

/* ── Input row ── */
.input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
}
.input-row:focus-within {
  border-color: var(--primary);
}
.plus-icon {
  color: var(--secondary);
  flex-shrink: 0;
}
.input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
  font-family: "DM Sans", sans-serif;
}
.input-row input::placeholder {
  color: var(--secondary);
}
.input-row #add-btn {
  background: none;
  border: none;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: color 0.15s;
}
.input-row #add-btn:hover {
  opacity: 0.8;
}
.input-row #add-btn:disabled {
  color: var(--secondary);
  cursor: default;
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 0.25rem;
  background: var(--input);
  border-radius: 10px;
  padding: 0.25rem;
}
.filter-btn {
  flex: 1;
  padding: 0.4rem;
  background: none;
  border: none;
  border-radius: 7px;
  font-size: 0.875rem;
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.filter-btn:hover {
  color: var(--text);
}
.filter-btn.active {
  background: var(--card);
  color: var(--text);
}

/* ── Todo list ── */
#todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  transition: border-color 0.15s;
}
.todo-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.todo-item:hover .delete-btn {
  opacity: 1;
}
.checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: none;
  cursor: pointer;
  transition: all 0.2s;
}
.checkbox:hover {
  border-color: var(--primary);
}
.done .checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.todo-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  transition: color 0.2s;
}
.done .todo-text {
  text-decoration: line-through;
  color: var(--secondary);
}
.delete-btn {
  background: none;
  border: none;
  opacity: 0;
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.delete-btn:hover {
  color: var(--destructive);
}
.empty {
  text-align: center;
  padding: 4rem 0;
  color: var(--secondary);
  font-size: 0.9rem;
}

/* ── Footer row ── */
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
}
#items-left {
  font-size: 0.75rem;
  color: var(--secondary);
}
#clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--secondary);
  cursor: pointer;
  transition: color 0.15s;
  font-family: inherit;
}
#clear-btn:hover {
  color: var(--destructive);
}
.filter-btn.active {
  background: #3d3b5a;
  color: white;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}
.hidden {
  display: none !important;
}
.todo-item {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.checkbox {
  transition: all 0.2s ease;
}

.checkbox:hover {
  transform: scale(1.15);
}

.todo-item.done .checkbox {
  background: #22c55e;
  transform: scale(1.1);
}
.todo-text {
  position: relative;
}
.todo-text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 50%;
  width: 0%;
  height: 2px;
  background: white;
  transition: 0.25s;
}
.todo-item.done .todo-text::after {
  width: 100%;
}
.todo-item.removing {
  animation: removeTodo 0.3s forwards;
}

@keyframes removeTodo {
  to {
    opacity: 0;
    transform: translateX(80px);
    height: 0;
    margin: 0;
    padding: 0;
  }
}
.progress-container {
  margin-top: 1rem;
  width: 100%;
  height: 8px;
  background: #2b2b2b;
  border-radius: 999px;
  overflow: hidden;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: #4caf50;
  transition: width 0.35s ease;
}
