* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: #fff;
  width: 100%;
  max-width: 420px;
  padding: 20px 25px 0px;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

#task-input {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
}

#add-task-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #667eea;
  color: #fff;
  cursor: pointer;
}

#add-task-btn:hover {
  background: #5563d9;
}


#task-list {
  list-style: none;
}

#task-list li {
  background: #f4f6ff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease;
  cursor: pointer;
}

#task-list li button {
  background: #ff4d4d;
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* completed task */
.completed {
  text-decoration: line-through;
  opacity: 0.6;
}
/* From Uiverse.io by adamgiebl */ 
/* From Uiverse.io by cuzpq */ 
.darkmode {
  display: block;         
  margin: 20px auto;
  margin-top: 35px;
  --toggle-size: 8px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 6.25em;
  height: 3.125em;
  background: -webkit-gradient(linear, left top, right top, color-stop(50%, #efefef), color-stop(50%, #2a2a2a)) no-repeat;
  background: -o-linear-gradient(left, #efefef 50%, #2a2a2a 50%) no-repeat;
  background: linear-gradient(to right, #efefef 50%, #2a2a2a 50%) no-repeat;
  background-size: 205%;
  background-position: 0;
  -webkit-transition: 0.4s;
  -o-transition: 0.4s;
  transition: 0.4s;
  border-radius: 99em;
  position: relative;
  cursor: pointer;
  font-size: var(--toggle-size);
}

.darkmode::before {
  content: "";
  width: 2.25em;
  height: 2.25em;
  position: absolute;
  top: 0.438em;
  left: 0.438em;
  background: -webkit-gradient(linear, left top, right top, color-stop(50%, #efefef), color-stop(50%, #2a2a2a)) no-repeat;
  background: -o-linear-gradient(left, #efefef 50%, #2a2a2a 50%) no-repeat;
  background: linear-gradient(to right, #efefef 50%, #2a2a2a 50%) no-repeat;
  background-size: 205%;
  background-position: 100%;
  border-radius: 50%;
  -webkit-transition: 0.4s;
  -o-transition: 0.4s;
  transition: 0.4s;
}

.darkmode:checked::before {
  left: calc(100% - 2.25em - 0.438em);
  background-position: 0;
}

.#darkmode:checked {
  background-position: 100%;
}

/* animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* DARK MODE */
.dark {
  background: #121212;
}

.dark .container {
  background: #1e1e1e;
  color: #fff;
}

.dark input {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
}

.dark li {
  background: #2a2a2a;
  color: #fff;
}

/* responsive */
@media (max-width: 480px) {
  .container {
    margin: 15px;
  }
}
