/* Globals */

:root {
  --bright-blue: hsl(220, 98%, 61%);
  --check-background: hsl(192, 100%, 67%);
  --shadow-color: rgba(0, 0, 0, 0.15);

  --background-image: url("images/bg-mobile-light.jpg");
  --background-image-desktop: url("images/bg-desktop-light.jpg");
  --background-color: hsl(233, 11%, 84%);
  --text-main: hsl(0, 0%, 98%);
  --text-secondary: hsl(236, 9%, 61%);
  --secondary-accent-color-light: hsl(236, 33%, 92%);

  --surface-background-color: hsl(0, 0%, 98%);
  --list-item-text: hsl(235, 19%, 35%);
  --list-item-checkbox: hsl(236, 33%, 92%);

  /* Colors to set up */
  --dark-theme-very-dark-blue: hsl(235, 21%, 11%);
  --dark-theme-very-dark-desaturated-blue: hsl(235, 24%, 19%);
  --dark-theme-light-grayish-blue: hsl(234, 39%, 85%);
  --dark-theme-light-grayish-blue-hover: hsl(236, 33%, 92%);
  --dark-theme-dark-grayish-blue: hsl(234, 11%, 52%);
  --dark-theme-very-dark-grayish-blue: hsl(233, 14%, 35%);
  --dark-theme-very-dark-grayish-blue-hover: hsl(237, 14%, 26%);
}

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

img {
  max-width: 100%;
}

body {
  font-size: 18px;
  font-family: 'Josefin Sans', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image: var(--background-image);
  background-repeat: no-repeat;
  background-color: var(--background-color);
}

@media screen and (min-width: 376px) {
  body {
    background-image: var(--background-image-desktop);
  }
}

@media screen and (min-width: 1440px) {
  body {
    background-size: 100vw;
  }
}

p {
  font-size: 1rem;
}

h2 {
  text-transform: uppercase;
  letter-spacing: .5rem;
  color: var(--text-main);
  margin: 1rem 0;
}

@media screen and (min-width: 376px) {
  h2 {
    margin-top: 2em;
    margin-bottom: 1.5em;
  }
}

input {
  caret-color: var(--bright-blue);
}

/* Layout */

.container {
  margin: 0 auto;
  max-width: 87%;
  flex: 1 0 auto;
}

@media screen and (min-width: 500px) {
  .container {
    max-width: 475px;
  }
}

.visual-container {
  margin-bottom: 1em;
  background-color: var(--surface-background-color);
  box-shadow: 0 0 4rem var(--shadow-color);
  border-radius: .25rem;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1em;
}

.center {
  margin: 0 auto;
}

.text-subtle {
  color: var(--text-secondary);
  font-size: .75rem;
  padding: .5rem 0;
}

.padding-0 {
  padding: 0;
}

/* Icons */

#theme-switcher-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.close-icon {
  border-radius: 50%;
}

/* Main title */

.main-title {
  margin: 1.75rem 0 .75rem 0;
  padding: 0;
}

#theme-switcher {
  all: unset;
  padding: .5rem;
}

#theme-switcher:hover,
#theme-switcher:focus-visible {
  cursor: pointer;
  opacity: .5;
  outline: 2px solid var(--bright-blue);
  background-color: var(--bright-blue);
}

/* Todo create form */

#todo-create-form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--surface-background-color);
  padding: .5em .7em;
  border-radius: .25rem;
  margin-bottom: 1em;
}

#todo-create-form input::placeholder {
  font-size: .85rem;
  color: var(--text-secondary);
}

.todo-create-form--text-input {
  border: none;
  background-color: transparent;
  font-size: 1rem;
  font-family: 'Josefin Sans', sans-serif;
  width: 100%;
  padding: .1rem;
  line-height: 2rem;
  color: var(--list-item-text);
}

.todo-create-form--checkbox-input {
  padding: .5rem;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
}

.todo-create-form--text-input:focus {
  outline: none;
}

input[type="checkbox"] {
  border-radius: 50%;
}

/* Todo Items */

#todo-list {
  padding: 0;
  list-style: none;
  margin: 0;
}

.todo-item {
  border-bottom: 1px solid var(--secondary-accent-color-light);
  padding: .75em .7em;
}

.todo-item label {
  color: var(--list-item-text);
  font-size: .75rem;
  align-self: center;
  cursor: pointer;
}

@media screen and (min-width: 500px) {
  .todo-item {
    font-size: 1rem;
  }
}

.todo-item-button {
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem;
  font-family: 'Josefin Sans', sans-serif;
  display: flex;
  align-items: center;
}

.todo-item-button:hover {
  cursor: pointer;
  background-color: var(--shadow-color);
  color: var(--list-item-text);
}

.todo-item-checkbox {
  width: 1.6em;
  height: 1.6em;
  margin-right: .75rem;
  border-radius: 50%;
  border: 1px solid var(--list-item-checkbox);
  appearance: none;
  outline: none;
  cursor: pointer;
}

.todo-item-checkbox:checked {
  background-color: var(--check-background);
  border: none;
  background-image: url('images/icon-check.svg'), linear-gradient(to bottom right, hsl(192, 100%, 67%), hsl(280, 87%, 65%));
  background-repeat: no-repeat;
  background-position: center;
}

.todo-item-checkbox span {
  color: var(--list-item-text);
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
}

.todo-item-checkbox:checked + span {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.todo-item-clear-button {
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 700;
  padding: .5rem;
  font-family: 'Josefin Sans', sans-serif;
}

.todo-item-clear-button:hover {
  cursor: pointer;
  color: var(--list-item-text);
}

.empty-item {
  padding: .5em 0;
}

/* Item Filter List */

#mobile-item-filter-list {
  display: block;
}

#desktop-item-filter-list {
  display: none;
}

@media screen and (min-width: 500px) {
  #mobile-item-filter-list {
    display: none;
  }

  #desktop-item-filter-list {
    display: block;
  }
}

.item-filter-list {
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: .5rem ;
}

.item-filter-list-item {
  padding: 0 .5rem;
  font-size: .9rem;
  font-weight: 700;
}

.item-filter-list-button {
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 700;
  font-family: 'Josefin Sans', sans-serif;
}

.item-filter-list-button:hover {
  cursor: pointer;
  color: var(--list-item-text);
}

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

button.item-filter-active:hover {
  color: var(--bright-blue);
}

/* Drag and drop text */

.drag-drop-instruction {
  text-align: center;
  margin-top: 1.5em;
  color: var(--text-secondary);
  font-size: .9rem;
}

/* Frontend Mentor Attribution */

footer {
  margin-top: auto;
}

.attribution {
  font-size: 11px; 
  color: var(--text-secondary);
  text-align: center; 
}

.attribution a {
  color: hsl(228, 45%, 44%); 
}