/* ============================
   EasySaveIt - Professional Animations & Enhanced Responsiveness
   ============================ */

/* Scroll-triggered reveal animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  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(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Float animation for hero */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
}

/* Pulse glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(124, 77, 255, 0.2); }
  50% { box-shadow: 0 0 40px rgba(124, 77, 255, 0.4), 0 0 80px rgba(124, 77, 255, 0.1); }
}

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

/* Counter spin */
@keyframes counterSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Typing cursor */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Shimmer loading */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Bounce subtle */
@keyframes bounceSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Reveal classes - hidden by default, animated on scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for grid items */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Hero animations */
.hero-title {
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
.hero-subtitle {
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}
.hero-badge {
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
.hero-icons {
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}
.hero-buttons {
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}
.hero-image {
  animation: fadeInRight 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* Card hover effects */
.card-hover {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s ease,
              border-color 0.4s ease;
}
.card-hover:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px rgba(124, 77, 255, 0.1),
              0 0 0 1px rgba(124, 77, 255, 0.15);
}

/* Button animations */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.6s ease;
}
.btn-primary:hover::before {
  left: 100%;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 40px rgba(124, 77, 255, 0.4);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Floating particles background */
.particles-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(124, 77, 255, 0.3);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}
@keyframes floatParticle {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* Stat counter animation */
.stat-number {
  display: inline-block;
  animation: pulseGlow 3s ease-in-out infinite;
  border-radius: 12px;
  padding: 4px 8px;
}

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

/* Navbar animation */
.navbar-animate {
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Section divider gradient line */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(124, 77, 255, 0.3), transparent);
}

/* Glowing border animation */
.glow-border {
  position: relative;
}
.glow-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124,77,255,0.5), transparent, rgba(124,77,255,0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.glow-border:hover::after {
  opacity: 1;
}

/* Text gradient animation */
.text-gradient-animate {
  background: linear-gradient(270deg, #ffffff, #7c4dff, #cdbdff, #ffffff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Icon bounce on hover */
.icon-bounce:hover {
  animation: bounceSoft 0.5s ease;
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
  .reveal { transform: translateY(15px); }
  .hero-title { animation-delay: 0.1s; }
  .hero-subtitle { animation-delay: 0.15s; }
  .hero-badge { animation-delay: 0s; }
  .hero-icons { animation-delay: 0.2s; }
  .hero-buttons { animation-delay: 0.25s; }

  .card-hover:hover {
    transform: translateY(-2px) scale(1.005);
    box-shadow: 0 8px 24px rgba(124, 77, 255, 0.08);
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  .reveal { transform: translateY(30px); }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
  }
}

/* FAQ accordion animation */
details[open] summary ~ * {
  animation: fadeInUp 0.3s ease;
}
details summary {
  cursor: pointer;
}
details summary::-webkit-details-marker {
  display: none;
}

/* Pricing card glow on best value */
.pricing-popular {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* Testimonial card subtle float */
.testimonial-float:nth-child(1) { animation: bounceSoft 4s ease-in-out infinite; }
.testimonial-float:nth-child(2) { animation: bounceSoft 4s ease-in-out 1s infinite; }
.testimonial-float:nth-child(3) { animation: bounceSoft 4s ease-in-out 2s infinite; }

/* Mobile hamburger animation */
.hamburger-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.menu-open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Touch-friendly tap targets for mobile */
@media (max-width: 768px) {
  .btn-primary, nav a, .mobile-menu a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
}
