/* URBot TTS — Text-to-Speech UI Styles */

/* Word-level highlight during speech */
.urbot-tts-highlight {
  background: rgba(13, 148, 136, 0.35);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
  transition: background 0.15s ease;
}

/* Speaking indicator on body */
.urbot-tts-speaking .urbot-tts-toggle-btn {
  animation: urbot-tts-pulse 1.5s ease-in-out infinite;
}

@keyframes urbot-tts-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(13, 148, 136, 0); }
}

/* TTS toggle button (floating) */
.urbot-tts-toggle-btn {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(13, 148, 136, 0.5);
  background: #151a2e;
  color: #a0a0c0;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-width: 48px;
  min-height: 48px;
}

.urbot-tts-toggle-btn:hover,
.urbot-tts-toggle-btn:focus-visible {
  background: rgba(13, 148, 136, 0.15);
  color: #0d9488;
  border-color: #0d9488;
}

.urbot-tts-toggle-btn[aria-pressed="true"] {
  background: #0d9488;
  color: #fff;
  border-color: #0d9488;
}

.urbot-tts-toggle-btn:focus-visible {
  outline: 3px solid #0d9488;
  outline-offset: 2px;
}

/* TTS status region (screen-reader announcement) */
#tts-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion: disable TTS pulse animation */
@media (prefers-reduced-motion: reduce) {
  .urbot-tts-speaking .urbot-tts-toggle-btn {
    animation: none;
  }
  .urbot-tts-highlight {
    transition: none;
  }
}

/* High contrast mode */
@media (forced-colors: active) {
  .urbot-tts-highlight {
    background: Highlight;
    color: HighlightText;
  }
  .urbot-tts-toggle-btn {
    border: 2px solid ButtonText;
  }
}
