/* === Calendar pager === */
.pager-year {
    line-height: 38px;
    margin: 0 10px;
}

/* === Calendar Grid === */
.calendar-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem;
}

/* === Month Container === */
.calendar-month-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.calendar-month {
    border: 1px solid #ddd;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* === Month Title === */
.date-heading {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    text-align: center;
}

/* === Calendar Table === */
.calendar-mini-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.calendar-mini-table th,
.calendar-mini-table td {
    width: 14.2857%;
    /* 7 columns */
    padding: 0;
    vertical-align: top;
    box-sizing: border-box;
}

/* === Square Cell Wrapper === */
.calendar-mini-table td .year-day-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* Square cell */
    box-sizing: border-box;
    background-color: transparent;
}

.calendar-mini-table td .year-day-wrapper>.year.day {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    box-sizing: border-box;
    background-color: transparent;
}


/* === Events and Past/Future States === */
.past .year.day,
.past .month {
    text-decoration: line-through;
    color: lightgray;
}

.has-events.past .year.day,
.has-events.past .year.day a {
    text-decoration: line-through;
    color: lightgrey;
}

.has-events.today .year.day {
    border: 4px solid chocolate;
}

.has-no-events.today .year.day {
    border: 4px solid grey;
}

.future-month,
.past-month {
    visibility: hidden;
}

.has-events:not(.past) div {
    background-color: coral !important;
    color: white;
}

.has-events a {
    color: white;
    pointer-events: none; /* link naar dag events uitschakelen */
}

/* === Gradient Backgrounds for Special Cases === */
.calendar-mini-table td {
    background: #f0f0f0;
}

/* Default gradient for other days */
td.has-events:not(.past).first-red div {
    background: linear-gradient(-45deg, coral 50%, #f0f0f0 50%) !important;
    /* Weekday background */
    color: white;
}

td.has-events:not(.past).last-green div {
    background: linear-gradient(135deg, coral 50%, #f0f0f0 50%) !important;
    /* Weekday background */
    color: white;
}

/* Weekend background */
.calendar-mini-table td:nth-child(6),
.calendar-mini-table td:nth-child(7) {
    background: #e0e0e0;
}

td.has-events:not(.past).first-red:nth-child(6) div,
td.has-events:not(.past).first-red:nth-child(7) div {
    background: linear-gradient(-45deg, coral 50%, #e0e0e0 50%) !important;
    /* Use #e0e0e0 for weekends */
    color: white;
}

td.has-events:not(.past).last-green:nth-child(6) div,
td.has-events:not(.past).last-green:nth-child(7) div {
    background: linear-gradient(135deg, coral 50%, #e0e0e0 50%) !important;
    /* Use #e0e0e0 for weekends */
    color: white;
}