* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f4f4;
  min-height: 100vh;
}

.container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

.todo-app {
  width: 100%;
  max-width: 500px;
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

h1 {
  margin-top: 0;
  margin-bottom: 8px;
  text-align: center;
}

.subtitle {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.input-section {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#taskInput {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

#addTaskBtn {
  padding: 12px 18px;
  border: none;
  background: #2563eb;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

#addTaskBtn:hover {
  background: #1d4ed8;
}

.filter-section {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid #ccc;
  background: white;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
}

.filter-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

#taskList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  margin-bottom: 10px;
}

.task-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.task-text {
  word-break: break-word;
}

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

.delete-btn {
  border: none;
  background: #ef4444;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.delete-btn:hover {
  background: #dc2626;
}

.bottom-row {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#taskCount {
  margin: 0;
  color: #555;
}

#clearCompletedBtn {
  border: none;
  background: #111827;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

#clearCompletedBtn:hover {
  background: #000;
}

.empty-message {
  text-align: center;
  color: #777;
  padding: 20px 0;
}

@media (max-width: 520px) {
  .todo-app {
    padding: 20px;
  }

  .input-section {
    flex-direction: column;
  }

  #addTaskBtn,
  #taskInput,
  .delete-btn,
  #clearCompletedBtn {
    width: 100%;
  }

  .task-item {
    flex-direction: column;
    align-items: stretch;
  }

  .task-left {
    align-items: flex-start;
  }

  .bottom-row {
    flex-direction: column;
    align-items: stretch;
  }
}
