/* Google Fonts import */
@import url("https://fonts.googleapis.com/css2?family=Asap:ital,wght@0,100..900;1,100..900&family=Martel+Sans:wght@200;300;400;600;700;800;900&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap");

/* General wildcard styles to override browser defaults */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global styles */

/* main body text */
html,
body {
  font-family: "Martel Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
  text-align: center;
  background-color: #fcfcfc;
  width: 100%;
  overflow-x: hidden;
  /* prevent horizontal overflow */
}

/* primary header text */
h1 {
  font-family: "Asap", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: italic;
  font-variation-settings: "wdth" 100;
}

/* secondary header text */
h2 {
  font-family: "Raleway", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
}

/* Error message styles */
.error-message {
  color: #d32f2f;
  font-size: 0.9em;
  margin: 5px 0;
  display: none;
  padding: 0 16px;
}

/* hidden style */
.hidden {
  display: none;
}

/* LANDING PAGE */
#landing-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100vh;
  background: url("../images/grocery-basket-hero-img.webp") no-repeat center
    center/cover;
}

/* hero section */
#hero-section {
  background: rgba(55, 71, 79, 0.5);
  /* Dark overlay for better text readability */
  padding: 20px;
  border-radius: 10px;
  color: #fcfcfc;
}

#hero-content > h1 {
  color: #ffeb3b;
}

#hero-paragraph {
  color: #b2ebf2;
}

/* logo img */
h1 > img {
  max-height: 40px;
}

/* buttons */
.cta-button {
  background-color: #477116;
  color: #fcfcfc;
  font-family: "Raleway", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  border: none;
  padding: 10px 30px;
  font-size: 1em;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-shadow: inset -11px 18px 10px 0px rgba(252, 252, 252, 0.3);
  margin: 10px 10px;
}

.cta-button:hover {
  background-color: #8bc34a;
  font-weight: 800;
  text-shadow: 2px 2px 8px #0b1a06;
}

/* signout button */
#sign-out-btn {
  padding: 5px 10px;
  font-size: 0.6em;
}

/* credits div */
#credits {
  margin-top: 10px;
  font-size: 0.8em;
}

#credits a {
  color: #fcfcfc;
}

/* input box */
input {
  width: 70%;
  max-width: 300px;
  font-size: 16px;
  padding: 1px;
  margin: 1px 0;
}

/* login error container */
#login-error {
  background: rgb(255 255 255 / 70%);
}

/* auth-form */
.auth-form {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

/* Media query: tablets and larger (>=768px) */
@media screen and (min-width: 768px) {
  /* landing page div */
  #hero-section {
    width: 70%;
    padding: 40px 30px;
  }

  /* hero content */
  #hero-content > h1 {
    font-size: 3em;
  }

  #hero-paragraph {
    font-size: 1.5em;
  }

  /* button */
  .cta-button {
    font-size: 1.2em;
  }

  /* credits div */
  #credits {
    margin-top: 20px;
    font-size: 0.8em;
  }
}

/* Media query: laptops and larger (>=992px) */
@media screen and (min-width: 992px) {
  /* landing page div */
  #hero-section {
    padding: 20px 10px;
  }

  /* hero content */
  #hero-content > h1 {
    font-size: 5em;
    padding-bottom: 10px;
  }

  #hero-paragraph {
    font-size: 2.5em;
    padding-bottom: 10px;
  }

  /* button */
  .cta-button {
    font-size: 1.5em;
    padding: 15px 10px;
    margin: 10px 20px;
  }

  /* credits div */
  #credits {
    margin-top: 50px;
    font-size: 1.2em;
  }
}

/* TRACKER PAGE */
header {
  background-color: rgb(255, 235, 59, 0.3);
  color: #37474f;
  padding: 10px 5px;
}

/* application area */
#app-area {
  position: relative;
  padding: 0 10%;
  text-align: left;
  margin: 10px 0;
}

/* category area */
.category-area {
  margin: 10px 0;
  border: solid #b2ebf2;
}

/* category heading */
.category-heading {
  margin-bottom: 10px;
  background-color: #b2ebf2;
  width: 100%;
  height: 35px;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3px;
}

/* new item input area */
.add-item-area,
.shop-list {
  padding-left: 1rem;
}

/* new item/category input box */
.add-item,
.add-category {
  width: 70%;
  max-width: 300px;
  font-size: 16px;
  padding: 1px;
}

/* grocery lists */
.shop-list {
  list-style: none;
}

/* ticked-off item style */
.ticked-off {
  text-decoration: line-through;
  text-shadow: 1px 1px 15px #8bc34a;
}

/* to modify the ticked icon */
.ticked-shadow {
  text-shadow: 1px 1px 15px #8bc34a;
}

/* button generic styles */
button {
  height: fit-content;
  width: fit-content;
  font-size: 16px;
  padding: 2px;
  vertical-align: baseline;
  box-shadow: 1px 1px 5px 1px #37474f;
  background-color: #fcfcfc;
  border: none;
}

/* add category button */
.add-category-btn,
.add-item-btn {
  color: #8bc34a;
  margin-left: 5px;
}

/* delete button */
.dlt-category-btn,
.dlt-item-btn {
  color: #d32f2f;
  background: none;
  border-radius: 40%;
}

/* toggle list button */
.toggle-list-btn {
  color: #37474f;
  box-shadow: 1px 1px 5px 1px #37474f;
  background: none;
}

/* category heading btns */
.category-btn {
  font-size: 20px;
  vertical-align: 4px;
  padding: 2px;
  border-radius: 40%;
}

/* tick item btn */
.tick-item-btn {
  box-shadow: none;
  text-shadow: 1px 1px 4px #37474f;
}

/* list item btns */
.li-btn {
  margin: 0 5px;
}

/* smaller btn */
.smaller-btn {
  font-size: small;
}

/* list items */
li {
  margin: 5px 0;
}

/* Error input field styles */
input.error {
  border-color: #d32f2f;
  background-color: #ffe6e6;
}

/* Media query: laptops and larger (>=992px) */
@media screen and (min-width: 992px) {
  /* main */
  main {
    display: grid;
    justify-items: center;
  }

  /* category area */
  .category-area {
    width: 50%;
  }

  /* add item input box */
  .add-item {
    width: auto;
  }

  /* add category input box */
  .add-category {
    width: 80%;
  }
}
