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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.header h1 {
  font-size: 48px;
  font-weight: 200;
  text-align: center;
  color: #e57373;
  letter-spacing: 8px;
  margin-bottom: 24px;
}

/* Input */
.input-area {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 2px;
}

.todo-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  outline: none;
  background: transparent;
  color: #333;
}

.todo-input::placeholder {
  color: #bbb;
  font-style: italic;
}

/* Main list */
.main {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 2px;
}

.todo-list {
  list-style: none;
}

/* Todo item */
.todo-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s;
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item:hover {
  background-color: #fafafa;
}

.todo-item:hover .delete-btn {
  opacity: 1;
}

/* Checkbox */
.todo-checkbox {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
}

.todo-checkbox:hover {
  border-color: #e57373;
}

.todo-checkbox:checked {
  background-color: #66bb6a;
  border-color: #66bb6a;
}

.todo-checkbox:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Todo label */
.todo-label {
  flex: 1;
  margin-left: 14px;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  word-break: break-word;
  transition: color 0.2s;
}

.todo-item.completed .todo-label {
  color: #bbb;
  text-decoration: line-through;
}

/* Edit input */
.todo-edit {
  flex: 1;
  margin-left: 14px;
  padding: 4px 8px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
}

.todo-edit:focus {
  border-color: #e57373;
}

/* Delete button */
.delete-btn {
  background: none;
  border: none;
  color: #e57373;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  padding: 0 4px;
  flex-shrink: 0;
  line-height: 1;
}

.delete-btn:hover {
  transform: scale(1.2);
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  color: #999;
}

.todo-count {
  min-width: 80px;
}

.filters {
  display: flex;
  gap: 4px;
}

.filter-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  transition: border-color 0.15s;
}

.filter-btn:hover {
  border-color: #e0e0e0;
}

.filter-btn.active {
  border-color: #e57373;
  color: #e57373;
}

.clear-completed {
  background: none;
  border: none;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  min-width: 110px;
  text-align: right;
}

.clear-completed:hover {
  color: #e57373;
}

/* Hidden state */
.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 480px) {
  .footer {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .todo-count,
  .clear-completed {
    min-width: auto;
  }
}
