/*
 * Slot state colours. Defined once so every calendar instance (#calendar,
 * #client-booking, #client-public-booking) matches the Available / Not available /
 * Holiday legend shown underneath it.
 */
:root {
    --hp-cal-unavailable: #b4bec5;
    --hp-cal-unavailable-border: #98a5ad;
    --hp-cal-holiday-base: #eaf1f4;
    --hp-cal-holiday-stripe: #7fc3d1;
    --hp-cal-break-base: #e6eaed;
    --hp-cal-break-stripe: #9aa7af;

    /*
     * Booked consultations carry the brand; synced Google events are tinted from their own
     * calendar colour at runtime (see hpApplyGcalColour) and only borrow this text colour.
     */
    --hp-cal-booking-bg: #d7eef4;
    --hp-cal-booking-text: #0f5a69;
    --hp-cal-gcal-text: #3f4e57;

    /*
     * Grid lines tinted toward the brand blue-grey rather than FullCalendar's neutral
     * #ddd, matching the blue-tinted card shadows the rest of the app uses.
     *
     * Translucent rather than a flat light grey so one value works on both grounds: over
     * white it lands around #e5e8ea as before, and over an unavailable slot it darkens
     * with the slot instead of cutting a white line through it.
     */
    --hp-cal-line: rgba(39, 61, 74, .12);
    --hp-cal-line-faint: rgba(39, 61, 74, .06);
    --hp-cal-brand: #199bb5;
}

.fc {
    --fc-border-color: var(--hp-cal-line);
    --fc-page-bg-color: #fff;
    --fc-today-bg-color: transparent;
}

/* Dotted rules are the most dated thing in the default grid; a faint solid reads calmer. */
.fc .fc-timegrid-slot-minor {
    border-top-style: solid;
    border-top-color: var(--hp-cal-line-faint);
}

/* Column headers: weekday over date, built by dayHeaderContent(). */
.fc .fc-col-header-cell-cushion {
    display: block;
    padding: 10px 4px;
    text-decoration: none;
}

.hp-dayhead-name {
    display: block;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 500;
    color: #8b949b;
}

.hp-dayhead-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    margin-top: 3px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    color: #50555b;
    line-height: 1;
}

.fc .fc-day-today .hp-dayhead-date {
    background: var(--hp-cal-brand);
    color: #fff;
}

/* Booked consultations. The old rule targeted .fc-time-grid-event, a FullCalendar v3
   class that does not exist in this version, so events never picked up the brand colour. */
/*
 * Booked consultations: a brand tint with a solid rule down the leading edge. They are what
 * the practitioner is here to see, so they stay the most saturated thing on the grid and
 * synced Google events (styled below) sit back behind them.
 */
.fc .fc-timegrid-event {
    /* FullCalendar writes the event's own colour inline, so the brand card has to win. */
    border: none !important;
    border-left: 4px solid var(--hp-cal-brand) !important;
    border-radius: 4px;
    box-shadow: none;
    background: var(--hp-cal-booking-bg) !important;
}

/*
 * The booking tooltip is attached as a child of the event element, so the event itself must
 * not clip or the tooltip is cut off the moment it opens. Overflow is handled one level in.
 */
.fc .fc-timegrid-event .fc-event-main {
    font-size: 12px;
    line-height: 1.3;
    padding: 1px 6px;
    overflow: hidden;
    border-radius: inherit;
}

.fc .fc-timegrid-event .fc-event-main-frame {
    overflow: hidden;
}

.fc .fc-timegrid-event .tooltiptext {
    z-index: 99999;
}

/*
 * Titles are clamped to however many lines the block can actually show, measured by
 * hpFitEventTitles(). Without it a long summary spills over the slots underneath it.
 */
.fc .fc-timegrid-event .fc-event-title,
.fc .fc-bg-event.fc-gcal .fc-event-title {
    font-size: 11px;
    line-height: 1.25;
    font-style: normal;
    font-weight: 500;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--hp-event-lines, 2);
    overflow: hidden;
    word-break: break-word;
}

