@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

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

body {
  background-image: linear-gradient(to top, #d299c2 0%, #fef9d7 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Centered wrapper ── */
.container {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Heading ── */
h1 {
  margin-bottom: 32px;
  font-size: clamp(28px, 6vw, 45px); /* scales between 28px–45px */
  text-decoration: underline;
  text-align: center;
}

/* ── Form ── */
form {
  border: 1px solid gray;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  width: 100%;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
}

form input {
  border: none;
  outline: none;
  background: transparent;
  padding: 7px;
  font-size: clamp(13px, 3vw, 15px);
  flex: 1;
  min-width: 0; /* prevents input from overflowing flex container */
}

form button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

form button i {
  font-size: clamp(16px, 4vw, 20px);
  transition: transform 0.3s ease-in;
}

form button i:hover {
  transform: scale(1.3);
}

/* ── Todo list ── */
.todos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 28px;
}

.todo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid black;
  transition: transform 0.3s ease-in;
  padding: 4px 0;
  gap: 8px;
}

.todo:hover {
  transform: translateY(-6px);
}

.todo p {
  padding: 3px;
  font-size: clamp(14px, 3.5vw, 18px);
  word-break: break-word; /* long words wrap instead of overflow */
  flex: 1;
  min-width: 0;
}

.todo .btn {
  display: flex;
  padding: 8px 6px;
  gap: 10px;
  flex-shrink: 0;
}

i {
  font-size: clamp(16px, 4vw, 20px);
  cursor: pointer;
  transition: transform 0.3s ease-in;
}

i:hover {
  transform: scale(1.3);
}

.btn i:first-child:hover {
  color: green;
}
.btn i:last-child:hover {
  color: red;
}

/* ── Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  body {
    padding: 16px 12px;
    align-items: flex-start;
    padding-top: 40px;
  }

  h1 {
    margin-bottom: 22px;
  }

  form {
    padding: 8px 12px;
    border-radius: 40px;
  }

  .todos {
    margin-top: 20px;
    gap: 10px;
  }

  .todo .btn {
    padding: 6px 4px;
    gap: 8px;
  }
}

/* ── Tablet (481px – 768px) ── */
@media (min-width: 481px) and (max-width: 768px) {
  body {
    padding: 24px 20px;
    align-items: flex-start;
    padding-top: 50px;
  }

  h1 {
    margin-bottom: 28px;
  }
}
