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

  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #3d3c40;
  --secondary: #313033;
  --accent-1: #4d4b52;
  --background: #1d1d1f;
  --font-primary: #ffffff;
  --font-secondary: #9b98a6;
  --highlight: #6562fc;
  --add-button: #f5f5f5;
  --check-box: #58d6bf;
  --delete: #d66d73;
  --clear-completed-button: #2cadf6;
  --resetAll-button: #f97c1c;
}

::-webkit-scrollbar {
  width: 0;
}

body {
  position: absolute;
  width: 100vw;
  height: 100%;
  overflow: hidden;
  background: var(--background);
  display: flex;
  justify-content: center;
  padding: 50px 20px;
  font-family: "Poppins", sans-serif;
}

li {
  list-style: none;
}

i {
  pointer-events: none;
}

button,
input {
  border: none;
  outline: none;
}

main {
  position: relative;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  text-align: center;
  color: var(--font-primary);
  margin-bottom: 30px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero p {
  font-size: clamp(22px, 2vw, 25px);
}

#day,
#greet {
  text-transform: capitalize;
}

#day {
  color: #58d6bf;
}

.input-wrap {
  width: 400px;
  max-width: 80vw;
  max-height: 50px;
  margin-top: 20px;
  border-radius: 5px;
  background: var(--secondary);
  border: 2px solid var(--highlight);
  display: flex;
  align-items: center;
  overflow: hidden;
}

#list-input {
  flex: 1;
  background: transparent;
  padding: 15px 10px;
  font-size: 18px;
  color: var(--font-primary);
}

#add-button {
  right: 0;
  width: 40px;
  background: var(--accent-1);
  padding: 15px 0;
  cursor: pointer;
  color: var(--add-button);
  font-size: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

#list-input:valid + #add-button {
  pointer-events: fill;
  opacity: 1;
}

#quote {
  position: relative;
  top: 10vh;
  display: none;
  padding: 20px;
  width: 100%;
  max-width: 400px;
}

#quote p {
  text-align: center;
  font-style: italic;
  color: var(--clear-completed-button);
}

#quote footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #58d6bf;
}

#quote footer .quote-control {
  display: flex;
  gap: 20px;
}

#quote footer .quote-control div {
  color: #9b98a6;
  cursor: pointer;
}

#quote-author::before {
  content: "\2010";
  margin-right: 5px;
}

#quote label {
  display: block;
  color: var(--highlight);
  text-align: center;
  margin-top: 30px;
  cursor: pointer;
}

#checklists-container {
  width: fit-content;
  min-height: fit-content;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  background: var(--primary);
  box-shadow: 0 3px 6px #00000029, 0 3px 6px #0000003b;
}

#checklists-container.has-list {
  padding: 20px;
}

#checklists-container::-webkit-scrollbar {
  width: 3px;
}

#checklists-container::-webkit-scrollbar-track {
  background-color: transparent;
  border-radius: 5px;
  margin: 3px 0;
}

#checklists-container::-webkit-scrollbar-thumb {
  background-color: var(--accent-1);
  border-radius: 5px;
  background-clip: content-box;
}

.checklist {
  display: flex;
}

.checklist.remove_item {
  opacity: 0.1;
  transform: translateX(-100%);
  transition: all 0.3s ease-in-out;
}

.checklist__item {
  margin: 0 20px;
  outline: none;
  padding: 5px 10px;
  font-size: 18px;
  resize: none;
  display: block;
  width: 250px;
  max-width: 50vw;
  overflow: hidden;
  background: var(--accent-1);
  color: var(--font-primary);
  cursor: default;
  box-shadow: 0 3px 6px #00000029, 0 3px 6px #0000003b;
  transition: all 0.25s ease-in-out;
}

.checklist__item > div {
  outline: none;
}

.checklist__item[contenteditable="true"] {
  cursor: auto;
}

.checklist__complete-btn,
.checklist__delete-btn {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  background: var(--accent-1);
  cursor: pointer;
  box-shadow: 0 3px 6px #00000029, 0 3px 6px #0000003b;
  text-shadow: 0 3px 6px #00000029, 0 3px 6px #0000003b;
  transition: all 0.25s ease-in-out;
}

.checklist__complete-btn {
  color: var(--check-box);
  border-radius: 5px 0 0 5px;
}

.checklist__delete-btn {
  color: var(--delete);
  border-radius: 0 5px 5px 0;
}

/* --------------- checklist complete style --------------- */

.checklist.completed > .checklist__item {
  text-decoration: line-through;
  pointer-events: none;
  background: var(--secondary);
  color: var(--font-secondary);
}

.checklist.completed > .checklist__complete-btn,
.checklist.completed > .checklist__delete-btn {
  background: var(--secondary);
  color: var(--font-secondary);
}

/* -------------------------------------------------------- */

.list-action {
  margin-top: 10px;
  width: 100%;
  max-width: 300px;
  min-width: 250px;
  display: none;
  justify-content: space-between;
}

#clear-completed {
  color: var(--clear-completed-button);
}

#reset-all {
  color: var(--resetAll-button);
}

.list-action > div {
  cursor: pointer;
}

.list-action > div i {
  margin-right: 5px;
}

#checklists-container.has-list + .list-action {
  display: flex;
}

@media screen and (max-width: 991px) {
  body {
    padding: 20px;
  }

  main {
    max-width: 100vw;
    overflow: hidden;
  }

  #list-input {
    padding: 10px;
    font-size: 14px;
  }

  .checklist__item {
    margin: 0 10px;
  }

  .checklist__complete-btn,
  .checklist__delete-btn {
    width: 40px;
    height: 40px;
  }
}
