body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    height: 100vh;
    width: 100%;
    margin: 0;
}
#app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}
header {
    background-color: white;
    padding: 1rem;
}
header h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}
.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}
#searchInput, #ingredientSearchInput {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #e1dede;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}
#searchButton, #ingredientSearchButton {
    padding: 0.75rem 1.5rem;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    font-size: 1rem;
}
#searchButton:hover, #ingredientSearchButton:hover {
    background-color: #0056b3;
}
.random-container, .favourites-container, .shopping-list-container, .meal-plan-container, .filter-container {
    max-width: 600px;
    margin: 0.75rem auto 0;
    display: flex;
}
.filter-container {
    gap: 0.75rem;
}
#randomButton {
    flex-grow: 1;
    padding: 0.75rem 1.5rem;
    border: 1px solid #24a842;
    background-color: #24a842;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
}
#randomButton:hover {
    background-color: #218838;
}
#favouritesButton {
    flex-grow: 1;
    padding: 0.75rem 1.5rem;
    border: 1px solid #007bff;
    background-color: #2975c6;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
}
#shoppingListButton {
    flex-grow: 1;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.2s;
    width: 100%;
}
#shoppingListButton:hover {
    background-color: #218838;
}
#mealPlanButton {
    flex-grow: 1;
    background-color: #e76f51;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.2s;
    width: 100%;
}
#mealPlanButton:hover {
    background-color: #d65a3b;
}
#resultsContainer {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
}
#placeholder {
    text-align: center;
    color: #696666;
    margin-top: 4rem;
}
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.meal-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}
.meal-card:hover {
    transform: scale(1.05);
}
.meal-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
.meal-card h3 {
    padding: 1rem;
    font-size: 1.1rem;
    margin: 0;
}
#recipeModal, #mealPlanModal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}
#modalContent, #mealPlanModalContent {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dad5d5;
}
.modal-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}
#closeModalButton, #closeMealPlanModalButton {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    color: #666;
}
#closeModalButton:hover, #closeMealPlanModalButton:hover {
    color: #000;
}
.favourite-button {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #aea3a3;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.favourite-button:hover {
    color: #989393;
}
.favourite-button.active {
    color: #e63946;
}
.favourite-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -20px);
    background-color: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1001;
    transition: opacity 0.5s ease, transform 0.5s ease;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
}
.favourite-popup.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.modal-body {
    padding: 1rem;
    overflow-y: auto;
}
.modal-body img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.modal-body h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}
.modal-body ul {
    list-style-position: inside;
    padding-left: 0.5rem;
}
.modal-body p {
    white-space: pre-wrap;
    line-height: 1.6;
}
.video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.filter-container select {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #e1dede;
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
}
.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.add-to-list-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 28px;
    text-align: center;
    transition: background-color 0.2s;
    padding: 0;
}
.add-to-list-button:hover {
    background-color: #0056b3;
}
.shopping-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e1dede;
}
.remove-from-list-button {
    background-color: #d52738;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;    
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
.remove-from-list-button:hover {
    background-color: #c82333;
}
.meal-plan-modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 2rem;
}
.meal-plan-day {
    background: #ffffff;
    border: 1px solid #dbd4d4;
    border-radius: 8px;
    padding: 1.5rem;
}
.meal-plan-day h3 {
    margin-top: 0;
    color: #e76f51;
    border-bottom: none;
}
.meal-plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.meal-plan-item:hover {
    background-color: #f0f0f0;
}
.remove-from-plan-button {
    background: #dc3545;
    color: white;
    font-size: 0.8rem;
    padding: 5px 10px;
    margin-top: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.remove-from-plan-button:hover {
    background: #c82333;
}
.meal-plan-empty {
    color: #868181;
    font-style: italic;
    margin: 0;
}
.day-selector-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.day-select-button {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.day-select-button:hover {
    background-color: #e2e6ea;
    border-color: #ccc;
}
.modal-footer-actions {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #eee;
    text-align: right;
}
.add-to-plan-button, .back-to-recipe-button {
    background-color: #e76f51;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}
.add-to-plan-button:hover, .back-to-recipe-button:hover {
    background-color: #d65a3b;
}
.hidden {
    display: none !important;
}