﻿/* --- Calendar Wrapper --- */
.calendar-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: solid 5px #000;
    border-radius: 8px;
    box-shadow: 10px 10px 0px #000;
}

/* --- Header --- */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ccc;
    flex-wrap: wrap;
}

    .calendar-header h2 {
        text-align: center;
        font-weight: 700;
        font-size: 2.4rem;
        margin: 0 auto;
    }
@media (max-width: 450px) {
    .calendar-header h2 {
        font-size: 1.3rem;
    }
}
.btn-month-nav {
    font-size: 1.6rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    color: #333;
    transition: background 0.2s;
}

    .btn-month-nav:hover {
        background: #eee;
    }

/* --- Day Labels --- */
.day-labels {
    display: none;
}

/* --- Calendar Grid (Mobile Stacked by Default) --- */
.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calendar-cell {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-bottom: 2px solid #eee;
    display: block;
    border-radius: 6px;
    position: relative;
}

    .calendar-cell.empty {
        visibility: hidden;
        display: block;
    }

    /* --- Circular Date Badge with Weekday (Mobile Style) --- */
    .calendar-cell .date {
        font-size: 1.4rem;
        font-weight: 700;
        width: 42px;
        height: 42px;
        line-height: 42px;
        text-align: center;
        border-radius: 50%;
        display: inline-block;
        position: relative;
        margin-bottom: 10px;
        border: 2px solid #e8e8e8; /* light grey border */
        color: #002664;
        background: transparent;
    }

    /* Style for Today's Date */
    .calendar-cell .today-date {
        background: #eecb27 !important;
        color: #fff !important;
        border: none;
    }

        .calendar-cell .date:before {
            content: attr(data-week-day) " ";
            position: absolute;
            left: 48px;
            top: 2px;
            color: #666;
            font-size: 1.4rem;
        }

    /* --- Event Links --- */
    .calendar-cell .event {
        margin-top: 10px;
    }

.event-link {
    text-decoration: none;
    padding: 5px;
    display: block;
    color: #000;
    transition: color 0.2s linear;
    font-weight: 700;
}

    .event-link:hover,
    .event-link:focus {
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.01);
        color: #d42027;
    }

.menu-link {
    text-decoration: none;
    padding: 2px;
    display: block;
    color: #000;
    transition: color 0.2s linear;
    font-weight: 400;
}

/* --- Legend --- */
.calendar-legend {
    font-size: 0.85rem;
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* --- Existing Styles Support --- */
/*.calendar-cell.today {
    border: 2px solid #007bff;
    background-color: #eecb27;
}*/

/*.calendar-cell.has-meals {
    background-color: #e6f8e6;
}*/

/* --- Desktop Grid View at 960px+ --- */
@media (min-width: 960px) {
    .day-labels {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        text-align: center;
        font-weight: 700;
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }

    .calendar-cell {
        padding: 10px;
        min-height: 120px;
        border: 1px solid #ddd;
/*        background-color: #f9f9f9;
*/    }

        .calendar-cell .date {
            float: right;
            margin-bottom: 10px;
        }

            .calendar-cell .date:before {
                display: none;
            }

        .calendar-cell.today .date {
            background-color: #eecb27;
            border: none;
        }

/*        .calendar-cell.has-meals {
            background-color: #f3f3f3;
        }
*/
    .event-link {
        clear: both;
        font-size: 1rem;
    }
}

/* --- Icon Colors --- */
.text-green {
    color: #28a745;
}

.text-red {
    color: #d42027;
}

.text-gray {
    color: #6c757d;
}

.text-blue {
    color: #007bff;
}

.event-icon.multi {
    color: #0d6efd;
}

.event-icon.ongoing {
    color: #fd7e14;
}

.event-icon[title] {
    cursor: help;
}

.event-icon.fa-play {
    color: green;
}

.event-icon.fa-clock {
    color: orange;
}

.event-icon.fa-flag-checkered {
    color: red;
}

/* --- Button Style --- */
.btn-month-nav {
    padding: 6px 12px;
    font-size: 1rem;
    font-weight: bold;
}

/* --- MODAL STYLING --- */

/* Modal Container */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Content Fade-In (pure CSS) */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: fadeInScale 0.3s ease;
    width: 35vw;
    max-width: 95%;
    max-height: 85vh;
    background-color: #fff;
    padding: 0px;
    border-radius: 8px;
    box-shadow: 5px 5px 10px #000;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
@media (max-width: 450px) {
    .modal-content{
        width: 95vw;
    }
}
    .modal-text {
        padding: 10px;
    }

    /* Full-width modal image at the top */
    #modal-photo {
        width: 100%;
        height: 150px;
        object-fit: cover;
        display: block;
        margin: 0;
        padding: 0;
        position: relative;
        z-index: 1;
    }

    

    /* Modal title over the photo */
    #modal-title {
        position: relative;
        bottom: 70px;
        left: 20px;
        z-index: 3;
        font-size: 1.5rem;
        color: #fff;
        font-weight: 700;
        margin: 0;
        text-shadow: 3px 3px 0px #000;
    }


    /* Close button in upper-right over the image */
    .close-button {
        position: absolute;
        top: 10px;
        right: 12px;
        font-size: 1.5rem;
        font-weight: bold;
        cursor: pointer;
        color: #fff;
        background: black;
        border-radius: 20px;
        z-index: 4;
        width: 32px;
        height: 32px;
        text-align: center;
        line-height: 32px;
        transition: color 0.2s linear;
    }

        .close-button:hover {
            color: #d42027;
        }

    /* Modal body text area */
