/* Reset default styles */
body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(to right, #8e9eab, #eef2f3);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Main container styling */
.todo-container {
  background: #fff;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-height: 90vh;
  overflow: auto;
}

/* Header styling */
header h1 {
  font-size: 2rem;
  color: #333333;
  margin-bottom: 20px;
}

/* Input section */
.input-section {
  position: sticky;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  top: 0;
  background-color: #fff;
  z-index: 10;
  padding: 10px 0;
}

/* Input field */
#taskInput {
  flex: 1;
  padding: 10px;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#taskInput:focus {
  outline: none;
  border-color: #3d3d3e;
}

/* Add button */
#addTaskButton {
  padding: 10px 15px;
  background-color: #00bcd4;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

#addTaskButton:hover:not(:disabled) {
  background: #0097a7;
  ;
  color: #ebe8e8;
}

#addTaskButton:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
}

/* Filters styling */
.filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-button,
.clear-button {
  padding: 8px 12px;
  background: #ddd;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.filter-button.active,
.clear-button:hover {
  background: #673ab7;
  color: #fff;
}

/* Task list */
#taskList {
  list-style: none;
  max-height: calc(90vh - 150px);
  overflow-y: auto;
  padding: 10px;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
}

/* Task item */
.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  transition: background-color 0.3s;
}

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

.task-item.fade-out {
  opacity: 0;
  transition: opacity 0.5s;
}

/* Task buttons */
.task-buttons {
  display: flex;
  gap: 10px;
}

.task-buttons button {
  font-size: 0.9rem;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.complete-btn {
  background-color: #43a047;
  color: white;
}

.edit-btn {
  background-color: #2196f3;
  color: white;
}

.delete-btn {
  background-color: #e53935;
  color: white;
}

.task-buttons button:hover {
  transform: scale(1.05);
}

.task-buttons button:active {
  transform: scale(0.95);
}

/* Toast notification */
.custom-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #212121;
  color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 1rem;
  display: none;
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
}

.custom-toast.show {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  margin: auto;
  margin-top: 10%;
  padding: 30px 20px;
  width: 90%;
  max-width: 400px;
  border-radius: 10px;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-50%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  float: right;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #ff5555;
}

.modal h2 {
  margin-top: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  text-align: center;
  margin-bottom: 20px;
}

.modal input {
  display: block;
  width: 95%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.modal input:focus {
  border-color: #2196f3;
  box-shadow: 0 0 5px rgba(33, 150, 243, 0.5);
}

.modal button {
  display: block;
  width: 100%;
  padding: 10px;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.modal button:hover {
  background: #1976d2;
}

.modal button:active {
  transform: scale(0.98);
}

/* No tasks message */
.no-tasks {
  text-align: center;
  color: #777;
  font-style: italic;
}

/* Responsive styling */
@media (max-width: 768px) {
  .todo-container {
    padding: 15px;
    width: 95%;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .input-section {
    flex-wrap: wrap;
    gap: 8px;
  }

  #taskInput {
    font-size: 0.95rem;
  }

  #addTaskButton {
    font-size: 1.1rem;
    padding: 8px 12px;
  }

  .task-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }

  .task-buttons {
    width: 100%;
    justify-content: space-between;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  .todo-container {
    padding: 10px;
    width: 100%;
  }

  header h1 {
    font-size: 1.5rem;
  }

  #taskInput {
    font-size: 0.85rem;
    padding: 8px;
  }

  #addTaskButton {
    font-size: 1rem;
    padding: 6px 8px;
  }

  .task-item {
    padding: 10px;
    font-size: 0.9rem;
  }

  .task-buttons {
    gap: 5px;
  }
}

@media (max-width: 360px) {
  header h1 {
    font-size: 1.2rem;
  }

  .todo-container {
    padding: 8px;
  }

  #taskInput {
    font-size: 0.8rem;
    padding: 6px;
  }

  #addTaskButton {
    font-size: 0.9rem;
    padding: 5px 7px;
  }

  .task-item {
    padding: 8px;
    font-size: 0.8rem;
  }

  .task-buttons button {
    font-size: 0.7rem;
    padding: 4px 6px;
  }
}