/* ============================================
   Animation Keyframes & Transitions
   Enterprise Trust & Authority Design System
   ============================================ */

/* Metric Pulse Animation - Trust & Authority */
@keyframes metricPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(3, 105, 161, 0);
  }
  25% {
    transform: scale(1.02);
    text-shadow: 0 0 20px rgba(3, 105, 161, 0.3);
  }
  50% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(3, 105, 161, 0);
  }
  75% {
    transform: scale(1.01);
    text-shadow: 0 0 10px rgba(3, 105, 161, 0.2);
  }
}

.metric-pulse {
  animation: metricPulse 1.5s ease-in-out;
}

/* Stat Reveal Animation */
@keyframes statReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    filter: blur(4px);
  }
  50% {
    opacity: 0.5;
    transform: translateY(10px) scale(0.98);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.stat-reveal {
  animation: statReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Certificate/Badge Hover Animation */
@keyframes badgeGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(3, 105, 161, 0);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(3, 105, 161, 0.2);
  }
}

.badge-glow:hover {
  animation: badgeGlow 0.6s ease-in-out;
}

/* Smooth Number Counter */
@keyframes countUpSmooth {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.count-up-smooth {
  animation: countUpSmooth 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Trust Indicator Pulse */
@keyframes trustPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.trust-pulse {
  animation: trustPulse 2s ease-in-out infinite;
}

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

.fade-in {
  animation: fadeIn var(--transition-base) ease forwards;
}

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

.fade-in-up {
  animation: fadeInUp var(--transition-base) ease forwards;
}

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

.fade-in-down {
  animation: fadeInDown var(--transition-base) ease forwards;
}

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

.fade-in-left {
  animation: fadeInLeft var(--transition-base) ease forwards;
}

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

.fade-in-right {
  animation: fadeInRight var(--transition-base) ease forwards;
}

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

.scale-in {
  animation: scaleIn var(--transition-base) ease forwards;
}

/* Slide In From Bottom */
@keyframes slideInBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.slide-in-bottom {
  animation: slideInBottom var(--transition-base) ease forwards;
}

/* Slide In From Right */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight var(--transition-base) ease forwards;
}

/* Bounce */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.bounce {
  animation: bounce 1s ease infinite;
}

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

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

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

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Gradient Text Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-text-animated {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-primary-light) 25%,
    var(--color-primary) 50%,
    var(--color-primary-light) 75%,
    var(--color-primary) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Counter Animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Scroll Reveal Animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Lift Effect */
.hover-lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Hover Glow Effect */
.hover-glow {
  transition: box-shadow var(--transition-fast);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Page Transition */
.page-transition {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.page-transition.active {
  opacity: 1;
  transform: translateY(0);
}

/* Modal Animation */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-animate {
  animation: modalIn var(--transition-base) ease forwards;
}

/* Toast Animation */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-enter {
  animation: toastIn var(--transition-fast) ease forwards;
}

.toast-exit {
  animation: toastOut var(--transition-fast) ease forwards;
}

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

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* Agent Pipeline Flow Animation */
@keyframes flowLine {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.flow-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: flowLine 2s ease forwards;
}

/* Parallax Scroll */
.parallax {
  will-change: transform;
}

/* ============================================
   Pre-Login Redesign — Animation Utilities
   ============================================ */

/* Float — Gentle floating for hero elements (translateY oscillation) */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Pulse Dot — Pulsing indicator for badge dots (scale + opacity) */
@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

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

/* Glow Pulse — Subtle glow expansion for decorative orbs (scale + opacity) */
@keyframes glow-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

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

/* Shimmer Utility — Animates background-position for gradient sweep effect.
   Uses existing @keyframes shimmer (defined above).
   Apply to elements with a gradient background to create a sweeping highlight. */
.animate-shimmer {
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

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

/* Print Animations */
@media print {
  .fade-in,
  .fade-in-up,
  .fade-in-down,
  .scale-in,
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}