.modal-content p {
    padding: 3px 20px;
    margin: 0;
    font-size: 0.8rem;
    color: #333;
    line-height: 1.4;
}

#modal-description{
    padding-bottom: 25px
}

        .modal-content p strong {
            display: inline-block;
            width: 100px;
        }

    /* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    margin-top: auto;
    background: black;
}

        .modal-footer .button--secondary {
            font-size: 0.7rem !important;
        }

    #modal-url {
        font-weight: bold;
        padding: 4px 8px;
        border-radius: 5px;
        text-align: center;

    }

    /*.footer-divider {
        content: "";
        position: relative;
        margin-bottom: 0.5vh;
        top: 0;
        left: 0;
        height: 2px;
        width: 100%;
        background: linear-gradient(to right, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.05));
    }*/

    /* Other Elements */
    #daily-modal-title {
        padding-bottom: 15px;
    }    
    #weekly-modal-title {
        padding-bottom: 15px;
    }

    .meal-block {
        padding: 11px 0px;
    }

    #start-time {
        margin-right: 20px;
    }


#daily-modal-body, #weekly-modal-body {
    padding: 0px 30px 30px 30px;
}


.meal-content {
    position: relative;
    padding-top: 160px; /* adjust to match your image height */
    background-color: #fff; /* fallback */
}

.daily {
    background-image: url('../images/menu/daily_header.jpg'); /* update with your image path */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
}
.weekly {
    background-image: url('../images/menu/weekly_header.jpg'); /* update with your image path */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
}

/* Keep title and body visually separated */
#daily-modal-title, #weekly-modal-title {
    margin-top: -140px; /* pull title up over image */
    margin-bottom: 20px;
    padding: 20px;
    color: #fff;
    font-size: 2.4rem;
    font-weight: bold;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.6); /* readability over image */
    z-index: 2;
    position: relative;
}

.meal-block ul{
    line-height: 1.3;
}
/* Make the inner modal scrollable without affecting header/footer */
.modal-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 85vh; /* already set, good! */
}

#weekly-modal-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 0px 30px 30px 30px;
}

/* Ensure modal-footer stays pinned at the bottom */
.modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    margin-top: auto;
    background: black;
}
.date-range{
    font-size: 1.4rem;
}
@media (max-width: 450px) {
    #daily-modal-title, #weekly-modal-title {
        font-size: 2rem;
    }
    .daily {
        background-size: 580px !important;
    }
    .weekly {
        background-size: 685px !important;
    }
}