@import url('https://fonts.cdnfonts.com/css/josefin-sans');

:root {

  /*Colors*/
  /*Primary*/
  --bright-blue: hsl(220, 98%, 61%);
  --check-background-start: hsl(192, 100%, 67%);
  --check-background-end: hsl(280, 87%, 65%);
  /*Neutral*/
  /*Light Theme*/
  --very-light-gray: hsl(0, 0%, 98%);
  --very-light-grayish-blue: hsl(236, 33%, 92%);
  --light-grayish-blue-1: hsl(233, 11%, 84%);
  --dark-grayish-blue-1: hsl(236, 9%, 61%);
  --very-dark-grayish-blue-1: hsl(235, 19%, 35%);
  /*Dark Theme*/
  --very-dark-blue: hsl(235, 21%, 11%);
  --very-dark-desaturated-blue: hsl(235, 24%, 19%);
  --light-grayish-blue-2: hsl(234, 39%, 85%);
  --light-grayish-blue-hover: hsl(236, 33%, 92%);
  --dark-grayish-blue-2: hsl(234, 11%, 52%);
  --very-dark-grayish-blue-2: hsl(233, 14%, 35%);
  --very-dark-grayish-blue-3: hsl(237, 14%, 26%);

  --font-size: 16px;
  --font-weight-normal: 400;
  --font-weight-bold: 700;

}

* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  margin: 0;
  color: var(--light-grayish-blue-2);
  background-color: var(--very-dark-blue);
  font-size: var(--font-size);
  font-weight: var(--font-weight-normal);
  font-family: 'Josefin Sans', sans-serif;
}

body.light {
  color: var(--very-dark-grayish-blue-1);
  background-color: hsl(0, 0%, 98%);
}

button,
input {
  background-color: transparent;
  border: none;
  outline: none;
}

button {
  padding: 0;
  cursor: pointer;
}

ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

/* APP */

.app {
  margin: 0 auto;
  padding-top: 100px;
  padding-bottom: 20px;
  max-width: 600px;
}

.app__title {
  margin-top: 0;
  margin-bottom: 50px;
  letter-spacing: 10px;
  color: white;
}

