:root {
  --c-dark-brown: #40352B;
  --c-light-brown: #CDBB93;
  --c-cream: #fae6c9;
  --c-tan: #D9C6A3;
  --c-light-yellow: #F2E1AC;
  --c-olive-green: #697353;
  --c-dark-olive-green: #495438;
  --c-medium-brown: #BF9169;
  --c-red: #C0392B;
  --c-confirm-green: #1E8449;
  --c-black: black;
  --c-white: white;
  --c-translucent-black-50: rgba(0, 0, 0, 0.5);
  --c-translucent-black-30: rgba(0, 0, 0, 0.3);
}
/* reset.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
h2 {
  font-size: 1rem;
}

#app-title{
  font-size: 3rem;
  font-weight: bold;
  font-family: 'Nunito', sans-serif;
  text-align: center;
  color: var(--c-dark-brown);
  text-shadow: 2px 2px 4px var(--c-light-brown);
  margin-bottom: 16px;
}

#empty-fridge-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.7rem;
  font-weight: bold;
  font-family: 'Nunito', sans-serif;
  text-align: center;
  color: var(--c-dark-brown);
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  margin-bottom: 16px;
  margin-top: 3rem;
}
#sub-msg {
  font-size: 1.2rem;
  font-weight: bold;
  font-family: 'Nunito', sans-serif;
  text-align: center;
  color: var(--c-dark-brown);
  margin: 4rem;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--c-cream);
  display: flex;
  flex-direction: column;
  justify-content: top;
  font-size: 1rem;
  height: 100vh;
}
#login-body {
  background-color: var(--c-cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#home-body {
  justify-content: center;
  align-items: center;
  padding-top: 2rem;
}
#fridge-body{ 
  margin-top: 7rem;
}
#add-item-body {
  padding-top: 1rem;
  align-items: center;
}
#item-details-body {
  padding-top: 1rem;
  align-items: center;
}

#login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}
.top-bar {
  position: fixed;
  padding-bottom: 1.2rem;
  top: 0;
  width: 100%;
  box-shadow: 0.5px 1px 7px var(--c-dark-brown);
  background-color: var(--c-tan);
  border-bottom-left-radius: 0.8rem;
  border-bottom-right-radius: 0.8rem;
  z-index: 1;
}

.fridge-container {
  max-width: 90%;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.fridge-container:hover {
  transform: scale(1.03);
}
#fridge-img {
  width: 100%;
  transition: opacity 1s ease;
}
#app-title {
  transition: opacity 1s ease;
}
.fade-out {
  opacity: 0;
}
.fade-in {
  opacity: 1;
}

/* Page fade */
#home-body {
  transition: opacity 1s ease;
  opacity: 1;
}

.fade-page-out {
  opacity: 0;
}

.background {
  width: 100%;
  height: 100%;
}

.home-and-title-container {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  width: 100%;
}
.home-button {
  margin-left: 1rem;
  z-index: 1; 
}
.page-title {
  text-align: center;
  color: var(--c-dark-brown);
  position: absolute;
  font-size: 2rem;
  padding: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.filter-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.4rem 0.3rem 0.4rem;
  border-radius: 1rem;
}
.sort-btn {
  text-decoration: none;
  color: var(--c-dark-brown);
  background-color: var(--c-light-yellow);
  border: 1px solid var(--c-dark-brown);
  border-radius: 0.4rem;
  padding: 0.4rem 0.8rem;
  box-shadow: 2px 2px 4px var(--c-dark-brown);
}
.sort-btn.active {
  color: var(--c-light-yellow);
  background-color: var(--c-olive-green);
}

.item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: center;
  align-items: stretch;
  gap: 0.7rem;
  padding: 0.5rem;
  width: 100%;
 }

 .item-link {
  text-decoration: none;
  color: inherit;
  display: block;
 }

/* Forms */
input, select {
  font-family: 'Nunito', sans-serif;
  text-align: center;
  background-color: var(--c-tan);
  height: 2.5rem;
  padding: 0.2rem;
}

textarea {
  font-family: 'Nunito', sans-serif;
  background-color: var(--c-tan);
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}
label {
  font-size: 1.2rem;
  color: var(--c-light-yellow);
}
.item-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--c-dark-olive-green);
  box-shadow: 4px 4px 7px var(--c-dark-brown);
  border-radius: 1.3rem;
  gap: 0.3rem;
  padding: 0.7rem;
  max-width: 95%;
  max-height: 95%;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  overflow: hidden;
}
.item-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  background-color: var(--c-dark-olive-green);
  box-shadow: 4px 4px 7px var(--c-dark-brown);
  border-radius: 1.3rem;
  gap: 0.3rem;
  padding: 0.7rem;
  max-width: 100%;
  height: 100%;
  max-height: 100%;

  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  overflow: hidden; 
}
.item-container #item-name{
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: bold;
  text-align: center;
  color: var(--c-light-yellow);
  margin-bottom: 1rem;
}
.item-container p {
  color: var(--c-medium-brown);
}
.item-container #item-date {
  color: var(--c-tan);
}
#item-details-pg {
  width: 80%;
}

