.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #65ab65;
    padding: 20px 0;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 16px;
    padding-right: 16px;
    background-color: #65ab65;
}

.nav-link {
    text-decoration: none;
    color: white;
    background-color: #65ab65;
}

.page-header h1 {
    font-size: 36px;
    text-align: center;
    padding-left: 16px;
    color: white;
    background-color: #65ab65;
}

.page-header a {
    text-decoration: none;
    color: white;
    background-color: #65ab65;
}

@media (max-width: 480px) {
    .nav-list {
        gap: 8px;
    }
    .page-header h1 {
        font-size: 16px;
    }
}
.main-container {
    display: flex;
    flex-direction: column;
    gap: 100px;
}

.recipes-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
    font-size: 48px;
}

@media (max-width: 480px) {
    .recipes-header {
        font-size: 24px;
    }
}

.search-bar {
    padding-top: 50px;
    text-align: center;
}

.search-bar form {
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-bar input {
    width: 50%;
    height: 50px;
    border: 1px solid lightgray;
    border-radius: 10px;
    font-size: 18px;
}

.search-clear-all {
    width: 10%;
    height: 50px;
    border: 1px solid lightgray;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .search-clear-all {
        width: 20%;
        font-size: 14px;
    }
}

.search-bar .submit-btn {
    width: 10%;
    cursor: pointer;
}

.recipes {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    display: none;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #65ab65;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
    grid-column: 1 / -1;
}

@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

.recipe-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid lightgray;
    border-radius: 20px;
    padding: 20px;
    position: relative;
}

