
/* style.css */

/* Style for the clickable Dish Library heading */
.dish-library h2#dishLibraryLink {
  cursor: pointer;
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #555;
  background-color: #ffffff;
  color: #333;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease-in-out;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.dish-library h2#dishLibraryLink:hover {
  background-color: #ddd;
  color: #333;
  transform: scale(1.02);
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.dish-library h2#dishLibraryLink:active {
  transform: scale(0.98);
}

/* Keep your existing styles below */
body {
  font-family: sans-serif;
  margin: 20px;
  line-height: 1.6;
  background-color: #ffffff;
  color: #333;
  
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 15px 20px;
  background-color: #072444; /* Fake blue to match icon */
  color: #FFCB05;
  border-radius: 5px;
}

header h1 {
  margin: 0;
  font-size: 2em;
}

header h1 img {
  height: 1.5em; /* Match image height to h1 font size */
  margin-right: 8px; /* Adjust spacing between image and text */
  vertical-align: middle; /* Ensure vertical alignment */
}

body.grocery-page header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 15px 20px;
  background-color: #072444; /* Fake blue to match icon */
  color: #FFCB05;
  border-radius: 5px;
}

body.grocery-page header h1 {
  margin: 0;
  font-size: 2em;
}

header button {
  padding: 10px 15px;
  background-color: #293e52;
  color: #FFCB05;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

header button:hover {
  background-color: #777;
}

.calendar-container {
  margin-bottom: 30px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0;
}

.calendar-header button {
  padding: 8px 17px;
  background-color: #ddd;
  color: #333;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.5em;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.calendar-header button:hover {
  background-color: #ccc;
}

.calendar-header h2 {
  margin: 0;
  font-size: 1.5em;
  color: #555;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day {
  padding: 15px;
  border: 1px solid #eee;
  text-align: center;
  cursor: pointer;
  background-color: #f9f9f9;
  border-radius: 5px;
  transition: background-color 0.2s ease;
}

.day:hover {
  background-color: #e0e0e0;
}

.day.has-meal {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.day.has-meal:hover {
  background-color: #c1e1d1;
}

.day-content {
  margin-top: 8px;
  font-size: 0.9em;
  font-weight: bold;
}



.add-meal-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-content {
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    /* Adjust max-width to make it narrower */
    max-width: 300px; /* Example: narrower modal */
    width: 90%; /* Keep responsiveness for smaller screens */
    height: 420px; /* Set a fixed height for the modal */
  }
  
  /* Style adjustments for Select2 within the modal */
.modal-content .select2-container {
    width: 100% !important; /* Make sure it takes the full width of the modal-content */
  }
  
  .modal-content .select2-dropdown {
    width: 100% !important; /* Ensure the dropdown doesn't extend beyond the modal-content width */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    /* You might need to adjust the z-index if it's still appearing behind other modal elements */
    z-index: 100 !important; /* Ensure it's above the modal (which has z-index: 10) */
  }
  
  .modal-content .select2-results__options {
    box-sizing: border-box; /* Apply box-sizing to the results list as well */
  }

  .select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #aaa;
    font-size: 1.5em;
    transform: translateY(-45px) translateX(-5px);
    height: 45px !important;
    width: 300px !important;
}
.select2-container--default .select2-selection--single {
  height: 40px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #444;
  line-height: 25px !important;
}

.select2-container--open .select2-dropdown--below {
  height: 40% !important;
}
#select2-selectDish-container {
  display: none !important;
  border: none !important;

}
.select2-container--default .select2-results>.select2-results__options {
  max-height: 320px !important; /* Set a max height for the dropdown */
  overflow-y: auto  !important; /* Enable vertical scrolling */
  transform: translateY(-45px)!important;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #00274C !important; /* Active icon color */
  color: #FFCB05  !important; /* Active icon color */
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5em;
  cursor: pointer;
  color: #888;
}

.close-button:hover {
  color: #333;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #00274C; /* Active icon color */
  font-size: 1.5em;
}

.modal-content select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
}

.modal-content button {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.modal-content button:hover {
  background-color: #0056b3;
}

/* ... other styles ... */



#dishListManagement li button.delete-button:hover {
  background-color: #c82333;
}

