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

body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.todo-container {
  width: 100%;
  max-width: 500px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

h1 {
  text-align: center;
  margin-bottom: 25px;
  color: #222;
}

/* Inputs */

#search,
#todo-input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  outline: none;
  font-size: 15px;
}

#search {
  margin-bottom: 15px;
}

#search:focus,
#todo-input:focus {
  border-color: #6a9bd4;
  box-shadow: 0 0 0 3px rgba(106, 155, 212, 0.15);
}

/* Add */

.add-task {
  display: flex;
  gap: 10px;
}

#add-btn {
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  background: #6a9bd4;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

#add-btn:hover {
  background: #5689c5;
}

/* Filters */

.filters {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.filters button {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: #eef1f5;
  cursor: pointer;
  transition: background 0.2s ease;
}

.filters button:hover {
  background: #dfe5ec;
}

/* Todo list */

#todo-list {
  list-style: none;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#todo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 15px;
  background: #f7f9fc;
  border: 1px solid #edf0f4;
  border-radius: 10px;
}

/* Todo text */

#todo-list li .span {
  flex: 1;
  min-width: 0;
  color: #333;
  overflow-wrap: anywhere;
}

/* Completed */

.done .span {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Checkbox */

#todo-list li input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #6a9bd4;
  flex-shrink: 0;
}

/* Task Buttons */

.edit-btn,
.delete-btn,
.save-btn {
  border: none;
  padding: 8px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.edit-btn {
  background: #e5effb;
  color: #477db8;
}

.edit-btn:hover {
  background: #cfe1f6;
}

.delete-btn {
  background: #fff0f0;
  color: #e05252;
}

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

.save-btn {
  background: #e5f5e9;
  color: #32834a;
}

.save-btn:hover {
  background: #ccebd4;
}

/* Edit input */

.edit-input {
  flex: 1;
  min-width: 100px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 7px;
  outline: none;
}

.edit-input:focus {
  border-color: #6a9bd4;
}

/* Delete all */

#delete-all {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #ff5c5c;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

#delete-all:hover {
  background: #e64545;
}

/* Mobile */

@media (max-width: 500px) {
  .todo-container {
    margin: 15px;
    padding: 20px;
  }

  .add-task {
    flex-direction: column;
  }

  #add-btn {
    padding: 12px;
  }

  .edit-btn,
  .delete-btn,
  .save-btn {
    padding: 7px 10px;
    font-size: 12px;
  }
}
