/* ==================== VARIABLES CSS ==================== */
:root {
  /* Colores principales */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  
  /* Colores de fondo */
  --bg-light: #ffffff;
  --bg-dark: #0f172a;
  --bg-panel-light: rgba(255, 255, 255, 0.95);
  --bg-panel-dark: rgba(15, 23, 42, 0.95);
  
  /* Colores de texto */
  --text-light: #1e293b;
  --text-dark: #f8fafc;
  --text-muted-light: #64748b;
  --text-muted-dark: #94a3b8;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Bordes */
  --border-radius: 0.75rem;
  --border-radius-sm: 0.5rem;
  --border-radius-lg: 1rem;
  
  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Transiciones */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Z-index */
  --z-panel: 10000;
  --z-trigger: 9999;
  --z-overlay: 10001;
  
  /* WCAG AAA específicas */
  --contrast-ratio-aaa: 7:1;
  --focus-outline-width: 3px;
  --focus-outline-offset: 2px;
  --minimum-target-size: 44px;
  --text-spacing-multiplier: 1.5;
  --font-dyslexia: 'OpenDyslexic', 'Arial', sans-serif;
  
  /* Temas oscuros */
  /* Tema Clásico (por defecto) */
  --theme-classic-bg-primary: #0f172a;
  --theme-classic-bg-secondary: #1e293b;
  --theme-classic-bg-tertiary: #334155;
  --theme-classic-text-primary: #f8fafc;
  --theme-classic-text-secondary: #e2e8f0;
  --theme-classic-accent: #3b82f6;
  --theme-classic-accent-hover: #2563eb;
  
  /* Tema Medianoche */
  --theme-midnight-bg-primary: #000000;
  --theme-midnight-bg-secondary: #1a1a1a;
  --theme-midnight-bg-tertiary: #2d2d2d;
  --theme-midnight-text-primary: #ffffff;
  --theme-midnight-text-secondary: #cccccc;
  --theme-midnight-accent: #00d9ff;
  --theme-midnight-accent-hover: #00b8e6;
  
  /* Tema Púrpura */
  --theme-purple-bg-primary: #1a0d2e;
  --theme-purple-bg-secondary: #2d1b45;
  --theme-purple-bg-tertiary: #432859;
  --theme-purple-text-primary: #f0e6ff;
  --theme-purple-text-secondary: #d4c5f9;
  --theme-purple-accent: #a855f7;
  --theme-purple-accent-hover: #9333ea;
  
  /* Tema Bosque */
  --theme-forest-bg-primary: #0d1b0d;
  --theme-forest-bg-secondary: #1a2e1a;
  --theme-forest-bg-tertiary: #264026;
  --theme-forest-text-primary: #e6f7e6;
  --theme-forest-text-secondary: #c5f0c5;
  --theme-forest-accent: #22c55e;
  --theme-forest-accent-hover: #16a34a;
  
  /* Tema Océano */
  --theme-ocean-bg-primary: #0c1e2e;
  --theme-ocean-bg-secondary: #1a3045;
  --theme-ocean-bg-tertiary: #264259;
  --theme-ocean-text-primary: #e6f4ff;
  --theme-ocean-text-secondary: #c5e6ff;
  --theme-ocean-accent: #0ea5e9;
  --theme-ocean-accent-hover: #0284c7;
  
  /* Tema Atardecer */
  --theme-sunset-bg-primary: #2e1a0d;
  --theme-sunset-bg-secondary: #452e1a;
  --theme-sunset-bg-tertiary: #594026;
  --theme-sunset-text-primary: #fff4e6;
  --theme-sunset-text-secondary: #ffe6c5;
  --theme-sunset-accent: #f97316;
  --theme-sunset-accent-hover: #ea580c;
}

/* ==================== RESET Y BASE ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  background-color: var(--bg-light);
  color: var(--text-light);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  font-size: 16px;
}

/* ==================== MODOS DE ACCESIBILIDAD ==================== */
/* Modo oscuro */
body.dark-mode {
  --bg-light: #0f172a;
  --bg-dark: #ffffff;
  --text-light: #f8fafc;
  --text-dark: #1e293b;
  --bg-panel-light: rgba(15, 23, 42, 0.95);
  --bg-panel-dark: rgba(255, 255, 255, 0.95);
}

/* Alto contraste */
body.high-contrast {
  --primary-color: #000000;
  --bg-light: #ffffff;
  --text-light: #000000;
  --shadow-md: 0 0 0 2px #000000;
}

body.high-contrast.dark-mode {
  --primary-color: #ffffff;
  --bg-light: #000000;
  --text-light: #ffffff;
  --shadow-md: 0 0 0 2px #ffffff;
}

/* Cursor grande */
body.cursor-large {
  cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="%23fbbf24" stroke="%23000" stroke-width="2"/></svg>') 24 24, auto !important;
}

body.cursor-large * {
  cursor: inherit !important;
}

/* Zoom de texto */
body.text-large {
  font-size: 1.25rem;
}

body.text-larger {
  font-size: 1.5rem;
}

/* Pausar animaciones */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ==================== PANEL DE ACCESIBILIDAD ==================== */
.accessibility-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 350px;
  max-height: 80vh;
  background: var(--bg-panel-light);  
  -webkit-backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-panel);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.accessibility-panel.active {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 600;
  font-size: 1.1rem;
}

.panel-title i {
  font-size: 1.2rem;
}

.panel-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-fast);
}

.panel-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.panel-content {
  padding: var(--spacing-lg);
  max-height: calc(80vh - 80px);
  overflow-y: auto;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--info-color) transparent;
 
}

/* WebKit browsers */
.summary-content::-webkit-scrollbar {
  width: 6px;
}

.summary-content::-webkit-scrollbar-track {
  background: transparent;
}

.summary-content::-webkit-scrollbar-thumb {
  background-color: var(--info-color);
  border-radius: 3px;
}

