/* Timeline view: units across the top, dates down the left, channel-coloured cells. */

.timeline-scroll {
    --timeline-period-height: 2.5rem;
    position: relative;
    max-height: calc(100vh - 12rem);
    overflow: auto;
    border: 1px solid var(--tblr-border-color);
    border-radius: 0.5rem;
    background-color: var(--tblr-body-bg);
}

.timeline-period-bar {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    width: 100%;
    height: var(--timeline-period-height);
    padding: 0 0.75rem;
    border-bottom: 1px solid var(--tblr-border-color);
    background-color: var(--tblr-body-bg);
    font-weight: 600;
    font-size: 1rem;
}

.timeline-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.timeline-table th,
.timeline-table td {
    padding: 0;
    border-right: 1px solid var(--tblr-border-color);
    border-left: 1px solid var(--tblr-border-color);
    outline: 1pt solid #d3d3d345;
}

.timeline-table thead th {
    position: sticky;
    top: var(--timeline-period-height);
    z-index: 6;
    background-color: var(--tblr-body-bg);
}

.timeline-table thead .timeline-corner {
    left: 0;
    z-index: 8;
    min-width: 4.75rem;
    width: 4.75rem;
    padding-left: 0.5rem;
    text-align: left;
    font-size: 0.75rem;
    color: var(--tblr-secondary-color);
}

.timeline-unit-head {
    padding: 1px;
    text-align: center;
    vertical-align: bottom;
    font-size: 10px;
}

.timeline-unit-name {
    display: block;
    max-width: 7rem;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    writing-mode: sideways-lr;
    font-size: 10pt!important;
    margin-bottom: 2pt !important;
}

.timeline-unit-floor {
    display: block;
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--tblr-secondary-color);
}

.timeline-unit-head.is-unit-unavailable {
    opacity: 0.42;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.timeline-date {
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 4.75rem;
    width: 4.75rem;
    padding: 0 0.5rem;
    background-color: var(--tblr-body-bg);
    text-align: left;
    vertical-align: middle;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.timeline-date:hover {
    background-color: var(--tblr-tertiary-bg);
}

.tl-row.is-selected {
    background-color: var(--tblr-primary-bg-subtle);
}

.timeline-date.is-selected {
    background-color: var(--tblr-primary-bg-subtle);
    color: var(--tblr-primary-text-emphasis);
    font-weight: 700;
}

.timeline-dow {
    display: inline-block;
    width: 2rem;
    color: var(--tblr-secondary-color);
}

.timeline-date.is-selected .timeline-dow {
    color: inherit;
}

.timeline-day {
    display: inline-block;
    min-width: 1.25rem;
    text-align: right;
}

.timeline-cell {
    position: relative;
}

.timeline-cell.is-free {
    background-color: transparent;
}

.timeline-cell.is-booked {
    background-color: var(--timeline-channel-color, #dc3545);
}

.timeline-cell.has-halves {
    background-color: transparent;
}

.timeline-half {
    position: absolute;
    width: 100%;
    height:50%;
    background-color: var(--timeline-channel-color, #dc3545);
    background-image: none;
    background-repeat: no-repeat;
}

.timeline-half-start {
    bottom: 0;
}

.timeline-half-end {
    top: 0;
}


.booking-status-Provisional {
    background-image: linear-gradient(transparent 50%, rgba(255, 255, 255, .5) 50%);
    background-size: 1pt 1pt;
    background-repeat: repeat;
}

.cell-booked-airbnb {
    --timeline-channel-color: #ff5a5f;
}

.cell-booked-booking-com {
    --timeline-channel-color: #003580;
}

.cell-booked-expedia {
    --timeline-channel-color: #f5b700;
}

.cell-booked-agoda {
    --timeline-channel-color: #6f42c1;
}

.cell-booked-vrbo {
    --timeline-channel-color: #2f6f4e;
}

.cell-booked-direct {
    --timeline-channel-color: #198754;
}

.cell-booked-default {
    --timeline-channel-color: #dc3545;
}

.timeline-action-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 99;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 0.75rem;
    background-color: var(--tblr-body-bg);
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.16);
}

.timeline-action-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.timeline-instruction {
    font-size: 0.95rem;
}

@media (max-width: 767.98px) {
    .timeline-scroll {
        max-height: calc(100vh - 16rem);
    }

    .timeline-action-bar {
        bottom: 4.75rem;
    }
}

@media (max-width: 575.98px) {
    .timeline-table thead .timeline-corner,
    .timeline-date {
        min-width: 4rem;
        width: 4rem;
    }

    .timeline-unit-head,
    .timeline-cell {
        padding:1px;
    }
}

.timeline-dow-Sat,
.timeline-dow-Sun {
background: lightskyblue;
}