/* ============================================
   Smooth Animations & Scroll Effects
   Professional animations for ReleasePilot
   ============================================ */

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* Smooth scroll for all browsers */
* {
  scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== SCROLL ANIMATIONS ===== */
/* Default: Content is visible (no JS fallback) */
.animate-on-scroll,
.animate-fade-in,
.animate-slide-up,
.animate-slide-left,
.animate-slide-right,
.animate-scale,
.animate-rotate {
  opacity: 1;
  transform: none;
}

/* Only hide if JavaScript is enabled */
.js-enabled .animate-on-scroll:not(.animated) {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-enabled .animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Fade In */
.js-enabled .animate-fade-in:not(.animated) {
  opacity: 0;
  transition: opacity 1s ease-out;
}

.js-enabled .animate-fade-in.animated {
  opacity: 1;
}

/* Slide Up */
.js-enabled .animate-slide-up:not(.animated) {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-enabled .animate-slide-up.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Slide Left */
.js-enabled .animate-slide-left:not(.animated) {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-enabled .animate-slide-left.animated {
  opacity: 1;
  transform: translateX(0);
}

/* Slide Right */
.js-enabled .animate-slide-right:not(.animated) {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-enabled .animate-slide-right.animated {
  opacity: 1;
  transform: translateX(0);
}

/* Scale In */
.js-enabled .animate-scale:not(.animated) {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-enabled .animate-scale.animated {
  opacity: 1;
  transform: scale(1);
}

/* Rotate In */
.js-enabled .animate-rotate:not(.animated) {
  opacity: 0;
  transform: rotate(-5deg) scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-enabled .animate-rotate.animated {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Stagger Animation Delays */
.animate-delay-100 {
  transition-delay: 0.1s;
}

.animate-delay-200 {
  transition-delay: 0.2s;
}

.animate-delay-300 {
  transition-delay: 0.3s;
}

.animate-delay-400 {
  transition-delay: 0.4s;
}

.animate-delay-500 {
  transition-delay: 0.5s;
}

.animate-delay-600 {
  transition-delay: 0.6s;
}

/* ===== HOVER ANIMATIONS ===== */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-scale {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

/* ===== BUTTON ANIMATIONS ===== */
.btn-primary,
.btn-secondary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before,
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

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

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

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

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

/* ===== PARALLAX EFFECTS ===== */
.parallax-slow {
  transition: transform 0.3s ease-out;
}

.parallax-medium {
  transition: transform 0.2s ease-out;
}

.parallax-fast {
  transition: transform 0.1s ease-out;
}

/* ===== GRADIENT ANIMATIONS ===== */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

/* ===== TEXT ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-animate {
  animation: fadeInUp 0.8s ease-out;
}

/* ===== CARD ANIMATIONS ===== */
.feature-card,
.pricing-tier,
.testimonial-card,
.use-case-card,
.step {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover,
.pricing-tier:hover,
.testimonial-card:hover,
.use-case-card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* ===== NAVBAR ANIMATIONS ===== */
.navbar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a {
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--elite-accent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ===== HERO ANIMATIONS ===== */
.hero-text h1 {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-text .subtitle {
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-cta {
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-image {
  animation: fadeInUp 1s ease-out 0.8s both;
  will-change: transform;
}

.hero-image img {
  transition: transform 0.3s ease;
}

.hero-image:hover img {
  transform: scale(1.02);
}

/* ===== NUMBER COUNTER ANIMATION ===== */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.count-animate {
  animation: countUp 0.8s ease-out;
}

/* ===== PROGRESS BAR ANIMATION ===== */
@keyframes progress {
  from {
    width: 0%;
  }
}

.progress-bar {
  animation: progress 2s ease-out;
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-transition.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ICON ANIMATIONS ===== */
.icon-bounce {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-bounce:hover {
  transform: scale(1.2) rotate(5deg);
}

.icon-rotate {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-rotate:hover {
  transform: rotate(360deg);
}

/* ===== SECTION ENTRANCE ANIMATIONS ===== */
.section {
  position: relative;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.section.visible::before {
  opacity: 1;
}

/* ===== SMOOTH SCROLL INDICATOR ===== */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--elite-gradient-primary);
  z-index: 9999;
  transition: width 0.1s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: var(--elite-gradient-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5);
}

.scroll-to-top:active {
  transform: translateY(-2px) scale(0.95);
}

.scroll-to-top i {
  font-size: 1.5rem;
  animation: bounceUp 2s ease-in-out infinite;
}

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

@media (max-width: 768px) {
  .scroll-to-top {
    width: 48px;
    height: 48px;
    bottom: 1.5rem;
    right: 1.5rem;
  }
  
  .scroll-to-top i {
    font-size: 1.25rem;
  }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .animate-on-scroll,
  .animate-slide-up,
  .animate-slide-left,
  .animate-slide-right {
    transform: translateY(20px);
  }
  
  .animate-on-scroll.animated,
  .animate-slide-up.animated,
  .animate-slide-left.animated,
  .animate-slide-right.animated {
    transform: translateY(0);
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.animate-on-scroll,
.animate-fade-in,
.animate-slide-up,
.animate-slide-left,
.animate-slide-right,
.animate-scale,
.animate-rotate {
  will-change: opacity, transform;
}

.animate-on-scroll.animated,
.animate-fade-in.animated,
.animate-slide-up.animated,
.animate-slide-left.animated,
.animate-slide-right.animated,
.animate-scale.animated,
.animate-rotate.animated {
  will-change: auto;
}
