/******************************************
/* CSS
/*******************************************/

/* Box Model Hack */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

i,
#addItem {
  cursor: pointer;
}

html {
  display: flex;
  justify-content: center;
  padding-top: 20px;
  background-color: rgba(63, 0, 139, 0.6);
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  width: 600px;
  border: 2px solid black;
  border-radius: 10px;
}

header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

header p {
  text-decoration: underline;
  color: white;
}

/* Container for all todos */
.todo-list {
  display: flex;
  flex-direction: column; /* stack todo-item vertically */
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Each todo item */
.todo-item {
  display: flex;
  flex-direction: row; /* inner layout: checkbox, textarea, icons */
  align-items: center;
  gap: 1rem;
  background-color: rgba(63, 0, 139, 0.4);
  border: 2px solid black;
  border-radius: 10px;
  padding: 1rem 2rem;
}

/* Checkbox */
.todo-item input[type="checkbox"] {
  margin: 0;
}

/* Textarea */
.todo-item textarea {
  appearance: none;
  background: none;
  resize: none;
  height: 20px;
  flex: 1 1 0%;
  border-radius: 5px;
  color: white;
  padding-left: 5px;
}
/* Source: tyler potts(https://www.youtube.com/watch?v=6eFwtaZf6zc&t=11s) & (https://www.youtube.com/watch?v=3OqWCGVaOkA&t=604s)
 */
.todo-item textarea:not(:disabled) {
  text-decoration: underline;
}

.todoItem:hover,
/* Source: tyler potts(https://www.youtube.com/watch?v=6eFwtaZf6zc&t=11s) & (https://www.youtube.com/watch?v=3OqWCGVaOkA&t=604s)
 */
.todoItem:focus-within {
  outline: 2px solid white;
}


/* Completed todo item */
.todo-item textarea.completed {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.5);
}


.todo-item textarea::placeholder {
  color: white;
  padding-top: 2px;
}

/* Icons */
.icons {
  display: flex;
  gap: 1rem;
}

.icons i:hover {
  opacity: .5;
}
.fa-trash:hover{
    color: red;
}
#addItem:hover{
  color: yellow;
}

/* Footer */
h3 {
  margin-top: 20px;
}

footer {
  font-size: x-small;
  text-align: center;
}
@media screen and (max-width: 650px) {
  body{
  margin: .5rem;
  }
}
@media screen and (max-width: 350px) {
  .todo-item{
    flex-direction: column;
  }
  #addItem{
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}