.bg {
  position: absolute;
  height: 320px;
  width: 100%;
  background-image: url("https://images.unsplash.com/photo-1676113139624-1712f26a9372?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  z-index: -1;
}

.bg.light {
  background-image: url("https://images.unsplash.com/photo-1676798531090-1608bedeac7b?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80");
}

/* MODE */

.app__header {
  display: flex;
}

.change-mode {
  width: 30px;
  height: 30px;
  margin-left: auto;
  background-image: url('./images/icon-sun.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.change-mode.light {
  background-image: url('./images/icon-moon.svg');
}

/* TODO */

.todo {
  border-radius: 0 0 5px 5px;
}

.todo__new {
  display: flex;
  align-items: center;
  height: 60px;
  margin-bottom: 20px;
  padding-left: 20px;
  padding-right: 20px;
  background-color: #25273C;
  border-radius: 5px;
}

.todo.light .todo__new,
.todo.light .todo__item,
.todo__footer.light,
.todo__footer-mobile.light {
  background-color: hsl(0, 0%, 98%);
}

.todo.light .todo__item {
  border-bottom: 1px solid var(--light-grayish-blue-1);
}

.todo.light .todo__item button:first-child {
  border: 1px solid var(--light-grayish-blue-1);
}

.todo.light .todo__item button.completed ~ .todo__text {
  color: var(--light-grayish-blue-1);
}

.todo__footer.light,
.todo__footer.light button,
.todo.light .todo__new input::placeholder {
  color: var(--dark-grayish-blue-1);
}

.todo.light .todo__new input,
.todo__footer.light button:hover {
  color: var(--very-dark-grayish-blue-1);
}

.todo.light {
  box-shadow: 0px 20px 30px rgba(119, 110, 110, 0.15);
}

.todo__new input {
  width: 100%;
  color: var(--light-grayish-blue-2)
}

.todo__new input::placeholder {
  color: var(--very-dark-grayish-blue-2);
}

.todo__list {
  border-radius: 5px 5px 0 0;
  overflow: hidden;
}

.todo__item {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
  padding-left: 20px;
  padding-right: 20px;
  background-color: #25273C;
  border-bottom: 1px solid var(--very-dark-grayish-blue-2);
}

.todo__item.selected {
  background-color: rgba(56, 50, 61, 0.484);
  opacity: 0.6;
}
.todo__item.selected-sub {
  opacity: 0.5;
}

.todo.light .todo__item.selected {
  background: linear-gradient(90deg, hsla(192, 100%, 67%, 0.585), hsla(280, 87%, 65%, 0.442));
  opacity: 0.6;
}

.todo__check {
  width: 20px;
  height: 20px;
  margin-right: 20px;
  border: 1px solid var(--dark-grayish-blue-2);
  border-radius: 50%;
}

.todo__check.completed {
  position: relative;
  background: linear-gradient(hsl(192, 100%, 67%), hsl(280, 87%, 65%));
  overflow: hidden;
}

.todo__check.completed::before {
  content: '';
  top: 0;
  left: 1px;
  width: 100%;
  height: 100%;
  position: absolute;
  background-image: url('./images/icon-check.svg');
  background-repeat: no-repeat;
  background-position: center center;
}

.todo__check.completed ~ .todo__text {
  color: var(--very-dark-grayish-blue-2);
  text-decoration: line-through;
}

.todo__text {
  flex: 1;
  max-width: 70%;
}

.todo__add-sub-item {
  width: 16px;
  height: 16px;
  margin-left: auto;
  background-image: url('./images/add.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity .2s ease-in-out;
}

.todo__edit-item {
  width: 14px;
  height: 14px;
  margin-left: 20px;
  background-image: url('./images/pen.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity .2s ease-in-out;
}
.todo__item.sub-item .todo__edit-item {
  margin-left: auto;
}

.todo__edit-item.ok,
.todo__add-sub-item.ok {
  background-image: url('./images/ok.png');
}

.todo__edit-item:hover,
.todo__delete-item:hover,
.todo__add-sub-item:hover {
  opacity: 0.7;
}

.todo__edit-input {
  padding: 0;
  width: 80%;
  font-size: var(--font-size);
  font-weight: var(--font-weight-normal);
  font-family: 'Josefin Sans', sans-serif;
  color: var(--light-grayish-blue-2);
  border-bottom: 1px solid var(--light-grayish-blue-2);
}

.todo.light .todo__edit-input {
  color: var(--very-dark-grayish-blue-2);
}

.todo__delete-item {
  width: 14px;
  height: 14px;
  margin-left: 20px;
  background-image: url('./images/icon-cross.svg');
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity .2s ease-in-out;
}

.sub-item-input {
  position: absolute;
  top: 47px;
  right: 80px;
  padding: 10px 20px;
  width: 60%;
  border: 1px solid var(--very-dark-grayish-blue-2);
  color: var(--dark-grayish-blue-1);
  background-color: #25273C;
  z-index: 1;
}

.todo.light .sub-item-input {
  border: 1px solid var(--light-grayish-blue-1);
  color: var(--very-dark-grayish-blue-2);
  background-color: #FAFAFA;
}

.todo__item:last-child .sub-item-input {
  top: 10px;
  right: 112px;
}

.sub-item-input::placeholder {
  color: var(--very-dark-grayish-blue-2);
}
.todo.light .sub-item-input::placeholder {
  color: #dadada;
}

.sub-item {
  padding-left: 50px;
  background-color: #2c2e46;
}
.todo.light .todo__item.sub-item {
  background-color: #f1f1f1;
}

.todo__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding-left: 20px;
  padding-right: 20px;
  font-size: 12px;
  color: var(--very-dark-grayish-blue-2);
  background-color: #25273C;
  border-radius: 0 0 5px 5px;
}

.todo__footer-filter button,
.todo__footer-mobile button {
  margin-left: 10px;
  margin-right: 10px;
  font-weight: var(--font-weight-bold);
  color: var(--very-dark-grayish-blue-2);
  transition: color .2s ease-in-out;
}

.todo__footer-filter button:hover,
.todo__footer-mobile button:hover {
  color: var(--light-grayish-blue-hover);
}

.todo__clear-completed {
  color: var(--very-dark-grayish-blue-2);
  transition: color .2s ease-in-out;
}

.todo__clear-completed:hover {
  color: var(--light-grayish-blue-hover);
}

.todo__footer-filter button.active,
.todo__footer-mobile button.active {
  color: hsl(220, 98%, 61%);
}

.drag-and-drop {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  font-size: 12px;
  color: #4f5166;
}

.change-image-button {
  position: absolute;
  transform: translateY(-30px);
  width: 20px;
  height: 20px;
  background-image: url('./images/landscape.png');
  background-repeat: no-repeat;
  background-size: contain;
}

.change-image-input {
  position: absolute;
  color: white;
  transform: translate(30px, -30px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.681);
}

.change-image-input::placeholder {
  color: rgba(255, 255, 255, 0.434);
}

.close-image-input {
  position: absolute;
  transform: translate(200px, -30px);
  width: 20px;
  height: 20px;
  background-image: url('./images/close.png');
  background-repeat: no-repeat;
  background-size: contain;
}

/* FOLDERS */

.folders {
  display: flex;
}

.folders ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 5px 20px;
  background-color: #25273C;
  border-radius: 6px;
  border-bottom: 1px solid var(--very-dark-grayish-blue-2);
}

.todo.light .folders ul {
  background-color: var(--very-light-gray);
  border-bottom: 1px solid var(--light-grayish-blue-1);
}

.folders ul.empty {
  padding: 0;
}

.folders button {
  font-size: 12px;
  color: var(--dark-grayish-blue-1);
  background-color: #25273C;
  border-radius: 3px;
  transition: color .2s ease-in-out;
}
.folders button:hover {
  color: var(--light-grayish-blue-2);
}
.todo.light .folders button:hover {
  color: var(--very-dark-blue);
}

.todo.light .folders button {
  color: var(--dark-grayish-blue-1);
  background-color: var(--very-light-gray);
}

#add-folder,
#show-folders {
  padding: 5px 15px;
  border-bottom: 1px solid var(--very-dark-grayish-blue-2);
}

.todo.light #add-folder,
.todo.light #show-folders {
  border-bottom: 1px solid var(--light-grayish-blue-1);
}

