/* Font */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(./assets/fonts/jost-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

/* Icon */
.icon {
  width: 1.02em;
  height: 1.02em;
  vertical-align: -0.125em;
}

body {
  font-family: 'Jost', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  background: url(./assets/background-image-mobile.webp) no-repeat;
  background-size: cover;
}

/* Desktop background */
@media (min-width: 768px) {
  body {
    background-image: url(./assets/background-image.webp);
  }
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 20px;
}

.todo-app {
  width: 100%;
  max-width: 600px;
  min-height: 750px;
  padding: 2rem;
  display: flex;
  align-items: start;
  justify-content: start;
  flex-direction: column;
  gap: 30px;
  color: #fff;
  border-radius: 20px;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

/* Byline spacing */
.todo-app > *:first-child {
  margin-bottom: -25px;
}

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

.title h1 {
  font-size: 3rem;
  margin-bottom: -15px;
}

.author {
  font-family: 'Arial', sans-serif;
  font-size: 1.2rem;
  text-align: right;
  font-weight: bold;
  color: rgba(180, 230, 255, 0.9);
  text-shadow:
    0 0 5px rgba(0, 195, 255, 0.6),
    0 0 15px rgba(0, 195, 255, 0.3);
}

/* Stats container */
.stat-container {
  padding: 15px 20px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.details-progress {
  width: 100%;
}

.details-progress h2 {
  color: #fff;
  font-size: 1rem;
}

/* Progress bar */
#progressbar {
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  position: relative;
  margin-top: 15px;

  box-shadow:
    inset 2px 2px 5px rgba(0, 0, 0, 0.5),
    inset -1px -1px 2px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

#progress {
  height: 100%;
  /* Liquid gradient */
  background: linear-gradient(
    to bottom,
    #22ff77 0%,
    /* Top */ #0ef66e 40%,
    /* Main */ #0bc357 60%,
    /* Mid */ #09a349 100% /* Base */
  );

  border-radius: 20px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  position: relative;
  box-shadow: 0 0 15px rgba(14, 246, 110, 0.4); /* Glow */
}

/* Glossy highlight */
#progress::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  right: 5px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  filter: blur(1px);
}

/* Stats frame */
.stats-number {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stats-number span {
  position: absolute;
  left: 27px;
  width: 0.4rem;
  height: 0.07rem;
  background: #2c4766;
  border-radius: 3px;
  transform-origin: 22px;
  transform: scale(2.2) rotate(calc(var(--index) * (360deg / 60)));
  overflow: hidden;
}

.stats-number span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #0ef;
  border-radius: inherit;
  opacity: 0;
  animation: animateSecond 60s linear infinite;
  animation-delay: calc(var(--index) * (60s / 60));
}

@keyframes animateSecond {
  0% {
    opacity: 1;
  }
  25% {
    opacity: 0;
  }
}

/* Stat number */
#numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  font-weight: 900;
  font-size: 1.1rem;
  color: #0ef;
  text-shadow:
    1px 1px 0px rgba(0, 0, 0, 0.2),
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

/* Input form */
.input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 10px;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Task input */
#todo-input {
  flex: 1;
  padding: 10px 17px;
  font-size: 1.1rem;
  border: 2px solid rgba(0, 195, 255, 0.6);
  outline: none;
  border-radius: 22px;
  background: rgba(182, 176, 201, 0.3);
  color: #dbdbdb;
}

#todo-input:focus {
  border: 2px solid rgba(0, 195, 255, 0.6);
}

#todo-input::placeholder {
  color: #bcbcbc;
}

/* Priority select */
#priority-input {
  appearance: base-select;
  width: 80px;
  padding: 6px 15px 5px;
  border: 1px solid #ddd;
  color: #bcbcbc;
  border-radius: 20px;
  background: rgba(182, 176, 201, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;

  &::picker(select) {
    appearance: base-select;
    background-color: rgba(182, 176, 201, 0.01);
    border: rgba(182, 176, 201, 0.01);
  }

  option {
    color: black;
    background-color: rgba(182, 176, 201, 1);
    padding: 2px 20px 2px 10px;
    margin: 5px 0;
    border-radius: 20px;
    font-weight: 500;
  }

  option:first-child {
    background-color: #4caf50;
  }

  option:nth-child(2) {
    background-color: #ffa500;
  }

  option:nth-child(3) {
    background-color: #ff4d4d;
  }
}

/* Priority badge */
.priority-badge {
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 10px;
  max-width: 70px;
  text-align: center;
  color: #000;
  text-transform: uppercase;
  font-weight: 500;
}

.prio-3 {
  background: #ff4d4d;
} /* High */
.prio-2 {
  background: #ffa500;
} /* Medium */
.prio-1 {
  background: #4caf50;
} /* Low */

/* Add button */
#add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  background: rgba(182, 176, 201, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: all 0.2s ease;
}

#add-btn:hover {
  transform: scale(1.2);
  background: #5240ab;
}

/* Task list wrapper */
.todos-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar */
.todos-container::-webkit-scrollbar {
  width: 6px;
}

/* Track */
.todos-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

/* Thumb */
.todos-container::-webkit-scrollbar-thumb {
  background: rgba(182, 176, 201, 0.5);
  border-radius: 10px;
}

/* Task list */
#task-list {
  width: 100%;
  align-self: flex-start;
}

/* Empty state */
.empty-image {
  display: none;
  max-width: 300px;
  margin-top: 50px;
}

/* Task item */
#task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #5240ab;
  margin-bottom: 10px;
  padding: 8px 10px;
  gap: 10px;
  border-radius: 30px;
  font-size: 1.2rem;
  color: #fff;
  position: relative;
  transition: box-shadow 0.2s ease;
  outline: 1px solid blue;
}

#task-list li:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Task content */
.task-content {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
}

/* Checkbox */
#task-list li .checkbox {
  min-width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 50%;
  appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

#task-list li .checkbox:checked {
  background: #ff6f91;
  transform: scale(1.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

#task-list li .checkbox:checked::before {
  content: '\2713';
  color: #fff;
  line-height: 1;
  display: inline-block;
  font-size: 1rem;
}

/* Task text */
.todo-text {
  margin-left: 10px;
  word-wrap: break-word;
}

/* Completed */
#task-list li.completed .todo-text {
  text-decoration: 2px line-through #000;
  color: rgba(255, 255, 255, 0.75);
}

/* Task buttons */
.task-buttons {
  display: flex;
  gap: 10px;
  margin-right: auto;
}

/* Buttons */
.task-buttons button {
  background: rgba(182, 176, 201, 0.3);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.task-buttons button:hover {
  transform: scale(1.2);
}

/* Edit button */
.task-buttons .edit-btn {
  background: #ffbf00;
}

/* Delete button */
.task-buttons .delete-btn {
  background: #ff6f91;
}

/* Disabled */
.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* Edit input */
.edit-input {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid #fff;
  color: #fff;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 1.1rem;
  font-family: inherit;
  width: 100%;
}
