/* ============================================
   EL OLFATO — Animations & Micro-interactions
   ============================================ */

/* ── Keyframes ── */

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

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--accent-primary-glow);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

@keyframes pulseSuccess {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--success-glow);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

@keyframes pulseDanger {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--danger-glow);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes progressBar {
  from { width: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Animation Utility Classes ── */

.anim-fade-in {
  animation: fadeIn var(--transition-base) both;
}

.anim-fade-in-up {
  animation: fadeInUp var(--transition-slow) both;
}

.anim-fade-in-down {
  animation: fadeInDown var(--transition-slow) both;
}

.anim-fade-in-scale {
  animation: fadeInScale var(--transition-slow) both;
}

.anim-slide-in-left {
  animation: slideInLeft var(--transition-slow) both;
}

.anim-slide-in-right {
  animation: slideInRight var(--transition-slow) both;
}

.anim-scale-in {
  animation: scaleIn var(--transition-bounce) both;
}

/* Staggered animation delays */
.anim-delay-1 { animation-delay: 50ms; }
.anim-delay-2 { animation-delay: 100ms; }
.anim-delay-3 { animation-delay: 150ms; }
.anim-delay-4 { animation-delay: 200ms; }
.anim-delay-5 { animation-delay: 250ms; }
.anim-delay-6 { animation-delay: 300ms; }
.anim-delay-7 { animation-delay: 350ms; }
.anim-delay-8 { animation-delay: 400ms; }

/* ── Skeleton Loading ── */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-circle {
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

/* ── Loading Spinner ── */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-secondary);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

/* ── Pulse Indicators ── */

.pulse-live {
  position: relative;
}

.pulse-live::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: var(--radius-full);
  animation: pulseSuccess 2s ease-in-out infinite;
}

/* ── Floating Animation ── */

.float {
  animation: float 3s ease-in-out infinite;
}

/* ── Gradient Background Animation ── */

.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* ── Progress Bar Animation ── */

.progress-animated .progress-fill {
  animation: progressBar 1s ease-out both;
}

/* ── Reduced Motion ── */

@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;
  }
}