.add-new-dish-form {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.add-new-dish-form input[type="text"],
.add-new-dish-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
}

.add-new-dish-form button {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.add-new-dish-form button:hover {
  background-color: #0056b3;
}


#dishListManagement li button.edit-button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.9em;
  margin-right: 5px;
  transition: background-color 0.3s ease;
}

#dishListManagement li button.edit-button:hover {
  background-color: #0056b3;
}

#dishListManagement li button.delete-button {
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

#dishListManagement li button.delete-button:hover {
  background-color: #c82333;
}

#dishListManagement li > div {
  display: flex;
  gap: 5px;
}


.edit-dish-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.edit-dish-modal .modal-content label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

.edit-dish-modal .modal-content input[type="text"],
.edit-dish-modal .modal-content textarea {
  width: calc(100% - 22px);
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
  box-sizing: border-box;
}

.edit-dish-modal .modal-content input[type="text"]:focus,
.edit-dish-modal .modal-content textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.edit-dish-modal .modal-content textarea {
  min-height: 80px;
}

.edit-dish-modal button {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.edit-dish-modal button:hover {
  background-color: #0056b3;
}



#dishListManagement {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
}

#dishListManagement li {
  padding: 8px 0;
  border-bottom: 1px dashed #ddd;
  display: flex;
  align-items: baseline;
  font-size: 1em;
}

#dishListManagement li:last-child {
  border-bottom: none;
}

#dishListManagement li span.dish-name {
  font-weight: bold;
  color: #333;
  margin-right: 1px;
  flex-shrink: 0;
  width: 100px;
}

#dishListManagement li span.ingredients {
  color: #777;
  font-style: italic;
  white-space: pre-wrap;
  word-break: break-word;
  margin-left: 20px;
  margin-right: 10px;
}

#dishListManagement li > div {
  display: flex;
  gap: 5px;
  margin-left: auto;
}


.add-new-dish-form input[type="text"],
.add-new-dish-form textarea {
  padding: 8px;
  border: 1px solid #aaa;
  border-radius: 8px;
  font-size: 1.1em;
  margin-bottom: 15px;
  box-sizing: border-box;
  width: calc(100% - 24px);
}

.add-new-dish-form input[type="text"]:focus,
.add-new-dish-form textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.add-new-dish-form textarea {
  min-height: 100px;
  resize: vertical;
}


.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.modal-header {
  padding: 10px 20px;
  background-color: #f1f1f1;
  border-bottom: 1px solid #ddd;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.modal-header h2{
  font-size: 1.5em;
  margin: 0;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 10px 20px;
  background-color: #f1f1f1;
  border-top: 1px solid #ddd;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  text-align: right;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 15px;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
}


#dishSearch {
  width: calc(100% - 20px);
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  box-sizing: border-box;
}

#dishSearch:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}


#selectDish {
  width: 100%;
  padding: 10px;
  margin: 5px 0 15px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  box-sizing: border-box;
}

#selectDish:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}


#saveMeal, #clearMeal {
  background-color: #4CAF50;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  margin-left: 10px;
  transition: background-color 0.3s ease;
}

#saveMeal:hover, #clearMeal:hover {
  background-color: #367c39;
}

#clearMeal {
  background-color: #f44336;
  color: white;
}

#clearMeal:hover {
  background-color: #d32f2f;
}

/* Override transitions on the Select2 container when open */
.modal-content .select2-container--open {
    transition: none !important;
    animation: none !important;
  }
  
  /* Also target the dropdown itself to be thorough */
  .modal-content .select2-container--open .select2-dropdown {
    transition: none !important;
    animation: none !important;
  }

