:root {
  --bg-color: #f4f4f4;
  --text-color: #333;
  --card-bg: #fff;
  --accent: #28a745;
  --delete: #dc3545;
}

body.dark {
  --bg-color: #121212;
  --text-color: #eee;
  --card-bg: #1e1e1e;
  --accent: #1db954;
  --delete: #ff4d4d;
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: start;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

.container {
  margin-top: 40px;
  background: var(--card-bg);
  padding: 40px 40px;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  transition: background 0.3s;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 15px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.add-btn {
  background-color: var(--accent);
  color: white;
}

.clear-btn {
  background-color: gray;
  color: white;
}

.toggle-theme {
  background-color: #007bff;
  color: white;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  background: #eee;
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}

body.dark li {
  background: #2a2a2a;
}

li.completed span {
  text-decoration: line-through;
  color: gray;
}

.actions {
  display: flex;
  gap: 5px;
}

.complete-btn {
  background-color: var(--accent);
  color: white;
}

.delete-btn {
  background-color: var(--delete);
  color: white;
}

.edit-btn {
  background-color: orange;
  color: white;
}

.save-btn {
  background-color: dodgerblue;
  color: white;
}

.edit-input {
  width: 100%;
  padding: 6px;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-right: 10px;
  font-size: 14px;
}

@media screen and (max-width: 500px) {
  .buttons {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