.fc .fc-timegrid-event .fc-event-title {
    color: var(--hp-cal-booking-text);
    font-weight: 650;
}

/* Drag selection picks up the brand instead of FullCalendar's default blue. */
.fc .fc-highlight {
    background: rgba(25, 155, 181, .18);
    border-radius: 6px;
}

/* The time axis is scaffolding, not content. */
.fc .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-axis-cushion {
    font-size: 12px;
    font-weight: 400;
    color: #9aa2a8;
}

/*.fc-event{font-size:1em; padding-top: 25px; padding-left:15px;}*/
.fc-time-grid-event{
    background-color: rgba(25, 155, 181, 0.48);
    border:none;
}
.fc-day{border: none}

.fc-dayGridMonth-button
{
    background: #199bb5;
    color: white;
    border: none
}

.fc-timeGridWeek-button{
    background: #fff;
    border:1px solid #199bb5;
    color: #199bb5;


}
.fc-dayGrid-button{
    background: #fff;
    border:1px solid #199bb5;
    color: #199bb5;
    /* margin-right: -14px; */
}

.fc-button-active{
    background:#199bb5 !important;
    color:#fff !important;
}

.fc-prev-button{
    background : #fff;
    border:1px solid #199bb5;
    color: #199bb5;
}

.fc-next-button{
    background: #fff;
    border:1px solid #199bb5;
    color: #199bb5;
}

.fc-today{
    background: #E4F1F4 !important;
}

.fc-widget-content{
    height:80px !important;    
}


/* .fc-timegrid-event-harness{
    background:#199bb5 !important;
} */

/* .fc-timegrid-event{
    background:#199bb5 !important;
}

.fc-timegrid-event .fc-event-main{
    background:#199bb5 !important;
    color:#fff !important;
} */

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

#client-booking .fc-event-title {
    color: var(--hp-cal-booking-text) !important;
}

/*
 * An inset outline rather than a border, so highlighting today does not consume 12px of
 * the column. On a phone the column is only about 25px wide to begin with.
 */
.fc .fc-timegrid-col.fc-day-today{
    background-color: rgba(25, 155, 181, .09);
}

/*
 * FullCalendar paints the slot background layer (z-index 2) over the grid-line table
 * (z-index 1), which was fine while the unavailable states were near-transparent. Now
 * that they are solid, dropping the background layer below the grid keeps the day and
 * time separators visible instead of merging a run of unavailable days into one block.
 * The lines themselves are translucent (see --hp-cal-line), so over a filled slot they
 * read as a slightly darker rule rather than a white gap. Events stay on top at z-index 3.
 */
.fc .fc-timegrid-col-bg {
    z-index: 0;
}

/* Outside the practitioner's working hours. */
.fc .fc-non-business {
    background: var(--hp-cal-unavailable);
}

/*
 * Existing bookings, synced calendar events, breaks and the booking buffer.
 *
 * These and .fc-ooo both render as background events, which FullCalendar stacks at the
 * same z-index, so DOM order decided which one showed. The app loads them from three
 * separate event sources, so a slot that is both booked and out of office could come out
 * grey on one load and striped on the next. Ordering them here makes it deterministic:
 * out of office wins, then blocked, then plain non-business. The drag-selection highlight
 * stays above all of them at z-index 3.
 */
.fc .fc-bg-event.fc-nonbusiness-custom-opacity {
    opacity: 1 !important;
    background-color: var(--hp-cal-unavailable) !important;
    z-index: 1;
}

.fc .fc-bg-event.fc-ooo {
    z-index: 2;
}

/* Keep the day separator readable where it runs through a filled slot. */
.fc .fc-non-business,
.fc .fc-bg-event.fc-nonbusiness-custom-opacity,
.fc .fc-bg-event.fc-past-slot,
.fc .fc-ooo {
    box-shadow: inset -1px 0 0 var(--hp-cal-unavailable-border);
}

