/**
 * ================================================================
 * CSS ANIMATIONS MASTER v1.0 - ANIMACOES CENTRALIZADAS
 * ================================================================
 *
 * @description Arquivo centralizado com TODAS as animacoes CSS do ERP
 * @version 1.0.0
 * @date 2026-02-01
 * @author ERP.DOTCOMPANY
 *
 * IMPORTANTE:
 * - Este arquivo consolida animacoes de varios arquivos CSS
 * - Mantem compatibilidade total com codigo existente
 * - Novos arquivos devem usar estas animacoes via classes
 *
 * USO:
 * - Importe apos _css-variables.css
 * - Use classes .animate-* ou animation: nome-animacao
 *
 * ================================================================
 */

/* ================================================================
   1. ANIMACOES BASE - FUNDAMENTAIS
   ================================================================ */

/* Fade In - Aparecer suavemente */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade Out - Desaparecer suavemente */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Fade In Up - Aparecer subindo */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down - Aparecer descendo */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left - Aparecer da esquerda */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right - Aparecer da direita */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================================================================
   2. ANIMACOES SLIDE - DESLIZAR
   ================================================================ */

/* Slide In Up - Deslizar para cima */
@keyframes slideInUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide In Down - Deslizar para baixo */
@keyframes slideInDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide In Left - Deslizar da esquerda */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide In Right - Deslizar da direita */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide Out Up - Sair para cima */
@keyframes slideOutUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}

/* Slide Out Down - Sair para baixo */
@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(10px);
    opacity: 0;
  }
}

/* ================================================================
   3. ANIMACOES SCALE - ESCALA
   ================================================================ */

/* Scale In - Crescer */
@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Scale Out - Diminuir */
@keyframes scaleOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Pop In - Efeito pop */
@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Zoom In - Zoom suave */
@keyframes zoomIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ================================================================
   4. ANIMACOES DE ROTACAO - SPIN
   ================================================================ */

/* Spin - Rotacao continua */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Spin Reverse - Rotacao inversa */
@keyframes spinReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

/* Spin Center - Rotacao centralizada */
@keyframes spinCenter {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* GPU Spin - Rotacao otimizada para GPU */
@keyframes gpuSpin {
  from {
    transform: rotate(0deg) translateZ(0);
  }
  to {
    transform: rotate(360deg) translateZ(0);
  }
}

/* ================================================================
   5. ANIMACOES DE PULSO - PULSE
   ================================================================ */

/* Pulse - Pulso suave */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Pulse Ring - Anel pulsante */
@keyframes pulseRing {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Pulse Dot - Ponto pulsante */
@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

/* Heartbeat - Batimento */
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.1);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(1);
  }
}

/* ================================================================
   6. ANIMACOES DE BOUNCE - QUICAR
   ================================================================ */

/* Bounce - Quicar */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Bounce In - Entrar quicando */
@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Bounce Subtle - Quicar sutil */
@keyframes bounceSubtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ================================================================
   7. ANIMACOES DE SHAKE - TREMER
   ================================================================ */

/* Shake - Tremer horizontal */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

/* Shake Subtle - Tremer sutil */
@keyframes shakeSubtle {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

/* Wiggle - Balancear */
@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

/* ================================================================
   8. ANIMACOES DE LOADING - CARREGAMENTO
   ================================================================ */

/* Skeleton Loading - Esqueleto */
@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Shimmer - Brilho */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Progress Indeterminate - Progresso indeterminado */
@keyframes progressIndeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

/* Dots Loading - Pontos carregando */
@keyframes dotsLoading {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Spinner Dots - Pontos girando */
@keyframes spinnerDots {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ================================================================
   9. ANIMACOES DE NOTIFICACAO
   ================================================================ */

/* Ring Bell - Sino tocando */
@keyframes ringBell {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(14deg);
  }
  20% {
    transform: rotate(-8deg);
  }
  30% {
    transform: rotate(14deg);
  }
  40% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(0);
  }
}

/* Attention - Chamar atencao */
@keyframes attention {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Blink - Piscar */
@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ================================================================
   10. ANIMACOES ESPECIAIS
   ================================================================ */

/* Float - Flutuar */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Glow - Brilho pulsante */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px currentColor;
  }
  50% {
    box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
  }
}

/* Gradient Shift - Gradiente em movimento */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Typing - Cursor de digitacao */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Cursor Blink - Cursor piscando */
@keyframes cursorBlink {
  0%, 100% {
    border-color: transparent;
  }
  50% {
    border-color: currentColor;
  }
}

/* ================================================================
   CLASSES DE ANIMACAO - USO DIRETO
   ================================================================ */

/* Fade */
.animate-fadeIn {
  animation: fadeIn 0.3s ease forwards;
}

.animate-fadeOut {
  animation: fadeOut 0.3s ease forwards;
}

.animate-fadeInUp {
  animation: fadeInUp 0.3s ease forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.3s ease forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.3s ease forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.3s ease forwards;
}

