/* ============================================
   CLEAN SCROLL ANIMATIONS - Simple & Smooth
   ============================================ */

/* Base state - elements hidden before scroll */
section,
.feature-card,
.benefit-card,
.step-item,
.stat-item,
.faq-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated state - elements visible */
section.animate-in,
.feature-card.animate-in,
.benefit-card.animate-in,
.step-item.animate-in,
.stat-item.animate-in,
.faq-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Hero section - always visible */
.hero-section {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for cards in a grid */
.feature-card {
    transition-delay: 0s;
}

.feature-card:nth-child(1) { transition-delay: 0.1s; }
.feature-card:nth-child(2) { transition-delay: 0.2s; }
.feature-card:nth-child(3) { transition-delay: 0.3s; }
.feature-card:nth-child(4) { transition-delay: 0.4s; }
.feature-card:nth-child(5) { transition-delay: 0.5s; }
.feature-card:nth-child(6) { transition-delay: 0.6s; }

.benefit-card:nth-child(1) { transition-delay: 0.1s; }
.benefit-card:nth-child(2) { transition-delay: 0.2s; }
.benefit-card:nth-child(3) { transition-delay: 0.3s; }
.benefit-card:nth-child(4) { transition-delay: 0.4s; }

.step-item:nth-child(1) { transition-delay: 0.15s; }
.step-item:nth-child(2) { transition-delay: 0.3s; }
.step-item:nth-child(3) { transition-delay: 0.45s; }

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    section,
    .feature-card,
    .benefit-card,
    .step-item,
    .stat-item,
    .faq-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-300) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Glow Effect */
.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(153, 27, 27, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(153, 27, 27, 0.6);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Heartbeat Animation */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Rotate Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease;
}

/* Scale Up Animation */
@keyframes scaleUp {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.scale-up {
    animation: scaleUp 0.5s ease;
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-down {
    animation: slideDown 0.5s ease;
}

/* Blur In Animation */
@keyframes blurIn {
    from {
        filter: blur(20px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 1s ease;
}

/* Typing Animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typing-text {
    overflow: hidden;
    border-left: 2px solid;
    white-space: nowrap;
    animation: typing 3.5s steps(40) 1s, blink 0.75s step-end infinite;
}

/* Parallax Effect */
.parallax {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Hover Lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Text Gradient Animation */
.gradient-text {
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--gold),
        var(--cyan),
        var(--primary)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 5s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Underline Expand */
.underline-expand {
    position: relative;
    display: inline-block;
}

.underline-expand::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.underline-expand:hover::after {
    width: 100%;
}

/* Border Animation */
@keyframes borderAnimation {
    0%, 100% {
        border-color: var(--primary);
    }
    33% {
        border-color: var(--gold);
    }
    66% {
        border-color: var(--cyan);
    }
}

.border-animate {
    animation: borderAnimation 3s ease infinite;
}

/* Float Animation */
@keyframes floatUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-animation {
    animation: floatUp 3s ease-in-out infinite;
}

/* Swing Animation */
@keyframes swing {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
}

.swing {
    animation: swing 2s ease-in-out infinite;
    transform-origin: top center;
}

/* Flip Animation */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

.flip {
    animation: flip 2s ease-in-out infinite;
}

/* Zoom In/Out */
@keyframes zoomInOut {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.zoom-in-out {
    animation: zoomInOut 2s ease-in-out infinite;
}

/* Confetti Effect */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary);
    animation: confetti-fall 3s linear forwards;
}

/* Wave Animation */
@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.wave-animation > * {
    display: inline-block;
    animation: wave 1s ease-in-out infinite;
}

.wave-animation > *:nth-child(1) { animation-delay: 0s; }
.wave-animation > *:nth-child(2) { animation-delay: 0.1s; }
.wave-animation > *:nth-child(3) { animation-delay: 0.2s; }
.wave-animation > *:nth-child(4) { animation-delay: 0.3s; }
.wave-animation > *:nth-child(5) { animation-delay: 0.4s; }

/* Progress Bar Animation */
@keyframes progressBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

.progress-bar {
    animation: progressBar 2s ease forwards;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 4s steps(40) 1s infinite;
}

/* Fade In Up Stagger */
@keyframes fadeInUpStagger {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up-stagger > * {
    opacity: 0;
    animation: fadeInUpStagger 0.8s ease forwards;
}

.fade-in-up-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.fade-in-up-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.fade-in-up-stagger > *:nth-child(5) { animation-delay: 0.5s; }
.fade-in-up-stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* Performance Optimizations */
.will-animate {
    will-change: transform, opacity;
}

/* Optimize heavy animations on mobile */
@media (max-width: 768px) {
    .float-animation,
    .zoom-in-out,
    .parallax {
        animation: none !important;
    }
    
    .feature-card,
    .benefit-card {
        transition: box-shadow 0.3s ease, transform 0.3s ease !important;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
