#calendar {
    --calendar-bar-height: 48px;
    --calendar-day-header-height: 24px;

    width: 100vw;
    min-height: 50vh;
    position: relative;
    left: calc(-50vw + 50%);
    margin: 2em 0;
    overflow: clip;
    background-color: var(--color-white);
}

.navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--calendar-bar-height);
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-white);
}

.navigation-bar button {
    color: var(--color-theme);
    background-color: transparent;
    font-weight: 700;
    word-break: keep-all;
}

.navigation-bar button.disabled {
    color: var(--color-light-gray);
}

.navigation-bar .navigation {
    display: flex;
    flex-direction: row;
}

.navigation-bar .range {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: var(--calendar-bar-height);
}

.navigation-bar button[name="prev"]::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: "\f053";
}

.navigation-bar button[name="next"]::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: "\f054";
}

.loader {
    border: 4px solid var(--color-light-gray);
    border-top: 4px solid var(--color-gray);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 2s linear infinite;
}

.week-view .week {
    display: flex;
    flex-direction: column;
}

.week-view .day[data-count="0"] {
    display: none;
}

.week-view .day-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    position: sticky;
    top: var(--calendar-bar-height);
    z-index: 1;
    height: var(--calendar-day-header-height);
    font-size: 0.9em;
    padding: 0 0.5em;
    background: var(--color-white-transparent);
}

.week-view .day-header .count {
    color: var(--color-gray);;
}
.week-view .no-events {
    margin: 8px;
    text-align: center;
}

.month-view .month-header {
    display: flex;
    flex-direction: row;
    position: sticky;
    top: var(--calendar-bar-height);
    z-index: 2;
    height: var(--calendar-day-header-height);
    background-color: var(--color-white);
}

.month-view .month-header .day-of-week {
    flex: 1;
    font-size: 0.8em;
    text-align: center;
    vertical-align: middle;
    line-height: var(--calendar-day-header-height);
}

.month-view .week {
    display: flex;
    flex-direction: row;
}

.month-view .day {
    flex: 1;
}

.month-view .day-header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    position: sticky;
    top:  calc(var(--calendar-bar-height) + var(--calendar-day-header-height));
    z-index: 1;
    height: var(--calendar-day-header-height);
    font-size: 0.8em;
    padding: 0;
    background: var(--color-white);
    opacity: 0.8;
}

.month-view .day-header .count {
    display: none;
}

.month-view .day-header .date {
    width: calc(var(--calendar-day-header-height) - 2px);
    height: calc(var(--calendar-day-header-height) - 2px);
    line-height: calc(var(--calendar-day-header-height) - 2px);
    text-align: center;
    vertical-align: middle;
}

.month-view .other-month .day-header .date {
    color: var(--color-gray);
}

.month-view .today .day-header .date {
    color: var(--color-white);
    background: var(--color-black);
    border-radius: calc(var(--calendar-day-header-height) - 2px);
}

.month-view .events {
    min-height: var(--calendar-day-header-height);
}

#calendar .event {
    animation: show 0.5s linear;
}

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

@keyframes show {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (min-width: 660px) {
    #calendar {
        width: 100%;
        position: initial;
    }
}
