@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Manufacturing+Consent&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: url(images/nature.jpg);
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  color: #fff;
}

h1 {
  font-family: kanit;
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Tasks Container */
.task-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: start;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 10px;
  width: 400px;
  height: 60vh;
}

#task-input {
  font-size: 1.2rem;
  padding: 10px;
  border: none;
  border-radius: 5px 0 0 5px;
  background-color: rgba(255, 255, 255, 0.8);
  margin-top: 10px;
  font-family: 'Kanit', sans-serif;
  color: #000;
}

#task-input:focus {
  outline: none;
  border-bottom: 2px solid #ff7200;
}

#task-input::placeholder {
  color: #3c3c3c;
}

#add {
  font-size: 1.2rem;
  padding: 10px 20px;
  border: none;
  margin-top: 10px;
  ;
  border-radius: 0 5px 5px 0;
  background-color: #ff7200;
  color: white;
  cursor: pointer;
  font-family: 'Kanit', sans-serif;
}

#add:hover {
  background-color: #e65c00;
  color: #111;
}

/* Task List (ul) */
#task-list {
  list-style: none;
  font-family: kanit;
  font-size: 1.2rem;
  display: flex;
  flex-direction: column;
  width: 75%;
  height: 75%;
  margin: 20px;
  align-items: start;
  overflow-y: scroll;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

#task-list::-webkit-scrollbar {
  display: none;
}

#task-list {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 10px;
}


#task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 10px;
  margin: 8px 0;
  border-radius: 5px;
  width: 100%;
  transition: background 0.3s;
  position: relative;
}

#task-list li:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Checkbox style */
.task-check {
  margin-right: 10px;
  transform: scale(1.2);
  accent-color: #ff7200;
}

.task-text {
  flex-grow: 1;
  font-size: 1.1rem;
}

/* Edit Button */
.edit-btn {
  background: none;
  border: none;
  color: #0ff;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  margin-left: 5px;
}

.edit-btn:hover {
  text-shadow: 1px 1px 10px #0ff;
  transition: color 0.3s;
}

#task-list li:hover .edit-btn {
  display: inline;
}

.edit-input {
  font-family: 'Kanit', sans-serif;
  font-size: 1rem;
  padding: 5px;
  width: 100%;
  border-radius: 4px;
}

/* Delete button */
.delete-btn {
  background: none;
  border: none;
  color: #f44336;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  transition: color 0.3s;
}

.delete-btn:hover {
  text-shadow: 1px 1px 10px #f44336;
  transition: color 0.3s;
}

#task-list li:hover .delete-btn {
  display: inline;
}

.controls {
  margin-top: 20px;
  display: flex;
  gap: 15px;
}

.controls button {
  padding: 10px 20px;
  /* background-color: #ff7200; */
  border: none;
  border-radius: 5px;
  color: white;
  font-family: 'Kanit', sans-serif;
  cursor: pointer;
  transition: background-color 0.3s;
}

#clear-completed {
  background-color: #4caf50;
}

#clear-completed:hover {
  background-color: #388e3c;
}

#clear-all {
  background-color: #ff0000;
}

#clear-all:hover {
  background-color: #d32f2f;
}

/* Tablets (768px and below) */
@media (max-width: 900px) {
  h1 {
    font-size: 2.5rem;
    text-align: center;
    padding: 0 10px;
  }

  .task-container {
    width: 70%;
    height: 65vh;
    padding: 15px;
  }

  #task-input,
  #add {
    font-size: 1rem;
    padding: 8px 10px;
    width: 100%;
  }

  #task-list {
    /* width: 100%; */
    height: 70%;
    margin: 10px 0;
  }

  .controls {
    flex-direction: row;
    width: 40%;
    align-items: center;
    gap: 10px;
  }

  .controls button {
    width: 100%;
  }

  .task-text {
    font-size: 1rem;
  }
}


/* Mobile (480px and below) */
@media (max-width: 480px) {
  body {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
    letter-spacing: 1px;
  }

  .task-container {
    width: 90%;
    height: 70vh;
    padding: 10px;
  }

  #task-input {
    font-size: 0.95rem;
    padding: 8px;
  }

  #add {
    font-size: 0.95rem;
    padding: 8px 12px;
  }

  #task-list li {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
  }

  .task-text {
    width: 100%;
  }

  .edit-btn,
  .delete-btn {
    font-size: 1rem;
  }

  .controls {
    flex-direction: column;
    width: 100%;
  }

  .controls button {
    font-size: 1rem;
    padding: 10px;
  }
}