/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Page Load Animations */
.hero-section {
    animation: fadeInUp 1s ease-out;
}

.hero-content {
    animation: fadeInLeft 1s ease-out 0.2s both;
}

.hero-image {
    animation: fadeInRight 1s ease-out 0.4s both;
}

.features-section {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.steps-section {
    animation: fadeInUp 1s ease-out 0.8s both;
}

.benefits-section {
    animation: fadeInUp 1s ease-out 1s both;
}

.faq-section {
    animation: fadeInUp 1s ease-out 1.2s both;
}

.cta-section {
    animation: fadeInUp 1s ease-out 1.4s both;
}

/* Feature Cards Animation */
.feature-card {
    animation: scaleIn 0.6s ease-out both;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
}

.feature-card:nth-child(1) { --animation-order: 1; }
.feature-card:nth-child(2) { --animation-order: 2; }
.feature-card:nth-child(3) { --animation-order: 3; }
.feature-card:nth-child(4) { --animation-order: 4; }

/* Step Cards Animation */
.step-card {
    animation: scaleIn 0.6s ease-out both;
    animation-delay: calc(var(--animation-order, 0) * 0.2s);
}

.step-card:nth-child(1) { --animation-order: 1; }
.step-card:nth-child(2) { --animation-order: 2; }
.step-card:nth-child(3) { --animation-order: 3; }

/* FAQ Items Animation */
.faq-item {
    animation: slideInFromTop 0.5s ease-out both;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
}

.faq-item:nth-child(1) { --animation-order: 1; }
.faq-item:nth-child(2) { --animation-order: 2; }
.faq-item:nth-child(3) { --animation-order: 3; }

/* Hover Animations */
.feature-card:hover {
    animation: pulse 0.6s ease-in-out;
}

.step-card:hover .step-number {
    animation: pulse 0.6s ease-in-out;
}

.btn:hover {
    animation: pulse 0.3s ease-in-out;
}

/* Floating Animation for Icons */
.feature-icon {
    animation: float 3s ease-in-out infinite;
}

.feature-card:nth-child(1) .feature-icon {
    animation-delay: 0s;
}

.feature-card:nth-child(2) .feature-icon {
    animation-delay: 0.5s;
}

.feature-card:nth-child(3) .feature-icon {
    animation-delay: 1s;
}

.feature-card:nth-child(4) .feature-icon {
    animation-delay: 1.5s;
}

/* Gradient Animation for Hero Title */
.hero-title {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Shimmer Effect for Buttons */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scroll-triggered Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Smooth Transitions */
* {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation Menu Animation */
.nav-menu.active {
    animation: slideInFromTop 0.3s ease-out;
}

/* Hamburger Menu Animation */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Card Flip Animation */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* Bounce Animation for CTA */
.cta-section {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Typing Animation */
.typing-animation {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
} 