/* Make the select box itself clean */
.select2-container--default .select2-selection--single {
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 6px;
    height: 40px;
    padding: 6px 12px;
    font-size: 16px;
  }
  
  /* Text inside the selected box */
  .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #333;
    line-height: 26px;
  }
  
  /* Arrow icon */
  .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 10px;
  }
  
  /* Dropdown panel */
  .select2-container--default .select2-dropdown {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 1011 !important; /* stay on top */
  }
  
  /* Dropdown options */
  .select2-container--default .select2-results__option {
    padding: 10px 12px;
    font-size: 16px;
  }
  
  /* Hover & selected state */
  .select2-container--default .select2-results__option--highlighted {
    background-color: #007bff;
    color: white;
  }
  
  .select2-container--default .select2-results__option--selected {
    background-color: #e9ecef;
  }
  
  .day.today {
    background-color: #fcf29e; /* Yellow background */
    color: #000; /* Black text */
    font-weight: bold;
    border: 2px solid #afa842; /* Optional: Border for emphasis */
  }
  
  .day.today:hover {
    background-color: #ffdd46; /* Lighter yellow when hovered */
  }


  .bottom-navigation {
    position: fixed;
    bottom: 4.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    background-color: #ffffff;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 7%;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }
  
  /* Style for the colored circle behind the active button */
  .active-home-button::before {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; /* Adjust size to be slightly larger than the button */
    height: 60px;
    background-color: #00274C; /* Your highlight color */
    border-radius: 50%;
    z-index: -1; /* Behind the icon */
  }

  .active-grocery-button::before {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 83%;
    transform: translate(-40%, -50%);
    width: 60px; /* Adjust size to be slightly larger than the button */
    height: 60px;
    background-color: #00274C; /* Your highlight color */
    border-radius: 50%;
    z-index: -1; /* Behind the icon */
  }

  .active-dish-button::before {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 13%;
    transform: translate(-40%, -50%);
    width: 60px; /* Adjust size to be slightly larger than the button */
    height: 60px;
    background-color: #00274C; /* Your highlight color */
    border-radius: 50%;
    z-index: -1; /* Behind the icon */
  }

/* Grocery buttons */
  



  #dishLibraryButton {
    position: absolute; /* Position relative to the nearest positioned ancestor */
    left: 13%;
    top: 50%;
    transform: translateX(-50%) translateY(-60%);
    display: inline-block;
    padding: 10px 20px;
    margin: 5px; /* Standard margins */
    font-size: 2em;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    background-color: #ffffff;
    color: #555;
    cursor: pointer;
    width: auto;
  }

  #active-dishLibraryButton {
    position: absolute; /* Position relative to the nearest positioned ancestor */
    left: 13%;
    top: 50%;
    transform: translateX(-50%) translateY(-60%);
    display: inline-block;
    padding: 10px 10px;
    margin: 5px; /* Standard margins */
    font-size: 2em;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    color: #FFCB05; /* Active icon color */
    background-color: #00274C; /* Active button color */
    cursor: pointer;
    width: auto;
  }

  #groceryListButton {
    position: absolute; /* Position relative to the nearest positioned ancestor */
    left: 83%;
    top: 50%;
    transform: translateX(-50%) translateY(-60%);
    display: inline-block;
    padding: 10px 20px;
    margin: 5px; /* Standard margins */
    font-size: 2em;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    background-color: #ffffff;
    color: #555;
    cursor: pointer;
    width: auto;
  }

  #active-groceryListButton {
    position: absolute; /* Position relative to the nearest positioned ancestor */
    left: 83%;
    top: 50%;
    transform: translateX(-50%) translateY(-60%);
    display: inline-block;
    padding: 10px 10px;
    margin: 5px; /* Standard margins */
    font-size: 2em;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    color: #FFCB05; /* Active icon color */
    background-color: #00274C; /* Active button color */
    cursor: pointer;
    width: auto;
  }

  #homeButton {
    position: absolute; /* Position relative to the nearest positioned ancestor */
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-60%);
    display: inline-block;
    padding: 10px 20px;
    margin: 5px 0 5px 0; /* Add auto margin to the left */
    font-size: 2em;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50%;
    background-color: #ffffff;
    color: #555;
    cursor: pointer;
    width: auto;
  }

  #active-homeButton {
    position: absolute; /* Position relative to the nearest positioned ancestor */
    left: 50%;
    transform: translateX(-50%) translateY(-60%);
    top: 50%;
    display: block;
    padding: 10px 10px;
    margin: 5px 0 5px 0; /* Add auto margin to the left */
    font-size: 2em;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    color: #FFCB05; /* Active icon color */
    background-color: #00274C; /* Active button color */
    cursor: pointer;
    width: auto;
    border-radius: 50%; /* Optional, for a circular container */
  }


  
