/* SSH AI UX. Read Aloud component
   Scope: Track 2. Read Aloud Mode
   Notes: Calm styling. Compatible with .ssh-ft-wide lane. */

/* Container */
.ssh-ra {
  margin: 0.75rem 0 1rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 0.9rem;
  background: rgba(0,0,0,0.02);
}

/* Header layout */
.ssh-ra__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.ssh-ra__meta {
  margin-left: auto;
  font-weight: 600;
  opacity: 0.8;
}

/* Buttons */
.ssh-ra__btn {
  appearance: none;
  border-radius: 0.6rem;
  padding: 0.35rem 0.7rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.20);
  background: rgba(255,255,255,0.9);
}

.ssh-ra__btn:disabled,
.ssh-ra__btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Button hierarchy */
.ssh-ra__btn--primary {
  font-weight: 700;
  border-color: rgba(0,0,0,0.28);
}


/* Voice over speaking */
.ssh-mode__content.ssh-ra-speaking {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 10px;
}

/* Follow-along highlight for persona sub-panel */
.ssh-mode__content.ssh-ra-speaking {
  outline: 3px solid var(--md-accent-fg-color);
  outline-offset: 4px;
  border-radius: 10px;
}

/* Optional. A soft background wash that won't fight table zebra striping */
.ssh-mode__content.ssh-ra-speaking {
  background: color-mix(in srgb, var(--md-accent-fg-color) 10%, transparent);
}


/* Single icon source of truth */
.ssh-ra__btn--primary::before {
  content: "🔊";
  margin-right: 0.4rem;
  line-height: 1;
}

/* Stop becomes quieter (secondary outline) */
.ssh-ra__btn--stop {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.18);
  color: rgba(0,0,0,0.70);
  font-weight: 600;
}

.ssh-ra__btn--stop:hover:not(:disabled) {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.22);
}

/* Options disclosure */
.ssh-ra__options {
  margin-top: 0.65rem;
  background: transparent;
  border: 0;
  padding: 0;
}

.ssh-ra__options summary {
  cursor: pointer;
  font-weight: 600;
  opacity: 0.9;

  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.75);
}

/* Options panel. Calm, light */
.ssh-ra__options[open] {
  margin-top: 0.6rem;
  padding-top: 0.2rem;
}

.ssh-ra__main {
  margin-top: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 0.75rem;
  background: rgba(0,0,0,0.015);

  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
  align-items: center;
}

/* Labels and selects */
.ssh-ra__label {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  font-weight: 600;
}

.ssh-ra__select {
  border: 1px solid rgba(0,0,0,0.20);
  border-radius: 0.6rem;
  padding: 0.35rem 0.5rem;
  background: rgba(255,255,255,0.95);
}

.ssh-ra__check {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  font-weight: 600;
}

/* Voice control. Respect the HTML hidden attribute */
.ssh-ra__voice[hidden] {
  display: none;
}

/* Status */
.ssh-ra__status,
.ssh-ra__fallback {
  margin: 0.35rem 0 0 0;
  font-size: 0.92rem;
  opacity: 0.72;
  padding-left: 0.15rem;
}

/* Focus. Keep keyboard focus visible on controls */
.ssh-ra__btn:focus,
.ssh-ra__select:focus,
.ssh-ra__options summary:focus,
.ssh-ra__check input:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Follow-along highlight */
.ssh-ra-speaking {
  outline: 2px solid rgba(0,0,0,0.30);
  outline-offset: 2px;
  border-radius: 0.35rem;
  background: rgba(0,0,0,0.04);
}

/* Stronger follow-along highlight only for table rows */
.ssh-ft-table tr.ssh-ft-row.ssh-ra-speaking td {
  background: rgba(0,0,0,0.06);
}

.ssh-ft-table tr.ssh-ft-row.ssh-ra-speaking {
  outline: 3px solid rgba(0,0,0,0.28);
  outline-offset: -1px;
  border-radius: 0.35rem;
}

/* Softer zebra */
.ssh-ft-table tbody tr:nth-child(even) td {
  background: rgba(0,0,0,0.015);
}

/* Highlight always wins over zebra */
.ssh-ft-table tr.ssh-ft-row.ssh-ra-speaking td,
.ssh-ft-table tr.ssh-ft-row.is-emphasis td {
  background: rgba(0,0,0,0.06) !important;
}


/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ssh-ra-speaking {
    transition: none;
  }
}
