/* ===== ANIMATIONS & KEYFRAMES ===== */

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

/* Slide In From Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In From Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

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

/* Network Node Animation */
@keyframes networkPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

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

/* ===== REVEAL ON SCROLL ANIMATIONS ===== */

/* Base state for elements that will animate in */
.reveal-element {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* When element comes into view */
.reveal-element.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.reveal-element:nth-child(1) {
  transition-delay: 0ms;
}

.reveal-element:nth-child(2) {
  transition-delay: 100ms;
}

.reveal-element:nth-child(3) {
  transition-delay: 200ms;
}

.reveal-element:nth-child(4) {
  transition-delay: 300ms;
}

.reveal-element:nth-child(5) {
  transition-delay: 400ms;
}

.reveal-element:nth-child(6) {
  transition-delay: 500ms;
}

/* ===== COMPONENT SPECIFIC ANIMATIONS ===== */

/* Hero Section Animations */
.hero h1 {
  animation: fadeIn 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both;
}

.hero p {
  animation: fadeIn 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both;
}

.hero .actions {
  animation: fadeIn 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both;
}

.hero .trust-badges {
  animation: fadeIn 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.8s both;
}

/* Button Hover Animations */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::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:hover::before {
  left: 100%;
}

/* Card Hover Effects */
.card {
  position: relative;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(46, 204, 113, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

/* Timeline Icon Animation */
.timeline-icon {
  position: relative;
}

.timeline-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(46, 204, 113, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-icon::after {
  width: 60px;
  height: 60px;
}

/* Navigation Dropdown Animation */
.dropdown {
  animation: slideInDown 0.3s ease-out;
}

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

/* Mobile Menu Animation */
.nav-drawer {
  backdrop-filter: blur(10px);
}

.mobile-dropdown {
  transform-origin: top;
  transition: all 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.mobile-dropdown[hidden] {
  transform: scaleY(0);
  opacity: 0;
}

.mobile-dropdown:not([hidden]) {
  transform: scaleY(1);
  opacity: 1;
}

/* Trust Badges Animation */
.badge-placeholder {
  animation: float 3s ease-in-out infinite;
}

.badge-placeholder:nth-child(2) {
  animation-delay: 0.5s;
}

.badge-placeholder:nth-child(3) {
  animation-delay: 1s;
}

.badge-placeholder:nth-child(4) {
  animation-delay: 1.5s;
}

/* Logo Placeholder Hover */
.logo-placeholder {
  transition: all 0.3s ease;
}

.logo-placeholder:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Compliance Item Animation */
.compliance-item {
  transition: all 0.3s ease;
}

.compliance-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(10, 35, 66, 0.15);
}

/* CTA Banner Background Animation */
.cta-banner {
  background: linear-gradient(-45deg, var(--navy), var(--graphite), var(--slate), var(--navy));
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* Skip Link Animation */
.skip-link {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Focus Ring Animation */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  animation: pulse 1s ease-in-out;
}

/* Loading State Animations */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

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

/* Network Background Animation Classes */
.network-node {
  animation: networkPulse 3s ease-in-out infinite;
}

.network-node:nth-child(odd) {
  animation-delay: 0.5s;
}

.network-node:nth-child(3n) {
  animation-delay: 1s;
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (min-width: 768px) {
  /* Enhanced animations for larger screens */
  .reveal-element {
    transform: translateY(50px);
  }

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

  .timeline-item:hover .timeline-icon {
    transform: scale(1.1);
  }
}

@media (min-width: 1024px) {
  /* Parallax-like effects for desktop */
  .hero-inner {
    animation: fadeIn 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .services-grid .card:nth-child(1) {
    animation: slideInLeft 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both;
  }

  .services-grid .card:nth-child(2) {
    animation: slideInRight 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
  }

  .services-grid .card:nth-child(3) {
    animation: slideInLeft 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both;
  }

  .services-grid .card:nth-child(4) {
    animation: slideInRight 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s both;
  }
}

/* ===== ACCESSIBILITY CONSIDERATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  /* Disable all animations for users who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Keep essential transforms but remove animation */
  .reveal-element {
    opacity: 1;
    transform: none;
  }

  .reveal-element.in-view {
    opacity: 1;
    transform: none;
  }

  /* Remove floating animations */
  .badge-placeholder,
  .network-node {
    animation: none;
  }

  /* Remove background animations */
  .cta-banner {
    background: var(--navy);
    animation: none;
  }

  /* Maintain hover states but without transitions */
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-2);
  }
}