.dish-library-management {
    margin: 5px 5px 150px 5px;
}


/* Meal Selection Page */
#dishListContainer {
  display: grid; /* Use CSS Grid Layout */
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); /* Create responsive columns */
  gap: 10px; /* Spacing between grid items */
  padding: 5px; /* Padding around the grid */
  margin-bottom: 200px; /* Space for the bottom navigation bar */
}

.dish-item {
  border: 1px solid #ddd;
  background-color: #fff;
  padding: 5px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex; /* Enable Flexbox */
  flex-direction: column; /* Stack content vertically */
  justify-content: space-between; /* Distribute space */
  height: 90%; /* Ensure full height to push to bottom */
  margin-bottom: 5px; /* Add margin to the bottom of each item */
}

.dish-item h3 {
  margin-top: 0;
  margin-bottom: 5px;
  color: #00274C;
}

.dish-item .tags {
  color: #777;
  font-size: 0.9em;
  margin-top: auto;
  margin-bottom: 0px;
  font-style: italic;
}

/* Optional: Style for the rows if you were previously using them */
.dish-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px; /* Adjust as needed */
}

.dish-row > .dish-item {
  flex: 1; /* Distribute space equally among items in a row */
}

.filter-section {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative; /* For positioning the popup */
}

.popup {
  display: none; /* Initially hidden */
  position: absolute;
  top: 100%; /* Position below the button */
  left: 0;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10; /* Ensure it's above other content */
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.popup label {
  font-weight: bold;
}

.current-dishes-header {
  display: flex;
  align-items: center; /* Vertically align items in the center */
  justify-content: space-between; /* Distribute space between them */
  gap: 20px; /* Add some space between the items */
}

.current-dishes-header h2 {
  margin-right: auto; /* Push the heading to the left */
}

.current-dishes-header button {

  border: none; /* Remove the border */
  border-radius: 5px; /* Keep the border-radius if you like the rounded corners */
  background-color: transparent; /* Make the background transparent */
  cursor: pointer;
  font-size: 2.5em; /* Make the text bigger */
  color: #00274C; /* Set the text color (you can choose any color) */
}

#openAddDishModal {
margin-left: 10px;;
}

.current-dishes-header button:hover {
  background-color: rgba(0, 123, 255, 0.1); /* Add a subtle background on hover for feedback */
}


.tag-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
  flex-direction: column; /* Keep items stacked vertically */
  gap: 15px; /* Increased gap for better spacing between sections */
  width: 100px; /* Adjust width as needed */
}

.tag-popup .popup-header {
  width: 100%;
  display: flex;
  justify-content: flex-start; /* Left justify header content */
  margin-bottom: 0; /* Remove default bottom margin */
}

.tag-popup .popup-header button#clearFilter {
  padding: 8px 12px;
  border: 1px solid #bbb;
  border-radius: 5px;
  background-color: #eee;
  cursor: pointer;
  font-size: 0.9em;
  width: 100%; /* Make the button take full width */
  text-align: left; /* Left align the text inside the button */
}

.tag-popup .popup-header button#clearFilter:hover {
  background-color: #ddd;
}

#tagButtonsContainer {
  display: flex;
  flex-direction: column; /* Stack buttons vertically */
  gap: 8px; /* Space between tag buttons */
  align-items: flex-start; /* Left align tag buttons */
}

#tagButtonsContainer button {
  padding: 8px 12px;
  border: 1px solid #bbb;
  border-radius: 5px;
  background-color: #eee;
  cursor: pointer;
  font-size: 0.9em;
  width: 100%; /* Make buttons take full width */
  text-align: left; /* Left align text inside buttons */
}

#tagButtonsContainer button.active {
  background-color: #00274C;
  color: #FFCB05; /* Active icon color */

}

.tag-popup .popup-footer {
  width: 100%;
  display: flex;
  justify-content: flex-start; /* Left justify footer content */
  margin-top: 0; /* Remove default top margin */
}

.tag-popup .popup-footer button#openAddTagPopup {
  padding: 8px 15px;
  border-radius: 5px;
  color: #FFCB05; /* Active icon color */
    background-color: #00274C; /* Active button color */
  cursor: pointer;
  font-size: 1em;
  width: 100%; /* Make button take full width */
  text-align: left; /* Left align text inside button */
}

