/**
 * Agrimotion Child Theme – Animations
 * Exakt aus der React App (index.css) übernommen + Erweiterungen für WordPress
 */

/* ============================================================
   KEYFRAMES – 1:1 aus React App
   ============================================================ */

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

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

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

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

@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateX(-50%) translateY(-8px);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

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

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

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

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

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

/* ============================================================
   ANIMATION UTILITY CLASSES
   ============================================================ */

/* Basis-Animationen (aus React App) */
.animate-fade-up {
  animation: fadeUp 0.6s ease-out forwards;
  opacity: 0;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
  opacity: 0;
}

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

.animate-bounce {
  animation: bounce 2s infinite;
}

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

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

.animate-slide-in-right {
  animation: slideInRight 0.5s ease-out forwards;
  opacity: 0;
}

.animate-slide-in-left {
  animation: slideInLeft 0.5s ease-out forwards;
  opacity: 0;
}

/* ============================================================
   STAGGER DELAYS – 1:1 aus React App
   ============================================================ */

.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-TRIGGERED ANIMATIONS (Intersection Observer)
   ============================================================ */

/* Initial state: elements hidden before animation */
.agri-animate {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.6s ease-out,
    transform 0.6s ease-out;
}

/* When in viewport */
.agri-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for .agri-animate children */
.agri-animate.stagger-1 { transition-delay: 0.1s; }
.agri-animate.stagger-2 { transition-delay: 0.2s; }
.agri-animate.stagger-3 { transition-delay: 0.3s; }
.agri-animate.stagger-4 { transition-delay: 0.4s; }
.agri-animate.stagger-5 { transition-delay: 0.5s; }

/* Scale variant */
.agri-animate-scale {
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity   0.4s ease-out,
    transform 0.4s ease-out;
}

.agri-animate-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

/* Slide from left */
.agri-animate-left {
  opacity: 0;
  transform: translateX(-30px);
  transition:
    opacity   0.6s ease-out,
    transform 0.6s ease-out;
}

.agri-animate-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.agri-animate-right {
  opacity: 0;
  transform: translateX(30px);
  transition:
    opacity   0.6s ease-out,
    transform 0.6s ease-out;
}

.agri-animate-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   HOVER TRANSITIONS – Cards & Buttons
   ============================================================ */

/* Card hover lift */
.agri-hover-lift {
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.agri-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--agri-shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.08));
}

/* Icon scale on card hover */
.agri-feature-card:hover .agri-feature-icon,
.agri-product-card:hover .agri-product-card__icon {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* ============================================================
   SKELETON LOADING (Team Section Placeholder)
   ============================================================ */

.agri-skeleton {
  background: linear-gradient(
    90deg,
    hsl(40, 20%, 90%) 25%,
    hsl(40, 20%, 95%) 50%,
    hsl(40, 20%, 90%) 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--agri-radius, 0.75rem);
}

.agri-skeleton-circle {
  border-radius: 50%;
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */

/* Content fade-in on page load */
.site-main {
  animation: fadeIn 0.3s ease-out forwards;
}

/* ============================================================
   MICRO-INTERACTIONS
   ============================================================ */

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

  .agri-animate,
  .agri-animate-scale,
  .agri-animate-left,
  .agri-animate-right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .agri-animate.stagger-1,
  .agri-animate.stagger-2,
  .agri-animate.stagger-3,
  .agri-animate.stagger-4,
  .agri-animate.stagger-5 {
    transition-delay: 0s;
  }
}
