* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.app {
  width: 100%;
  max-width: 600px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

header h1 { font-size: 1.6rem; color: #1a1a2e; }
header span { color: #888; font-size: 0.9rem; }

main {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.add-task {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.add-task input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-task input:focus { border-color: #6c63ff; }

.add-task select {
  padding: 10px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

.add-task button, .stats button {
  padding: 10px 16px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.add-task button:hover, .stats button:hover { background: #574fd6; }

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 6px 14px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #6c63ff;
  color: #fff;
  border-color: #6c63ff;
}

#taskList { list-style: none; }

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }

.task-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: #6c63ff;
  cursor: pointer;
  flex-shrink: 0;
}

.task-text {
  flex: 1;
  font-size: 0.95rem;
  color: #333;
  transition: all 0.2s;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: #aaa;
}

.priority-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-badge.high { background: #ffe0e0; color: #e53935; }
.priority-badge.medium { background: #fff3cd; color: #f57c00; }
.priority-badge.low { background: #e0f7e9; color: #2e7d32; }

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 1.1rem;
  transition: color 0.2s;
  padding: 0 4px;
}

.delete-btn:hover { color: #e53935; }

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.stats span { font-size: 0.85rem; color: #888; }
.stats button { background: #ff6b6b; padding: 6px 12px; font-size: 0.82rem; }
.stats button:hover { background: #e53935; }
