/* 
  Animation Styles for PILOTING Website
  Author: Bolt
  Version: 1.0
*/

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

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

/* Slide Up Animation */
@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.8s ease-out forwards;
}

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

.slide-in-left {
  animation: slideInLeft 0.8s ease-out forwards;
}

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

.slide-in-right {
  animation: slideInRight 0.8s ease-out forwards;
}

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

.pulse {
  animation: pulse 2s infinite;
}

/* Button Hover Animation */
.btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: -1;
}

.btn:hover::after {
  height: 100%;
}

/* Icon Hover Animation */
.feature-icon i,
.benefit-icon i,
.social-icons a i {
  transition: transform 0.3s ease;
}

.feature-item:hover .feature-icon i,
.usa-benefit-card:hover .benefit-icon i,
.social-icons a:hover i {
  transform: scale(1.2);
}

/* Navigation Animation */
.navbar-nav .nav-link {
  position: relative;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--secondary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
  width: 70%;
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Reveal for Multiple Items */
.stagger-reveal > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.stagger-reveal.active > *:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.stagger-reveal.active > *:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.stagger-reveal.active > *:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

.stagger-reveal.active > *:nth-child(4) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.7s;
}

/* Form Focus Animation */
.form-control {
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.form-control:focus {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--secondary);
}

/* Rotating Icon Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate-icon {
  animation: rotate 4s linear infinite;
}

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

.cta-box, .apply-form {
  position: relative;
  overflow: hidden;
}

.cta-box::before, .apply-form::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shimmer 6s infinite linear;
  pointer-events: none;
}

/* Custom Animation Delays */
.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

/* Testimonial Cards Hover Effect */
.testimonial-card {
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Card Flip Animation */
.flip-card {
  perspective: 1000px;
  height: 300px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.flip-card-front {
  background-color: white;
  color: var(--dark);
}

.flip-card-back {
  background-color: var(--primary);
  color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-lg);
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
  .flip-card {
    height: auto;
  }
  
  .flip-card-inner {
    transform-style: flat;
  }
  
  .flip-card:hover .flip-card-inner {
    transform: none;
  }
  
  .flip-card-back {
    position: relative;
    transform: none;
    margin-top: var(--spacing-md);
  }
}