* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #f4f4f4;
  margin: 0; 
  padding: 30px 20px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  background: white;
  width: 90vw;
  max-width: 700px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
  margin: 0 auto;
}

.header {
  background-color: #f44336;
  color: white;
  text-align: center;
  padding: 30px 20px;
}

.header h2 {
  margin: 0 0 10px;
}

#myInput {
  width: 70%;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-radius: 4px 0 0 4px;
  outline: none;
  transition: box-shadow 0.3s ease;
}

#myInput:focus {
  box-shadow: 0 0 6px 2px rgba(244,67,54,0.6);
}

.addBtn {
  width: 30%;
  padding: 10px;
  background: #d9d9d9;
  border: none;
  cursor: pointer;
  font-size: 16px;
  border-radius: 0 4px 4px 0;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.addBtn:hover,
.addBtn:focus {
  background-color: #bbb;
  box-shadow: 0 0 6px 2px rgba(187,187,187,0.7);
  outline: none;
}

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
  flex-grow: 1;
}

ul li {
  padding: 12px 12px 12px 40px;
  background: #eee;
  font-size: 18px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  user-select: none;
  word-break: break-word;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

ul li:nth-child(odd) {
  background: #f9f9f9;
}

ul li:hover {
  background: #ddd;
}

ul li.checked {
  background: #888;
  color: #fff;
  text-decoration: line-through;
}

ul li.checked::before {
  content: '';
  position: absolute;
  border-color: #fff;
  border-style: solid;
  border-width: 0 2px 2px 0;
  top: 12px;
  left: 16px;
  transform: rotate(45deg);
  height: 15px;
  width: 7px;
}

.close {
  color: #888;
  font-weight: bold;
  cursor: pointer;
  font-size: 22px;
  user-select: none;
  transition: color 0.3s;
  padding: 0 10px;
  margin-left: 12px;
  border-radius: 4px;
  align-self: center;
}

.close:hover,
.close:focus {
  color: #f44336;
  outline: none;
  background-color: rgba(244,67,54,0.15);
}

.footer {
  padding: 10px 20px;
  background: #f9f9f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #555;
  border-top: 1px solid #ddd;
}

.footer button {
  background: #f44336;
  border: none;
  color: white;
  padding: 6px 10px;
  margin-left: 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 14px;
}

.footer button:hover,
.footer button:focus {
  background: #d32f2f;
  outline: none;
}

li.editing input {
  all: unset;
  width: 100%;
  padding: 12px 40px 12px 10px;
  font-size: 18px;
  box-sizing: border-box;
  border-radius: 0;
  outline: 2px solid #f44336;
  color: #333;
  background: #fff;
  cursor: text;
}

/* Responsive styles */
@media screen and (max-width: 480px) {
  body {
    padding: 15px;
  }

  .container {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    width: 100vw;
  }

  #myInput {
    width: 65%;
    font-size: 14px;
    padding: 8px;
  }

  .addBtn {
    width: 35%;
    font-size: 14px;
    padding: 8px;
  }

  ul li {
    font-size: 16px;
    padding-left: 35px;
  }

  .close {
    font-size: 20px;
    padding: 0 8px;
    margin-left: 8px;
  }

  .header {
    padding: 20px 15px;
  }

  .footer {
    padding: 8px 15px;
    font-size: 13px;
  }

  .footer button {
    padding: 5px 8px;
    font-size: 13px;
  }
}

@media screen and (max-width: 320px) {
  #myInput {
    width: 60%;
  }

  .addBtn {
    width: 40%;
  }

  ul li {
    font-size: 14px;
    padding-left: 30px;
  }

  .close {
    font-size: 18px;
    padding: 0 6px;
  }
}