/* WebKit browsers */
.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 3px;
}

.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 3px;
}

/* ==================== SECCIONES DE CARACTERÍSTICAS ==================== */
.feature-section {
  margin-bottom: var(--spacing-xl);
}

.feature-section h3 {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
}

.feature-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  background: white;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.feature-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-btn.active {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
  position: relative;
}

/* Indicador especial para comandos de voz activos */
#voice-commands.active {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: voice-active-glow 2s infinite;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

#voice-commands.active::before {
  content: '🎤';
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 16px;
  animation: voice-pulse 1.5s infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes voice-active-glow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6);
  }
}

/* Indicador de navegación por teclado */
.keyboard-focused {
  outline: 3px solid #3b82f6 !important;
  outline-offset: 2px !important;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05)) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3) !important;
  z-index: 10 !important;
  border-color: #3b82f6 !important;
}

/* Mejoras de accesibilidad para navegación por teclado */
.feature-btn:focus-visible,
.theme-option:focus-visible,
select:focus-visible,
input:focus-visible,
.control-btn:focus-visible,
.detect-btn:focus-visible,
.transcription-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Animación suave para transiciones de foco */
.feature-btn,
.theme-option,
select,
input,
.control-btn,
.detect-btn,
.transcription-btn {
  transition: all 0.2s ease-in-out;
}

.feature-btn i {
  font-size: 1.2rem;
}

.feature-btn span {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* Tooltips */
.feature-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 1000;
}

.feature-btn:hover::after {
  opacity: 1;
}

/* ==================== CONTROLES DE VOZ Y TRADUCCIÓN ==================== */
.voice-controls, .language-section {
  background: rgba(255, 255, 255, 0.5);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-top: var(--spacing-lg);
}

.voice-controls label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
}

.voice-controls input[type="range"] {
  width: 100%;
  margin-bottom: var(--spacing-sm);
}

#rate-value {
  font-weight: 600;
  color: var(--primary-color);
}

/* Estilos para la sección de idiomas */
.language-section h4 {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
}

/* Controles de subtítulos */
.subtitle-controls {
  background: rgba(255, 255, 255, 0.5);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-top: var(--spacing-md);
  display: none;
}

.subtitle-controls.active {
  display: block;
}

.subtitle-controls h4 {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.control-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
}

.control-row select {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--border-radius-sm);
  background: white;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.control-row select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.transcription-btn {
  width: 100%;
  background: var(--accent-color);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.transcription-btn:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.transcription-btn.active {
  background: var(--danger-color);
  animation: pulse 2s infinite;
}

.language-selector {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--border-radius-sm);
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-md);
}

.language-selector:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.language-selector:hover {
  border-color: var(--primary-color);
}

.translation-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
}

.status-text {
  font-size: 0.85rem;
  color: var(--text-muted-light);
  flex: 1;
}

.detect-btn {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  position: relative;
  overflow: hidden;
}

.detect-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.detect-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 1000;
  margin-bottom: 5px;
}

.detect-btn:hover::after {
  opacity: 1;
}

/* Estados de traducción */
.translating {
  animation: translatePulse 1.5s infinite;
}

@keyframes translatePulse {
  0%, 100% { 
    background: var(--secondary-color);
  }
  50% { 
    background: var(--accent-color);
  }
}

/* Indicador de contenido traducido */
.translated-content {
  position: relative;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
  border-left: 3px solid var(--secondary-color);
  padding-left: var(--spacing-sm);
  animation: translateHighlight 2s ease-out;
}

@keyframes translateHighlight {
  0% {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.3), transparent);
  }
  100% {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
  }
}

/* Overlay de traducción */
.translation-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  z-index: var(--z-overlay);
  text-align: center;
  min-width: 300px;
  box-shadow: var(--shadow-xl);
}

.translation-overlay.hidden {
  display: none;
}

.translation-progress {
  margin-top: var(--spacing-md);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
  width: 0%;
  transition: width var(--transition-normal);
  animation: progressShimmer 2s infinite;
}

/* ==================== SISTEMA DE SUBTÍTULOS ==================== */
.subtitle-container {
  position: fixed;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-overlay);
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.subtitle-container.hidden {
  opacity: 0;
  visibility: hidden;
}

