/* ----------------------------------------------------------------------------------------
 * Author        : Prospera
 * File          : My Sessions (client bookings) css
 * ----------------------------------------------------------------------------------------
 *
 * The sessions page is built around one idea: therapy is a continuous course of
 * care, not a list of transactions. Everything below draws a single vertical
 * thread through the client's sessions, anchored at today. Above the anchor is
 * what is coming; below it is what has been done.
 *
 * Every colour is derived from the brand variables in custom.css section 01 --
 * no new brand colours are introduced. Gold (--gold-color) is spent in exactly
 * one place on this page: the today anchor.
 *
 * Class prefix `bk-` keeps these rules from colliding with the global section /
 * button selectors in custom.css.
 * -------------------------------------------------------------------------- */

/* The drawer lives outside .bk-page in the DOM, so both scopes declare the
   tokens -- otherwise the shared pieces (states, buttons, chips) lose every
   colour the moment they are rendered inside the drawer. */
.bk-page,
.bk-drawer {
  --bk-ink: var(--primary-color);
  --bk-thread: var(--accent-color);
  --bk-ground: #f2f7f7;
  --bk-surface: #ffffff;
  --bk-hair: rgba(13, 59, 102, 0.1);
  --bk-muted: rgba(13, 59, 102, 0.55);
  --bk-rail: 34px; /* x-position of the thread line */
  --bk-tile: 68px; /* width of the date tile that sits on the thread */
}

.bk-page {
  background-color: var(--bk-ground);
  padding: 100px 0 120px;
}

/* Data (dates, times, money, counts) is set in lining tabular figures so
   columns align and nothing shifts as the countdown ticks. */
.bk-page [data-bk-figure] {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.bk-page :focus-visible,
.bk-drawer :focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Gate, loading and empty states --------------------------------------- */

.bk-state {
  background: var(--bk-surface);
  border: 1px solid var(--bk-hair);
  border-radius: 22px;
  padding: 70px 40px;
  text-align: center;
}

.bk-state > i {
  display: block;
  font-size: 34px;
  color: var(--bk-thread);
  margin-bottom: 22px;
}

.bk-state h2 {
  font-family: var(--accent-font);
  font-size: 30px;
  color: var(--bk-ink);
  margin-bottom: 14px;
}

.bk-state p {
  color: var(--bk-muted);
  max-width: 460px;
  margin: 0 auto 26px;
  line-height: 1.7em;
}

.bk-state-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.bk-spinner {
  width: 34px;
  height: 34px;
  border: 2px solid var(--bk-hair);
  border-top-color: var(--bk-thread);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: bk-spin 0.8s linear infinite;
}

@keyframes bk-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- The arc: true facts about this client's course of care --------------- */

/* inline-flex, not flex: with a single stat a full-width band is a metre of
   empty card. The band grows with the number of figures instead. */
.bk-arc {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  background: var(--bk-surface);
  border: 1px solid var(--bk-hair);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 40px;
  vertical-align: top;
}

.bk-arc-stat {
  flex: 0 1 auto;
  min-width: 150px;
  padding: 22px 30px;
}

.bk-arc-stat + .bk-arc-stat {
  border-inline-start: 1px solid var(--bk-hair);
}

/* Sized with clamp because this slot holds both a bare count ("12") and a
   month-and-year ("Mar 2024") -- a fixed 42px overflows the narrower one. */
.bk-arc-figure {
  display: block;
  font-family: var(--accent-font);
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1;
  color: var(--bk-ink);
  white-space: nowrap;
}

.bk-arc-label {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bk-muted);
}

/* --- Next session: the one thing the client came here to check ------------ */

.bk-next {
  position: relative;
  background: var(--bk-ink);
  border-radius: 24px;
  padding: 32px 40px;
  margin-bottom: 48px;
  overflow: hidden;
  /* An explicit colour so any text that loses its own rule stays legible on
     the dark card rather than falling back to the page's dark ink. */
  color: var(--white-color);
}

/* One soft teal light behind the date tile -- the only ornament on the card. */
.bk-next::after {
  content: '';
  position: absolute;
  inset-block-start: -120px;
  inset-inline-start: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(47, 168, 160, 0.32) 0%,
    rgba(47, 168, 160, 0) 70%
  );
  pointer-events: none;
}

.bk-next-eyebrow {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sand-color);
  margin-bottom: 26px;
}

