* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    }
  
  body {
  background: #f4f6f8;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  }
  
  .container {
  background: #ffffff;
  padding: 25px;
  width: 100%;
  max-width: 550px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  }
  
  h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
  }
  
  .input-section {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  }
  
  .input-section input, .input-section select {
  flex: 1 1 150px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  }
  
  .input-section button {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: none;
  background: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  }
  
  .input-section button:hover {
  background: #0056b3;
  }
  
  #taskCounter {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
  }

  ul {
  list-style: none;
  }
  
  li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  background: #f1f3f5;
  border-radius: 5px;
  }
  
  li.completed span {
  text-decoration: line-through;
  color: gray;
  }
  
  .task-buttons button {
  margin-left: 5px;
  border: none;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 4px;
  background: #6c757d;
  color: white;
  }
  
  .task-buttons button.complete-btn {
    background: #28a745;
    color: white;
}

.task-buttons button.delete-btn {
    background: #dc3545;
    color: white;
}

.task-buttons button.edit-btn {
    background: #6c757d;
    color: white;
}

  /* Filters */
.filters {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  }
  
  .filters button {
  flex: 1;
  margin: 0 3px;
  padding: 6px;
  border: none;
  background: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  }
  
  .theme-toggle-container {
    position: absolute;
    top: 10px; /* Adjust as needed */
    right: 10px; /* Adjust as needed */
  }
  
  .theme-btn {
    width: auto; 
    margin: 0;
    padding: 8px 15px; 
    border: none;
    background: #333;
    color: white;
    cursor: pointer;
    border-radius: 5px;
  }
  .task-category {
    font-size: 0.75rem;
    padding: 2px 5px;
    border-radius: 4px;
    color: white;
    margin-right: 5px;
}

  .task-category.General { background: #6c757d; }
  .task-category.Work { background: #007bff; }
  .task-category.Personal { background: #fd7e14; }
  .task-category.Shopping { background: #20c997; }

  /* Dark mode */
  body.dark {
  background: #121212;
  }
  
  body.dark .container {
  background: #1e1e1e;
  color: white;
  }
  
  body.dark li {
  background: #2c2c2c;
  }

  body.dark h1 {
    background: #1e1e1e;
    color: white;
    }

  .overdue {
  border-left: 5px solid #dc3545;
  background: #ffe5e5;
   }

  .overdue span {
  color: #b30000;
  font-weight: bold;
   }

   .due-today {
    border-left: 5px solid #ffc107; 
    background: #fff3cd;
   }

   .due-tomorrow {
    border-left: 5px solid #fd7e14;
    background: #ffe8cc
   }

   .due-today span {
    color: #ffc107;
    font-weight: bold;
   }

   .due-tomorrow span{
    color: #fd7e14;
    font-weight: bold; 
   }

   .search-container {
    margin-bottom: 15px;
   }

   .search-container input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    outline: none;
   }

   li.priority-High {
    border-left: 5px solid red;
  }

   li.priority-Medium {
    border-left: 5px solid yellow;
  }

   li.priority-Low {
    border-left: 5px solid green;
  }

  .status-legend {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  }
  .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
  }
  
  .legend-item:last-child {
    margin-bottom: 0;
  }
  
  .legend-color {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border-radius: 3px;
  }
  
  .overdue-legend .legend-color {
    background: #dc3545;
  }
  
  .today-legend .legend-color {
    background: #ffc107;
  }
  
  .tomorrow-legend .legend-color {
    background: #fd7e14;
  }
  
  /* Dark mode support */
  body.dark .status-legend {
    background: #1e1e1e;
    color: white;
  }

  @media (max-width: 480px) {

    .container {
      padding: 15px;
    }
  
    .input-section {
      flex-direction: column;
    }
  
    .input-section input,
    .input-section select,
    .input-section button {
      width: 100%;
    }
  
    .filters {
      flex-direction: column;
    }
  
    .filters button {
      margin: 5px 0;
    }
  
    .status-legend {
      position: static;
      margin-bottom: 15px;
    }
  }