/*
 * Time that has already passed. Not selectable on any of the calendars, so it carries the
 * same grey as the other unavailable states. Sits below the booked/out of office/break
 * layers, which stay distinguishable on top of it.
 */
.fc .fc-bg-event.fc-past-slot {
    opacity: 1 !important;
    background-color: var(--hp-cal-unavailable) !important;
    z-index: 0;
}

/* Days the service is not offered on. */
.fc .fc-timegrid-col.fc-disabled-day,
.fc .fc-daygrid-day.fc-disabled-day {
    background-color: var(--hp-cal-unavailable) !important;
    box-shadow: inset 0 0 0 1px var(--hp-cal-unavailable-border);
}

/*
 * The app swaps FullCalendar's toolbar controls for its own markup (.today-button,
 * .prev-week, .next-week, #datepicker, .availability-dropdown) with jQuery after render.
 * FullCalendar re-renders that toolbar whenever a button's state changes, which puts its
 * originals straight back next to the replacements: navigating flips the today button's
 * disabled state and a stock "today" button reappears beside "THIS WEEK".
 *
 * Hiding them here is not timing dependent, so it holds for every navigation path rather
 * than only the ones that remember to re-hide.
 */
.fc .fc-today-button,
.fc .fc-customPrev-button,
.fc .fc-customNext-button,
.fc .fc-availabilityDropdown-button,
.fc .fc-toolbar-title {
    display: none !important;
}

.ui-datepicker-trigger {
    display: none;
}

/*
 * Events synced from a connected Google calendar. They render as background events so the
 * practitioner can still book over them, which also means FullCalendar's own italic,
 * unclipped background-event title applies until it is overridden here. The tint and accent
 * come from the calendar's Google colour, normalised in hpApplyGcalColour().
 */
.fc .fc-bg-event.fc-gcal {
    opacity: 1 !important;
    overflow: hidden;
    border-radius: 4px;
    background: var(--hp-gcal-tint) !important;
    box-shadow: inset 3px 0 0 var(--hp-gcal-accent);
    z-index: 2;
}

.fc .fc-bg-event.fc-gcal .fc-event-title {
    margin: 1px 4px 1px 8px;
    font-size: 11px;
    font-weight: 400;
    color: var(--hp-cal-gcal-text);
}

/* Out of office / holiday. Striped so it stays distinct from a plain unavailable slot. */
.fc-ooo {
    opacity: 1 !important;
    display: flex;
    justify-content: center;
    background: repeating-linear-gradient(
            45deg,
            var(--hp-cal-holiday-stripe),
            var(--hp-cal-holiday-stripe) 3px,
            var(--hp-cal-holiday-base) 3px,
            var(--hp-cal-holiday-base) 12px
    ) !important;
}

/*
 * A practitioner's own break. Distinct from out of office because the two behave
 * differently: a practitioner can book over a break but not over out of office.
 * Client-facing calendars report breaks as plain unavailable time instead.
 */
.fc-break {
    opacity: 1 !important;
    display: flex;
    justify-content: center;
    background: repeating-linear-gradient(
            -45deg,
            var(--hp-cal-break-stripe),
            var(--hp-cal-break-stripe) 3px,
            var(--hp-cal-break-base) 3px,
            var(--hp-cal-break-base) 12px
    ) !important;
    box-shadow: inset -1px 0 0 var(--hp-cal-unavailable-border);
}

.fc .fc-bg-event.fc-break {
    z-index: 2;
}

.fc-ooo .fc-event-title{
    font-weight: 800;
    opacity: unset;
    font-size: 1em !important;
    color: black;
}

