
/* Animation Styles for Mundaine AI Landing Page */

/* Keyframe Definitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

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

@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  33% { 
    transform: translateY(-20px) rotate(120deg); 
  }
  66% { 
    transform: translateY(10px) rotate(240deg); 
  }
}

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

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

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Animation Classes */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

.slide-in-up {
  animation: slideInUp 0.7s ease-out forwards;
}

.bounce-in {
  animation: bounceIn 0.8s ease-out forwards;
}

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

/* Staggered Animation Classes */
.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; }

/* Scroll-triggered Animation Base */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Specific Element Animations */
.hero-content {
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-headline {
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-subtitle {
  animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero-cta {
  animation: fadeInUp 0.8s ease-out 0.9s both;
}

.tagline {
  animation: fadeInUp 0.8s ease-out 1.1s both;
}

/* Method Card Animations */
.method-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.method-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.method-card:hover .method-icon {
  animation: pulse 1s ease-in-out;
}

/* Process Step Animations */
.process-step {
  transition: all 0.3s ease;
}

.process-step:hover {
  transform: translateX(10px);
}

.process-step:hover .step-number {
  animation: pulse 0.6s ease-in-out;
}

/* Button Animations */
.btn-primary,
.btn-secondary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before,
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
  left: 100%;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
}

/* Form Field Animations */
.form-group input,
.form-group select,
.form-group textarea {
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  transform: scale(1.02);
}

/* Loading Animation for Form Submission */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Shimmer Effect for Loading States */
.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Floating Elements Animation */
.floating-element {
  animation: float 6s ease-in-out infinite;
}

.floating-element-1 {
  animation-delay: 0s;
}

.floating-element-2 {
  animation-delay: 2s;
}

.floating-element-3 {
  animation-delay: 4s;
}

/* Section Reveal Animations */
.problem-section .animate-on-scroll {
  transform: translateX(-50px);
}

.methodology-section .animate-on-scroll {
  transform: scale(0.9);
}

.qualification-section .animate-on-scroll {
  transform: translateX(50px);
}

.process-section .animate-on-scroll {
  transform: translateY(50px);
}

.cta-section .animate-on-scroll {
  transform: scale(0.95);
}

/* Typewriter Effect for Headlines */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary-accent);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
}

/* Hover Effects for Interactive Elements */
.interactive-hover {
  transition: all 0.3s ease;
}

.interactive-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(174, 122, 229, 0.3);
}

/* Success Animation */
.success-animation {
  animation: bounceIn 0.6s ease-out;
}

/* Error Animation */
.error-animation {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Entrance Animations for Different Sections */
.hero-entrance {
  animation: fadeInUp 1s ease-out both;
}

.section-entrance {
  animation: slideInFromBottom 0.8s ease-out both;
}

/* Micro-interactions */
.micro-bounce:hover {
  animation: micro-bounce 0.3s ease;
}

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

/* Page Transition Animations */
.page-enter {
  animation: fadeInUp 0.5s ease-out both;
}

.page-exit {
  animation: fadeOut 0.3s ease-in both;
}

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

/* Scroll Progress Indicator Animation */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-accent), var(--secondary-coral));
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* Cookie Banner Animation */
.cookie-banner {
  animation: slideInUp 0.5s ease-out;
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating-element {
    animation: none !important;
  }
  
  .typewriter {
    border-right: none;
    animation: none;
    white-space: normal;
    overflow: visible;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus Animations for Accessibility */
*:focus {
  outline: 3px solid var(--primary-accent);
  outline-offset: 2px;
  animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
  0% { outline-color: transparent; }
  100% { outline-color: var(--primary-accent); }
}
