* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #a7c7e7, #fff);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 50px 15px;
  color: #333;
}

.container {
  background: #ffffffdd;
  padding: 30px 35px;
  max-width: 450px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

h1 {
  text-align: center;
  margin-bottom: 25px;
  font-weight: 700;
  font-size: 2.2rem;
  color: #374151;
  user-select: none;
}

form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

#task-input,
#date-input,
form button {
  min-width: 0;
}

#task-input {
  flex: 2.5;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
}

#date-input {
  flex: 1.5;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
}

form button {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 12px;
  border: none;
  background: #3b82f6;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 5px 10px rgb(59 130 246 / 0.3);
  margin-left: 0;
  align-self: stretch;
  min-width: 60px;
  transition: background 0.2s;
}

form button:hover {
  background: #2563eb;
  box-shadow: 0 7px 15px rgb(37 99 235 / 0.5);
}

#task-input:focus,
#date-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 6px #3b82f6aa;
}

.filter {
  text-align: right;
  margin-bottom: 20px;
  font-weight: 600;
}

#filter {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

#filter:hover, #filter:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 6px #3b82f6aa;
}

#task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-item {
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.07);
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
  gap: 10px;
}

.task-item:hover {
  background-color: #e0e7ff;
}

.task-item.completed {
  color: #6b7280;
  text-decoration: line-through;
  background-color: #dbeafe;
  box-shadow: none;
}

.task-text {
  flex-grow: 1;
  font-size: 1rem;
  user-select: none;
}

.task-date {
  margin-left: 10px;
  font-size: 0.95em;
  color: #65748b;
  font-style: italic;
  user-select: none;
  white-space: nowrap;
}

.task-buttons {
  display: flex;
  gap: 10px;
  margin-left: 8px;
  flex-shrink: 0;
}

.task-buttons button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  transition: background-color 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #6b7280;
  user-select: none;
}

.task-buttons button:hover {
  background-color: #3b82f6;
  color: white;
  box-shadow: 0 3px 8px rgb(59 130 246 / 0.4);
}

@media (max-width: 480px) {
  form {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  #date-input {
    flex: 2;
  }
  form button {
    width: 100%;
    min-width: unset;
  }
  .task-date {
    display: none;
  }
  .task-buttons {
    gap: 8px;
  }
}