.tag-popup .popup-footer button#openAddTagPopup:hover {
  background-color: #0056b3;
}
/* Styles for the addTagPopup modal (reusing modal styles) */
#addTagPopup.modal {
  display: none; /* Initially hidden */
  position: fixed;
  z-index: 11; /* Higher than other modals */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}

#addTagPopup .modal-content {
  background-color: #fefefe;
  margin: 15% auto; /* 15% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 80%; /* Could be more or less, depending on screen size */
  border-radius: 8px;
  position: relative;
}

#addTagPopup .close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

#addTagPopup .close-button:hover,
#addTagPopup .close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

#addTagPopup h3 {
  margin-top: 0;
  margin-bottom: 15px;
  text-align: center;
}

#addTagPopup label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

#addTagPopup input[type=text] {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#addTagPopup button#saveNewTagButton {
  background-color: #4CAF50;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

#addTagPopup button#saveNewTagButton:hover {
  background-color: #45a049;
}
#addTagPopup .add-new-tag {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}

#addTagPopup .add-new-tag input[type=text] {
  flex-grow: 1;
}





/* Style for the modal content */
#addDishModal .modal-content,
#editDishModal .modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* Slightly reduce top margin */
    padding: 15px; /* Slightly reduce padding */
    border: 1px solid #888;
    width: 80%;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px; /* Reduce gap between elements */
    margin-bottom: 150px;
    height: auto;
    
}

/* Style for the close button */
#addDishModal .close-button,
#editDishModal .close-button {
    color: #aaa;
    position: absolute;
    right: 10px; /* Slightly reduce right positioning */
    top: 5px; /* Slightly reduce top positioning */
    font-size: 24px; /* Slightly reduce font size */
    font-weight: bold;
    cursor: pointer;
}

#addDishModal .close-button:hover,
#addDishModal .close-button:focus,
#editDishModal .close-button:hover,
#editDishModal .close-button:focus {
    color: black;
    text-decoration: none;
}

/* Style for the heading */
#addDishModal h3,
#editDishModal h3 {
    margin-top: 0;
    margin-bottom: 15px; /* Reduce bottom margin */
    text-align: center;
    color: #333;
    font-size: 1.5em; /* Slightly reduce font size */
}

/* Style for labels */
#addDishModal label,
#editDishModal label {
  margin-top: 15px; /* Reduce top margin */
  margin-bottom: 0px; /* Reduce bottom margin */
  color: #333;
  font-size: 1.1em; /* Slightly reduce font size */
  font-weight: bold;
}

/* Style for input fields */
#addDishModal input[type=text],
#editDishModal input[type=text] {
    width: calc(100% - 12px);
    padding: 8px; /* Reduce padding */
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9em; /* Reduce font size */
}

/* Style for the ingredients section heading */
#addDishModal h4,
#editDishModal h4:nth-of-type(1) {
    margin-top: 15px; /* Reduce top margin */
    margin-bottom: 0px; /* Reduce bottom margin */
    color: #333;
    font-size: 1.1em; /* Slightly reduce font size */
}

/* Style for the add ingredient section */
#addDishModal .add-ingredient,
#editDishModal .add-ingredient {
    display: flex;
    gap: 8px; /* Reduce gap */
    margin-bottom: 10px; /* Reduce bottom margin */
    align-items: center;
}

#addDishModal .add-ingredient input[type=text],
#editDishModal .add-ingredient input[type=text] {
    flex-grow: 1;
    padding: 8px; /* Reduce padding */
    font-size: 0.9em; /* Reduce font size */
}

#addDishModal .add-ingredient button,
#editDishModal .add-ingredient button {
    padding: 8px 12px; /* Reduce padding */
    border-radius: 4px;
    font-size: 0.9em; /* Reduce font size */
}

/* Style for the ingredients list */
#addDishModal #ingredientsList,
#editDishModal #editIngredientsList {
    margin-bottom: 10px; /* Reduce bottom margin */
    border: 1px solid #eee;
    border-radius: 4px;
}