.subtitle-text {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  text-align: center;
  max-width: 80vw;
  box-shadow: var(--shadow-lg);
  backdrop-filter: invert(80%);;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Estilos de tamaño de subtítulos */
.subtitle-container.size-small .subtitle-text {
  font-size: 0.9rem;
  padding: var(--spacing-sm) var(--spacing-md);
}

.subtitle-container.size-medium .subtitle-text {
  font-size: 1.1rem;
  padding: var(--spacing-md) var(--spacing-lg);
}

.subtitle-container.size-large .subtitle-text {
  font-size: 1.3rem;
  padding: var(--spacing-lg) var(--spacing-xl);
}

.subtitle-container.size-xl .subtitle-text {
  font-size: 1.6rem;
  padding: var(--spacing-lg) var(--spacing-xl);
  font-weight: 600;
}

/* Posiciones de subtítulos */
.subtitle-container.position-top {
  top: 10%;
  bottom: auto;
}

.subtitle-container.position-center {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.subtitle-container.position-bottom {
  bottom: 10%;
}

/* Estilos de subtítulos */
.subtitle-container.style-box .subtitle-text {
  background: rgba(0, 0, 0, 0.9);
  border-radius: var(--border-radius);
}

.subtitle-container.style-outline .subtitle-text {
  background: transparent;
  color: white;
  text-shadow: 
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 0 4px #000;
}

.subtitle-container.style-shadow .subtitle-text {
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Controles de subtítulos overlay */
.subtitle-controls-overlay {
  position: fixed;
  bottom: 5%;
  right: 5%;
  z-index: var(--z-overlay);
  transition: opacity var(--transition-normal);
}

.subtitle-controls-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.subtitle-settings-btn {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.subtitle-settings-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* ==================== PANEL DE TRANSCRIPCIÓN ==================== */
.transcription-panel {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 350px;
  max-height: 60vh;
  background: var(--bg-panel-light);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-panel);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: transform var(--transition-normal);
}

.transcription-panel.hidden {
  transform: translateX(-100%);
}

.transcription-header {
  background: linear-gradient(135deg, var(--accent-color), #d97706);
  color: white;
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transcription-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1rem;
}

.transcription-controls {
  display: flex;
  gap: var(--spacing-xs);
}

.control-btn {
  background: none;
  border: none;
  color: white;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  font-size: 0.9rem;
}

.control-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.transcription-content {
  padding: var(--spacing-lg);
  max-height: calc(60vh - 80px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
}

.transcription-content::-webkit-scrollbar {
  width: 6px;
}

.transcription-content::-webkit-scrollbar-track {
  background: transparent;
}

.transcription-content::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 3px;
}

.transcription-status {
  color: var(--text-muted-light);
  font-style: italic;
  text-align: center;
  margin: var(--spacing-lg) 0;
}

.transcription-line {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  border-left: 3px solid var(--accent-color);
  background: rgba(245, 158, 11, 0.05);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  animation: fadeInTranscription 0.3s ease-out;
}

@keyframes fadeInTranscription {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.transcription-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted-light);
  display: block;
  margin-bottom: var(--spacing-xs);
}

.transcription-text {
  line-height: 1.5;
  color: var(--text-light);
}

/* Indicador de grabación activa */
.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--danger-color);
  font-weight: 600;
  animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.recording-dot {
  width: 8px;
  height: 8px;
  background: var(--danger-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Adaptaciones para modo oscuro */
body.dark-mode .subtitle-container.style-shadow .subtitle-text {
  background: rgba(0, 0, 0, 0.95);
  color: white;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.2);
}

/* ==================== RESPONSIVE PARA SUBTÍTULOS ==================== */
@media (max-width: 768px) {
  .transcription-panel {
    width: calc(100vw - 40px);
    left: 20px;
  }
  
  .subtitle-text {
    max-width: 95vw;
    font-size: 0.9rem !important;
    padding: var(--spacing-sm) var(--spacing-md) !important;
  }
  
  .subtitle-controls-overlay {
    bottom: 10%;
    right: 10px;
  }
}
.translation-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-panel-light);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-overlay);
  min-width: 350px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  backdrop-filter: blur(10px);
  animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.popup-header {
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-md);
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.popup-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1.1rem;
}

.fallback-badge,
.online-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: var(--spacing-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fallback-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.online-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.popup-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.popup-content {
  padding: var(--spacing-lg);
}

.original-text,
.translated-text {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--border-radius-sm);
  border-left: 3px solid var(--primary-color);
}

.translated-text {
  border-left-color: var(--secondary-color);
  background: rgba(16, 185, 129, 0.05);
}

.original-text strong,
.translated-text strong {
  color: var(--primary-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.original-text p,
.translated-text p {
  margin: var(--spacing-sm) 0 0 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-light);
}

.popup-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-lg);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: var(--spacing-md);
}

.popup-actions button {
  flex: 1;
  min-width: 100px;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
}

.popup-actions button:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.popup-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fallback-notice {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
  font-size: 0.9rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Indicadores de estado de traducción */
.translating {
  position: relative;
  opacity: 0.7;
}

.translating::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
  animation: translateScan 1.5s infinite;
  pointer-events: none;
}

@keyframes translateScan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.translated-content {
  background: rgba(16, 185, 129, 0.1) !important;
  border-left: 3px solid var(--secondary-color) !important;
  padding-left: 8px !important;
  transition: var(--transition-normal);
}

.translation-failed {
  background: rgba(239, 68, 68, 0.1) !important;
  border-left: 3px solid var(--danger-color) !important;
  padding-left: 8px !important;
}

/* Adaptaciones para modo oscuro */
[data-theme="dark"] .translation-popup,
.dark-mode .translation-popup {
  background: var(--bg-panel-dark);
  border-color: var(--primary-color);
}

[data-theme="dark"] .original-text,
[data-theme="dark"] .translated-text,
.dark-mode .original-text,
.dark-mode .translated-text {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .original-text p,
[data-theme="dark"] .translated-text p,
.dark-mode .original-text p,
.dark-mode .translated-text p {
  color: var(--text-dark);
}

[data-theme="dark"] .popup-actions,
.dark-mode .popup-actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .fallback-notice,
.dark-mode .fallback-notice {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Responsive */
@media (max-width: 480px) {
  .translation-popup {
    min-width: 300px;
    margin: var(--spacing-md);
  }
  
  .popup-actions {
    flex-direction: column;
  }
  
  .popup-actions button {
    min-width: auto;
  }
}

.popup-content {
  padding: var(--spacing-lg);
}

.original-text, .translated-text {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--border-radius-sm);
}

.original-text {
  background: rgba(37, 99, 235, 0.05);
  border-left: 3px solid var(--primary-color);
}

.translated-text {
  background: rgba(16, 185, 129, 0.05);
  border-left: 3px solid var(--secondary-color);
}

.original-text strong, .translated-text strong {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-size: 0.9rem;
  color: var(--primary-color);
}

.translated-text strong {
  color: var(--secondary-color);
}

.original-text p, .translated-text p {
  margin: 0;
  line-height: 1.5;
}

.popup-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.popup-actions button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.popup-actions button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ==================== BOTÓN FLOTANTE ==================== */
.accessibility-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-trigger);
  transition: all var(--transition-normal);
  animation: pulse 2s infinite;
}

.accessibility-trigger:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

@keyframes pulse {
  0%, 100% { box-shadow: var(--shadow-lg), 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: var(--shadow-lg), 0 0 0 10px rgba(37, 99, 235, 0); }
}