.ui-datepicker-calendar {
    border-collapse: collapse;
}
.ui-datepicker-calendar td {
    padding-left: 10px;
    padding-right: 10px;
}
.ui-datepicker-calendar tr:hover td {
    background-color: #199BB51A;
}
.ui-datepicker-calendar td a {
    background-color: transparent !important;
}

.ui-datepicker-calendar .ui-datepicker-current-day a {
    color: #f9615a !important;
}

.editing-booking .fc-event-main {
    background: #8B8E92 !important;
}

.editing-booking.tooltip{
    border-bottom: 5px solid #199bb5;
}

.editing-booking {
    border: 5px solid #199bb5;
}


.switches {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    position: relative;
}

.switches>div {
    display: block;
    position: relative;
    width: 64px;
    height: 32px;
    border: 2px solid #dadbdd;
    border-radius: 16px;
    transition: all .3s ease;
    -webkit-transition: all .3s ease;
    -ms-transition: all .3s ease;
    -moz-transition: all .3s ease
}

.switches>div:after {
    color: #dadbdd;
    content: "Unavailable";
    position: absolute;
    top: 2px;

    right: 5px;
    font-weight: 700;
    font-size: 14px
}

.switches>div>i {
    position: absolute;
    display: block;
    top: 2px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 14px;
    background: #dadbdd;
    transition: all .3s ease;
    -webkit-transition: all .3s ease;
    -ms-transition: all .3s ease;
    -moz-transition: all .3s ease
}

.switches input {
    position: absolute;
    z-index: 9;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0
}

.switches input:hover {
    cursor: pointer
}

.switches input:checked+div {
    border-color: #199bb5
}

.switches input:checked+div>i {
    background: #199bb5;
    left: auto;
    left: 33px
}

.switches input:checked+div:after {
    color: #199bb5;
    content: "Available";
    right: auto;
    left: 5px
}

.switches.small>div {
    width: 52px;
    height: 24px;
    width: 95px;
}

.switches.small>div:after {
    top: 1px;
    right: 5px;
    font-size: 12px;
  
}

.switches.small>div>i {
    position: absolute;
    display: block;
    top: 2px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 14px;
    background: #dadbdd;
    transition: all .3s ease;
    -webkit-transition: all .3s ease;
    -ms-transition: all .3s ease;
    -moz-transition: all .3s ease
}

.switches.small input:checked+div>i {
    left: 69px
}

.switches.alt>div {
    width: 66px;
    height: 36px;
    border: none;
    background: #199bb5;
    border-radius: 36px
}

.switches.alt>div:after {
    content: ""
}

.switches.alt>div>i {
    background: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    left: 4px;
    top: 4px
}

.switches.alt input:checked+div {
    background: #50555b
}

.switches.alt input:checked+div>i {
    background: #fff;
    left: auto;
    left: 33px
}

.switches.alt input:checked+div:after {
    content: ""
}

.switches.alt.small>div {
    width: 108px;
    height: 24px
}

.switches.alt.small>div>i {
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 14px;
    background: #dadbdd;
    transition: all .3s ease;
    -webkit-transition: all .3s ease;
    -ms-transition: all .3s ease;
    -moz-transition: all .3s ease
}

.switches.alt.small input:checked+div>i {
    left: 28px
}

/*
 * Day strip: the mobile replacement for picking a day off a seven column header. Rendered
 * by hpRenderDayStrip() and hidden outright above the breakpoint.
 */
.hp-day-strip {
    display: none;
}

/*
 * Legend swatches, drawn from the same custom properties as the grid so a colour can
 * never drift out of sync with what the calendar actually renders.
 */
.hp-legend-swatch {
    display: inline-block;
    width: 17px;
    height: 17px;
    margin-right: 8px;
    border: 1px solid var(--hp-cal-unavailable-border);
    border-radius: 4px;
    flex: 0 0 auto;
}

.hp-legend-swatch.is-available {
    background: #fff;
}

.hp-legend-swatch.is-unavailable {
    background: var(--hp-cal-unavailable);
}

