/* Resetting Default Margin & Padding */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Container */
.container {
  width: 100%;
  max-width: 500px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Header Section */
.header {
  background: linear-gradient(to right, #6e8efb, #a777e3);
  color: white;
  padding: 25px;
  text-align: center;
}

.header h1 {
  font-weight: 600;
  font-size: 28px;
  margin-bottom: 5px;
}

.header p {
  opacity: 0.9;
  font-size: 14px;
}

/* App Body Section */
.app-body {
  padding: 25px;
}

.input-area {
  display: flex;
  margin-bottom: 25px;
  position: relative;
}

.input-area input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  background-color: #f0f0f0;
  border-radius: 30px;
  font-size: 16px;
  padding-right: 50px;
  outline: none;
  border: 1px solid #e6e6e6;
  transition: 0.2s;
}

.input-area input:focus {
  background-color: #e6e6e6;
}

.input-area input.active:focus{
  border: 1px solid red;
}

.input-area input.warning:focus{
  border: 1px solid rgb(178, 170, 53);
}

.input-area button {
  position: absolute;
  right: 5px;
  top: 5px;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(to right, #6e8efb, #a777e3);
  color: white;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.2s;
}

.input-area button:hover {
  transform: scale(1.05);
}

.filter-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 10px;
}

.filter-buttons button {
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.filter-buttons button:hover {
  background: #f5f5f5;
}

.filter-buttons button.active {
  background: linear-gradient(to right, #6e8efb, #a777e3);
  color: white;
  border-color: #6e8efb;
}

.tasks-container {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 5px;
}

.tasks-container::-webkit-scrollbar {
  width: 6px;
}

.tasks-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.tasks-container::-webkit-scrollbar-thumb {
  background: #a777e3;
  border-radius: 10px;
}

/* Task Section */
.task {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 12px;
  background: #f9f9f9;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeIn 0.5s ease;
}

.task:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

.task input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  background-color: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  transition: background-color 0.2s;
}

.task input[type="checkbox"]:after {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f00c";
  font-size: 12px;
  color: white;
  display: none;
}

.task input[type="checkbox"]:checked {
  background: linear-gradient(to right, #6e8efb, #a777e3);
}

.task input[type="checkbox"]:checked:after {
  display: block;
}

.task input[type="checkbox"]:checked + .task-text {
  text-decoration: line-through;
  color: #888;
}

#clear-task{
  cursor: pointer;
  transition: .3s ease-in-out;
}

#clear-task:hover{
  color: red;
}

.task-text {
  flex: 1;
  font-size: 16px;
  color: #333;
  word-break: break-word;
}

.task-actions {
  display: flex;
  gap: 10px;
}

.task-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #888;
  transition: color 0.2s;
}

.task-actions button.edit-btn:hover {
  color: #6e8efb;
}

.task-actions button.delete-btn:hover {
  color: #ff6b6b;
}

/* Empty State Section */
.empty-state {
  text-align: center;
  padding: 30px 0;
  color: #888;
  transition: .3s ease-in-out;
}

.empty-state i {
  font-size: 50px;
  margin-bottom: 15px;
  color: #d0d0d0;
}

.empty-state p {
  font-size: 16px;
}

.empty-state.active{
  display: none;
  opacity: 0;
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  color: #777;
  font-size: 14px;
}

/* Custom Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsiveness */
@media (max-width: 600px) {
  .container {
    border-radius: 15px;
  }

  .header {
    padding: 20px;
  }

  .app-body {
    padding: 20px;
  }

  .filter-buttons {
    flex-wrap: wrap;
  }
}