/* ==================== OVERLAYS ==================== */
.reading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-overlay);
  transition: opacity var(--transition-normal);
}

.reading-overlay.hidden {
  opacity: 0;
}

.reading-line {
  position: absolute;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  box-shadow: 0 0 10px var(--accent-color);
  transition: top var(--transition-fast);
}

/* ==================== CONTENIDO PRINCIPAL ==================== */
#main-content {
  min-height: 100vh;
  padding: var(--spacing-xl);
}

header {
  text-align: center;
  padding: var(--spacing-xl) 0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--spacing-xl);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.demo-content {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-xl);
}

.demo-content h2 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
}

.demo-content h3 {
  color: var(--text-light);
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
}

.demo-content ul {
  padding-left: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.demo-content li {
  margin-bottom: var(--spacing-sm);
}

.demo-content a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  padding: var(--spacing-md) var(--spacing-lg);
  background: rgba(37, 99, 235, 0.1);
  border-radius: var(--border-radius);
  display: inline-block;
  margin: var(--spacing-md) 0;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.demo-content a:hover,
.demo-content a:focus {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-hover);
}

/* Instrucciones de demostración */
.demo-instructions {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  margin: var(--spacing-xl) 0;
  box-shadow: var(--shadow-md);
}

.demo-instructions h4 {
  color: #0ea5e9;
  margin: 0 0 var(--spacing-lg) 0;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.demo-instructions ol {
  margin: 0;
  padding-left: var(--spacing-xl);
  counter-reset: step-counter;
}

.demo-instructions li {
  margin-bottom: var(--spacing-md);
  position: relative;
  padding-left: var(--spacing-sm);
  line-height: var(--line-height-relaxed);
}

.demo-instructions li strong {
  color: #0c4a6e;
  font-weight: 600;
}

/* Modo oscuro para instrucciones */
.dark-mode .demo-instructions {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
  border-color: #0ea5e9;
}

.dark-mode .demo-instructions h4 {
  color: #38bdf8;
}

.dark-mode .demo-instructions li strong {
  color: #7dd3fc;
}

.dark-mode .demo-content a {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text-dark);
}

.dark-mode .demo-content a:hover,
.dark-mode .demo-content a:focus {
  background: var(--primary-color);
  color: var(--white);
}

/* ==================== MODO OSCURO - CONTENIDO PRINCIPAL ==================== */
.dark-mode #main-content {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

.dark-mode header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: var(--text-dark);
}

.dark-mode header h1 {
  color: var(--text-dark);
}

.dark-mode header p {
  color: var(--text-dark);
  opacity: 0.9;
}

.dark-mode .demo-content {
  background: var(--bg-panel-dark);
  color: var(--text-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .demo-content h2 {
  color: var(--primary-color);
}

.dark-mode .demo-content h3 {
  color: var(--text-dark);
}

.dark-mode .demo-content p {
  color: var(--text-dark);
  line-height: 1.7;
}

.dark-mode .demo-content li {
  color: var(--text-dark);
}

.dark-mode .ai-section {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .ai-content h3 {
  color: var(--primary-color);
}

.dark-mode .ai-content p {
  color: var(--text-dark);
}

/* ==================== SECCIÓN DEL AGENTE IA ==================== */
.ai-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(16, 185, 129, 0.1));
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  margin: 0 auto;
  max-width: 800px;
}

.ai-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
  animation: happyBounce 2s ease-in-out infinite;
  border: 3px solid #fef3c7;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.ai-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(251, 191, 36, 0.6);
  animation-duration: 1s;
}

@keyframes happyBounce {
  0%, 100% { 
    transform: translateY(0) rotate(0deg); 
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
  }
  25% { 
    transform: translateY(-5px) rotate(-2deg); 
    box-shadow: 0 12px 25px rgba(251, 191, 36, 0.5);
  }
  50% { 
    transform: translateY(-8px) rotate(0deg); 
    box-shadow: 0 15px 30px rgba(251, 191, 36, 0.6);
  }
  75% { 
    transform: translateY(-5px) rotate(2deg); 
    box-shadow: 0 12px 25px rgba(251, 191, 36, 0.5);
  }
}

.ai-avatar i {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { 
    transform: scale(1);
    filter: brightness(1);
  }
  50% { 
    transform: scale(1.1);
    filter: brightness(1.2);
  }
}

.ai-content h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

/* Modo oscuro para el avatar alegre */
.dark-mode .ai-avatar {
  background: linear-gradient(135deg, #f59e0b, #d97706, #b45309);
  border-color: #451a03;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.dark-mode .ai-avatar:hover {
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.5);
}

.dark-mode .ai-content h3 {
  color: #fbbf24;
}

.dark-mode .ai-content p {
  color: var(--text-dark);
}

