/* ==========================================================================
   NovaChat - Animaciones y Efectos Visuales
   ========================================================================== */

/* Flotación Suave */
@keyframes floatSlow {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

@keyframes floatReverse {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(10px) rotate(-1.5deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

/* Animación de Ondas Sonoras para Nota de Voz */
@keyframes soundWave {
  0% {
    height: 4px;
  }
  50% {
    height: 18px;
  }
  100% {
    height: 7px;
  }
}

.waveform-bar:nth-child(1) { animation-delay: 0.1s; }
.waveform-bar:nth-child(2) { animation-delay: 0.3s; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { animation-delay: 0.5s; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { animation-delay: 0.25s; }
.waveform-bar:nth-child(7) { animation-delay: 0.6s; }
.waveform-bar:nth-child(8) { animation-delay: 0.35s; }
.waveform-bar:nth-child(9) { animation-delay: 0.15s; }
.waveform-bar:nth-child(10) { animation-delay: 0.45s; }

/* Pulso de Estado En Línea */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Entrada de Elementos (Scroll Reveal) */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Retardos escalonados para listas de tarjetas */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Toast flotante de notificación */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.toast-text h4 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.toast-text p {
  font-size: 0.85rem;
}

/* Efecto Brillo / Shimmer en Botones Destacados */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transform: rotate(30deg);
  animation: buttonShimmer 4s infinite;
}

@keyframes buttonShimmer {
  0% { transform: translate(-100%, -100%) rotate(30deg); }
  30% { transform: translate(100%, 100%) rotate(30deg); }
  100% { transform: translate(100%, 100%) rotate(30deg); }
}

/* Desactivar animaciones si el usuario prefiere movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
