/* ============================================================================
   VRYNO BOOKINGS -- the scheduling pages
   ============================================================================
   The card, address-row, chip, QR-frame and empty-state vocabulary shared by
   Booking Links, Routing Forms and Meeting Polls.

   It is a stylesheet rather than a <style> block in each page because three
   copies of a card definition is how three pages that were designed together
   stop looking alike. Everything else those pages use -- .kpi,
   .lead-pagerbar, .vryno-list-table, .lead-status, .lead-action-btn,
   .filter-set-content, .vrd-iconbar -- is the module's existing vocabulary in
   style.css, untouched.

   Loaded with a <link> on the three pages rather than through vp_bootstrap:
   the runtime layer is for chrome every page in the product needs, and no page
   outside Bookings needs any of this.
============================================================================ */

.bk-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: #fff;
    box-shadow: var(--box-shadow-lg);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.bk-card:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}

/* Expired and used-up links stay legible but stop competing for
   attention: 0.68 was low enough to read as "not live" and still pass
   4.5:1 on the body text. */
.bk-card-dim {
    opacity: .68;
}

.bk-card-dim:hover {
    opacity: 1;
}

.bk-card-single {
    border-left: 3px solid var(--indigo);
}

.bk-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bk-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bk-card-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--heading-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bk-card-name:hover {
    color: var(--primary);
}

.bk-card-sub {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 1px;
}

/* The address row. A grid rather than .input-group because the three
   buttons must not wrap under the field on a narrow card, and the
   field itself has to be the part that shrinks. */
.bk-url {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 4px;
    /* Literal, not var(--gray-100): that token is #CDCDCD in this
       theme -- a mid grey, not a surface -- and --gray-600 text on it
       measures 4.29:1, under the 4.5:1 floor. #f6f7fb is the same
       near-white the .filter-content-list panels already sit on, where
       the same ink measures 6.44:1. */
    background: #f6f7fb;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 3px 3px 3px 8px;
}

.bk-url-input {
    border: 0;
    background: transparent;
    padding: 2px 0;
    height: 26px;
    font-size: 12.5px;
    font-family: var(--bs-font-monospace, ui-monospace, monospace);
    color: var(--gray-600);
    box-shadow: none;
    min-width: 0;
}

.bk-url-input:focus {
    background: transparent;
    box-shadow: none;
    border: 0;
}

.bk-url-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--gray-600);
    text-decoration: none;
    flex-shrink: 0;
}

.bk-url-btn:hover {
    background: var(--primary-transparent);
    color: var(--primary);
}

.bk-url-cell {
    max-width: 230px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.bk-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.bk-stats > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.bk-stat-v {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading-color);
    white-space: nowrap;
}

.bk-stat-l {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    color: var(--gray-500);
}

.bk-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.bk-card-acts {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.bk-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f3f9; /* literal, for the reason noted on .bk-url */
    color: var(--gray-600);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The chip inks below are measured, not guessed: the accent colours
   the app uses for text on white are 1.6:1 to 2.3:1 on their own
   tints, so each one here was moved down in lightness only -- same
   hue, same saturation -- until it cleared 4.6:1 on its own chip. */
.bk-chip-single {
    background: var(--indigo-transparent);
    color: #4a35b8;
}

.bk-chip-team {
    background: var(--info-transparent);
    color: #1368da;
}

.bk-chip-route {
    background: var(--pink-transparent, #ffe0ef);
    color: #ab2a77;
}

.bk-chip-warn {
    background: var(--warning-transparent);
    color: #8e6901;
}

.bk-qr-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    width: 100%;
}

.bk-code {
    font-family: var(--bs-font-monospace, ui-monospace, monospace);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre;
    overflow-x: auto;
}

.bk-empty {
    text-align: center;
    padding: 48px 16px;
}

.bk-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 24px;
    margin-bottom: 12px;
    background: var(--primary-transparent);
    color: var(--primary);
}

@media (max-width: 575.98px) {
    .bk-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Dark theme. Only the surfaces and the four chip inks are remapped --
   the accents themselves are already theme-aware. The QR keeps a white
   plate on purpose: a scanner wants the quiet zone light. */
[data-bs-theme="dark"] .bk-card {
    background: var(--dtf-surface-2, #13132e);
    border-color: var(--dtf-border, #26264f);
}

[data-bs-theme="dark"] .bk-url {
    background: var(--dtf-surface, #0d0d26);
    border-color: var(--dtf-border, #26264f);
}

[data-bs-theme="dark"] .bk-url-input,
[data-bs-theme="dark"] .bk-url-btn {
    color: var(--dtf-text, #a9b1c7);
}

[data-bs-theme="dark"] .bk-card-name {
    color: var(--dtf-heading, #e8eaff);
}

[data-bs-theme="dark"] .bk-stat-v {
    color: var(--dtf-heading, #e8eaff);
}

[data-bs-theme="dark"] .bk-stats,
[data-bs-theme="dark"] .bk-card-foot {
    border-top-color: var(--dtf-border, #26264f);
}

[data-bs-theme="dark"] .bk-chip {
    background: rgba(255, 255, 255, .06);
    color: var(--dtf-text, #a9b1c7);
}

[data-bs-theme="dark"] .bk-chip-single {
    background: rgba(103, 76, 226, .26);
    color: #a99bff;
}

[data-bs-theme="dark"] .bk-chip-team {
    background: rgba(47, 128, 237, .22);
    color: #6fa8f5;
}

[data-bs-theme="dark"] .bk-chip-route {
    background: rgba(194, 51, 138, .22);
    color: #f191c6;
}

[data-bs-theme="dark"] .bk-chip-warn {
    background: rgba(249, 184, 1, .18);
    color: #e2ad2a;
}

[data-bs-theme="dark"] .bk-qr-frame {
    border-color: var(--dtf-border, #26264f);
}

/* ---------------------------------------------------------------------------
   AN EDITABLE ROW
   A label, a type, a required flag and a remove button. Used by the routing
   form's question list and by the booking-form questions on an event type, so
   it lives here rather than in either page: the two lists are the same list
   seen from two places, and they have to look like it.
   --------------------------------------------------------------------------- */
.bk-builder-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 150px 62px 28px;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid var(--border-color);
}

.bk-builder-row:last-child {
    border-bottom: 0;
}

.bk-grip {
    color: var(--gray-400, #a0a0a0);
    cursor: grab;
    display: inline-flex;
    font-size: 15px;
}

.bk-b-req {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    color: var(--gray-600);
    white-space: nowrap;
}

/* A row that is inherited from Booking Settings rather than set here: it can
   be seen but not edited, and saying so in place beats a footnote nobody
   reads. */
.bk-builder-row.bk-inherited .bk-b-label,
.bk-builder-row.bk-inherited .bk-b-type {
    background: #f6f7fb;
    color: var(--gray-600);
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .bk-builder-row {
        grid-template-columns: 18px minmax(0, 1fr) 28px;
    }

    .bk-builder-row .bk-b-type,
    .bk-builder-row .bk-b-req {
        grid-column: 2;
    }
}

[data-bs-theme="dark"] .bk-builder-row {
    border-bottom-color: var(--dtf-border, #26264f);
}

[data-bs-theme="dark"] .bk-builder-row.bk-inherited .bk-b-label,
[data-bs-theme="dark"] .bk-builder-row.bk-inherited .bk-b-type {
    background: var(--dtf-surface, #0d0d26);
    color: var(--dtf-text, #a9b1c7);
}
