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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  padding: 2rem 1rem;
  color: #2d3748;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #2b6cb0;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #718096;
  font-size: 0.9rem;
}

.task-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.task-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}

.task-form input:focus {
  border-color: #4299e1;
}

.task-form button {
  padding: 0.75rem 1.25rem;
  background: #4299e1;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.task-form button:hover {
  background: #3182ce;
}

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #718096;
}

.filter-btn.active {
  background: #4299e1;
  border-color: #4299e1;
  color: white;
}

.filter-btn:hover:not(.active) {
  border-color: #4299e1;
  color: #4299e1;
}

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #718096;
}

.clear-btn {
  background: none;
  border: none;
  color: #fc8181;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  transition: color 0.2s;
}

.clear-btn:hover {
  color: #e53e3e;
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 0;
  color: #a0aec0;
  font-size: 0.95rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: opacity 0.2s, transform 0.15s;
  animation: slideIn 0.2s ease;
}

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

.task-item.completed {
  opacity: 0.6;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e0;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.task-checkbox:hover {
  border-color: #4299e1;
}

.task-item.completed .task-checkbox {
  background: #48bb78;
  border-color: #48bb78;
}

.task-checkbox::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: none;
}

.task-item.completed .task-checkbox::after {
  display: block;
}

.task-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
  transition: all 0.2s;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: #a0aec0;
}

.task-delete {
  background: none;
  border: none;
  color: #cbd5e0;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.2s;
  flex-shrink: 0;
}

.task-delete:hover {
  color: #fc8181;
}
