/* Events Calendar Grid Styles */
.events-calendar-grid {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    font-family: inherit;
    box-sizing: border-box;
}
.calendar-grid-header, .calendar-grid-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    box-sizing: border-box;
}
.calendar-grid-dayname, .calendar-grid-cell {
    text-align: center;
    padding: 0.75rem 0;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    letter-spacing: 0.05em;
    box-sizing: border-box;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}
.calendar-grid-dayname {
    font-weight: 600;
    color: #333;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}
.calendar-grid-body {
    background: #fff;
}
.calendar-grid-cell {
    min-height: 90px;
    border: 1px solid #f0f0f0;
    padding: 0.5rem 0.25rem 0.25rem 0.5rem;
    position: relative;
    background: #fff;
    vertical-align: top;
    transition: background 0.2s;
    font-weight: normal;
    color: inherit;
    border-bottom: none;
}
.calendar-grid-cell.empty {
    background: #fafafa;
    border: none;
}
.calendar-date {
    font-size: 1.1rem;
    font-weight: 500;
    color: #007cba;
    margin-bottom: 0.25rem;
}
.calendar-event {
    background: #eaf6ff;
    color: #007cba;
    border-radius: 5px;
    margin: 0.2rem 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar-event:hover {
    background: #007cba;
    color: #fff;
}
.calendar-event a {
    color: inherit;
    text-decoration: none;
}
.calendar-event a:hover {
    text-decoration: underline;
}

.calendar-month-scroll {
    display: flex;
    flex-direction: column; /* for vertical, use row for horizontal */
    max-height: 300px;
    overflow-y: auto;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.month-box {
    padding: 1rem;
    background: #f0f0f0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.month-box.active {
    background: #1976d2;
    color: #fff;
    font-weight: bold;
}
.month-box:hover {
    background: #90caf9;
}

.calendar-monthyear-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
    max-width: 95vw;
}
.calendar-monthyear-cols {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    justify-content: center;
    width: 100%;
}
.modal-col {
    display: flex;
    flex-direction: column;
    max-height: 300px;
    overflow-y: auto;
    min-width: 120px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 0.5rem 0.5rem 1rem 0.5rem;
    box-sizing: border-box;
}
.modal-col-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #1976d2;
}
.year-box {
    padding: 1rem 0.5rem;
    background: #f0f0f0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 0.25rem;
    transition: background 0.2s, color 0.2s;
}
.year-box.active {
    background: #1976d2;
    color: #fff;
    font-weight: bold;
}
.year-box:hover {
    background: #90caf9;
}
.modal-col-submit {
    margin-top: 1.5rem;
    text-align: center;
}
#monthYearSubmit.button {
    padding: 0.7rem 2.5rem;
    font-size: 1.1rem;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    margin-bottom: 1rem;
}
#monthYearSubmit.button:hover {
    background: #125ea2;
}


@media (max-width: 900px) {
    .events-calendar-grid {
        max-width: 100%;
    }
}
@media (max-width: 700px) {
    .calendar-grid-header, .calendar-grid-body {
        font-size: 0.95rem;
    }
    .calendar-grid-cell, .calendar-grid-dayname {
        min-height: 60px;
        padding: 0.3rem 0.1rem 0.1rem 0.3rem;
    }
}
@media (max-width: 500px) {
    .calendar-grid-header, .calendar-grid-body {
        font-size: 0.85rem;
    }
    .calendar-grid-cell, .calendar-grid-dayname {
        min-height: 40px;
        padding: 0.15rem 0.05rem 0.05rem 0.15rem;
    }
    .calendar-date {
        font-size: 1rem;
    }
}
