/* ===============================
   CALENDAR WRAPPER
================================= */
#calendar {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    padding: 0px;
    box-sizing: border-box;
}
#calendar.fc table{
margin-bottom: 0;
}
#calendar table.fc-col-header {
    margin-bottom: 0;
}
/* ===============================
   FULLCALENDAR CORE SAFETY
================================= */
/* Never break FullCalendar scrollers */
.fc .fc-scroller {
    /* overflow: auto !important; */
    -webkit-overflow-scrolling: touch;
}

/* Prevent layout overflow issues */
.fc {
    max-width: 100%;
}

/* ===============================
   TOOLBAR STYLES
================================= */
.fc .fc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Stack toolbar safely on mobile */
@media (max-width: 768px) {
    .fc .fc-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
}

.fc .fc-toolbar-title {
    margin: 10px 0 0;
}

/* Toolbar background */
.fc-toolbar .fc-toolbar-chunk:last-child {
    width: 100%;
    padding: 10px;
    background-color: rgb(87, 182, 178);
}

/* Buttons */
.fc-button-group .fc-prev-button,
.fc-button-group .fc-next-button,
.fc-toolbar-chunk .fc-today-button {
    background-color: rgb(215, 119, 26);
    border-color: #ffffff;
}

/* ===============================
   CALENDAR TEXT & LINKS
================================= */
a.fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
    color: rgb(34, 34, 34) !important;
    text-decoration: none !important;
    font-weight: normal;
}

/* ===============================
   EVENTS
================================= */
.fc-daygrid-event {
    font-size: 14px;
    text-align: center;
}

.fc-event-title {
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
}

.fc-event:hover {
    color: #ffffff !important;
}

/* Smaller font on small devices */
@media (max-width: 768px) {
    .fc-daygrid-event {
        font-size: 11px;
    }
}

/* ===============================
   MODAL (UNCHANGED & SAFE)
================================= */
.modal {
    display: none;
    align-items: center;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background-color: rgb(122 122 122 / 60%);
}

.modal-content {
    height: fit-content;
    background-color: #ffffff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 450px;
    border-radius: 10px;
    position: relative;
}

/* Close button */
.close {
    color: #363636;
    font-size: 28px;
    position: absolute;
    right: -20px;
    top: -20px;
    background-color: #eeeeee;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.4s ease;
}

.close:hover {
    transform: rotate(90deg);
    cursor: pointer;
}

/* Modal content */
#modal-content ul li {
    padding: 10px;
    list-style: auto;
}

#modal-content ul li:not(:last-child) {
    margin-bottom: 10px;
}

#modal-content a {
    color: #ffffff;
    display: block;
    text-decoration: none;
}

/* ===============================
   SMALL DEVICES
================================= */
@media (max-width: 489px) {
    #calendar {
        padding: 10px;
        min-height: 650px;
    }

    .modal-content {
        padding: 15px;
        width: 85%;
    }

    .close {
        right: -10px;
        top: -15px;
        width: 30px;
        height: 30px;
        font-size: 22px;
    }
}
