/* --- Main conversation area: transcript, waveform, talk button, errors --- */

#main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-height: 0;
}

#transcriptArea {
  overflow-y: auto;
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.bubble.mine {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid rgba(193, 64, 61, 0.35);
  border-bottom-right-radius: 4px;
}
.bubble.mine.pending {
  opacity: 0.6;
  font-style: italic;
}
.bubble.tutor {
  align-self: flex-start;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble .speaker-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

#emptyState {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 320px;
}

/* --- Waveform --- */

#waveformWrap {
  padding: 4px 40px 0;
}
#waveform {
  width: 100%;
  height: 56px;
  display: block;
}

/* --- Talk button (signature element) --- */

#talkArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 32px;
}

#talkRow {
  display: flex;
  align-items: center;
  gap: 16px;
}

#talkBtn {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: breathe 3.2s ease-in-out infinite;
  transition: background 0.15s ease, transform 0.1s ease;
}
#talkBtn:hover { background: var(--accent-hover); }
#talkBtn:active { transform: scale(0.96); }
#talkBtn.recording {
  animation: none;
  box-shadow: 0 0 0 0 rgba(193, 64, 61, 0.5);
  animation: pulse-ring 1.1s ease-out infinite;
}
#talkBtn svg { width: 30px; height: 30px; fill: #fff; }

#handsFreeBtn svg,
#cameraToggleBtn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193, 64, 61, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(193, 64, 61, 0); }
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(193, 64, 61, 0.55); }
  100% { box-shadow: 0 0 0 22px rgba(193, 64, 61, 0); }
}

#talkHint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  #talkBtn, #talkBtn.recording { animation: none; }
}

/* --- Status toast (connection issues / "still waiting" / errors) - fixed
   to the viewport so it's impossible to miss regardless of scroll
   position, non-blocking (no backdrop, rest of the page stays usable)
   unlike the settings/notes modals. Two tones (see transcript.js's
   showStatusToast): 'info' for a transient "still waiting" state (no
   retry button - nothing to retry, it's still in progress), 'error' for
   an actual failure (retry button shown - see websocket.js). */

#statusToast {
  display: none;
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 80;
  align-items: center;
  gap: 12px;
  max-width: min(480px, 90vw);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 0.86rem;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#statusToast.visible {
  display: flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#statusToast.error {
  background: rgba(193, 64, 61, 0.16);
  border: 1px solid rgba(193, 64, 61, 0.5);
  color: #f0b4b2;
}
#statusToast.info {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text);
}
#statusToastIcon::before {
  content: '\26A0\FE0F'; /* warning triangle - overridden to an hourglass for .info below */
}
#statusToast.info #statusToastIcon::before {
  content: '\23F3'; /* hourglass */
}
#statusToastMessage {
  flex: 1;
}
#statusToastRetryBtn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.8rem;
}