/* Date, session and actions share one row so the card fills its width instead
   of packing everything into the left third. `align-items: center` keeps the
   three unequal blocks optically related. */
.bk-next-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.bk-next-date {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  text-align: center;
}

.bk-next-day {
  display: block;
  font-family: var(--accent-font);
  font-size: 52px;
  line-height: 0.9;
  color: var(--white-color);
}

.bk-next-month {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-color);
}

.bk-next-body {
  flex: 1 1 260px;
  min-width: 0;
}

.bk-next-title {
  font-family: var(--accent-font);
  font-size: 28px;
  line-height: 1.25em;
  color: var(--white-color);
  margin-bottom: 10px;
}

/* Facts and countdown share a line; they wrap together on narrow screens. */
.bk-next-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.bk-next-meta {
  font-size: 15px;
  line-height: 1.7em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

.bk-next-meta span + span::before {
  content: '\00b7';
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.4);
}

.bk-countdown {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(47, 168, 160, 0.18);
  border: 1px solid rgba(47, 168, 160, 0.5);
  color: var(--secondary-color);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* Pushed to the trailing edge of the row on wide screens; falls to its own
   full-width line once the row wraps (see the responsive block). */
.bk-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-inline-start: auto;
}

/* Page-local buttons, kept off .btn-default so the global button rules in
   custom.css cannot cancel these out. */
.bk-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--default-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

.bk-btn-join {
  background: var(--bk-thread);
  color: #ffffff;
}

.bk-btn-join:hover,
.bk-btn-join:focus {
  background: var(--secondary-color);
  color: var(--bk-ink);
}

.bk-btn-ghost {
  background: transparent;
  color: var(--white-color);
  border-color: rgba(255, 255, 255, 0.3);
}

.bk-btn-ghost:hover,
.bk-btn-ghost:focus {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white-color);
}

.bk-btn-quiet {
  background: transparent;
  color: var(--bk-ink);
  border-color: var(--bk-hair);
}

.bk-btn-quiet:hover,
.bk-btn-quiet:focus {
  border-color: var(--bk-thread);
  color: var(--bk-thread);
}

/* --- The thread ----------------------------------------------------------- */

.bk-thread {
  position: relative;
  padding-inline-start: calc(var(--bk-tile) + 24px);
}

.bk-thread::before {
  content: '';
  position: absolute;
  inset-block: 6px 6px;
  inset-inline-start: var(--bk-rail);
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--bk-thread) 0%,
    rgba(47, 168, 160, 0.35) 45%,
    var(--bk-hair) 100%
  );
}

.bk-thread-heading {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bk-muted);
  margin-bottom: 20px;
}

/* Today anchor -- the single point of gold on the page. */
.bk-anchor {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block: 34px;
  margin-inline-start: calc((var(--bk-tile) + 24px) * -1);
}

.bk-anchor-mark {
  flex: 0 0 var(--bk-tile);
  display: flex;
  justify-content: center;
}

.bk-anchor-mark::before {
  content: '';
  width: 13px;
  height: 13px;
  background: var(--gold-color);
  transform: rotate(45deg);
  box-shadow: 0 0 0 6px var(--bk-ground);
}

.bk-anchor-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-color);
}

.bk-anchor-rule {
  flex: 1;
  height: 1px;
  background: var(--bk-hair);
}

/* --- A session on the thread ---------------------------------------------- */

.bk-node {
  position: relative;
  margin-bottom: 16px;
}

/* The date tile sits on the line like a bead: its opaque background breaks the
   thread, so the line reads as passing through each session. */
.bk-node-date {
  position: absolute;
  inset-inline-start: calc((var(--bk-tile) + 24px) * -1);
  inset-block-start: 18px;
  width: var(--bk-tile);
  padding: 10px 0;
  text-align: center;
  background: var(--bk-ground);
  border-radius: 12px;
}

.bk-node-day {
  display: block;
  font-family: var(--accent-font);
  font-size: 30px;
  line-height: 1;
  color: var(--bk-ink);
}

.bk-node-month {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bk-muted);
}

.bk-node-card {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  text-align: start;
  background: var(--bk-surface);
  border: 1px solid var(--bk-hair);
  border-radius: 16px;
  padding: 22px 24px;
  cursor: pointer;
  font-family: var(--default-font);
  transition: border-color 0.3s ease, background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.bk-node-card:hover,
.bk-node-card:focus-visible {
  border-color: var(--bk-thread);
  box-shadow: 0 10px 30px rgba(13, 59, 102, 0.08);
}

.bk-node-main {
  flex: 1;
  min-width: 0;
}

/* Both are <span>s inside the card button, so they need blockifying before
   the ellipsis and the stacked layout can take effect. */
.bk-node-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--bk-ink);
  margin-bottom: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-node-meta {
  display: block;
  font-size: 13px;
  color: var(--bk-muted);
  line-height: 1.6em;
}

