@import url("https://fonts.googleapis.com/css2?family=Anton&family=Mogra&family=Playwrite+NZ+Basic+Guides&family=Poppins: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=Seymour+One&display=swap");

html {
  touch-action: manipulation;
}

button,
.list-container,
.delete-btn {
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #0f0f13;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  background-image:
    radial-gradient(
      circle at 15% 20%,
      rgba(68, 196, 161, 0.18),
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(130, 87, 229, 0.18),
      transparent 40%
    ),
    linear-gradient(180deg, #0f0f13, #13131a);
  background-size: cover;
  background-position: center;
}

/* Heading */
h1 {
  text-align: center;
  font-size: 30px;
  font-weight: 300;
  font-family: "Anton", sans-serif;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: grid;
  grid-template-columns: 1fr max-content 1fr;
  grid-template-rows: 27px 0;
  grid-gap: 10px;
  align-items: center;
}

h1::before,
h1::after {
  content: "";
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
}

/* Main Container */
.main-container {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 80%;
  max-width: 500px;
  height: 500px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 0 0.5px rgba(255, 255, 255, 0.4);
}

/* Form */
form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 400px;
  margin: auto;
}

/* Input */
input[name="taskInput"] {
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  padding: 10px;
  border-radius: 12px;
  min-width: 100px;
  flex: 1;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: white;

  outline: none;
  transition:
    border 0.3s ease,
    box-shadow 0.3s ease;
}

input[name="taskInput"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

input[name="taskInput"]:focus {
  border: 1px solid #44c4a1 !important;
  box-shadow: 0 0 0 2px rgba(68, 196, 161, 0.25);
}

/* Add Button */
button[type="submit"] {
  padding: 2px 22px;
  background: linear-gradient(135deg, #44c4a1, #3aaed8);
  border-radius: 12px;
  border: none;
  color: white;
  font-size: 2rem;
  font-weight: bold;

  cursor: pointer;
  box-shadow: 0 8px 20px rgba(68, 196, 161, 0.4);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Task Container */
.task-container {
  padding: 5px;
  border-radius: 10px;
  height: 310px;
  overflow-y: scroll;
  scrollbar-width: none;
}

.task-container::-webkit-scrollbar {
  display: none;
}

.task-container.empty {
  display: flex;
  height: 280px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.task-container p {
  width: 100%;
  text-align: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
}

.task-container p:nth-child(1) {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.task-container p:nth-child(2) {
  font-size: 13px;
  margin-top: 6px;
}

.task-container p:nth-child(3) {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.6;
}

/* Task Item */
.list-container {
  list-style-type: none;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  max-width: 400px;
  height: fit-content;
  margin: auto;
  margin-bottom: 12px;
  gap: 12px;

  color: white;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-radius: 14px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.3),
    inset 0 0 0.5px rgba(255, 255, 255, 0.3);

  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

/* Task Text */
.list {
  flex: 1;
  font-size: 0.95rem;
}

li::first-letter {
  text-transform: capitalize;
}

/* Checkbox */
.check-box {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background-color: transparent;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}

.tick-image {
  width: 20px;
  height: 20px;
  display: none;
}

/* Delete Button */
.delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  height: 36px;
  width: 36px;
  background-color: transparent;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
}

.delete-img {
  width: 22px;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

/* categories container */

.categories-container {
  display: flex;
  max-width: 400px;
  margin: auto;
  margin-top: 16px;
  justify-content: space-around;
}

/* Category Buttons */
.categories-container button {
  flex: 1;
  margin: 0 6px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 0 0.5px rgba(255, 255, 255, 0.3);
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease;
}

.categories-container button.active {
  background: linear-gradient(135deg, #44c4a1, #3aaed8);
  border: none;
  color: white;

  box-shadow: 0 10px 30px rgba(68, 196, 161, 0.45);
}

.categories-container button:active {
  transform: scale(0.97);
}

/* Edit task button */
.edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
  color: white;
  opacity: 0.7;
  transition:
    opacity 0.25s ease,
    transform 0.1s ease;
}

.pencil-img {
  width: 20px;
  pointer-events: none;
  filter: invert(1);
}

/* Edit Input */
.edit-input {
  flex: 1;
  height: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transition:
    border 0.3s ease,
    box-shadow 0.3s ease;
}

.edit-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.edit-input:focus {
  border: 1px solid #44c4a1 !important;
  box-shadow: 0 0 0 2px rgba(68, 196, 161, 0.25);
}

.save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
  color: white;
  font-size: 22px;
  opacity: 0.7;
  transition:
    opacity 0.25s ease,
    transform 0.1s ease;
}

.cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
  color: white;
  font-size: 22px;
  opacity: 0.7;
  transition:
    opacity 0.25s ease,
    transform 0.1s ease;
}

.dragging {
  opacity: 0.5;
  background-color: rgba(255, 255, 255, 0.5);
}

@media (hover: hover) and (pointer: fine) {
  button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(68, 196, 161, 0.6);
  }

  .list-container:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  }

  /* delete btn */
  .delete-btn:hover {
    background-color: rgba(255, 0, 0, 0.25);
    transform: rotate(8deg);
  }

  .delete-btn:hover .delete-img {
    opacity: 1;
  }

  /* categories container */
  .categories-container button:hover {
    transform: translateY(-2px);
    background: linear-gradient(
      270deg,
      rgba(68, 196, 161, 0.5),
      rgba(58, 174, 216, 0.5)
    );
    color: white;
    box-shadow: 0 10px 30px rgba(68, 196, 161, 0.45);
  }

  /* edit btn */
  .edit-btn:hover {
    background-color: rgba(255, 193, 7, 0.25);
    transform: rotate(45deg);
  }
  .edit-btn:hover .pencil-img {
    opacity: 1;
  }

  /* save btn */
  .save-btn:hover {
    background-color: rgba(68, 196, 161, 0.25);
    transform: rotate(15deg);
    opacity: 1;
  }

  /* cancel btn */
  .cancel-btn:hover {
    background-color: rgba(255, 0, 0, 0.25);
    transform: rotate(8deg);
    opacity: 1;
  }
}
