/* ==========================================================================
   ESTILOS DINÁMICOS: GENERADOR DE TEXTO A VOZ (TTS) - PIRUTOOLS
   Optimizado 100% para Tailwind CSS v4. Solo reglas indispensables no utilitarias.
   ========================================================================== */

/* Pestañas de Modo (Voz del Sistema vs IA WebGPU) */
.tts-mode-tab {
  color: var(--text-muted);
}

.tts-mode-tab:hover {
  color: var(--text-main);
}

.tts-mode-tab.active {
  background-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Indicador Pulsante de Estado */
.tts-badge-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: ttsPulseDot 1.5s infinite;
}

@keyframes ttsPulseDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.3);
  }
}

/* Resaltado de Lectura Sincronizada en Tiempo Real */
.tts-highlight-word {
  background-color: rgba(99, 102, 241, 0.22);
  color: #4f46e5;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 6px;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
  transition: all 0.15s ease;
}

[data-bs-theme="dark"] .tts-highlight-word,
.dark .tts-highlight-word {
  background-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

/* Sliders de Rango Nativos */
.tts-range-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 9999px;
  background-color: rgba(148, 163, 184, 0.25);
  cursor: pointer;
  outline: none;
}

.tts-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #6366f1;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
  transition: transform 0.15s ease;
}

.tts-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.tts-range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background-color: #6366f1;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
  transition: transform 0.15s ease;
}

.tts-range-slider::-moz-range-thumb:hover {
  transform: scale(1.25);
}

/* Modal de Información */
.tts-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tts-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.tts-modal-card {
  transform: translateY(16px);
  transition: transform 0.2s ease;
}

.tts-modal-overlay.active .tts-modal-card {
  transform: translateY(0);
}

/* Historial de Lecturas Dinámico */
.tts-history-item {
  padding: 10px 12px;
  border-radius: 12px;
  background-color: var(--page-bg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  transition: border-color 0.2s ease;
}

.tts-history-item:hover {
  border-color: #6366f1;
}

.tts-history-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 600;
}

.tts-history-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Notificaciones Flotantes (Toasts) */
.tts-toast {
  padding: 10px 16px;
  border-radius: 12px;
  background-color: var(--container-bg, #ffffff);
  color: var(--text-main, #1e293b);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.2s ease;
  pointer-events: auto;
}

.tts-toast.show {
  opacity: 1;
  transform: translateY(0);
}
