/* general styles for the page and the todo cards */
body {
  font-family: Arial;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

textarea,
input::placeholder {
  font-size: 0.8rem;
}

select {
  font-size: 0.8rem;
}

html {
  font-size: 62.5%;
}

article {
  margin: 1rem auto;
  width: 80%;
  display: flex;
  flex-direction: column;
}

button {
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0.4rem rgba(36, 35, 35, 0.1);
}

button:hover {
  background-color: #737773;
  transform: translateY(-0.3rem);
  box-shadow: 0 0.7rem 1.4rem rgba(0, 0, 0, 0.2);
}

/* general but specific for the input container  */
input,
textarea,
select {
  background-color: #f8f7f7;
  border: none;
}

input {
  padding-top: 0.07rem;
  padding-bottom: 0.07rem;
  padding-left: 0.5rem;
}

textarea {
  flex: 1;
}

#due-time {
  font-size: 0.8rem;
}

/* styling for the everyting on the input container  */
.input-title,
.input-description {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.input-description {
  height: 4rem;
}

.input-description input,
.input-title input {
  height: 100%;
  flex-grow: 1;
}
.input-due-time,
.input-priority,
.input-tag {
  margin-bottom: 0.5rem;
}

.input-due-time input {
  width: 9.15rem;
}

.input-layer-three {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: space-between;
}

.input-tag > input {
  height: 1.1rem;
  width: 4.5rem;
}

.input-container {
  margin-bottom: 3rem;
  background-color: #ccc;
  padding: 2rem;
  border-radius: 2rem;
}

.add-btn {
  padding: 0.8rem;
  font-size: 0.7rem;
  background-color: #858591;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #f9f9f9;
  margin-top: 1rem;
}

/* everything in the card container and the cards themselves */
.card-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.collapse-priority-container {
  display: flex;
  gap: 0.6rem;
}

.collapse-icons {
  width: 1.5rem;
}

.collapse-btn {
  padding: 0 0.5rem;
  height: 1.5rem;
}

.icon-texts {
  font-size: 0.8rem;
}

.edit-container {
  background-color: #ccc;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.1);
  flex: 1;
}
.editing-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.done-btn,
.cancel-btn {
  background-color: rgb(133, 133, 145);
  display: inline-flex;
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  align-items: center;
  cursor: pointer;
  border: none;
}

.cards {
  background-color: #f9f9f9;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.1);
  flex: 1;
}

/* outline for the edit state of the card
It is made using background gradients and keyframe animation. */
.edit-outline {
  padding: 0.2rem;
  background:
    linear-gradient(90deg, #59635c 50%, #0000 0) repeat-x top,
    linear-gradient(90deg, #59635c 50%, #0000 0) repeat-x bottom,
    linear-gradient(0deg, #59635c 50%, #0000 0) repeat-y left,
    linear-gradient(0deg, #59635c 50%, #0000 0) repeat-y right;
  background-size:
    0.6rem 0.1rem,
    0.6rem 0.1rem,
    0.1rem 0.6rem,
    0.1rem 0.6rem;
  animation: m 20s infinite linear;
  background-color: white;
  outline: none;
  border-radius: 0.3rem;
}

@keyframes m {
  to {
    background-position:
      1.2rem 0,
      -1.2rem 100%,
      0 -1.2rem,
      100% 1.2rem;
  }
}

.icons {
  width: 1.2rem;
  height: 2rem;
  margin-right: 0.2rem;
}

.edit,
.delete {
  background-color: #8d99a5;
  display: inline-flex;
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  align-items: center;
  cursor: pointer;
  border: none;
}

.edit-priority {
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
}

.time-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-container {
  background-color: #8d99a5;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.card-layer-one {
  display: flex;
  justify-content: space-between;
}

.card-layer-four {
  display: flex;
  justify-content: space-between;
}

.card-layer-three {
  display: flex;
  justify-content: space-between;
}

.card-status,
.card-priority {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.card-title {
  margin-bottom: 0;
}

.card-body {
  max-height: 50rem;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
  opacity: 1;
}

.collapsed .card-body {
  max-height: 0;
  opacity: 0;
}

.collapsed {
  max-height: 5rem;
}

/*-------- toggle switch ------- */

/* The switch - the box around the slider */
.switch-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 3rem;
  height: 1.5rem;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The track (background) */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 3rem;
}

/* The circular knob */
.slider:before {
  position: absolute;
  content: "";
  height: 1.1rem;
  width: 1.1rem;
  left: 0.3rem;
  bottom: 0.2rem;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

/* Change background when checked */
input:checked + .slider {
  background-color: #0baa3a;
}

/* Move the knob to the right when checked */
input:checked + .slider:before {
  transform: translateX(1.3rem);
}

@media (max-width: 420px) {
  html {
    font-size: 60%;
  }

  article {
    width: 90%;
  }
}

@media (max-width: 380px) {
  html {
    font-size: 50%;
  }

  article {
    width: 95%;
  }
}

@media (min-width: 580px) {
  html {
    font-size: 75%;
  }

  article {
    width: 70%;
  }
}

@media (min-width: 700px) {
  html {
    font-size: 85%;
  }
}

@media (min-width: 900px) {
  html {
    font-size: 90%;
  }
  article {
    width: 65%;
  }
}

@media (min-width: 1000px) {
  html {
    font-size: 110%;
  }

  article {
    width: 60%;
  }

  .collapse-icons {
    width: 1.4rem;
  }
  .collapse-btn {
    padding: 0.2rem 0.4rem;
    height: 2rem;
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 110%;
  }

  .collapse-icons {
    width: 1.3rem;
  }
  .collapse-btn {
    padding: 0.1rem 0.3rem;
    height: 1.8rem;
  }
}
