/**
 * Animaciones CSS personalizadas para el chatbot
 * Colores naranjas consistentes con el sitio
 */

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideDownFade {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0);
  }
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Clases de utilidad para animaciones */
.chat-widget-enter {
  animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.chat-widget-exit {
  animation: slideDownFade 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.chat-message-enter {
  animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.chat-button-pulse {
  animation: pulseGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.chat-typing-dot {
  animation: typing 1.4s ease-in-out infinite;
}

.chat-typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Mejoras de accesibilidad y responsive */
@media (prefers-contrast: high) {
  .chat-widget-enter {
    border: 2px solid rgba(249, 115, 22, 1) !important;
  }
  
  .chat-button-pulse {
    outline: 3px solid rgba(249, 115, 22, 1) !important;
  }
}

/* Mejoras para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
  .chat-button-pulse,
  button,
  [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Mejoras responsive para móvil */
@media (max-width: 767px) {
  .chat-widget-enter {
    border-radius: 16px 16px 0 0 !important;
  }
  
  /* Prevenir scroll del body cuando el chat está abierto en móvil */
  body.chat-open {
    overflow: hidden;
  }
}

/* Focus visible mejorado para accesibilidad */
*:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.8);
  outline-offset: 2px;
}

/* Mejoras para modo de alto contraste */
@media (prefers-contrast: high) {
  *:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 1);
    outline-offset: 3px;
  }
}