@media (max-width: 480px) {
    .recipe-cards {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .recipe-card {
        width: 50%;
        height: 50%;
    }
}
.favorite {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.title-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.title-wrapper h3 {
    font-size: 28px;
}

.meal-calendar {
    display: flex;
    flex-direction: column;
    align-items: end;
    padding-right: 100px;
    gap: 0px;
}
.meal-calendar-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 50px;
    border: none;
    background-color: #65ab65;
}


.meal-calendar-button img {
    align-self: center;
    background: transparent;
    background-color: #65ab65;
}

.meal-calendar-button a {
    text-decoration: none;
    background-color: #65ab65;
}

@media (max-width: 480px) {
    .meal-calendar {
        padding-right: 25px;
        padding-bottom: 25px;
    }
    .meal-calendar-button {
        width: 25px;
        height: 25px;
        padding: 25px;
    }

    .meal-calendar-button img {
        width: 25px;
        height: 25px;
    }
}

.modal-container {
    display: none;
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.modal-container.show-modal {
    display: block;
    opacity: 1;
    visibility: visible;
}

.modal, .confirm-modal {
    background: #98ecb4;
    display: block;
    border-radius: 5px;
    position: absolute;
    cursor: move;
    overflow: hidden;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    width: 400px;
    z-index: 1100;
}

@media (max-width: 480px) {
    .modal, .confirm-modal {
        width: 50%;
    }
}

.modal-content {
    padding: 20px;
    background: transparent;
}

.modal-content h1 {
    background: transparent;
}

.modal-form {
    background: transparent;
}

.modal-form div {
    margin: 20px 0;
    background: transparent;
}

.modal-form label {
    display: block;
    margin-bottom: 6px;
    background: transparent;
}

.modal-form .form-input {
    padding: 8px;
    width: 100%;
}

@media (max-width: 480px) {
    .modal-form div input {
        width: 50%;
    }
    .modal-form .form-input {
        width: 30%;
    }
}

.close-button {
    background: transparent;
    border: none;
    font-size: 25px;
    position: absolute;
    top: 5px;
    right: 0;
    cursor: pointer;
}

.modal-container .submit-button {
    padding: 10px 30px;
    font-weight: bold;
    background: #65ab65;
    border: none;
    color: #ffffff;
    cursor: pointer;
}

.add-plan-button {
    font-size: 24px;
    padding: 10px 20px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    background-color: #65ab65;
    border: none;
}
/* Meal Plan Calendar */

.meal-plan {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
}

.meal-plan-calendar-header {
    font-size: 48px;
    padding-bottom: 50px;
}

.calendar-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding-right: 50px;
    padding-top: 20px;
}


@media (max-width: 1024px) {
    .meal-plan-calendar-header {
        font-size: 24px;
    }

    .meal-plan-calendar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calendar {
        min-width: 700px;
        border-spacing: 3px;
    }

    .calendar thead {
        display: none; /* Hide table headers on mobile */
    }

    .calendar tbody, 
    .calendar tr {
        display: block;
        width: 100%;
    }

    .calendar td {
        /* Stack cells vertically */
        display: block;
        width: 90%;
        margin: 10px auto;
        border: 1px solid lightgray;
        border-radius: 8px;
        position: relative;
    }

        /* Day label styles - simplified and consistent */
    .meal[data-day]::before {
        content: attr(data-day);
        display: block;
        width: 100%;
        text-align: center;
        font-weight: bold;
        font-size: 16px;
        padding: 8px 0;
        border-radius: 8px 8px 0 0;
        /* Remove position absolute/relative positioning */
        text-transform: capitalize;
    }

    .meal {
        padding: 10px;
        min-height: 50px;
        border-radius: 0 0 8px 8px;
        /* Add word wrap for long content */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Remove specific day styles that might cause inconsistency */
    .meal[data-day="monday"]::before,
    .meal[data-day="tuesday"]::before,
    .meal[data-day="wednesday"]::before,
    .meal[data-day="thursday"]::before,
    .meal[data-day="friday"]::before,
    .meal[data-day="saturday"]::before,
    .meal[data-day="sunday"]::before {
        position: static; /* Override any position settings */
        top: auto;
        margin: 0;
    }

        /* Adjust favorite button position */
    .meal .favorite {
        top: 15px;
        right: 15px;
    }

    .favorite {
        max-width: 50px;
    }

    /* Adjust add meal button style */
    .meal button {
        width: auto; /* Changed from 100% */
        min-width: 80px;
        padding: 8px 12px;
        margin: 5px 0;
        font-size: 14px; /* Reduced font size */
        white-space: nowrap; /* Prevent button text from wrapping */
    }

     /* Center the bottom action buttons */
    .calendar-buttons {
        display: flex;
        justify-content: center;
        gap: 10px;
        width: 90%;
        margin: 0 auto;
        padding: 10px 0;
        padding-right: 0;
    }

    .clear-all,
    .generate-shopping-list {
        width: auto;
        min-width: 100px;
        text-align: center;
    }
    /* CSS */
    .calendar td::before {
        content: attr(data-day); /* Gets the value from data-day attribute */
        display: block;
        font-weight: bold;
        color: black;
        /* ... other styling ... */
    }

    #modal-search {
        width: 90%;
    }
}


.meal-plan-calendar {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.calendar {
    border-spacing: 5px;
    width: 100%;
    min-width: 600px;
    table-layout: fixed;
}

.calendar th {
    font-size: 24px;
    padding-bottom: 20px;
}

.calendar td {
    border: 1px solid lightgray;
    background-color: white;
    width: 14.28%; /* Equal width for 7 columns */
    padding: 0;
    vertical-align: top;
}

.meal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background-color: white;
    padding: 10px 15px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
}

.heart-svg.favorited path {
    fill: red;
}

.meal button {
    border: none;
    font-size: 20px;
    cursor: pointer;
    background-color: white;
}



.meal img {
    background-color: white;
}



.modal-recipe-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
    overflow: scroll;
    max-height: 400px;
}

.modal-recipe-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50px;
    border: 1px solid lightgray;
    border-radius: 20px;
    padding: 20px;
    position: relative;
}

@media (max-width: 480px) {
    /* Update modal styles */
    .modal {
        background: #98ecb4;
        border-radius: 5px;
        position: fixed; /* Change from absolute to fixed */
        cursor: default; /* Remove move cursor */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 100%;
        width: 400px;
        z-index: 1100;
        max-height: 80vh; /* Limit modal height */
        overflow: hidden; /* Hide overflow */
    }

    /* Update recipe cards container */
    .modal-recipe-cards {
        display: flex; /* Change from grid to flex */
        flex-wrap: nowrap;
        gap: 16px;
        padding: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scroll-snap-type: x mandatory;
    }

    .modal-recipe-card {
        flex: 0 0 auto;
        width: 200px;
        min-width: 200px;
        scroll-snap-align: start;
        background: white;
        border: 1px solid lightgray;
        border-radius: 20px;
        padding: 20px;
        position: relative;
    }

        /* Add scrollbar styling */
    .modal-recipe-cards::-webkit-scrollbar {
        height: 8px;
    }

    .modal-recipe-cards::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .modal-recipe-cards::-webkit-scrollbar-thumb {
        background: #65ab65;
        border-radius: 4px;
    }

}