#exp {
  display: flex;
  gap: 10px;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 0.5rem;
  width: 100%;
  height: 100%;
}

.nav-buttons {
  display: flex;
  justify-content: space-evenly;
  width: 100%;
  margin: 0.5rem;
}
.nav-buttons #cancel-btn, #add-item-btn {
  font-size: 1rem;
}

.add-item-button-container {
  position: fixed;
  bottom: 4.5rem;
  right: 2rem;
  z-index: 9999;
  background: var(--c-medium-brown);
  padding: 1rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px var(--c-dark-brown);
}
.material-symbols-outlined {
  color: var(--c-dark-brown);
}

.instructions-msg {
  font-size: 1.2rem;
  padding: 1rem;
  color:var(--c-dark-brown);
  text-align: center;
  margin-bottom:0.7rem;
  /* text-shadow: 1px 1px 2px var(--c-light-brown); */
}

form {
  background-color: var(--c-tan);
  padding: 1.5rem;
  border: solid 2px var(--c-black);
  border-radius: 8px;
}
.form-name input,
.form-quantity input,
.form-type select {
  width: 100%;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.form-name input {
  text-align: start;
  padding-left: 1rem;
}
.form-quantity input {
  width: 2.5rem;
  font-size: 1rem;
  text-align: center;
}
#qty-type-exp {
  display: flex;
  gap: 0.5rem;
  justify-content:space-evenly;
}
.form-expiration-date{
  display: flex;
  flex-direction: column;
  align-items: center;
}
.form-expiration-date input {
  color: var(--c-dark-brown);
  font-size: 1rem;
  height: 2.5rem;
}

#login-form {
  background-color: var(--c-medium-brown);
  width: auto;
  height: 100%;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--c-medium-brown);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  color: var(--c-dark-brown);
}

/* Item details */
/* item card uses similar styles to item form */
.cont-name {
  font-size: 1.2rem;
  text-align: center;
  color: var(--c-dark-brown);
  padding-bottom: 5px;
}
.details-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  width: 100%;
  padding: 0.2rem 1.5rem 0.2rem 1.5rem;
}
#item-name-details {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: var(--c-cream);
  margin-bottom: 1rem;
  padding-top: 10px;
}
.attr-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
/*
.attr-container {
  background-color: var(--c-tan);
  border: 1px solid var(--c-dark-brown);
  padding: 10px;
  min-width: 3rem;
  min-height: 3rem;
  border-radius: 5px;
  box-shadow: 2px 4px 6px var(--c-dark-brown);
}
*/
.attr-container .cont-name {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--c-light-yellow);
  font-size: 1.1rem;
}
.attr-container .cont-val {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
  background-color: var(--c-olive-green);
  color: var(--c-light-brown);
  border: 1px solid var(--c-dark-brown);
  padding: 10px;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  box-shadow: 2px 4px 6px var(--c-dark-brown);
  text-decoration: none;
}
#notes-title {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--c-light-yellow)
}
.notes-background {
  width: 100%;
  min-height: 150px;
  max-height: 200px;
  background-color: var(--c-olive-green);
  box-shadow: 2px 2px 5px var(--c-dark-brown);
  overflow-y: auto;
}
#notes {
  color: var(--c-light-brown);
  padding: 15px; 
}


/* Modal */
.modal {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background-color: var(--c-translucent-black-50);
  /*blurs background when active*/
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px); 
}
#modal-title {
  color: var(--c-dark-brown);
  font-size: 2rem;
  margin-top: 20px;
  margin-bottom: 10px;
}
#modal-text {
  width: 100%;
  color: var(--c-dark-brown);
  font-size: 1rem;
  text-align: center;
  padding-bottom: 40px;
}
.modal-content {
  background-color: var(--c-cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 15% auto;
  padding: 2rem 2rem 1.4rem 2rem;
  border-radius: 2rem;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px var(--c-translucent-black-30);
  animation: fadeIn 0.3s ease;
}
#delete-btn, #confirm-delete-btn {
  background-color: var(--c-red);
  color: var(--c-light-yellow);
}
.close {
  align-self: flex-end;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.confirm-buttons {
  display: flex;
  justify-content: space-evenly;
  width: 100%;
}