/**
 * Estilos para el icono de pronunciación en el modal
 */

/* Icono de pronunciación */
.pronunciation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  margin-left: 8px;
  vertical-align: middle;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

/* Efecto de ondas al hacer clic */
.pronunciation-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.pronunciation-icon:active::before {
  width: 100px;
  height: 100px;
}

.pronunciation-icon:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.pronunciation-icon:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Estado: Pronunciando */
.pronunciation-icon.speaking {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  animation: pulse 1.5s infinite;
}

.pronunciation-icon.speaking:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Estado: Error */
.pronunciation-icon.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: shake 0.5s ease-in-out;
}

.pronunciation-icon.error:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Modo oscuro para el icono */
body.active .pronunciation-icon {
  background: linear-gradient(135deg, #fdc21c 0%, #f59e0b 100%);
  color: #1f2937;
  box-shadow: 0 2px 4px rgba(253, 194, 28, 0.2);
}

body.active .pronunciation-icon:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 8px rgba(253, 194, 28, 0.3);
}

body.active .pronunciation-icon.speaking {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

body.active .pronunciation-icon.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

/* Micro-interacciones en modo oscuro */
body.active .meaning:hover {
  background: rgba(253, 194, 28, 0.05);
  box-shadow: 0 2px 4px rgba(253, 194, 28, 0.1);
}

body.active .meaning.definition:hover {
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

body.active .meaning.example:hover {
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Animaciones */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Responsive */
@media (max-width: 480px) {
  .pronunciation-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .pronunciation-icon {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
}

/* Mejoras para accesibilidad */
.pronunciation-icon:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

body.active .pronunciation-icon:focus {
  outline-color: #fdc21c;
}

/* Micro-interacciones para las traducciones */
.meaning {
  transition: all 0.2s ease;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 4px 0;
  position: relative;
  cursor: default;
}

.meaning:hover {
  background: rgba(59, 130, 246, 0.05);
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.meaning.definition:hover {
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.meaning.example:hover {
  background: rgba(245, 158, 11, 0.05);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

/* Efecto de click en traducciones */
.meaning:active {
  transform: translateX(1px) scale(0.98);
  transition: all 0.1s ease;
}

/* Animación de entrada para el modal */
.modal {
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from { 
    opacity: 0; 
    transform: translateY(-10px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* Loading state para pronunciación */
.pronunciation-icon.loading {
  animation: spin 1s linear infinite;
}

.pronunciation-icon.loading i {
  animation: pulse 0.8s ease-in-out infinite alternate;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Efecto de partículas al hacer clic */
.pronunciation-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.3s ease;
}

.pronunciation-icon:active::after {
  opacity: 1;
  animation: particleBurst 0.6s ease-out;
}

@keyframes particleBurst {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* Selector de voces */
.voice-selector {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
}

.country-selector {
  margin-bottom: 12px;
}

.voice-selector-inner {
  margin-top: 8px;
  transition: all 0.3s ease;
}

.voice-selector label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.voice-selector select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #374151;
  transition: all 0.2s ease;
  cursor: pointer;
}

.voice-selector select:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.voice-selector select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.voice-selector option {
  padding: 8px;
  color: #374151;
}

/* Modo oscuro para selector de voces */
body.active .voice-selector {
  border-bottom-color: rgba(253, 194, 28, 0.2);
}

body.active .voice-selector label {
  color: #fbbf24;
}

body.active .voice-selector select {
  background: rgba(253, 194, 28, 0.1);
  border-color: rgba(253, 194, 28, 0.3);
  color: #fbbf24;
}

body.active .voice-selector select:hover {
  border-color: #fdc21c;
  box-shadow: 0 0 0 3px rgba(253, 194, 28, 0.1);
}

body.active .voice-selector select:focus {
  border-color: #fdc21c;
  box-shadow: 0 0 0 3px rgba(253, 194, 28, 0.2);
}

body.active .voice-selector option {
  color: #fbbf24;
}

/* Responsive para selector de voces */
@media (max-width: 480px) {
  .voice-selector select {
    font-size: 13px;
    padding: 6px 10px;
  }
  
  .voice-selector label {
    font-size: 13px;
  }
}

/* Ocultar enlaces a ingles.com cuando se use el nuevo sistema */
.view-ingles-website {
  display: none !important;
}

/* Estilos para mensajes de error */
.speech-error-message {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
}

/* Sección de pronunciación */
.pronunciation-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Modo oscuro para sección de pronunciación */
body.active .pronunciation-section {
  border-top-color: rgba(253, 194, 28, 0.2);
}

/* Mejoras para el modal existente */
.modal-content .pronunciation-section {
  margin-top: 20px;
}

/* Asegurar que el botón se vea bien en el modal */
.modal-content .pronunciation-btn {
  font-size: 14px;
  padding: 10px 16px;
}

/* Iconos de Bootstrap */
.pronunciation-btn i {
  font-size: 16px;
}

/* Estados de hover mejorados */
.pronunciation-btn:hover:not(:disabled) i {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Transición suave para todos los cambios de estado */
.pronunciation-btn,
.pronunciation-btn i,
.pronunciation-text {
  transition: all 0.2s ease;
}