/* Slide */
.animate-slideInUp {
  animation: slideInUp 0.3s ease forwards;
}

.animate-slideInDown {
  animation: slideInDown 0.3s ease forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.3s ease forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.3s ease forwards;
}

/* Scale */
.animate-scaleIn {
  animation: scaleIn 0.2s ease forwards;
}

.animate-scaleOut {
  animation: scaleOut 0.2s ease forwards;
}

.animate-popIn {
  animation: popIn 0.3s ease forwards;
}

.animate-zoomIn {
  animation: zoomIn 0.3s ease forwards;
}

/* Spin */
.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-spin-slow {
  animation: spin 2s linear infinite;
}

.animate-spin-fast {
  animation: spin 0.5s linear infinite;
}

/* Pulse */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-pulse-fast {
  animation: pulse 1s ease-in-out infinite;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* Bounce */
.animate-bounce {
  animation: bounce 1s ease infinite;
}

.animate-bounceIn {
  animation: bounceIn 0.5s ease forwards;
}

.animate-bounceSubtle {
  animation: bounceSubtle 2s ease-in-out infinite;
}

/* Shake */
.animate-shake {
  animation: shake 0.5s ease-in-out;
}

.animate-shakeSubtle {
  animation: shakeSubtle 0.3s ease-in-out;
}

.animate-wiggle {
  animation: wiggle 0.5s ease-in-out infinite;
}

/* Loading */
.animate-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
}

.dark .animate-skeleton {
  background: linear-gradient(90deg, #27272A 25%, #3F3F46 50%, #27272A 75%);
  background-size: 200% 100%;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Dark mode shimmer - ajustado para maior visibilidade */
.dark .animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
}

/* Especiais */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-blink {
  animation: blink 1s ease-in-out infinite;
}

.animate-attention {
  animation: attention 0.5s ease-in-out;
}

.animate-ringBell {
  animation: ringBell 1s ease-in-out;
}

/* ================================================================
   MODIFICADORES DE ANIMACAO
   ================================================================ */

/* Delays */
.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-500 { animation-delay: 500ms; }
.animation-delay-700 { animation-delay: 700ms; }
.animation-delay-1000 { animation-delay: 1000ms; }

/* Durations */
.animation-duration-75 { animation-duration: 75ms; }
.animation-duration-100 { animation-duration: 100ms; }
.animation-duration-150 { animation-duration: 150ms; }
.animation-duration-200 { animation-duration: 200ms; }
.animation-duration-300 { animation-duration: 300ms; }
.animation-duration-500 { animation-duration: 500ms; }
.animation-duration-700 { animation-duration: 700ms; }
.animation-duration-1000 { animation-duration: 1000ms; }

/* Fill Modes */
.animation-fill-none { animation-fill-mode: none; }
.animation-fill-forwards { animation-fill-mode: forwards; }
.animation-fill-backwards { animation-fill-mode: backwards; }
.animation-fill-both { animation-fill-mode: both; }

/* Iteration */
.animation-infinite { animation-iteration-count: infinite; }
.animation-once { animation-iteration-count: 1; }
.animation-twice { animation-iteration-count: 2; }

/* Direction */
.animation-normal { animation-direction: normal; }
.animation-reverse { animation-direction: reverse; }
.animation-alternate { animation-direction: alternate; }

/* Play State */
.animation-running { animation-play-state: running; }
.animation-paused { animation-play-state: paused; }

/* ================================================================
   ANIMACOES ADICIONAIS - COMPATIBILIDADE COM ARQUIVOS EXISTENTES
   Estas animacoes sao usadas em ajax-loader.css, dashboard-campanha.css, etc.
   ================================================================ */

/* Ajax Loading Bar - Gradient shift horizontal */
@keyframes ajaxLoadingBar {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ajax Dots Pulse - Loading dots */
@keyframes ajaxDotsPulse {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Ajax Progress Shine - Progress bar shine effect */
@keyframes ajaxProgressShine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Pulse Glow - Box shadow pulsante (usado em WhatsApp) */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
  }
}

/* Icon Ping - Efeito ping para icones */
@keyframes iconPing {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Icon Pulse Glow - Drop shadow glow para icones */
@keyframes iconPulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 2px currentColor);
  }
  50% {
    filter: drop-shadow(0 0 8px currentColor);
  }
}

/* Classes para animacoes adicionais */
.animate-ajax-bar {
  animation: ajaxLoadingBar 2s ease infinite;
}

.animate-dots-pulse {
  animation: ajaxDotsPulse 1.4s ease-in-out infinite both;
}

.animate-progress-shine {
  animation: ajaxProgressShine 2s linear infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-icon-ping {
  animation: iconPing 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-icon-glow {
  animation: iconPulseGlow 2s ease-in-out infinite;
}

/* ================================================================
   REDUCED MOTION - ACESSIBILIDADE
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-spin,
  .animate-pulse,
  .animate-bounce,
  .animate-float,
  .animate-wiggle,
  .animate-skeleton {
    animation: none !important;
  }
}