.ai-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.status-indicator {
  width: 12px;
  height: 12px;
  background: var(--secondary-color);
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* ==================== ESTADOS ACTIVOS ==================== */
body.focus-highlight *:focus {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: 2px !important;
}

body.links-highlight a {
  background: linear-gradient(120deg, transparent 0%, var(--accent-color) 0%, var(--accent-color) 100%, transparent 100%);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  animation: linkHighlight 2s infinite;
}

@keyframes linkHighlight {
  0%, 100% { background-size: 0% 2px; }
  50% { background-size: 100% 2px; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .accessibility-panel {
    width: calc(100vw - 40px);
    right: 20px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .ai-section {
    flex-direction: column;
    text-align: center;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  #main-content {
    padding: var(--spacing-md);
  }
}

/* ==================== UTILIDADES ==================== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== MEJORAS DE ACCESIBILIDAD ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== WCAG AAA ESPECÍFICO ==================== */

/* Filtros para daltonismo */
.color-blind-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: var(--z-overlay);
  mix-blend-mode: multiply;
  transition: opacity var(--transition-normal);
}

.color-blind-overlay.protanopia {
  background: linear-gradient(45deg, 
    rgba(255, 0, 0, 0.1) 0%, 
    rgba(0, 255, 255, 0.1) 100%);
}

.color-blind-overlay.deuteranopia {
  background: linear-gradient(45deg, 
    rgba(0, 255, 0, 0.1) 0%, 
    rgba(255, 0, 255, 0.1) 100%);
}

.color-blind-overlay.tritanopia {
  background: linear-gradient(45deg, 
    rgba(0, 0, 255, 0.1) 0%, 
    rgba(255, 255, 0, 0.1) 100%);
}

/* Fuente para dislexia */
.dyslexia-font {
  font-family: var(--font-dyslexia) !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
  line-height: 1.5 !important;
}

/* Espaciado de líneas mejorado */
.increased-line-spacing {
  line-height: calc(var(--line-height-normal) * var(--text-spacing-multiplier)) !important;
}

.increased-line-spacing p,
.increased-line-spacing div,
.increased-line-spacing span {
  line-height: inherit !important;
  margin-bottom: calc(var(--spacing-md) * var(--text-spacing-multiplier)) !important;
}

/* Indicador de foco mejorado WCAG AAA */
*:focus {
  outline: var(--focus-outline-width) solid var(--primary-color) !important;
  outline-offset: var(--focus-outline-offset) !important;
  box-shadow: 0 0 0 calc(var(--focus-outline-width) + 1px) rgba(37, 99, 235, 0.2) !important;
  transition: all var(--transition-fast) !important;
}

/* Enlaces de salto */
.skip-links {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: calc(var(--z-overlay) + 1);
  background: var(--bg-light);
  border-bottom: 2px solid var(--primary-color);
  padding: var(--spacing-sm);
  display: flex;
  gap: var(--spacing-md);
  transform: translateY(-100%);
  transition: transform var(--transition-normal);
}

.skip-links.visible {
  transform: translateY(0);
}

.skip-link {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-color);
  color: var(--bg-light);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  min-height: var(--minimum-target-size);
  min-width: var(--minimum-target-size);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skip-link:hover,
.skip-link:focus {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Panel de ayuda contextual */
.context-help-panel {
  position: fixed;
  top: 50%;
  right: var(--spacing-lg);
  transform: translateY(-50%);
  width: 320px;
  max-height: 70vh;
  background: var(--bg-panel-light);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-overlay);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.context-help-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(100%);
}

.help-header {
  background: var(--primary-color);
  color: var(--bg-light);
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.help-header h4 {
  margin: 0;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.help-content {
  padding: var(--spacing-md);
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

/* Navegador de encabezados */
.heading-navigator {
  position: fixed;
  top: 20%;
  left: var(--spacing-lg);
  width: 280px;
  max-height: 60vh;
  background: var(--bg-panel-light);
  border: 2px solid var(--secondary-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-overlay);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.heading-navigator.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
}

.navigator-header {
  background: var(--secondary-color);
  color: var(--bg-light);
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navigator-header h4 {
  margin: 0;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.headings-list {
  padding: var(--spacing-sm);
  max-height: 45vh;
  overflow-y: auto;
}

.heading-item {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--spacing-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: var(--minimum-target-size);
  color: var(--text-light);
}

.heading-item:hover,
.heading-item:focus {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary-color);
}

.heading-item.h1 { padding-left: var(--spacing-md); font-weight: 700; }
.heading-item.h2 { padding-left: calc(var(--spacing-md) * 1.5); font-weight: 600; }
.heading-item.h3 { padding-left: calc(var(--spacing-md) * 2); font-weight: 500; }
.heading-item.h4 { padding-left: calc(var(--spacing-md) * 2.5); font-weight: 400; }
.heading-item.h5 { padding-left: calc(var(--spacing-md) * 3); font-weight: 400; }
.heading-item.h6 { padding-left: calc(var(--spacing-md) * 3.5); font-weight: 400; }

/* Advertencia de tiempo de sesión */
.timeout-warning {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  background: var(--bg-light);
  border: 3px solid var(--warning-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: calc(var(--z-overlay) + 2);
  animation: pulse 2s infinite;
}

.timeout-warning.hidden {
  display: none;
}

.warning-content {
  padding: var(--spacing-xl);
  text-align: center;
}

.warning-content i {
  font-size: 3rem;
  color: var(--warning-color);
  margin-bottom: var(--spacing-md);
}

.warning-content h4 {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-light);
  font-size: var(--font-size-xl);
}

.warning-content p {
  margin: 0 0 var(--spacing-lg) 0;
  color: var(--text-light);
}

#timeout-countdown {
  font-weight: 700;
  color: var(--warning-color);
  font-size: var(--font-size-lg);
}

.warning-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: var(--minimum-target-size);
  min-width: 120px;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--bg-light);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--bg-light);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #059669;
  transform: translateY(-2px);
}

/* Panel de resumen de página */
.page-summary-panel {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 350px;
  max-height: 60vh;
  background: var(--bg-panel-light);
  border: 2px solid var(--info-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-overlay);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.page-summary-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
}

.summary-header {
  background: var(--info-color);
  color: var(--bg-light);
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-header h4 {
  margin: 0;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.summary-controls {
  display: flex;
  gap: var(--spacing-sm);
}

.summary-content {
  padding: var(--spacing-md);
  max-height: 45vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--info-color) transparent;
}

.summary-section {
  margin-bottom: var(--spacing-lg);
}

.summary-section h5 {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--info-color);
  font-size: var(--font-size-base);
  font-weight: 600;
}

.summary-section p,
.summary-section ul {
  margin: 0;
  color: var(--text-light);
  line-height: var(--line-height-relaxed);
}

.summary-section ul {
  padding-left: var(--spacing-lg);
}

.summary-section li {
  margin-bottom: var(--spacing-xs);
}

/* Configuración de contexto */
.context-section {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(37, 99, 235, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.context-section h4 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: var(--font-size-lg);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  gap: var(--spacing-md);
}

.control-row:last-child {
  margin-bottom: 0;
}

.control-row label {
  font-weight: 500;
  color: var(--text-light);
  flex: 1;
}

.control-row select,
.control-row input[type="checkbox"] {
  min-height: var(--minimum-target-size);
  min-width: 120px;
}

.control-row input[type="checkbox"] {
  min-width: 20px;
  transform: scale(1.2);
  margin-right: var(--spacing-sm);
}

.checkbox-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted-light);
}

/* Orden de lectura visual */
.reading-order-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: var(--z-overlay);
  background: rgba(0, 0, 0, 0.1);
}

