/* Parallax and Animation Effects */

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

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

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

/* Mouse parallax effects */
.mouse-parallax {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Floating background elements */
.floating-bg {
  will-change: transform;
  animation: float 6s ease-in-out infinite;
}

/* Floating envelope specific styles */
.floating-envelope {
  animation: floatEnvelope 8s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.floating-envelope:nth-child(odd) {
  animation-delay: -2s;
  animation-direction: reverse;
}

.floating-envelope:nth-child(3n) {
  animation-delay: -4s;
  animation-duration: 10s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes floatEnvelope {
  0%,
  100% {
    transform: translateY(0px) rotate(-5deg) scale(1);
  }
  25% {
    transform: translateY(-15px) rotate(2deg) scale(1.1);
  }
  50% {
    transform: translateY(-30px) rotate(5deg) scale(0.9);
  }
  75% {
    transform: translateY(-15px) rotate(-2deg) scale(1.05);
  }
}

/* Enhanced button hover effects */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Stagger animations for grid items */
.stagger-animation {
  animation: staggerIn 0.6s ease-out forwards;
}

@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Parallax sections */
.parallax-section {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* Gradient overlay effects */
.gradient-overlay {
  position: relative;
  overflow: hidden;
}

.gradient-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(3, 112, 187, 0.1) 0%, rgba(102, 102, 102, 0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Scroll-triggered reveal animations */
.reveal-up {
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.reveal-left {
  transform: translateX(-50px);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.reveal-right {
  transform: translateX(50px);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.is-visible {
  transform: translateX(0);
  opacity: 1;
}

/* Scale in animation */
.scale-in {
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.is-visible {
  transform: scale(1);
  opacity: 1;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .mouse-parallax,
  .parallax-element,
  .floating-bg,
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .scale-in {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Performance optimizations */
.parallax-container {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

/* Custom easing for smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Blur effects for background elements */
.blur-bg {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Glow effects */
.glow-on-hover {
  transition: all 0.3s ease;
}

.glow-on-hover:hover {
  box-shadow: 0 0 20px rgba(3, 112, 187, 0.3);
}

/* Particle animation background */
.particles-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: particleFloat 20s infinite linear;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}