#addDishModal #ingredientsList li,
#editDishModal #editIngredientsList li {
    padding: 6px 0; /* Reduce padding */
    font-size: 0.9em; /* Reduce font size */
}

#addDishModal #ingredientsList li button,
#editDishModal #editIngredientsList li button {
    padding: 4px 8px; /* Reduce padding */
    font-size: 1em; /* Reduce font size */
    margin-left: auto;
    background-color: #f44336; /* Red background for delete button */
}

#ingredientsList li,
#editIngredientsList li {
  display: flex;
  justify-content: space-between; /* Put space between text and button */
  align-items: center; /* Vertically align items */
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
#IngredientsList li div:last-child,
#editIngredientsList li div:last-child { /* Target the button's div */
  padding: 4px 8px; /* Reduce padding */
  font-size: 0.7em; /* Reduce font size */
  margin-left: auto;
}

/* Style for the tags section heading */
#editDishModal h4:nth-of-type(2) {
    margin-top: 15px; /* Reduce top margin */
    margin-bottom: 8px; /* Reduce bottom margin */
    color: #333;
    font-size: 1.1em; /* Slightly reduce font size */
}

/* Style for the available tags dropdown */
#addDishModal #availableTags,
#editDishModal #editAvailableTags {
    padding: 8px; /* Reduce padding */
    margin-bottom: 10px; /* Reduce bottom margin */
    font-size: 0.9em; /* Reduce font size */
}

/* Style for the selected tags list */
#addDishModal #selectedTagsList,
#editDishModal #editSelectedTagsList {
    gap: 3px; /* Reduce gap */
    margin-bottom: 10px; /* Reduce bottom margin */
    padding-left: 0px;
}



#addDishModal #selectedTagsList li button,
#editDishModal #editSelectedTagsList li button {
    font-size: 0.9em; /* Adjust delete button size */
    margin-left: auto; /* Add a little space */
}

/* Style for the save buttons */
#addDishModal button#addDishButton,
#editDishModal button#saveEditedDishButton {
    padding: 10px 15px; /* Reduce padding */
    font-size: 1em; /* Reduce font size */
}

#addDishModal #selectedTagsList li,
#editSelectedTagsList li {
  display: flex;
  align-items: center;
  gap: 8px; /* Space between tag and button */
  background-color: #e0f7fa;
  color: #00838f;
  border: 1px solid #b2ebf2;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  margin-right: 5px; /* Space between tags */
  margin-bottom: 5px; /* Space between rows of tags */
}

#editSelectedTagsList li span i {
  margin-right: 5px; /* Space between the tag icon and text */
}

#editSelectedTagsList li button.remove-tag-button {
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 1em;
  padding: 0;
  line-height: 1;
}

#editSelectedTagsList li button.remove-tag-button:hover {
  color: #b71c1c;
}

#selectedTagsList li {
  display: flex;
  align-items: center;
  gap: 8px; /* Space between tag and button */
  background-color: #e0f7fa;
  color: #00838f;
  border: 1px solid #b2ebf2;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  margin-right: 5px; /* Space between tags */
  margin-bottom: 5px; /* Space between rows of tags */
}

#selectedTagsList li span i {
  margin-right: 5px; /* Space between the tag icon and text */
}

#selectedTagsList li button.remove-tag-button {
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 1em;
  padding: 0;
  line-height: 1;
}

#selectedTagsList li button.remove-tag-button:hover {
  color: #b71c1c;
}

#existingTagsList li {
  display: flex;
  align-items: center;
  gap: 8px; /* Space between tag and button */
  background-color: #e0f7fa;
  color: #00838f;
  border: 1px solid #b2ebf2;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  margin-right: 5px; /* Space between tags */
  margin-bottom: 5px; /* Space between rows of tags */
}

#existingTagsList li span i {
  margin-right: 5px; /* Space between the tag icon and text */
}

#existingTagsList li button.delete-tag-button {
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 1em;
  padding: 0;
  line-height: 1;
}

#existingTagsList li button.delete-tag-button:hover {
  color: #b71c1c;
}

/* --- Grocery List Actions (Clear Button) --- */
.grocery-list-actions {
  text-align: center; /* Center the button */
  margin-bottom: 20px; /* Add space below the button */
}

