/* The pro's calendar, and the public one on a pro's profile. */

.bi-cal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.bi-cal-head h2 {
    font-size: 1.1rem;
}

.bi-cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 900px) {
    .bi-cal-week {
        grid-template-columns: 1fr;
    }
}

.bi-cal-day {
    min-height: 120px;
    padding: 8px;
    border: 1px solid var(--bi-border);
    border-radius: 10px;
    background: #fbfcfd;
}

.bi-cal-day.is-today {
    border-color: #0a4f8f;
    box-shadow: inset 0 0 0 1px #0a4f8f;
}

.bi-cal-day.is-past {
    opacity: 0.6;
}

.bi-cal-date {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
    color: #4a5866;
}

.bi-cal-date strong {
    color: #0a315f;
    font-size: 1.15rem;
}

.bi-cal-items {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.bi-cal-item {
    padding: 4px 6px;
    border-left: 3px solid;
    border-radius: 4px;
    overflow-wrap: anywhere;
}

.bi-cal-time {
    display: block;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bi-cal-block {
    border-color: #8a96a3;
    background: #eef1f4;
}

.bi-cal-booking {
    border-color: #1d7a4c;
    background: #e5f4ec;
}

.bi-cal-request {
    border-color: #b7791f;
    background: #fdf3e1;
}

.bi-cal-free {
    color: #1d7a4c;
}

.bi-cal-blocks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bi-cal-blocks li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bi-border);
}

.bi-cal-blocks li:last-child {
    border-bottom: 0;
}

.bi-cal-blocks form {
    margin: 0;
}

/* public calendar */

.bi-cal-public {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bi-cal-public li {
    padding: 8px 10px;
    border: 1px solid var(--bi-border);
    border-radius: 8px;
    font-size: 0.88rem;
}

.bi-cal-public .is-taken {
    background: #f3f4f6;
    color: #5b6773;
}

/* ---- the pro's month / week / day calendar (FullCalendar) ---- */

.bi-cal-panel {
    --fc-border-color: #dfe5ec;
    --fc-button-bg-color: #fff;
    --fc-button-border-color: #c9d3de;
    --fc-button-text-color: #0a315f;
    --fc-button-hover-bg-color: #eef4fb;
    --fc-button-hover-border-color: #9fb2c7;
    --fc-button-active-bg-color: #0a315f;
    --fc-button-active-border-color: #0a315f;
    --fc-today-bg-color: #f3f8fd;
    --fc-now-indicator-color: #c0392b;
    --fc-event-border-color: transparent;
}

.bi-cal-panel .fc .fc-button-primary:not(:disabled).fc-button-active,
.bi-cal-panel .fc .fc-button-primary:not(:disabled):active {
    color: #fff;
}

.bi-cal-panel .fc .fc-toolbar-title {
    font-size: 1.2rem;
    color: #0a315f;
}

.bi-cal-panel .fc a {
    color: inherit;
    text-decoration: none;
}

.bi-cal-toolbar-note {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.bi-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #4a5866;
}

.bi-cal-key::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    border-radius: 2px;
    vertical-align: -1px;
    background: var(--key);
}

.bi-cal-key.bi-ev-booking { --key: #1d7a4c; }
.bi-cal-key.bi-ev-request { --key: #d69e2e; }
.bi-cal-key.bi-ev-block { --key: #8a96a3; }
.bi-cal-key.bi-ev-external { --key: #b9c3cd; }

.bi-cal-sync {
    color: #0a4f8f;
    text-decoration: none;
}

.bi-cal-sync:hover {
    text-decoration: underline;
}

.fc-event.bi-ev-block {
    background: #8a96a3;
    color: #fff;
}

/* busy in another calendar: pale grey, striped, so it reads as not ours */
.fc-event.bi-ev-external {
    background: repeating-linear-gradient(135deg, #eef1f4 0 6px, #e1e6eb 6px 12px);
    border-color: #b9c3cd;
    color: #3d4a57;
}

.fc-event.bi-ev-external .fc-event-main {
    color: #3d4a57;
}

.fc-daygrid-dot-event.bi-ev-external .fc-daygrid-event-dot { border-color: #b9c3cd; }

/* a request: its service's colour, pale, with a dashed edge */
.fc-event.bi-ev-request {
    border-style: dashed;
    border-width: 1px;
}

/* month view shows timed events as a dot and a label; the dot takes the
   service's colour from FullCalendar, the label stays readable */
.fc-daygrid-dot-event.bi-ev-block { background: #eef1f4; color: #3d4a57; }
.fc-daygrid-dot-event.bi-ev-block .fc-daygrid-event-dot { border-color: #8a96a3; }
.fc-daygrid-dot-event .fc-event-title,
.fc-daygrid-dot-event .fc-event-time { color: #1f2328; }

.bi-cal-key-request::before {
    background: #fff;
    border: 1px dashed #5b6773;
}

.bi-cal-key-edit {
    color: #0a4f8f;
    font-size: 0.8rem;
}

/* month view bars: the time keeps its width, the title gives way */
.fc-daygrid-block-event .fc-event-main-frame {
    min-width: 0;
}

.fc-daygrid-block-event .fc-event-time {
    flex: 0 0 auto;
    overflow: visible;
    margin-right: 4px;
    font-weight: 600;
}

.fc-daygrid-block-event .fc-event-title-container {
    min-width: 0;
}

.fc-daygrid-block-event .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* the list view: rows stay plain, the dot says what it is */
.fc-list-event.bi-ev-block,
.fc-list-event.bi-ev-external {
    background: none;
    color: inherit;
}

.fc-list-event.bi-ev-block .fc-list-event-dot { border-color: #8a96a3; }
.fc-list-event.bi-ev-external .fc-list-event-dot { border-color: #b9c3cd; }
.fc-list-event.bi-ev-block td,
.fc-list-event.bi-ev-external td { color: #5b6773; }
.fc-list-event.bi-ev-request .fc-list-event-dot { border-style: dashed; }

/* a cancelled booking: an outline of where it was, struck through */
.fc-event.bi-ev-cancelled {
    border-style: dashed;
    border-width: 1px;
    opacity: 0.75;
}

.fc-event.bi-ev-cancelled .fc-event-title,
.fc-list-event.bi-ev-cancelled .fc-list-event-title a {
    text-decoration: line-through;
}

.fc-list-event.bi-ev-cancelled td { color: #8a96a3; }
.fc-daygrid-dot-event.bi-ev-cancelled { background: none; }

.bi-cal-toggle {
    cursor: pointer;
    user-select: none;
}

.bi-cal-toggle input {
    margin-right: 3px;
    vertical-align: -1px;
}

.bi-cal-key.bi-cal-toggle::before {
    display: none;
}
