/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
button:active {
  transform: scale(1.1);
  transition: transform ease 0.3s;
}
/* Background */
body {
  padding-top: 20px;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  min-height: 100vh;
  color: #fff;
}

/* App container */
.app-container {
  width: 400px;
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  margin: auto;
  border-radius: 12px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Header */
header h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.8rem;
  letter-spacing: 1px;
}
/* main */
main {
  display: flex;
  flex-direction: column;
}
/* Filter group */
.filter-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 25px;
}

.filter-btn {
  width: 90px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #e5e7eb;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.filter-btn:hover {
  background: #d1d5db;
}

.filter-btn.active {
  background: #4caf50;
  color: white;
}

/* Input group */
.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.input-group input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.input-group input::placeholder {
  color: #aaa;
}

.input-group input::selection {
  background-color: #0f2027;
}

.input-group button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #00c6ff;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.input-group button:hover {
  background: #0072ff;
}

/* Task list */
#task-list {
  list-style: none;
}

#task-list li {
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.3s;
}
#task-list li.active {
  box-shadow: 0px 0px 10px -2px rgba(0, 199, 0, 1);
}

#task-list li:hover {
  background: rgba(255, 255, 255, 0.15);
}
li input {
  flex: 1;
  font-size: 16px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  outline: none;
  background-color: rgba(0, 0, 0, 0);
  border-bottom: 1px solid #ffffff00;
  border-radius: 0;
  /* background: rgba(255, 255, 255, 0.1); */
  color: #fff;
  transition: all 0.3s;
}
li input:enabled {
  border-bottom: 1px solid #ffffff42;
}
li input::placeholder {
  color: #cfcfcf;
}
li input::selection {
  background-color: #0f2027;
}
li div {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
li i {
  color: #ffffff;
  font-size: 25px;
  cursor: pointer;
  transition: 0.3s;
}
li i.check-btn {
  color: #00c6ff;
}
li i.check-btn:hover {
  filter: brightness(85%);
}
li i.check-btn.active {
  color: rgb(0, 199, 0);
}
li i.edit-btn:hover {
  color: #bebebe;
}

.delete-btn {
  background: crimson;
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

.delete-btn:hover {
  background: darkred;
}
.edit-done-btn {
  position: absolute;
  right: 0;
  width: 80px;
  background-color: rgb(0, 211, 18);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-block {
  pointer-events: none;
  filter: brightness(50%);
}
.btn-disable {
  pointer-events: none;
  opacity: 0;
}
.edit-done-btn:hover {
  background-color: rgb(0, 168, 14);
}
.btn-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}
.form-btn {
  padding-block: 10px;
  margin-top: 20px;
  width: 80px;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-end;
  transition: 0.3s;
}
#save-btn {
  background-color: rgb(18, 216, 0);
}
#save-btn:hover {
  background-color: rgb(13, 155, 0);
}
#clear-list {
  background: #ff9900;
}
#clear-list:hover {
  background-color: rgb(216, 105, 0);
}
/* Response */

@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  .app-container {
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

  h1 {
    font-size: 22px;
  }

  .input-group {
    flex-direction: column;
    gap: 10px;
  }

  .input-group input,
  .input-group button {
    width: 100%;
    height: 44px; /* لمس راحت‌تر */
    font-size: 16px; /* جلوگیری از zoom در iOS */
  }

  .filter-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .filter-btn {
    padding: 10px;
    min-height: 40px;
    font-size: 14px;
  }

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

  #task-list li > div {
    justify-content: flex-end;
    padding-right: 30px;
    width: 100%;
    gap: 30px;
  }

  #task-list li > div i {
    font-size: 30px;
  }
  #task-list li > div button {
    padding: 10px 25px;
  }
  .btn-group {
    justify-content: stretch;
  }

  #clear-list {
    width: 100%;
    height: 44px;
    font-size: 16px;
  }
}
