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

img,
picture,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border-color: transparent;
}

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

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

:root {
  /*Gradient colors*/
  --check-background: linear-gradient(hsl(192, 100%, 67%), hsl(280, 87%, 65%));

  /*Borders*/
  --border-color: hsl(233, 11%, 84%);

  /*Font Weight*/
  --font-weight-regular: 400;
  --font-weight-bold: 700;

  /*Background Images and colors*/
  --bg-image-mobile-light: url(images/bg-mobile-light.jpg);
  --bg-image-mobile-dark: url(images/bg-mobile-dark.jpg);
  --bg-image: var(--bg-image-mobile-light);
  --bg-image-desktop-light: url(images/bg-desktop-light.jpg);
  --bg-image-desktop-dark: url(images/bg-desktop-dark.jpg);
  --bg-image-desktop: var(--bg-image-desktop-light);

  /*Background Colors*/
  --input-background: hsl(0, 0%, 100%);
  --background-color: hsl(0, 0%, 98%);

  /*Font Colors*/
  --heading-color: hsl(0, 0%, 98%);
  --font-list-color: hsl(236, 9%, 61%);
  --font-list-complete-light: hsl(233, 11%, 84%);
  --font-list-complete-dark: hsl(235, 16%, 43%);
  --font-list-completed: var(--font-list-complete-light);
  --filter-button-light: hsl(236, 9%, 61%);
  --filter-button-dark: hsl(235, 16%, 43%);
  --filter-button-color: var(--filter-button-light);
  --input-caret-color: hsl(220, 98%, 61%);

  /*Icon Images*/
  --icon-moon: url(images/icon-moon.svg);
  --icon-sun: url(images/icon-sun.svg);
  --header-icon: var(--icon-moon);

  /*Hover and Active state colors*/
  --button-hover-light: hsl(235, 24%, 19%);
  --button-hover-dark: hsl(0, 0%, 98%);
  --button-hover: var(--button-hover-light);
  --filter-button-active: hsl(220, 98%, 61%);
  --completed-hover-light: hsl(237, 14%, 26%);
  --completed-hover-dark: hsl(0, 0%, 98%);
  --completed-hover: var(--completed-hover-light);
}

/*=== General Styles ===*/
html,
body {
  min-height: 100vh;
}

html {
  font-family: Josefin Sans, sans-serif;
  font-size: 1.125rem;
}

body {
  background-image: var(--bg-image);
  background-color: var(--background-color);
  background-repeat: no-repeat;
  background-size: contain;
  padding: 2.7rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.dark {
  --background-color: hsl(235, 21%, 11%);
  --bg-image: var(--bg-image-mobile-dark);
  --header-icon: var(--icon-sun);
  --border-color: hsl(237, 14%, 26%);
  --input-background: hsl(235, 24%, 19%);
  --button-hover: var(--button-hover-dark);
  --font-list-completed: var(--font-list-complete-dark);
  --completed-hover: var(--completed-hover-dark);
  --filter-button-color: var(--filter-button-dark);
}

/*=== Header Section ===*/
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 30rem;
}

h1 {
  font-size: 1.4rem;
  color: var(--heading-color);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.6rem;
}

.theme-toggle {
  width: 1.1rem;
  height: 1.1rem;
  background-image: var(--header-icon);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  border: none;
  cursor: pointer;
}

/*=== Main Section ===*/
main {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 30rem;
}

/*=== Input Container ===*/
.todo-input-container {
  display: flex;
  align-items: center;
  font-size: 0.7rem;
  width: 100%;
  background-color: var(--input-background);
  padding: 0.7rem 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

::placeholder {
  color: var(--font-list-color);
  opacity: 0.8;
}

.todo-input {
  width: 100%;
  color: var(--font-list-color);
  caret-color: var(--input-caret-color);
}

.todo-input:focus {
  outline: none;
}

.check-placeholder {
  width: 1.11rem;
  height: 1.11rem;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  margin-right: 0.6rem;
}

/*=== Task List - To Do List section ===*/
.ul-container {
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  background-color: var(--input-background);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.list-item {
  display: flex;
  align-items: center;
  font-size: 0.6rem;
  padding: 0.9rem 1rem;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
  justify-content: space-between;
}

.li-container {
  display: flex;
  align-items: center;
  width: 100%;
}

input[type="checkbox"] {
  appearance: none;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--input-background);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: 0.7rem;
  cursor: pointer;
}

input[type="checkbox"]:not(:checked):hover {
  border: 1px solid transparent;
  background: linear-gradient(var(--input-background), var(--input-background))
      padding-box,
    var(--check-background) border-box;
}

input[type="checkbox"]:checked {
  background: url(images/icon-check.svg) center no-repeat,
    var(--check-background);
}

.task-text {
  display: flex;
  align-items: center;
  color: var(--font-list-color);
  letter-spacing: 0.5px;
  cursor: pointer;
}

.list-item.completed .task-text {
  text-decoration: line-through;
  color: var(--font-list-completed);
}

.task-delete {
  width: 0.8rem;
}

.delete-button {
  display: none;
  cursor: pointer;
}

.list-item:hover .delete-button {
  display: block;
}

/*=== Status Section ===*/
.status-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  width: 100%;
  background-color: var(--input-background);
  padding: 0.9rem 1rem;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  color: var(--filter-button-color);
  margin-bottom: 1rem;
}

/*=== Filter Section ===*/
.filter-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.8rem;
  font-weight: var(--font-weight-bold);
  width: 100%;
  background-color: var(--input-background);
  padding: 0.9rem 1rem;
  border-radius: 5px;
  color: var(--filter-button-color);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  margin-bottom: 2.5rem;
}

.filter-container-desktop {
  display: none;
}

.filter-all,
.filter-active,
.filter-completed {
  cursor: pointer;
}

.filter-active:hover,
.filter-all:hover,
.filter-completed:hover {
  color: var(--button-hover);
}

.active-filter {
  color: var(--filter-button-active);
}

.clear-completed:hover,
.count:hover {
  color: var(--completed-hover);
}

.hidden {
  display: none;
}

/*=== Text for drag and drop feature ===*/
.drag-drop-text {
  font-size: 0.8rem;
  text-align: center;
  color: var(--filter-button-color);
}

/*=== Media Queries 690px ===*/
@media (min-width: 43.125rem) {
  body {
    background-image: var(--bg-image-desktop);
  }

  body.dark {
    --bg-image-desktop: var(--bg-image-desktop-dark);
  }

  h1 {
    font-size: 2.2rem;
    letter-spacing: 0.8rem;
  }

  .theme-toggle {
    width: 1.5rem;
    height: 1.5rem;
  }

  .todo-input-container {
    padding: 1.05rem 1.5rem;
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .check-placeholder {
    width: 1.38rem;
    height: 1.38rem;
  }

  .list-item {
    font-size: 1rem;
    padding: 1.05rem 1.5rem;
  }

  input[type="checkbox"] {
    margin-right: 1rem;
    width: 1.38rem;
    height: 1.38rem;
  }

  .task-delete {
    width: 1rem;
  }

  .filter-container {
    display: none;
  }

  .filter-container-desktop {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    font-weight: var(--font-weight-bold);
  }

  .status-container {
    margin-bottom: 3rem;
    padding: 1rem 1.5rem;
  }

  .clear-completed,
  .count {
    font-size: 0.75rem;
    color: var(--filter-button-color);
    cursor: pointer;
  }
}