.reading-order-number {
  position: absolute;
  background: var(--primary-color);
  color: var(--bg-light);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-md);
  animation: readingOrderPulse 2s infinite;
}

@keyframes readingOrderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Orden de tabulación */
.tab-order-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: var(--z-overlay);
}

.tab-order-indicator {
  position: absolute;
  background: var(--accent-color);
  color: var(--text-light);
  border-radius: var(--border-radius);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-weight: 700;
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--bg-light);
}

/* Animaciones de pulso */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Modo alto contraste específico WCAG AAA */
.high-contrast-mode {
  filter: contrast(2) !important;
}

.high-contrast-mode * {
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.high-contrast-mode a {
  color: #0000ff !important;
  text-decoration: underline !important;
}

.high-contrast-mode a:visited {
  color: #800080 !important;
}

.high-contrast-mode button,
.high-contrast-mode input,
.high-contrast-mode select,
.high-contrast-mode textarea {
  border: 2px solid #000000 !important;
  background: #ffffff !important;
  color: #000000 !important;
}

/* Modo oscuro WCAG AAA */
.dark-mode .context-help-panel,
.dark-mode .heading-navigator,
.dark-mode .page-summary-panel {
  background: var(--bg-panel-dark);
  color: var(--text-dark);
}

.dark-mode .timeout-warning {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.dark-mode .warning-content h4,
.dark-mode .warning-content p {
  color: var(--text-dark);
}

.dark-mode .control-row label {
  color: var(--text-dark);
}

.dark-mode .checkbox-label {
  color: var(--text-muted-dark);
}

.dark-mode .summary-section p,
.dark-mode .summary-section ul {
  color: var(--text-dark);
}

/* Responsividad WCAG AAA */
@media (max-width: 768px) {
  .context-help-panel,
  .heading-navigator,
  .page-summary-panel {
    width: 90%;
    left: 5%;
    right: 5%;
    transform: translateX(0);
  }
  
  .context-help-panel.hidden,
  .heading-navigator.hidden {
    transform: translateY(-100%);
  }
  
  .page-summary-panel.hidden {
    transform: translateY(100%);
  }
  
  .control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  
  .control-row select {
    width: 100%;
  }
}

/* Asegurar tamaño mínimo de objetivos WCAG AAA */
button,
a,
input,
select,
textarea,
[role="button"],
[onclick],
[tabindex] {
  min-height: var(--minimum-target-size);
  min-width: var(--minimum-target-size);
}

/* Espaciado de texto WCAG AAA */
.wcag-text-spacing p {
  line-height: 1.5 !important;
  margin-bottom: 2em !important;
}

.wcag-text-spacing h1,
.wcag-text-spacing h2,
.wcag-text-spacing h3,
.wcag-text-spacing h4,
.wcag-text-spacing h5,
.wcag-text-spacing h6 {
  line-height: 1.3 !important;
  margin-bottom: 0.75em !important;
}

/* Indicadores de estado WCAG AAA - MEJORADOS */
.status-indicator {
  position: relative;
  transition: all 0.3s ease;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success-color);
  border: 2px solid var(--bg-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.status-indicator.warning::after {
  background: var(--warning-color);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4);
}

.status-indicator.error::after {
  background: var(--danger-color);
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.4);
}

.status-indicator.listening::after {
  background: #10b981;
  animation: voice-pulse 1.2s infinite;
  box-shadow: 0 2px 16px rgba(16, 185, 129, 0.6);
}

.status-indicator.processing::after {
  background: #f59e0b;
  animation: voice-spin 0.8s linear infinite;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.5);
}

.status-indicator.loading::after {
  background: #3b82f6;
  animation: voice-loading 1.5s infinite;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.5);
}

/* Animaciones mejoradas para mejor feedback visual */
@keyframes voice-pulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
    box-shadow: 0 2px 16px rgba(16, 185, 129, 0.6);
  }
  50% { 
    opacity: 0.7; 
    transform: scale(1.4);
    box-shadow: 0 2px 24px rgba(16, 185, 129, 0.8);
  }
}

@keyframes voice-spin {
  from { 
    transform: rotate(0deg);
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.5);
  }
  to { 
    transform: rotate(360deg);
    box-shadow: 0 2px 16px rgba(245, 158, 11, 0.7);
  }
}

@keyframes voice-loading {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  25% { 
    opacity: 0.8; 
    transform: scale(1.1);
  }
  50% { 
    opacity: 0.6; 
    transform: scale(1.2);
  }
  75% { 
    opacity: 0.8; 
    transform: scale(1.1);
  }
}

/* Indicador adicional para estado de escucha continua */
.ai-status.listening {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border-left: 3px solid #10b981;
  animation: glow-border 2s infinite;
}

@keyframes glow-border {
  0%, 100% { 
    border-left-color: #10b981;
    box-shadow: -2px 0 8px rgba(16, 185, 129, 0.3);
  }
  50% { 
    border-left-color: #059669;
    box-shadow: -2px 0 16px rgba(16, 185, 129, 0.5);
  }
}

/* ==================== SELECTOR DE TEMAS OSCUROS ==================== */

