:root {
  /* Common colors */
  --bright-blue: hsl(220, 98%, 61%);
  --check-gradient: linear-gradient(to bottom right, hsl(192, 100%, 67%), hsl(280, 87%, 65%));

  /* Dark Theme (default) */
  --bg-desktop: url('../images/bg-desktop-dark.jpg');
  --bg-mobile: url('../images/bg-mobile-dark.jpg');
  --bg-main: hsl(235, 21%, 11%);
  --bg-todo: hsl(235, 24%, 19%);
  --text-title: hsl(236, 33%, 92%);
  --text-active: hsl(236, 33%, 92%);
  --text-primary: hsl(234, 39%, 85%);
  --text-secondary: hsl(235, 16%, 43%);
  --text-muted: hsl(233, 14%, 35%);
  --todo-border: hsl(237, 14%, 26%);
  --shadow: 0 35px 50px -15px rgba(0, 0, 0, 0.3);

  /* Typography */
  --ff: 'Josefin Sans', arial;
  --fw-normal: 400;
  --fw-bold: 700;

  --transition: 300ms;
}

[data-theme="light"] {
  --bg-desktop: url('../images/bg-desktop-light.jpg');
  --bg-mobile: url('../images/bg-mobile-light.jpg');
  --bg-main: hsl(0, 0%, 98%);
  --bg-todo: hsl(0, 0%, 98%);
  --text-title: hsl(0, 0%, 98%);
  --text-active: hsl(235, 19%, 35%);
  --text-primary: hsl(235, 19%, 35%);
  --text-secondary: hsl(236, 9%, 61%);
  --text-muted: hsl(236, 9%, 61%);
  --todo-border: hsl(234, 39%, 85%);
  --shadow: 0 35px 50px -15px rgba(194, 195, 214, 0.6);
}

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

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
textarea,
select {
  font: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-main);
  font-family: var(--ff);
  font-size: 1.125rem;
  font-weight: var(--fw-normal);
  color: var(--text-primary);
  position: relative;
}

.hero {
  position: absolute;
  top: 0;
  width: 100%;
  background: var(--bg-desktop);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  height: 15.625rem;
  z-index: -1;
}

@media (max-width: 48em) {
  .hero {
    background: var(--bg-mobile);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
}

main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding-block: 5rem;
}

.wrapper {
  width: 100%;
  max-width: 40rem;
  padding-inline: 2rem;
}

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

h1 {
  letter-spacing: 14px;
  color: var(--text-title);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  font-size: 2.5rem;
}

.theme-switch {
  background: transparent;
  border: none;
}

.input-container {
  background-color: var(--bg-todo);
  color: var(--text-primary);
  box-shadow: var(--shadow);
  padding: 1rem 1.5rem;
  border-radius: .5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.error-msg {
  color: rgb(255, 0, 0, 0.8);
  font-size: .75rem;
}

.error-msg.hidden {
  display: none;
}

.input-container input {
  background: transparent;
  width: 100%;
  border: none;
  outline: none;
  color: var(--text-primary);
  caret-color: var(--bright-blue);
}

.check-box {
  width: 25px;
  aspect-ratio: 1;
  background: transparent;
  border: 1px solid var(--todo-border);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

/* only applies when not checked */
.check-box:hover:not(.checked) {
  border: 1px solid transparent;
  background: var(--check-gradient);
}

.check-box:hover:not(.checked)::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  background: var(--bg-todo);
  border-radius: 50%;
}

.check-box.checked {
  background: var(--check-gradient);
}

.check-box.checked::after {
  content: url(../images/icon-check.svg);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tasks-wrapper {
  background-color: var(--bg-todo);
  color: var(--text-primary);
  border-radius: .5rem;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  --padding: 1.25rem 1.5rem;
}

.todo-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--padding);
}

.todo-task.dragging {
  background-color: hsla(220, 98%, 61%, 0.1);
}

.empty-state {
  text-align: center;
  font-size: 1.25rem;
  padding: var(--padding);
}

.flex-spacing {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.delete-todo {
  border: none;
  background: transparent;
}

@media (min-width: 48em) {
  .delete-todo {
    opacity: 0;
    transition: var(--transition);
  }

  .todo-task:hover .delete-todo {
    opacity: 1;
  }
}

.task-text {
  transform: translateY(3px);
}

.task-text.checked {
  text-decoration: line-through;
  color: var(--text-muted);
}

.line {
  position: relative;
}

.line::before {
  content: '';
  position: absolute;
  top: 100%;
  width: 100%;
  height: 1px;
  background-color: var(--todo-border);
}

.record {
  padding: var(--padding);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  color: var(--text-secondary);
}

.clear-completed {
  transition: var(--transition);
  cursor: pointer;
}

.clear-completed:hover {
  color: var(--text-active);
}

.filters {
  color: var(--text-secondary);
  font-weight: var(--fw-bold);
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.filter-option {
  cursor: pointer;
  transition: var(--transition);
}

.filter-option:hover {
  color: var(--text-active);
}

.filter-option.active {
  color: var(--bright-blue);
}

.filters.mobile-only {
  display: none;
  background-color: var(--bg-todo);
  padding: 1rem 1.5rem 0.7rem 1.5rem;
  border-radius: .5rem;
}

@media (max-width: 48em) {
  .record .filters {
    display: none;
  }

  .filters.mobile-only {
    display: flex;
  }
}

.bottom-text {
  display: flex;
  justify-content: center;
  font-size: 1rem;
  margin-top: 3.5rem;
  color: var(--text-muted);
}