//
// calendar.scss
//

:root {
    --fc-border-color: var(--#{$prefix}border-color);
    --fc-page-bg-color: var(--#{$prefix}secondary-bg);
    --fc-neutral-bg-color: var(--#{$prefix}light);
}

.fc td,
.fc th {
    border: $table-border-width solid $table-border-color;
}

.fc {
    .fc-toolbar {
        h2 {
            font-size: 16px;
            line-height: 30px;
            text-transform: uppercase;
        }

        @media (max-width: 767.98px) {

            .fc-left,
            .fc-right,
            .fc-center {
                float: none;
                display: block;
                text-align: center;
                clear: both;
                margin: 10px 0;
            }

            >*>* {
                float: none;
            }

            .fc-today-button {
                display: none;
            }
        }

        .btn {
            text-transform: capitalize;
        }
    }

    .fc-col-header-cell {
        background-color: var(--#{$prefix}light);
    }

    .fc-col-header-cell-cushion {
        display: block;
        padding: 8px 4px;
        color: var(--#{$prefix}body-color);
    }

    .fc-daygrid-day-number {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: $font-weight-medium;
        margin: 2px;
        color: var(--#{$prefix}body-color);
    }

    .fc-daygrid-day {
        &.fc-day-today {
            background-color: var(--#{$prefix}light-bg-subtle);

            .fc-daygrid-day-number {
                background-color: var(--#{$prefix}primary);
                color: $white;
            }
        }
    }

    .fc-timegrid-col {
        &.fc-day-today {
            background-color: var(--#{$prefix}light-bg-subtle);
        }
    }

    .fc-list-event:hover td {
        background: transparent;
    }

    .fc-list-event-title {
        a {
            color: $white !important;
        }
    }

    .fc-col-header,
    .fc-daygrid-body,
    .fc-scrollgrid-sync-table {
        width: 100% !important;
    }

    .fc-scrollgrid-section>* {
        border-left: $table-border-width solid $table-border-color;
        border-top: $table-border-width solid $table-border-color;
    }

    .fc-scrollgrid {
        border: 0;
    }

    .fc-scrollgrid-section-liquid>td {
        border-top: 0;
    }

    .fc-multimonth {
        border-color: var(--#{$prefix}border-color);
    }
}

.fc-theme-bootstrap a:not([href]) {
    color: var(--#{$prefix}body-color);
}

.fc-event {
    color: $white;
}

.fc {
    th.fc-widget-header {
        background: var(--#{$prefix}gray-300);
        line-height: 20px;
        padding: 10px 0;
        text-transform: uppercase;
        font-weight: $font-weight-bold;
    }
}

.fc-unthemed {

    .fc-content,
    .fc-divider,
    .fc-list-heading td,
    .fc-list-view,
    .fc-popover,
    .fc-row,
    tbody,
    td,
    th,
    thead {
        border-color: $gray-300;
    }

    td.fc-today {
        background: lighten($gray-200, 2%);
    }
}

.fc-button {
    background: var(--#{$prefix}primary);
    border-color: var(--#{$prefix}border-color);
    color: $gray-700;
    text-transform: capitalize;
    box-shadow: none;
    padding: 6px 12px !important;
    height: auto !important;
}

.fc .fc-multimonth-multicol .fc-daygrid-more-link {
    border: 1px solid var(--#{$prefix}primary);
    display: block;
    float: none;
    padding: 1px;
    font-weight: $font-weight-medium;
}

.fc-state-down,
.fc-state-active,
.fc-state-disabled {
    background-color: var(--#{$prefix}primary);
    color: $white;
    text-shadow: none;
}

.fc-event {
    border-radius: 2px;
    border: none;
    cursor: move;
    font-size: 0.8125rem;
    margin: 5px 7px;
    padding: 5px 5px;
    text-align: center;
}

.fc-theme-standard {
    .fc-popover {
        .fc-popover-header {
            padding: 8px 14px;
        }
    }
}

.fc-event,
.fc-event-dot,
.fc-daygrid-dot-event.fc-event-mirror,
.fc-daygrid-dot-event:hover {
    background-color: var(--#{$prefix}primary);
}

.fc-event-title,
.fc-sticky {
    font-weight: $font-weight-medium !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-daygrid-event-dot {
    border-color: $white !important;
    display: none;
}

.fc-event-time {
    display: none;
}

.fc-event .fc-content {
    color: $white;
}

#external-events {
    .external-event {
        text-align: left;
        padding: 8px 16px;
        margin: 6px 0;
    }
}

.fc-day-grid-event.fc-h-event.fc-event.fc-start.fc-end.bg-dark {
    .fc-content {
        color: $light;
    }
}

.fc-h-event .fc-event-main,
.fc-v-event .fc-event-main {
    color: inherit !important;
}

.fc-prev-button,
.fc-next-button {
    position: relative;
    padding: 6px 8px !important;
}


.fc-toolbar-chunk {
    .fc-button-group {

        .fc-button {
            color: var(--#{$prefix}primary);
            background-color: rgba(var(--#{$prefix}primary-rgb), 0.1);
            border: none;
            box-shadow: none !important;

            &:hover,
            &.active {
                color: $white;
                background-color: var(--#{$prefix}primary);
            }
        }
    }

    .fc-today-button {
        background-color: var(--#{$prefix}primary) !important;
        border: var(--#{$prefix}primary);
        box-shadow: none !important;
    }
}

.fc {

    .fc-button-primary:not(:disabled).fc-button-active,
    .fc-button-primary:not(:disabled):active {
        background-color: var(--#{$prefix}primary) !important;
        border-color: var(--#{$prefix}primary) !important;
        color: $white !important;
    }

    .fc-button-primary {
        text-transform: capitalize;
    }
}


.fc-toolbar {
    @media (max-width: 575.98px) {
        flex-direction: column;
        gap: 16px;
    }
}

#event-modal {
    .event-details {
        display: none;
    }

    .view-event {
        .event-form {
            display: none;
        }

        #event-category-tag {
            display: none;
        }

        .event-details {
            display: block;
        }
    }
}

.fc-daygrid-event-harness {
    .fc-daygrid-event {
        backdrop-filter: blur(4px);
    }
}

.fc-timegrid-event-harness {
    .fc-timegrid-event {
        backdrop-filter: blur(4px);
    }
}


.fc-timegrid-slots {
    table {
        tr {
            border-color: var(--#{$prefix}border-color) !important;
        }
    }
}

.fc-list-table {
    border-color: var(--#{$prefix}border-color);
}

@each $color,
$value in $theme-colors {
    .fc-daygrid-event-harness {
        .fc-daygrid-event {
            &.bg-#{$color}-subtle {

                .fc-event-title,
                .fc-event-main {
                    color: var(--#{$prefix}value);
                }
            }
        }
    }

    .fc-timegrid-event-harness {
        .fc-timegrid-event {
            &.bg-#{$color}-subtle {
                .fc-event-title {
                    color: $value !important;
                }
            }
        }
    }

    .fc-list-table {
        .fc-list-event {
            &.bg-#{$color}-subtle {
                color: $value !important;

                .fc-list-event-title {
                    >a {
                        color: $value !important;
                    }
                }

                .fc-list-event-dot {
                    border-color: $value;
                }
            }
        }
    }
}

.fc-daygrid-event-harness .fc-daygrid-event.bg-dark-subtle {

    .fc-event-main,
    .fc-event-title {
        color: var(--#{$prefix}dark-text-emphasis) !important;
    }
}

.fc-direction-ltr {
    direction: ltr;

    .fc-toolbar>*>:not(:first-child) {
        margin-left: 0.75em;
    }
}