/* Appointment Book */

.appointment-book {
    width: 100%;
    height: 100%;
}

.appointment-workspace {
    display: flex;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    position: relative;
}

/* React calendar */

.appointment-calendar {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    overflow: auto;

    color: #333;
}

.appointment-calendar .rbc-time-view {
    background: #fff;
}

.appointment-calendar .rbc-time-header {
    background: var(--colour-surface);
}

.appointment-calendar .rbc-header {
    color: var(--colour-text);
}

.appointment-resource-header {
    padding: 14px 8px;
    font-weight: 600;
    text-align: center;
}

.rbc-allday-cell .rbc-row-content {
    height: 10px;
}

/* Right-hand appointment panel */

.appointment-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;

    width: 280px;

    padding: 1rem;

    border-left: 1px solid var(--colour-border);
    background: var(--colour-surface);

    display: flex;
    flex-direction: column;

    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;

    z-index: 10;

    transition:
        transform 250ms ease-out,
        opacity 250ms ease-out;
}

.appointment-panel.visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.appointment-panel h3 {
    margin-top: 0;
}

#close-appointment-panel {
    margin-top: auto;
    width: 100%;
}

.appointment-panel-header {
    padding: 0.85rem 1rem;
    margin: -1rem -1rem 1rem -1rem;

    background: var(--colour-border);

    font-weight: 600;
}

.appointment-panel-content {
    flex: 1;
}

.appointment-panel h3 {
    margin: 0 0 1rem 0;
}

.appointment-date {
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.appointment-time {
    margin-bottom: 1.5rem;
}

.appointment-notes-text {
    white-space: pre-wrap;
}

.appointment-status {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.appointment-status-tag {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid;
}

.appointment-status-tag.requested {
    background: #f3d98b;
    border-color: #c49a32;
    color: #5f4800;
}

.appointment-status-tag.confirmed {
    background: #b9dfc2;
    border-color: #5b9f6a;
    color: #20572d;
}

/* React calendar text */

.appointment-calendar .rbc-toolbar {
    color: var(--colour-text);
    margin-top: 0.5rem;
}

.appointment-calendar .rbc-header {
    color: var(--colour-text);
}

.appointment-calendar .rbc-toolbar button {
    color: var(--colour-text);
}

.appointment-event {
    color: #333;
    font-size: 0.7rem;
}

.appointment-event__header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.appointment-event__customer {
    font-size: 0.8rem;
    font-weight: 600;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-event__time {
    margin-left: auto;

    font-size: 0.6rem;
    white-space: nowrap;
}

.appointment-event__notes {
    margin-top: 0.15rem;

    font-size: 0.65rem;
    line-height: 1.2;
}

.appointment-event__requested,
.appointment-event__confirmed {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 14px;
    height: 14px;

    flex: 0 0 14px;

    font-size: 0.55rem;
    font-weight: 600;

    border-radius: 3px;
    color: white;
}

.appointment-event__requested {
    background: var(--colour-warning);
}

.appointment-event__confirmed {
    background: var(--colour-success);
}

.appointment-calendar .rbc-event-label {
    display: none;
}

/* Responsive adjustments for small screens */
@media (max-width: 600px) {
    .rbc-day-slot.rbc-time-column {
        flex: 0 0 calc(100vw - 86px);
        width: calc(100vw - 86px);
    }

    .rbc-time-header-content .rbc-row-resource .rbc-header {
        flex: 0 0 calc(100vw - 86px);
        width: calc(100vw - 86px);
    }
}