/* Import Bootstrap icons and handle the styling of the app. */

/* ChatGPT assisted with:
   - Media query breakpoints
   - Flexbox layout patterns
   - Mobile-responsive design
*/

@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
  font-size: large;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-top: 80px;
}

.autocomplete-item {
  cursor: pointer;
  padding: 4px 8px;
}
.autocomplete-item:hover {
  background: #eeeeee;
  color: black;
}

.card-body {
  background-color: whitesmoke;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.day_name {
  background-color: #f8f9fa;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.lunch_row {
  background-color: white;
  margin-left: 0;
  margin-right: 0;
}
.dinner_row {
  margin-left: 0;
  margin-right: 0;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  background-color: #f8f9fa;
}

#recipe-results {
  background-color: #dc3545;
  color: white;
}

#previous-btn,
#next-btn {
  width: 20vw;
  font-size: 1.5rem;
}

.grocery-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  width: fit-content;
}

.grocery-list-item {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.grocery-list-item-checkbox {
  width: 1.5rem;
  height: 1.5rem;
}

.grocery-list-item-checkbox:checked + .ingredient-label {
  text-decoration: line-through;
  color: #888;
}

.save-icon {
  display: none;
}

.login-container {
  max-width: 400px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper .form-control {
  width: 100%;
  padding-right: 40px; /* Makes room for the icon */
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 0;
  color: #666;
  cursor: pointer;
}

.toggle-password:hover,
.toggle-password:active,
.toggle-password:focus {
  color: #333;
  border: none;
  outline: none;
}

/* Styles for mobile phone */
@media (max-width: 599px) {
  .container {
    --bs-gutter-x: 0;
    margin: 0 !important;
  }

  .day_card {
    width: 100vw;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .day_card,
  .card-body,
  .day_name,
  .lunch_row,
  .dinner_row {
    border-radius: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  .lunch-text,
  .dinner-text,
  .remove-text,
  .add-text,
  .save-text,
  .load-text,
  .delete-text,
  .edit-text {
    display: none !important;
  }

  .lunch-icon,
  .dinner-icon,
  .add-icon,
  .remove-icon,
  .save-icon,
  .load-icon,
  .delete-icon,
  .edit-icon {
    display: inline !important;
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
    height: 4rem;
  }

  #delete_recipe_btn,
  #edit_recipe_btn {
    width: 20vw;
    padding: 0.1rem !important;
    margin-left: 0.5rem !important;
  }

  #previous-btn,
  #next-btn {
    width: 40vw;
    height: 6vh;
  }

  #mealplan-select {
    width: 95vw !important;
    font-size: 1.75rem;
  }

  #recipe-name {
    width: 95vw;
    height: 10vh;
    font-size: 1.5rem;
  }

  #main-side {
    width: 95vw;
    font-size: 1.5rem;
  }

  #recipe-results {
    width: 95vw;
    font-size: 1.5rem;
  }

  .ingredient {
    font-size: 1.2rem;
    width: 45vw;
  }
  .quantity {
    font-size: 1.2rem;
    width: 40vw;
  }

  .login-container {
    padding: 0 20px;
    margin: 10%;
    width: 100%;
  }

  .input-wrapper .form-control {
    font-size: 16px;
  }
}

/* Meal plan styles for bigger screens */
@media (min-width: 800px) {
  #week-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-content: space-between;
    align-items: stretch;
    justify-items: stretch;
  }

  .day_card {
    flex: 1 1 0;
    min-width: 350px;
    max-width: 1px;
    min-height: 200px;
    margin: 10px;
    display: flex;
    flex-direction: column;
  }
  .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
}