.theme-section {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all var(--transition-normal);
}

.theme-section.hidden {
  display: none;
}

.theme-section h4 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: var(--font-size-lg);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-normal);
  min-height: var(--minimum-target-size);
  position: relative;
  overflow: hidden;
}

.theme-option:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.theme-option.active {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
}

.theme-option.active::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.theme-preview {
  display: flex;
  gap: 4px;
  margin-bottom: var(--spacing-sm);
  padding: 8px;
  border-radius: 6px;
  background: #f1f5f9;
}

.theme-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Previews específicos para cada tema */
.classic-preview {
  background: var(--theme-classic-bg-primary);
}

.classic-preview .theme-primary {
  background: var(--theme-classic-bg-secondary);
}

.classic-preview .theme-secondary {
  background: var(--theme-classic-bg-tertiary);
}

.classic-preview .theme-accent {
  background: var(--theme-classic-accent);
}

.midnight-preview {
  background: var(--theme-midnight-bg-primary);
}

.midnight-preview .theme-primary {
  background: var(--theme-midnight-bg-secondary);
}

.midnight-preview .theme-secondary {
  background: var(--theme-midnight-bg-tertiary);
}

.midnight-preview .theme-accent {
  background: var(--theme-midnight-accent);
}

.purple-preview {
  background: var(--theme-purple-bg-primary);
}

.purple-preview .theme-primary {
  background: var(--theme-purple-bg-secondary);
}

.purple-preview .theme-secondary {
  background: var(--theme-purple-bg-tertiary);
}

.purple-preview .theme-accent {
  background: var(--theme-purple-accent);
}

.forest-preview {
  background: var(--theme-forest-bg-primary);
}

.forest-preview .theme-primary {
  background: var(--theme-forest-bg-secondary);
}

.forest-preview .theme-secondary {
  background: var(--theme-forest-bg-tertiary);
}

.forest-preview .theme-accent {
  background: var(--theme-forest-accent);
}

.ocean-preview {
  background: var(--theme-ocean-bg-primary);
}

.ocean-preview .theme-primary {
  background: var(--theme-ocean-bg-secondary);
}

.ocean-preview .theme-secondary {
  background: var(--theme-ocean-bg-tertiary);
}

.ocean-preview .theme-accent {
  background: var(--theme-ocean-accent);
}

.sunset-preview {
  background: var(--theme-sunset-bg-primary);
}

.sunset-preview .theme-primary {
  background: var(--theme-sunset-bg-secondary);
}

.sunset-preview .theme-secondary {
  background: var(--theme-sunset-bg-tertiary);
}

.sunset-preview .theme-accent {
  background: var(--theme-sunset-accent);
}

.theme-option span {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-light);
}

.theme-info {
  text-align: center;
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.theme-info p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

#current-theme-name {
  font-weight: 600;
  color: var(--primary-color);
}

/* ==================== APLICACIÓN DE TEMAS ==================== */

/* Tema Clásico */
body.dark-mode.theme-classic {
  --bg-dark: var(--theme-classic-bg-primary);
  --bg-panel-dark: rgba(30, 41, 59, 0.95);
  --text-dark: var(--theme-classic-text-primary);
  --text-muted-dark: var(--theme-classic-text-secondary);
  --primary-color: var(--theme-classic-accent);
  --primary-hover: var(--theme-classic-accent-hover);
}

/* Tema Medianoche */
body.dark-mode.theme-midnight {
  --bg-dark: var(--theme-midnight-bg-primary);
  --bg-panel-dark: rgba(26, 26, 26, 0.95);
  --text-dark: var(--theme-midnight-text-primary);
  --text-muted-dark: var(--theme-midnight-text-secondary);
  --primary-color: var(--theme-midnight-accent);
  --primary-hover: var(--theme-midnight-accent-hover);
}

body.dark-mode.theme-midnight .accessibility-panel,
body.dark-mode.theme-midnight .feature-btn {
  background: var(--theme-midnight-bg-secondary);
  border-color: var(--theme-midnight-bg-tertiary);
}

body.dark-mode.theme-midnight .panel-header {
  background: var(--theme-midnight-bg-tertiary);
}

/* Tema Púrpura */
body.dark-mode.theme-purple {
  --bg-dark: var(--theme-purple-bg-primary);
  --bg-panel-dark: rgba(45, 27, 69, 0.95);
  --text-dark: var(--theme-purple-text-primary);
  --text-muted-dark: var(--theme-purple-text-secondary);
  --primary-color: var(--theme-purple-accent);
  --primary-hover: var(--theme-purple-accent-hover);
}

body.dark-mode.theme-purple .accessibility-panel,
body.dark-mode.theme-purple .feature-btn {
  background: var(--theme-purple-bg-secondary);
  border-color: var(--theme-purple-bg-tertiary);
}

body.dark-mode.theme-purple .panel-header {
  background: var(--theme-purple-bg-tertiary);
}

/* Tema Bosque */
body.dark-mode.theme-forest {
  --bg-dark: var(--theme-forest-bg-primary);
  --bg-panel-dark: rgba(26, 46, 26, 0.95);
  --text-dark: var(--theme-forest-text-primary);
  --text-muted-dark: var(--theme-forest-text-secondary);
  --primary-color: var(--theme-forest-accent);
  --primary-hover: var(--theme-forest-accent-hover);
}

body.dark-mode.theme-forest .accessibility-panel,
body.dark-mode.theme-forest .feature-btn {
  background: var(--theme-forest-bg-secondary);
  border-color: var(--theme-forest-bg-tertiary);
}

body.dark-mode.theme-forest .panel-header {
  background: var(--theme-forest-bg-tertiary);
}

