/* audio-player.css — the shared sample-call player (Home, For Patients, Book a Call)
   Used with js/audio-player.js. Every page that plays the demo call uses these
   styles, so the waveform bars look the same everywhere: same width, same gap,
   pill-shaped, magenta for the played part and light pink for the rest. */

.ap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-primary-200);
  border-radius: 18px;
}

.ap audio {
  display: none;
}

.ap__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

/* Play / pause ---------------------------------------------------------- */

.ap__play {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-primary-600);
  color: var(--color-white);
  cursor: pointer;
  transition: background-color var(--transition-hover);
}

.ap__play:hover {
  background: var(--color-primary-700);
}

.ap__glyph {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent currentColor;
}

.ap__play.is-playing .ap__glyph {
  width: 14px;
  height: 18px;
  margin-left: 0;
  border: none;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

/* Waveform: uniform pill bars --------------------------------------------- */

.ap__wave {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px;
  cursor: pointer;
  touch-action: none;
}

.ap__bar {
  flex: 0 0 4px;
  width: 4px;
  border-radius: 999px;
  background: var(--color-primary-200);
  transition: background-color 0.12s linear;
}

.ap__bar.is-played {
  background: var(--color-primary-600);
}

.ap__wave:hover .ap__bar:not(.is-played) {
  background: var(--color-primary-300);
}

.ap__play:focus-visible,
.ap__wave:focus-visible,
.ap-line:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.ap__time {
  flex-shrink: 0;
  font-family: var(--font-caption-family);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--color-neutral-500);
}

/* Transcript --------------------------------------------------------------- */

.ap__transcript {
  border-top: 1px solid var(--color-primary-100);
  background: var(--color-neutral-50);
}

.ap__transcript-label {
  margin: 0;
  padding: 12px 20px 4px;
  font-family: var(--font-body-regular-family);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
}

.ap__transcript-label span {
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  text-transform: none;
}

.ap__transcript-list {
  height: 248px;
  margin: 0;
  padding: 4px 8px 10px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-neutral-250) transparent;
}

/* A transcript shown on its own (e.g. inside a <details> on Home). */
.ap__transcript-list--panel {
  height: auto;
  max-height: 320px;
  margin-top: 12px;
  border-radius: 14px;
  background: var(--color-neutral-50);
}

.ap-line {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.ap-line:hover {
  background: var(--color-neutral-100);
}

.ap-line.is-active {
  background: var(--color-white);
  box-shadow: inset 3px 0 0 var(--color-primary-600);
}

.ap-line__time {
  padding-top: 1px;
  font-family: var(--font-caption-family);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--color-neutral-500);
}

.ap-line__text {
  font-family: var(--font-body-regular-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-neutral-900);
}

/* Patient lines in teal (the patient's color site-wide; the 700 step keeps
   AA contrast on the tinted transcript panels). Carrie stays magenta. */
.ap-line__who {
  font-weight: var(--font-weight-bold);
  color: var(--color-accent1-700);
}

.ap-line__who--carrie {
  color: var(--color-primary-600);
}

/* Dark variant (Home "Hear Carrie" band): white for the played part, bright
   pink for the rest, on a lighter plum panel. Same bar shape and size. */
.ap--dark {
  border: none;
  border-radius: 20px;
  background: var(--color-primary-900);
  box-shadow: inset 0 0 0 1px var(--color-primary-800);
}

.ap--dark .ap__play {
  width: 64px;
  height: 64px;
  background: var(--color-white);
  color: var(--color-primary-950);
}

.ap--dark .ap__play:hover {
  background: var(--color-primary-100);
}

.ap--dark .ap__bar {
  background: var(--color-primary-300);
}

.ap--dark .ap__bar.is-played,
.ap--dark .ap__wave:hover .ap__bar:not(.is-played) {
  background: var(--color-white);
}

.ap--dark .ap__time {
  color: var(--color-white);
}

.ap--dark .ap__play:focus-visible,
.ap--dark .ap__wave:focus-visible {
  outline-color: var(--color-white);
}

@media (max-width: 480px) {
  .ap__row {
    gap: 12px;
    padding: 14px;
  }

  .ap__play {
    width: 44px;
    height: 44px;
  }

  .ap__time {
    font-size: 14px;
  }

  .ap__transcript-label {
    padding: 12px 14px 4px;
  }

  .ap__transcript-list {
    height: 300px;
    padding: 4px 4px 8px;
  }

  .ap-line {
    grid-template-columns: 36px 1fr;
    padding: 8px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ap__bar,
  .ap__play {
    transition: none;
  }
}
