/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #2598ce, #a1ccda);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* =========================
   APP CARD
========================= */
.donevia-app {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   HEADER
========================= */
.app-header {
  text-align: center;
  margin-bottom: 25px;
}

.app-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #5faedb;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
}

.app-header h1:hover {
  color: #764ba2;
  transform: scale(1.08);
}

.app-header p {
  font-size: 0.9rem;
  color: #777;
  margin-top: 5px;
}

/* =========================
   INPUT
========================= */
.task-input {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.task-input input {
  flex: 1;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid #ddd;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

.task-input input:focus {
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.task-input button {
  width: 45px;
  border-radius: 12px;
  border: none;
  background: #5faedb;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.task-input button:hover {
  background: #764ba2;
  transform: scale(1.1);
}

/* =========================
   ERROR
========================= */
#errorMessage {
  color: #e74c3c;
  font-size: 0.85rem;
  margin: 5px 0 10px;
}

/* =========================
   FILTERS
========================= */
.task-filters {
  display: flex;
  justify-content: space-between;
  margin: 15px 0;
}

.task-filters button {
  flex: 1;
  margin: 0 5px;
  padding: 8px;
  border-radius: 10px;
  border: none;
  background: #f1f1f1;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.task-filters button:hover {
  background: #c7c7c7;
}

.task-filters button.active {
  background: #5faedb;
  color: white;
}

/* =========================
   TASK LIST
========================= */
.task-list {
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding-right: 5px;
}

.task-list::-webkit-scrollbar {
  width: 6px;
}

.task-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

/* =========================
   TASK ITEM
========================= */
.task-item {
  background: #f8f9ff;
  border-radius: 12px;
  padding: 12px 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

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

.task-left input {
  accent-color: #5faedb;
  cursor: pointer;
}

.task-left span {
  font-size: 0.95rem;
  color: #333;
}

/* COMPLETED */
.task-item.completed {
  background: #e6e9ff;
  opacity: 0.8;
}

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

/* DELETE BUTTON */
.delete-btn {
  background: transparent;
  border: none;
  color: #999;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
}

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

/* EMPTY STATE */
.task-list .empty {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  padding: 20px 0;
}

/* =========================
   FOOTER
========================= */
.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 12px;
  font-size: 0.85rem;
}

#taskCount {
  color: #555;
}

#clearCompleted {
  background: none;
  border: none;
  font-weight: 600;
  color: #5faedb;
  cursor: pointer;
  transition: color 0.3s ease;
}

#clearCompleted:hover {
  color: #ca3929;
}

/* responsive */
@media (max-width: 500px) {

  body {
    padding: 19px;
  }

  /* APP CARD */
  .donevia-app {
    max-width: 100%;
    padding: 20px 16px;
    border-radius: 16px;
  }

  /* HEADER */
  .app-header h1 {
    font-size: 1.8rem;
  }

  .app-header p {
    font-size: 0.8rem;
  }

  /* INPUT */
  .task-input {
    gap: 8px;
  }

  .task-input input {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .task-input button {
    width: 42px;
    font-size: 1.1rem;
  }

  /* FILTERS */
  .task-filters {
    gap: 6px;
  }

  .task-filters button {
    font-size: 0.75rem;
    padding: 7px 5px;
    margin: 0;
  }

  /* TASK LIST */
  .task-list {
    max-height: 220px;
  }

  /* TASK ITEM */
  .task-item {
    padding: 10px 12px;
  }

  .task-left span {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .delete-btn {
    font-size: 0.9rem;
  }

  /* FOOTER */
  .task-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  #taskCount {
    font-size: 0.8rem;
  }

  #clearCompleted {
    font-size: 0.8rem;
  }
}