.grocery-list-actions #clearGroceryList {
  padding: 10px 15px;
  background-color: #dc3545; /* Reddish button */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.grocery-list-actions #clearGroceryList:hover {
  background-color: #c82333; /* Darker red on hover */
}

/* --- Grocery List Container and List --- */
.grocery-list-container {
  /* No container needed, let the ul take full width */
  flex-grow: 1; /* Allow the list to take up available vertical space */
  margin-bottom: 80px; /* IMPORTANT: Make space for fixed bottom navigation */
  overflow-y: auto; /* Make the list scrollable if it gets too long */
  padding: 0 20px;
  box-sizing: border-box;
}

#groceryList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#groceryList li {
  padding: 12px 15px;
  background-color: white;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 1.3em;
  display: flex; /* Use flexbox for list item content */
  align-items: center; /* Vertically center the text and remove button */
  justify-content: space-between; /* Space between text and button */
  border: 1px solid #ddd;
}



#groceryList li button {
  padding: 5px 10px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}

#groceryList li button:hover {
  background-color: #c82333;
}

/* --- New Checkbox Styles --- */
#groceryList li input[type="checkbox"] {
  position: relative;
  cursor: pointer;
  width: 40px;
  height: 40px;
  appearance: none;
  border: 2px solid #ccc;
  border-radius: 50%; /* Make it circular */
  background-color: white;
  transition: all 0.3s ease;
  outline: none;
  margin-left: 10px;
}

#groceryList li input[type="checkbox"]:checked {
  background-color: #00274C; /* Change to blue */
  border-color: #00274C; /* Change to blue */
}

#groceryList li input[type="checkbox"]:checked::before {
  content: "";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 12px;
  height: 21px;
  border: 4px solid #FFCB05; /* Change to yellow */
  border-top: none;
  border-left: none;
}

#groceryList li input[type="checkbox"]:hover {
  border-color: #00274C; /* Change to blue */
}

#groceryList li input[type="checkbox"]:focus {
  box-shadow: 0 0 0 2px rgba(0, 39, 76, 0.5); /* Use a blue shadow */
}

/* Focus effect */
#groceryList li input[type="checkbox"]:focus {
  box-shadow: 0 0 0 2px rgba(0, 39, 76, 0.5); /* Add a blue shadow for focus */
}
/* on phone specific */

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: bold;
  padding: 0;
  border-bottom: 1px solid #ccc;
}

.calendar-weekdays div {
  padding: 0;
  color: #333;
}

/* Highlight weekends with a slightly lighter gray */
.calendar-weekdays div:first-child, /* Sunday */
.calendar-weekdays div:last-child { /* Saturday */
  color: #777;
}

  @media (max-width: 768px) {
    /* Adjust calendar size for mobile */
    body {
        background-color: #2F65A7 !important;
        margin: 0px !important; /* Reduce margin on mobile */
      }

      header {
        margin-bottom: 5px !important;
        padding: 2px 20px 15px 20px;
        border-radius: 0px;
      }



      body.grocery-page header {
        margin-bottom: 30px;
        padding: 2px 20px 15px 20px;
        border-radius: 0px;
      }

      .calendar-container {
        margin-left: 6px; /* Reduce left margin */
        margin-right: 6px; /* Reduce right margin */
        margin-bottom: 5px !important;
        padding: 5px; /* Slightly reduce padding inside */
      }
      
      .calendar-grid {
        gap: 2px; /* Reduce gap between days */
      }

      .day {
        padding: 2px; /* Reduce padding inside each day cell */
        font-size: 1rem; /* Smaller font size for day numbers */
        font-weight: bold; /* Make day numbers bold */
        min-height: 80px; /* Ensure a minimum height for day cells */
      }

      .day-content {
        font-size: 0.8rem; /* Smaller font size for day content */
      }

      .fc-toolbar-title {
        font-size: 1rem; /* smaller month title */
      }
    
      .fc-daygrid-day-number {
        font-size: 0.5rem;
      }
    
      .fc-event {
        font-size: 0.5rem;
        padding: 1px 2px;
      }
    
      .fc {
        transform: scale(0.95);
        transform-origin: top center;
      }



}