/* Tema Océano */
body.dark-mode.theme-ocean {
  --bg-dark: var(--theme-ocean-bg-primary);
  --bg-panel-dark: rgba(26, 48, 69, 0.95);
  --text-dark: var(--theme-ocean-text-primary);
  --text-muted-dark: var(--theme-ocean-text-secondary);
  --primary-color: var(--theme-ocean-accent);
  --primary-hover: var(--theme-ocean-accent-hover);
}

body.dark-mode.theme-ocean .accessibility-panel,
body.dark-mode.theme-ocean .feature-btn {
  background: var(--theme-ocean-bg-secondary);
  border-color: var(--theme-ocean-bg-tertiary);
}

body.dark-mode.theme-ocean .panel-header {
  background: var(--theme-ocean-bg-tertiary);
}

/* Tema Atardecer */
body.dark-mode.theme-sunset {
  --bg-dark: var(--theme-sunset-bg-primary);
  --bg-panel-dark: rgba(69, 46, 26, 0.95);
  --text-dark: var(--theme-sunset-text-primary);
  --text-muted-dark: var(--theme-sunset-text-secondary);
  --primary-color: var(--theme-sunset-accent);
  --primary-hover: var(--theme-sunset-accent-hover);
}

body.dark-mode.theme-sunset .accessibility-panel,
body.dark-mode.theme-sunset .feature-btn {
  background: var(--theme-sunset-bg-secondary);
  border-color: var(--theme-sunset-bg-tertiary);
}

body.dark-mode.theme-sunset .panel-header {
  background: var(--theme-sunset-bg-tertiary);
}

/* ==================== TEMAS OSCUROS - CONTENIDO PRINCIPAL ==================== */

/* Tema Clásico - Contenido Principal */
body.dark-mode.theme-classic #main-content {
  background-color: var(--theme-classic-bg-primary);
  color: var(--theme-classic-text-primary);
}

body.dark-mode.theme-classic .demo-content {
  background: rgba(30, 41, 59, 0.8);
  color: var(--theme-classic-text-primary);
  border: 1px solid var(--theme-classic-bg-tertiary);
}

body.dark-mode.theme-classic .demo-content h2,
body.dark-mode.theme-classic .demo-content h3 {
  color: var(--theme-classic-accent);
}

/* Tema Medianoche - Contenido Principal */
body.dark-mode.theme-midnight #main-content {
  background-color: var(--theme-midnight-bg-primary);
  color: var(--theme-midnight-text-primary);
}

body.dark-mode.theme-midnight .demo-content {
  background: rgba(26, 26, 26, 0.9);
  color: var(--theme-midnight-text-primary);
  border: 1px solid var(--theme-midnight-bg-tertiary);
}

body.dark-mode.theme-midnight .demo-content h2,
body.dark-mode.theme-midnight .demo-content h3 {
  color: var(--theme-midnight-accent);
}

/* Tema Púrpura - Contenido Principal */
body.dark-mode.theme-purple #main-content {
  background-color: var(--theme-purple-bg-primary);
  color: var(--theme-purple-text-primary);
}

body.dark-mode.theme-purple .demo-content {
  background: rgba(45, 27, 69, 0.9);
  color: var(--theme-purple-text-primary);
  border: 1px solid var(--theme-purple-bg-tertiary);
}

body.dark-mode.theme-purple .demo-content h2,
body.dark-mode.theme-purple .demo-content h3 {
  color: var(--theme-purple-accent);
}

/* Tema Bosque - Contenido Principal */
body.dark-mode.theme-forest #main-content {
  background-color: var(--theme-forest-bg-primary);
  color: var(--theme-forest-text-primary);
}

body.dark-mode.theme-forest .demo-content {
  background: rgba(26, 46, 26, 0.9);
  color: var(--theme-forest-text-primary);
  border: 1px solid var(--theme-forest-bg-tertiary);
}

body.dark-mode.theme-forest .demo-content h2,
body.dark-mode.theme-forest .demo-content h3 {
  color: var(--theme-forest-accent);
}

/* Tema Océano - Contenido Principal */
body.dark-mode.theme-ocean #main-content {
  background-color: var(--theme-ocean-bg-primary);
  color: var(--theme-ocean-text-primary);
}

body.dark-mode.theme-ocean .demo-content {
  background: rgba(26, 48, 69, 0.9);
  color: var(--theme-ocean-text-primary);
  border: 1px solid var(--theme-ocean-bg-tertiary);
}

body.dark-mode.theme-ocean .demo-content h2,
body.dark-mode.theme-ocean .demo-content h3 {
  color: var(--theme-ocean-accent);
}

/* Tema Atardecer - Contenido Principal */
body.dark-mode.theme-sunset #main-content {
  background-color: var(--theme-sunset-bg-primary);
  color: var(--theme-sunset-text-primary);
}

body.dark-mode.theme-sunset .demo-content {
  background: rgba(69, 46, 26, 0.9);
  color: var(--theme-sunset-text-primary);
  border: 1px solid var(--theme-sunset-bg-tertiary);
}

body.dark-mode.theme-sunset .demo-content h2,
body.dark-mode.theme-sunset .demo-content h3 {
  color: var(--theme-sunset-accent);
}

/* Modo oscuro para selector de temas */
.dark-mode .theme-section {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.dark-mode .theme-section h4 {
  color: var(--primary-color);
}

.dark-mode .theme-option {
  background: var(--bg-panel-dark);
  color: var(--text-dark);
}

.dark-mode .theme-option:hover {
  background: rgba(59, 130, 246, 0.2);
}

.dark-mode .theme-option span {
  color: var(--text-dark);
}

.dark-mode .theme-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.dark-mode .theme-info p {
  color: var(--text-dark);
}

/* Responsividad para selector de temas */
@media (max-width: 768px) {
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }
  
  .theme-option {
    padding: var(--spacing-sm);
  }
  
  .theme-preview {
    margin-bottom: var(--spacing-xs);
  }
  
  .theme-color {
    width: 16px;
    height: 16px;
  }
}

/* Focus visible para mejor accesibilidad */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}