* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: radial-gradient(circle at center, #1f1c2c, #928dab);
  background-size: 200% 200%;
  color: white;
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: start;
  padding-top: 50px;
  transition: background 0.2s ease;
  overflow-x: hidden;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.todo-container {
  background-color: rgba(255,255,255,0.1);
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2rem;
}

.input-section {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
}

.input-section input[type="text"],
.input-section input[type="date"],
.input-section select {
  flex: 1 1 150px;
  padding: 10px;
  border-radius: 6px;
  border: none;
  min-width: 140px;
  font-size: 1rem;
}

.input-section button {
  padding: 10px 15px;
  background-color: #2ecc71;
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}

.input-section button:hover {
  background-color: #27ae60;
}

button {
  padding: 10px 15px;
  background-color: #2ecc71;
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #27ae60;
}

ul {
  margin-top: 20px;
  list-style: none;
  padding: 0;
}

li {
  background-color: rgba(255,255,255,0.1);
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

li.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  background-color: #e74c3c;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
}

.actions button.complete-btn {
  background-color: #3498db;
}

.actions button:hover {
  opacity: 0.8;
}

input[type="date"], select {
  padding: 10px;
  border-radius: 6px;
  border: none;
}

.filters {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.filters button {
  flex: 1;
  padding: 10px;
  background-color: #8e44ad;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: bold;
}

.filters button:hover {
  background-color: #6c3483;
}

.priority-high {
  border-left: 5px solid red;
}

.priority-medium {
  border-left: 5px solid orange;
}

.priority-low {
  border-left: 5px solid blue;
}

li .details {
  flex: 1;
  text-align: left;
}

body.light {
  background: linear-gradient(to right, #f5f7fa, #c3cfe2);
  color: #000;
}

body.light .todo-container {
  background-color: rgba(255,255,255,0.8);
}

body.light input, body.light select {
  background: white;
  color: #000;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  gap: 10px;
}

.theme-toggle input {
  display: none;
}

.theme-toggle .slider {
  width: 50px;
  height: 25px;
  background-color: #ccc;
  border-radius: 50px;
  position: relative;
  cursor: pointer;
}

.theme-toggle .slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.theme-toggle input:checked + .slider::before {
  transform: translateX(25px);
}

li.dragging {
  opacity: 0.5;
}

#starCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* -----------------------
   📱 Mobile Responsiveness
-------------------------- */
@media (max-width: 500px) {
  .todo-container {
    padding: 20px 15px;
    margin: 10px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .theme-toggle {
    flex-direction: column;
    font-size: 0.9rem;
  }

  .input-section {
    flex-direction: column;
    align-items: stretch;
  }

  .input-section input[type="text"],
  .input-section input[type="date"],
  .input-section select {
    width: 100% !important;
    min-width: auto !important;
    font-size: 1rem;
  }

  .input-section button {
    width: 100%;
  }

  .filters {
    flex-direction: column;
    gap: 8px;
  }

  .filters button {
    width: 100%;
  }
}
