/* Variables */
:root {
  --main-color: rgb(108, 99, 255);
  --white-color: #f9f9fb;
  --app-bg: #f4f6fb;
  --border-color: #d1d9e6;
  --red-color: #ff4d6d;
  --badge-color: #e3e7fd;
  --text-light: #7a7e9a;
  --text-dark: #232946;
  --loader-bg: rgba(255, 255, 255, 0.5);
}

.dark:root {
  --main-color: #a385ff;
  --white-color: #232946;
  --app-bg: #181a2a;
  --border-color: #393e5c;
  --red-color: #ff6f91;
  --badge-color: #393e5c4f;
  --text-light: #b8bcd9;
  --text-dark: #f4f6fb;
  --loader-bg: rgba(0, 0, 0, 0.5);
}

/* Reset CSS */

html {
  font-size: 62.5%;
  box-sizing: border-box;
}

body {
  font-size: 1.6rem;
  line-height: 1.6;
  font-family: sans-serif;
  background-color: var(--app-bg);
  color: var(--text-dark);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
  font-family: inherit;
}

ul,
ol,
dl {
  list-style-type: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
}

.container {
  max-width: 132rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  color: inherit;
}

/* App */
.app {
  background-color: var(--white-color);
  box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.1);
  padding: 3rem;
  border-radius: 1rem;
  margin-top: 4rem;
}

.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app__title {
  text-transform: capitalize;
}

.add-todo-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 2rem;
  margin-top: 2rem;
}

input,
textarea,
select {
  font-size: 1.8rem;
  padding: 0.6rem 1.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border-color);
  width: 100%;
  background: #f0f2fa;
  color: var(--text-dark);
  transition: background 0.2s, color 0.2s;
}

.dark input,
.dark textarea,
.dark select {
  background: #232946;
  color: var(--text-dark);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--main-color);
  background: #e3e7fd;
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
  background: #393e5c;
}

.error-msg {
  color: var(--red-color);
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

.description-input-field {
  grid-column: 1/-1;
}

.description-input {
  resize: none;
}

.add-todo-btn {
  max-width: 150px;
  border-radius: 0.8rem;
  padding: 0.6rem 1.8rem;
  font-size: 1.8rem;
  text-transform: capitalize;
  background-color: var(--main-color);
  color: #fff;
}

.todos-section {
  margin-top: 3rem;
  background-color: var(--white-color);
  padding: 3rem;
  border-radius: 1rem;
  box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.1);
}

.todos__form {
  display: flex;
  flex-direction: column;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-field {
  display: grid;
  grid-template-columns: 20rem 1fr;
}

.filter-field__title {
}

.sorting {
  margin-top: 2rem;
}

.sort-field {
  display: grid;
  grid-template-columns: 20rem 1fr;
}

.todos__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4rem;
}

.todos__header-right {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.todos-section__title {
  text-transform: capitalize;
}

.clear-todos-btn {
  border-radius: 0.8rem;
  padding: 0.6rem 1.8rem;
  font-size: 1.8rem;
  text-transform: capitalize;
  background-color: var(--red-color);
  color: #fff;
  flex-shrink: 0;
  align-self: stretch;
}

.export-type-select {
}

.export-btn {
  border: none;
  outline: none;
  background-color: var(--main-color);
  padding: 0.6rem 1.8rem;
  font-size: 1.8rem;
  text-transform: capitalize;
  border-radius: 0.8rem;
  color: #fff;
}

.todos__list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 4rem;
}

.todos__list-empty-msg {
  font-size: 3rem;
  color: var(--red-color);
}

.todos__list .empty-list-icon {
  display: none;
  width: 40rem;
}

.todos--empty {
  align-items: center;
  justify-content: center;
}

.todos--empty .empty-list-icon {
  display: inline-block;
}

/* Todo */
.todo {
  border: none;
  padding: 2rem 2.5rem;
  border-radius: 1.2rem;
  box-shadow: 0 4px 24px 0 rgba(108, 99, 255, 0.1), 0 1.5px 6px 0 var(--badge-color);
  background: linear-gradient(135deg, var(--white-color) 80%, var(--badge-color) 100%);
  transition: box-shadow 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.dark .todo {
  background: linear-gradient(135deg, #232946 80%, #393e5c 100%);
  box-shadow: 0 4px 24px 0 rgba(163, 133, 255, 0.1), 0 1.5px 6px 0 var(--badge-color);
}

.todo--active {
  filter: grayscale(100%) opacity(0.7);
}

.todo--active .todo__title,
.todo--active .todo__desc {
  text-decoration: line-through;
}

.todo__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.todo__header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.todo__header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.todo__timer-indicator {
  color: var(--text-light);
}

.todo__title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--main-color);
  letter-spacing: 0.5px;
}

.todo__cat {
  background-color: var(--badge-color);
  color: var(--main-color);
  font-size: 1.2rem;
  display: flex;
  text-align: center;
  padding: 0.2rem 1.2rem;
  border-radius: 10rem;
  font-weight: 500;
}

.todo__body {
  margin-top: 1rem;
}

.todo__desc {
  color: var(--text-light);
  font-size: 1.5rem;
}

.todo__footer {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.todo__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.todo__action-btn {
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  background-color: var(--badge-color);
  transition: background-color 150ms, color 150ms;
  color: var(--main-color);
  font-weight: 600;
}

.todo__action-btn:hover {
  background-color: var(--main-color);
  color: var(--white-color);
}

.todo__time {
  color: var(--text-light);
}

/* Theme Toggler */

.theme-toggler {
  width: 5rem;
  height: 5rem;
  background-color: var(--badge-color);
  border-radius: 50%;
  cursor: pointer;
  color: var(--main-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggler .moon-icon {
  display: none;
}

.dark .theme-toggler .moon-icon {
  display: inline-block;
}

.dark .theme-toggler .sun-icon {
  display: none;
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--loader-bg);
  backdrop-filter: blur(5px);
}

.loader--stop {
  display: none;
}

.loading {
  width: 5rem;
  height: 5rem;
  border: 4px solid var(--main-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

/* Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive */

@media screen and (max-width: 768px) {
  .add-todo-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 576px) {
  .add-todo-form {
    grid-template-columns: 1fr;
  }

  .add-todo-btn {
    max-width: unset;
  }

  .todo__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .todo__actions {
    gap: 0.5rem;
  }

  .icon {
    width: 18px;
    height: 18px;
  }
}