.add-meal-button {
    padding: 10px 20px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    background-color: #65ab65;
    border: none;
}

.modal-title-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}



.clear-all {
    border-radius: 5px;
    background-color: white;
    padding: 5px 10px;
    font-size: 24px;
    cursor: pointer;
}

.generate-shopping-list {
    border-radius: 5px;
    font-size: 24px;
    background-color: #65ab65;
    color: white;
    padding: 5px 10px;
    cursor: pointer;
}

/* Shopping List */

.shopping-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
}

.shopping-list-header {
    font-size: 48px;
    padding-bottom: 50px;
}

@media (max-width: 480px) {
    .shopping-list-header {
        font-size: 32px;
    }
}

.shopping-wrapper {
    border: 1px solid lightgray;
    width: 50%;

}
.shopping-list-ul {
    list-style: none;
    font-size: 50px;
}

.shopping-list .item {
    display: flex;
    gap: 16px;
}

.shopping-list .item input {
    width: 50px;
    height: 50px;
}

.shopping-list-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.clear-list, .export-print {
    border-radius: 5px;
    font-size: 32px;
    background-color: #65ab65;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border: none;
}


@media (max-width: 480px) {
    .shopping-list-ul {
        font-size: 24px;
    }

    .clear-list {
        height: 70px;
    }

    .clear-list, .export-print {
        width: 170px;
        font-size: 24px;
    }
}
/* Favorites */

.favorites {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
}

.favorites-header {
    font-size: 48px;
    padding-bottom: 50px;
}

.favorite-recipe-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

.favorite-recipe-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid lightgray;
    border-radius: 20px;
    padding: 20px;
    position: relative;
}

#success-toast-message, #clear-success-toast-message, 
#update-success-toast-message, #delete-success-toast-message, 
#generate-success-toast-message, #clear-list-success-toast-message {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px; /* Divide value of min-width by 2 */
    background-color: #06c455; /* Black background color */
    color: #fff; /* White text color */
    text-align: center; /* Centered text */
    border-radius: 2px; /* Rounded borders */
    padding: 16px; /* Padding */
    position: fixed; /* Sit on top of the screen */
    z-index: 1; /* Add a z-index if needed */
    left: 50%; /* Center the snackbar */
    bottom: 30px; /* 30px from the bottom */
}

#success-toast-message.show, #clear-success-toast-message.show, 
#update-success-toast-message.show, #delete-success-toast-message.show, 
#generate-success-toast-message.show, #clear-list-success-toast-message.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

#error-toast-message, #errorMessage {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px; /* Divide value of min-width by 2 */
    background-color: #c40606; /* Black background color */
    color: #fff; /* White text color */
    text-align: center; /* Centered text */
    border-radius: 2px; /* Rounded borders */
    padding: 16px; /* Padding */
    position: fixed; /* Sit on top of the screen */
    z-index: 1; /* Add a z-index if needed */
    left: 50%; /* Center the snackbar */
    bottom: 30px; /* 30px from the bottom */
}

#error-toast-message.show, #errorMessage.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
  from {bottom: 0; opacity: 0;} 
  to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
  from {bottom: 30px; opacity: 1;} 
  to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}


@media (max-width: 480px) {
    .favorites-header {
        font-size: 36px;
    }

    .favorite-recipe-cards {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        max-width: 350px;
    }

    .meal-plan-calendar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .calendar {
        min-width: 500px;
        border-spacing: 2px;
    }

    .meal {
        padding: 8px 10px;
        gap: 8px;
    }

    .meal button {
        font-size: 14px;
        padding: 6px 10px;
    }
}