.bk-node-meta span + span::before {
  content: '\00b7';
  margin: 0 8px;
}

.bk-node-chevron {
  flex: 0 0 auto;
  color: var(--bk-muted);
  font-size: 14px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.bk-node-card:hover .bk-node-chevron {
  color: var(--bk-thread);
  transform: translateX(3px);
}

body.rtl .bk-node-card:hover .bk-node-chevron {
  transform: translateX(-3px);
}

/* Past sessions recede: outlined tile, dashed card, quieter type. */
.bk-node--past .bk-node-day {
  color: var(--bk-muted);
}

.bk-node--past .bk-node-card {
  background: transparent;
  border-style: dashed;
}

.bk-node--past .bk-node-title {
  color: var(--bk-muted);
  font-weight: 500;
}

.bk-node--past .bk-node-card:hover,
.bk-node--past .bk-node-card:focus-visible {
  background: var(--bk-surface);
  border-style: solid;
}

/* Status chip */
.bk-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bk-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.bk-chip--live {
  background: rgba(47, 168, 160, 0.12);
  color: #1f7a74;
}

.bk-chip--done {
  background: rgba(13, 59, 102, 0.07);
  color: rgba(13, 59, 102, 0.55);
}

.bk-chip--off {
  background: rgba(230, 87, 87, 0.1);
  color: #b84a4a;
}

.bk-chip--wait {
  background: rgba(212, 162, 76, 0.14);
  color: #9a7128;
}

/* On the dark next-session card the chip needs its own contrast. */
.bk-next .bk-chip--live,
.bk-next .bk-chip--wait,
.bk-next .bk-chip--done,
.bk-next .bk-chip--off {
  background: rgba(255, 255, 255, 0.14);
  color: var(--secondary-color);
}

.bk-load-more {
  margin-top: 30px;
  text-align: center;
}

/* --- Detail drawer -------------------------------------------------------- */

/* A record is read, not filled in -- so the detail opens as a panel beside the
   thread rather than a centred modal like the booking and auth flows. */
.bk-scrim {
  position: fixed;
  inset: 0;
  background: rgba(13, 59, 102, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}

.bk-scrim.active {
  opacity: 1;
  visibility: visible;
}

.bk-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(520px, 100%);
  max-width: 100%;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: -20px 0 60px rgba(13, 59, 102, 0.18);
}

body.rtl .bk-drawer {
  transform: translateX(-102%);
  box-shadow: 20px 0 60px rgba(13, 59, 102, 0.18);
}

.bk-drawer.active,
body.rtl .bk-drawer.active {
  transform: translateX(0);
}

.bk-drawer-head {
  position: relative;
  flex: 0 0 auto;
  background: var(--primary-color);
  padding: 30px 34px 26px;
}

.bk-drawer-close {
  position: absolute;
  inset-block-start: 22px;
  inset-inline-end: 22px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--white-color);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.bk-drawer-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.bk-drawer-ref {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-color);
  margin-bottom: 16px;
  padding-inline-end: 46px;
}

.bk-drawer-when {
  font-family: var(--accent-font);
  font-size: 26px;
  line-height: 1.3em;
  color: var(--white-color);
  margin-bottom: 14px;
}

.bk-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 30px 34px 40px;
}

.bk-block + .bk-block {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid rgba(13, 59, 102, 0.1);
}

.bk-block-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(13, 59, 102, 0.55);
  margin-bottom: 16px;
}

.bk-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.6em;
}

.bk-line dt {
  flex: 0 0 auto;
  color: rgba(13, 59, 102, 0.55);
  font-weight: 400;
}

.bk-line dd {
  margin: 0;
  min-width: 0;
  color: var(--primary-color);
  font-weight: 600;
  text-align: end;
  word-break: break-word;
}

.bk-line--total {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(13, 59, 102, 0.1);
  font-size: 17px;
}

.bk-line--total dt {
  color: var(--primary-color);
  font-weight: 600;
}

.bk-service {
  padding: 14px 0;
  border-bottom: 1px solid rgba(13, 59, 102, 0.1);
}