#add-folder {
  position: relative;
}

#show-folders {
  display: none;
}

.rename-folder-input {
  width: 70px;
  font-size: 12px;
  color: var(--light-grayish-blue-2);
  text-decoration: underline;
}
.todo.light .rename-folder-input {
  color: black;
}

.folders button .delete-folder-button {
  margin-left: 5px;
  font-size: 8px;
  transform: translateY(-2px);
}

/* FOLDER MENU */

.folder {
  position: relative;
}

.folder-menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100px;
  padding: 10px;
  font-size: 12px;
  background-color: #25273C;
  border-radius: 2px;
  box-shadow: 0 2px 10px 2px rgba(0,0,0,0.2);
  z-index: 2;
}

.todo.light .folder-menu {
  background-color: var(--very-light-gray);
}

.folder-menu button {
  background-color: transparent;
}

.folder.active {
  color: var(--light-grayish-blue-2);
  font-weight: bold;
}

.todo.light .folder.active {
  color: black;
}

.import-label {
  cursor: pointer;
}

#input-file {
  position: absolute;
  opacity: 0;
  visibility: hidden;
}


@media (max-width: 650px) {

 .app {
  margin-right: 20px;
  margin-left: 20px;
  padding-bottom: 20px;
 }

}

@media (max-width: 550px) {

  body {
    font-size: 14px;
  }

  .bg {
    height: 314px;
    background-image: url('./images/bg-dark-small.jpg');
  }

  .bg.light {
    background-image: url('./images/bg-light-small.jpg');
  }

  .todo__edit-input {
    font-size: 14px;
  }

  .todo__footer-mobile {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    height: 60px;
    margin-top: 20px;
    padding-left: 20px;
    padding-right: 20px;
    border-radius: 5px;
    background-color: #25273C;
  }

  .drag-and-drop {
    display: none;
  }

}