body {
  font-family: "Segoe UI", sans-serif;
  background-color: #f4f4f4;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 2rem;
  box-sizing: border-box;
}

.container {
  background-color: #ffe3ed;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
  overflow-y: auto;  
  max-height: 90vh;  

}
.task-list {
  max-height: 400px; /* limit height */
  overflow-y: auto;  /* enable vertical scroll */
  margin-top: 20px;
}



.header {
  margin-bottom: 1.8rem;
}

h1 {
  color: #ff4081;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

input[type="text"] {
  padding: 0.7rem 1rem;
  width: 70%;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

button {
  padding: 0.7rem 1.2rem;
  margin-left: 0.5rem;
  background-color: #ff4081;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #e73370;
}

ul {
  list-style-type: none;
  padding: 0;
  margin-top: 1.5rem;
}

li {
  background-color: #fdf5f7;
  margin-bottom: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  animation: fadeIn 0.3s ease forwards;
  position: relative;
  padding-right: 40px;
}

li:hover {
  background-color: #ffddee;
  transform: scale(1.01);
}

li.completed {
  text-decoration: line-through;
  color: gray;
  opacity: 0.6;
}

.delete-btn {
  position: absolute;
  right: 10px;
  top: 6px;
  border: none;
  background-color: #f6a6bb;
  color: white;
  border-radius: 50%;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.delete-btn:hover {
  transform: rotate(15deg);
  background-color: #dcdcdc;
}

.fade-in {
  animation: fadeIn 0.4s ease-in;
}

.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* Mobile view adjustments */
@media (max-width: 500px) {
  h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 1.2rem;
  }
}