.hp-legend-swatch.is-holiday {
    background: repeating-linear-gradient(
            45deg,
            var(--hp-cal-holiday-stripe),
            var(--hp-cal-holiday-stripe) 3px,
            var(--hp-cal-holiday-base) 3px,
            var(--hp-cal-holiday-base) 12px
    );
}

.hp-legend-swatch.is-break {
    background: repeating-linear-gradient(
            -45deg,
            var(--hp-cal-break-stripe),
            var(--hp-cal-break-stripe) 3px,
            var(--hp-cal-break-base) 3px,
            var(--hp-cal-break-base) 12px
    );
}

/* Legend wraps instead of squashing "Not Available" onto two lines. */
.hp-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 20px;
}

/*
 * width is forced because .card.grid-table .card-body > div > div in stylesheet.min.css
 * stretches these to 100% below 1440px, which puts every legend key on its own line.
 */
.hp-calendar-legend > div {
    display: flex;
    align-items: center;
    width: auto !important;
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .hp-day-strip {
        display: flex;
        /*
         * Forced: .card.grid-table .card-body > div in stylesheet.min.css sets wrap at a
         * higher specificity, which breaks the chips onto a second row instead of letting
         * the strip scroll.
         */
        flex-wrap: nowrap !important;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0 12px;
        scrollbar-width: none;
    }

    .hp-day-strip::-webkit-scrollbar {
        display: none;
    }

    .hp-day-chip {
        flex: 0 0 auto;
        min-width: 42px;
        padding: 6px 4px;
        border: 1px solid var(--hp-cal-line);
        border-radius: 14px;
        background: #fff;
        color: #50555b;
        line-height: 1.2;
        text-align: center;
    }

    .hp-day-chip span {
        display: block;
        font-size: 11px;
        text-transform: uppercase;
    }

    .hp-day-chip strong {
        display: block;
        font-size: 15px;
    }

    .hp-day-chip.is-active {
        background: #199bb5;
        border-color: #199bb5;
        color: #fff;
    }

    /* Slot rows tall enough to tap. slotDuration stays at 15 minutes: the select handler
       rejects any range longer than that, so the height has to do the work. */
    .fc .fc-timegrid-slot {
        height: 26px;
    }

    .fc .fc-timegrid-slot-label-cushion,
    .fc .fc-timegrid-axis-cushion {
        font-size: 12px;
        padding: 0 4px;
    }

    .fc .fc-col-header-cell-cushion {
        padding: 8px 2px;
        font-size: 14px;
    }

    /* Toolbar stacks so THIS WEEK / arrows / date / AVAILABILITY stop colliding. */
    .fc .fc-toolbar {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .hp-calendar-legend {
        gap: 8px 14px;
        font-size: 13px;
    }

    /*
     * jQuery UI's autoSize gives the date field a fixed `size` attribute, so a long date
     * runs underneath the chevron that sits after it. Let the field take the whole row
     * between the arrows and pin the chevron inside its padding instead.
     */
    .fc .fc-header-toolbar {
        row-gap: 10px;
    }

    /*
     * Date navigation takes a row of its own, above the THIS WEEK and AVAILABILITY links,
     * so the field has the full width rather than a third of it.
     */
    .fc .fc-header-toolbar .fc-toolbar-chunk {
        flex: 0 0 auto;
        min-width: 0;
    }

    .fc .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) {
        flex: 1 0 100%;
        order: -1;
    }

    .fc .fc-toolbar-chunk > .justify-content-between {
        width: 100%;
        gap: 2px;
    }

    .fc .fc-toolbar-chunk .form-group {
        position: relative;
        flex: 1 1 auto;
        min-width: 0;
        margin-bottom: 0;
    }

    .fc .fc-toolbar-chunk #datepicker {
        width: 100%;
        padding-left: 10px;
        padding-right: 28px;
        text-overflow: ellipsis;
    }

    /*
     * Service header on the client booking pages. At 40px the title ran to five lines and
     * ~190px of a 568px screen before the calendar started, and the meta line at 24px took
     * another 60px. Service names can also be a single unbroken string, so the title needs
     * to be allowed to break inside a word.
     */
    .hp-booking-header h2.medium {
        font-size: 22px;
        line-height: 1.25;
        margin-bottom: 6px;
        overflow-wrap: anywhere;
    }

    .hp-booking-header h4 {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 0;
    }

    .hp-booking-header h4 i {
        margin-right: 4px !important;
    }

    /* Space between each icon/value pair, so they read as three facts not one run-on. */
    .hp-booking-header h4 strong + i {
        margin-left: 12px;
    }

    /* Price and duration are short and fixed, so never let them break across lines.
       The practitioner name is left free to wrap, since it can be long. */
    .hp-booking-header h4 strong:nth-of-type(-n+2) {
        white-space: nowrap;
    }

    /* Lets THIS WEEK and AVAILABILITY share one row instead of stacking. */
    .fc .fc-toolbar-chunk .dropdownAlt > a {
        margin-left: 0 !important;
        padding-right: 0 !important;
    }

    /*
     * The arrows carry px-3 either side, which is ~64px the date field cannot use. Trim
     * the visual padding but keep a 40px touch target via an overlay, so narrowing them
     * does not make them hard to hit.
     */
    .fc .fc-toolbar-chunk .prev-week,
    .fc .fc-toolbar-chunk .next-week {
        position: relative;
        padding-left: .25rem !important;
        padding-right: .25rem !important;
    }

    .fc .fc-toolbar-chunk .prev-week::after,
    .fc .fc-toolbar-chunk .next-week::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 40px;
        height: 40px;
        transform: translate(-50%, -50%);
    }

    .fc .fc-toolbar-chunk .trigger-header-calendar {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        margin-right: 0 !important;
    }

    /*
     * The tap-and-hold hint is a standing note, not an announcement. Keep it compact so it
     * does not push the grid down the page.
     *
     * The class is doubled to outrank .alert's 25px/45px padding and Bootstrap's .my-4,
     * which carries its own !important.
     */
    .hp-tap-hint.hp-tap-hint {
        padding: 10px 32px 10px 12px !important;
        margin-top: 0 !important;
        margin-bottom: 12px !important;
    }

    .hp-tap-hint .alert-close {
        top: 4px;
        right: 8px;
    }

    .hp-tap-hint p {
        margin-bottom: 0;
        font-size: 12px;
        line-height: 1.35;
    }

    .hp-tap-hint strong {
        font-weight: 600;
    }

    .hp-tap-hint img {
        width: 20px;
        height: auto;
        flex: 0 0 auto;
    }

    /*
     * The month picker is sized for a desktop toolbar: about 465px wide, positioned from
     * the input's left edge, so on a phone most of it sits past the right edge of the
     * screen. Pin it to the viewport and let the grid divide what is left.
     *
     * jQuery UI writes left/width inline, hence the !important.
     */
    .hp-calendar-datepicker.ui-datepicker {
        width: auto !important;
        left: 12px !important;
        right: 12px;
        max-width: calc(100vw - 24px) !important;
        box-sizing: border-box;
        z-index: 1000 !important;
    }

    .hp-calendar-datepicker .ui-datepicker-calendar {
        width: 100%;
        table-layout: fixed;
    }

    .hp-calendar-datepicker .ui-datepicker-calendar td {
        padding-left: 0;
        padding-right: 0;
    }

    .hp-calendar-datepicker .ui-datepicker-calendar td a,
    .hp-calendar-datepicker .ui-datepicker-calendar td span {
        display: block;
        padding: 8px 0;
        text-align: center;
    }

    .hp-calendar-datepicker .ui-datepicker-calendar th {
        padding: 4px 0;
        text-align: center;
    }
}