.bk-service:first-child {
  padding-top: 0;
}

.bk-service:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.bk-service-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.bk-service-meta {
  font-size: 13px;
  color: rgba(13, 59, 102, 0.55);
}

.bk-service-meta span + span::before {
  content: '\00b7';
  margin: 0 8px;
}

.bk-note {
  font-size: 14px;
  line-height: 1.75em;
  color: var(--primary-color);
  background: #f2f7f7;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0;
}

.bk-drawer-foot {
  flex: 0 0 auto;
  padding: 20px 34px;
  border-top: 1px solid rgba(13, 59, 102, 0.1);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bk-meet-link {
  display: inline-block;
  color: var(--accent-color);
  font-weight: 600;
  word-break: break-all;
}

/* --- Wide screens: read across, not down ---------------------------------- */

/* Below this width a session card stacks its title over its details. Above it
   there is room to lay them side by side, which turns the thread into a
   scannable rhythm — every session's time sits under the one above it, and
   every provider under theirs — instead of leaving the right half empty. */
@media (min-width: 992px) {
  .bk-node-main {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  .bk-node-title {
    flex: 1 1 auto;
    margin-bottom: 0;
  }

  .bk-node-meta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
  }

  /* The middot separates a run of inline facts; in columns the gap does. */
  .bk-node-meta span + span::before {
    content: none;
    margin: 0;
  }

  .bk-node-time {
    min-width: 84px;
  }

  .bk-node-provider {
    min-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bk-node-card {
    padding: 20px 26px;
  }
}

/* --- Responsive ----------------------------------------------------------- */

/* Chip and chevron drop to a second line rather than crushing the title. */
@media only screen and (max-width: 575px) {
  .bk-node-card {
    flex-wrap: wrap;
    gap: 12px;
  }

  .bk-node-main {
    flex: 1 1 100%;
  }

  .bk-node-chevron {
    margin-inline-start: auto;
  }
}

@media only screen and (max-width: 767px) {
  .bk-page {
    --bk-rail: 22px;
    --bk-tile: 44px;
    padding: 70px 0 90px;
  }

  .bk-state {
    padding: 50px 24px;
  }

  .bk-arc-stat {
    flex: 1 1 100%;
    padding: 22px 24px;
  }

  .bk-arc-stat + .bk-arc-stat {
    border-inline-start: none;
    border-top: 1px solid var(--bk-hair);
  }

  .bk-next {
    padding: 26px 22px;
  }

  .bk-next-row {
    gap: 18px;
  }

  .bk-next-date {
    min-width: 74px;
    padding: 12px 14px;
  }

  .bk-next-day {
    font-size: 36px;
  }

  .bk-next-title {
    font-size: 21px;
  }

  /* The row has wrapped by now, so the actions take their own full line and
     split it evenly rather than hugging the trailing edge. */
  .bk-next-actions {
    width: 100%;
    margin-inline-start: 0;
    margin-top: 4px;
  }

  .bk-next-actions .bk-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 13px 18px;
  }

  .bk-thread {
    padding-inline-start: calc(var(--bk-tile) + 16px);
  }

  .bk-anchor {
    margin-inline-start: calc((var(--bk-tile) + 16px) * -1);
  }

  .bk-node-date {
    inset-inline-start: calc((var(--bk-tile) + 16px) * -1);
    inset-block-start: 14px;
  }

  .bk-node-day {
    font-size: 20px;
  }

  .bk-node-month {
    font-size: 9px;
  }

  .bk-node-card {
    padding: 16px 18px;
    gap: 14px;
  }

  /* On phones the record opens as a bottom sheet -- the thread stays visible
     above it, which a full-screen takeover would lose. */
  .bk-drawer {
    inset-block-start: auto;
    height: 90vh;
    width: 100%;
    border-radius: 22px 22px 0 0;
    transform: translateY(102%);
    box-shadow: 0 -20px 60px rgba(13, 59, 102, 0.18);
  }

  body.rtl .bk-drawer {
    transform: translateY(102%);
    box-shadow: 0 -20px 60px rgba(13, 59, 102, 0.18);
  }

  .bk-drawer.active,
  body.rtl .bk-drawer.active {
    transform: translateY(0);
  }

  .bk-drawer-head,
  .bk-drawer-body,
  .bk-drawer-foot {
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bk-page *,
  .bk-drawer,
  .bk-scrim {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
