:root {
    /* Default values to be overridden by themes */
    --calendar-coll-event-background-lightness: 95%;
    --calendar-coll-event-background-saturation: 80%;
    --calendar-coll-event-background-color: var(--accented-background-color);
    --calendar-coll-event-text-color: var(--main-text-color);
    --calendar-coll-event-hover-filter: none;
    --callendar-coll-event-archived-sripe-color: #00000013;
    --calendar-coll-today-background-color: var(--more-accented-background-color);
}

.calendar-view {
    --fc-event-border-color: var(--calendar-coll-event-text-color);
    --fc-event-bg-color: var(--calendar-coll-event-background-color);
    --fc-event-text-color: var(--calendar-coll-event-text-color);
    --fc-event-selected-overlay-color: transparent;
    --fc-today-bg-color: var(--calendar-coll-today-background-color);

    overflow: hidden;
    position: relative;
    outline: 0;
    height: 100%;
    user-select: none;
    padding: 10px;
}

.calendar-view a,
:root .calendar-view a.fc-daygrid-event:hover {
    color: var(--fc-event-text-color);
}

.search-result-widget-content .calendar-view {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
}

.calendar-container {
    height: 100%;
    --fc-page-bg-color: var(--main-background-color);
    --fc-border-color: var(--main-border-color);
    --fc-neutral-bg-color: var(--launcher-pane-background-color);
    --fc-list-event-hover-bg-color: var(--left-pane-item-hover-background);
}

.calendar-container .fc-list-sticky .fc-list-day > * {
    z-index: 50;
}

.calendar-container .fc-button {
    padding: 0.2em 0.5em;
}

.calendar-container .promoted-attribute {
    font-size: 0.85em;
    opacity: 0.85;
    overflow: hidden;
}

/* #region Header */
.calendar-view .calendar-header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-view .calendar-header .btn {
    min-width: unset !important;
}

.calendar-view .calendar-header > .title {
    flex-grow: 1;
    font-size: 1.3rem;
    font-weight: normal;
}

body.desktop:not(.zen) .calendar-view .calendar-header {
    padding-block-start: 4px;
    padding-inline-end: 5em;
}

.search-result-widget-content .calendar-view .calendar-header {
    padding-inline-end: unset !important;
}
/* #endregion */

/* #region Events */

/*
 * week, month, year views
 */

 .calendar-container a.fc-event {
    text-decoration: none;
}

.calendar-container a.fc-event.archived {
    opacity: .65;
}

.calendar-container a.fc-event.archived::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;

    --c1: transparent;
    --c2: var(--callendar-coll-event-archived-sripe-color);

    background: repeating-linear-gradient(45deg, var(--c1), var(--c1) 8px,
                                          var(--c2) 8px, var(--c2) 16px);
}

.calendar-view a.fc-timegrid-event,
.calendar-view a.fc-daygrid-event,
.calendar-view .fc-daygrid-dot-event .fc-event-title {
    font-weight: 500;
}

.calendar-view a.fc-timegrid-event,
.calendar-view a.fc-daygrid-event {
    --border-color: transparent;
    
    border: 2px solid;
    border-left-width: 4px;
    border-color: var(--border-color) var(--border-color) var(--border-color)
                  var(--fc-event-text-color) !important;
    background: var(--fc-event-bg-color) !important;

    padding-left: 8px;
}

.calendar-view .fc-timegrid-event.with-hue,
.calendar-view .fc-daygrid-event.with-hue {
    --fc-event-text-color: var(--custom-color);

    --fc-event-bg-color: hsl(var(--custom-color-hue),
                    var(--calendar-coll-event-background-saturation),
                    var(--calendar-coll-event-background-lightness)) !important;
}

.calendar-view a.fc-timegrid-event:focus-visible,
.calendar-view a.fc-daygrid-event:focus-visible {
    outline: none;
}

.calendar-view a.fc-timegrid-event.fc-event-selected,
.calendar-view a.fc-timegrid-event.fc-event:focus,
.calendar-view a.fc-daygrid-event.fc-event-selected,
.calendar-view a.fc-daygrid-event.fc-event:focus {
    --border-color: var(--custom-color, var(--input-focus-outline-color));
}

.calendar-view a.fc-timegrid-event:hover,
.calendar-view a.fc-daygrid-event:hover {
    filter: var(--calendar-coll-event-hover-filter);
    border-color: var(--fc-event-text-color);
    text-decoration: none;
    color: currentColor;
    opacity: 1;
}

.calendar-view .fc-daygrid-event-dot {
    display: none;
}


.calendar-view .fc-event-time {
    opacity: .75;
}

/* 
 * List view
 */

.fc-list-table tr.fc-event.archived {
    opacity: .5;
}

.fc-list-table .fc-list-event-dot {
    /* Apply note colors to the list item dots */
    --fc-event-border-color: var(--custom-color);
}

/* #endregion */