@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap");

*,
*::after,
*::before {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: none;
  outline: none;
}

:root {
  --darkGreen: rgb(0, 70, 0);
  --deepGreen: rgb(41, 128, 1);
  --lightGreen: rgba(98, 211, 132, 0.712);
  --gold: rgb(255, 223, 41);
}

html {
  font-size: 62.5%;
  font-family: "Roboto", sans-serif;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--lightGreen);
  border-radius: 10px;
}

body {
  font-size: 1.6rem;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

input {
  display: block;
  width: 100%;
}

i,
button,
input[type="submit"] {
  cursor: pointer;
}

main {
  background: url(../images/bg2.jpg) no-repeat;
  background-position: center;
  background-size: cover;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem;
}

.groceryList {
  background-color: var(--deepGreen);
  padding: 3rem;
  height: 85vh;
  width: 500px;
  max-width: 100%;
  position: relative;
}

.groceryList > h1 {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 2rem;
  color: rgb(255, 223, 41);
}

.groceryList > h1 > a {
  margin-left: 2rem;
}

#searchBar {
  font-size: 1.8rem;
  padding: 0.8rem 1rem;
  margin-bottom: 2rem;
}

#itemInput {
  font-size: 1.8rem;
  padding: 0.8rem 1rem;
  margin-bottom: 2rem;
}

#addBtn {
  width: 140px;
  margin-inline: auto;
  padding: 1rem;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--deepGreen);
  background-color: rgb(255, 223, 41);
}

#itemList {
  margin-top: 5rem;
  text-align: center;
  background-color: var(--gold);
  padding: 2rem;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 2rem;
  height: 45vh;
  overflow-y: auto;
}

#itemList .item {
  background-color: var(--lightGreen);
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.6rem;
  flex-direction: column;
}

.inputController {
  width: 100%;
}

.itemContainer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.4rem;
}

.itemContainer > span {
  color: var(--darkGreen);
  font-size: 1.8rem;
  margin-right: 1rem;
  font-weight: 600;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--darkGreen);
  border-radius: 100%;
}

.itemContainer > textarea {
  flex: 1;
  resize: none;
  color: var(--darkGreen);
  font-family: "Roboto", sans-serif;
  font-size: 1.6rem;
  padding: 1rem;
  height: 4rem;
  text-transform: capitalize;
  background-color: rgb(212, 253, 202);
  font-weight: 500;
  letter-spacing: 1px;
}

.editControllers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.editControllers > i {
  font-size: 1.8rem;
}

.editControllers > i:nth-of-type(1) {
  color: red;
}

.editControllers > i:nth-of-type(2) {
  color: rgb(0, 66, 133);
}

.updateControllers {
  display: none;
  margin-top: 1.4rem;
}

.updateControllers > button {
  font-size: 1.6rem;
  padding: 0.6rem 1rem;
  font-weight: 500;
}

.updateControllers > button:nth-of-type(1) {
  background-color: rgb(0, 66, 133);
  color: gold;
  margin-right: 1rem;
}

.updateControllers > button:nth-of-type(2) {
  color: white;
  background-color: rgb(216, 79, 0);
}

#itemList .item.hide {
  display: none;
}

#clearAll {
  padding: 1rem 3rem;
  font-size: 2.2rem;
  font-weight: 600;
  background-color: rgb(255, 0, 0);
  color: gold;
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

/* Media Queries */

@media (max-width: 768px) {
  html {
    font-size: 55%;
  }
}

@media (max-width: 450px) {
  html {
    font-size: 52.5%;
  }
  .groceryList {
    height: 90vh;
  }
  #itemList {
    height: 50vh;
  }
}
