/* ===== Animations CSS ===== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Scroll Progress Indicator ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-teal), var(--dark-teal));
    z-index: 10000;
    transform-origin: left;
    transform: scaleX(0);
    will-change: transform;
}

/* ===== Page Load Animations ===== */
body {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== Hero Section Animations ===== */

/* Hero content fade-in and slide-up */
.hero-content {
    animation: slideUpFadeIn 0.8s ease-out 0.2s both;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero image parallax container */
.hero-image {
    transition: transform 0.5s ease-out;
    will-change: transform;
}

/* Floating animation for dragonfly */
.hero-image img {
    animation: floatingDragonfly 6s ease-in-out infinite;
    will-change: transform;
}

@keyframes floatingDragonfly {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-15px) translateX(3px);
    }
}

/* ===== Scroll-Triggered Animations ===== */

/* Initial state for elements that will animate in */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Active state when in viewport */
.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays for groups of items */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }

/* Fade-in variation for sections */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Feature Cards 3D Tilt Effect ===== */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 196, 154, 0.15);
}

/* Add subtle 3D effect on icon */
.feature-icon {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: translateZ(20px) scale(1.05);
}

/* ===== Enhanced Button & CTA Interactions ===== */

/* Hero CTA enhancements with glow */
.hero-cta {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25),
                0 0 20px rgba(24, 211, 180, 0.2);
    animation: ctaGlowPulse 3s ease-in-out infinite;
}

@keyframes ctaGlowPulse {
    0%, 100% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25),
                    0 0 20px rgba(24, 211, 180, 0.2);
    }
    50% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25),
                    0 0 30px rgba(24, 211, 180, 0.35),
                    0 0 45px rgba(24, 211, 180, 0.15);
    }
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.hero-cta:hover::before {
    width: 300px;
    height: 300px;
}

.hero-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
                0 0 35px rgba(24, 211, 180, 0.45),
                0 0 60px rgba(24, 211, 180, 0.2);
    animation: none;
}

.hero-cta:active {
    transform: translateY(0) scale(0.98);
}

/* Arrow animation on hover */
.hero-cta-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.hero-cta:hover .hero-cta-arrow {
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* Features CTA with down arrow */
.features-cta {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25),
                0 0 20px rgba(24, 211, 180, 0.2);
    animation: ctaGlowPulse 3s ease-in-out infinite;
}

.features-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
                0 0 35px rgba(24, 211, 180, 0.45),
                0 0 60px rgba(24, 211, 180, 0.2);
    animation: none;
}

.features-cta:hover .hero-cta-arrow {
    animation: arrowBounceDown 0.6s ease infinite;
}

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

/* Nav buttons */
.nav-btn-demo,
.nav-btn-login {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-btn-demo:hover,
.nav-btn-login:hover {
    transform: translateY(-2px);
}

/* Form button enhancements */
.form-button {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.form-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.form-button:hover::before {
    width: 400px;
    height: 400px;
}

.form-button:hover {
    transform: translateY(-2px) scale(1.02);
}

.form-button:active {
    transform: translateY(0) scale(0.98);
}

.form-button-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.form-button:hover .form-button-arrow {
    animation: arrowBounce 0.6s ease infinite;
}

/* ===== Number Count-Up Animation ===== */
.count-up {
    font-weight: inherit;
}

/* Dark info box items fade in */
.check-line {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.check-line.animated {
    opacity: 1;
    transform: translateX(0);
}

.check-line:nth-child(1) { transition-delay: 0.1s; }
.check-line:nth-child(2) { transition-delay: 0.2s; }
.check-line:nth-child(3) { transition-delay: 0.3s; }
.check-line:nth-child(4) { transition-delay: 0.4s; }

/* ===== Use Case Cards ===== */
.use-case-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.use-case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.use-case-image {
    overflow: hidden;
}

.use-case-image img {
    transition: transform 0.5s ease;
}

.use-case-card:hover .use-case-image img {
    transform: scale(1.08);
}

/* ===== Content Section Images ===== */
.content-image {
    overflow: hidden;
    border-radius: var(--base-border-radius);
}

.content-image img {
    transition: transform 0.5s ease;
}

.content-grid:hover .content-image img {
    transform: scale(1.05);
}

/* ===== Form Enhancements ===== */

/* Floating labels */
.form-group {
    position: relative;
}

.form-group label:not(.form-checkbox-label) {
    position: absolute !important;
    left: 1.5rem;
    top: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    background: transparent;
    padding: 0 0.5rem;
    margin: 0 !important;
    display: inline-block !important;
}

.form-input:focus + label:not(.form-checkbox-label),
.form-input:not(:placeholder-shown) + label:not(.form-checkbox-label),
.form-input.has-value + label:not(.form-checkbox-label) {
    top: -0.7rem;
    left: 1rem;
    font-size: 0.9rem;
    color: var(--primary-teal);
    background: var(--dark-green);
}

textarea.form-input:focus + label:not(.form-checkbox-label),
textarea.form-input:not(:placeholder-shown) + label:not(.form-checkbox-label),
textarea.form-input.has-value + label:not(.form-checkbox-label) {
    top: -0.7rem;
}

.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(24, 211, 180, 0.1);
    outline: none;
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.success {
    border-color: var(--primary-teal);
}

/* Success animation */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(24, 211, 180, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(24, 211, 180, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(24, 211, 180, 0);
    }
}

.form-success {
    animation: successPulse 1s ease;
}

/* ===== Navigation Blur Effect ===== */
.navbar.scrolled {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Nav links smooth transitions */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-teal);
    transition: width 0.3s ease;
}

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

/* ===== Smooth Transitions for All Interactive Elements ===== */
a, button {
    transition: all 0.3s ease;
}

/* ===== Footer Dragonfly Parallax ===== */
.footer-dragonfly {
    transition: transform 0.3s ease-out;
}

/* ===== Gradient Mesh Backgrounds ===== */

/* Dark Info Section Mesh */
.dark-info {
    position: relative;
}

.dark-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(24, 211, 180, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(31, 155, 134, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(24, 211, 180, 0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: meshMove 20s ease infinite;
}

@keyframes meshMove {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
}

/* CTA Section Mesh */
.cta-section {
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(24, 211, 180, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 30% 80%, rgba(31, 155, 134, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 60% 40%, rgba(24, 211, 180, 0.1) 0%, transparent 60%);
    pointer-events: none;
    animation: meshMoveAlt 18s ease infinite;
}

/* CTA Content Decorative Element */
@media (min-width: 1200px) {
    .cta-content::after {
        content: '';
        position: absolute;
        bottom: -2rem;
        left: 2rem;
        width: 200px;
        height: 200px;
        background: rgba(24, 211, 180, 0.15);
        border-radius: 10px;
        pointer-events: none;
        z-index: 0;
        mix-blend-mode: screen;
    }

    .cta-content::before {
        content: '';
        position: absolute;
        bottom: 1rem;
        left: 8rem;
        width: 150px;
        height: 180px;
        background: rgba(31, 155, 134, 0.2);
        border-radius: 15px;
        pointer-events: none;
        z-index: 0;
        mix-blend-mode: screen;
        transform: rotate(-5deg);
    }

    .cta-content {
        position: relative;
    }

    .cta-content > * {
        position: relative;
        z-index: 1;
    }
}

@keyframes meshMoveAlt {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.9;
    }
}

/* Features Section Mesh */
.features {
    position: relative;
}

.features-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(24, 211, 180, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(31, 155, 134, 0.06) 0%, transparent 40%);
    pointer-events: none;
    opacity: 0.8;
    z-index: 0;
}

/* ===== Geometric Accent Shapes ===== */

/* Hero Section Geometric Shapes */
.hero::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(24, 211, 180, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -10%;
    right: 20%;
    pointer-events: none;
    z-index: 0;
    animation: floatShape 15s ease-in-out infinite;
}

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

/* Dark Info Section Shapes */
.dark-info::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(24, 211, 180, 0.1);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    bottom: -100px;
    left: -100px;
    pointer-events: none;
    z-index: 0;
    animation: morphShape 20s ease-in-out infinite;
}

@keyframes morphShape {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

/* Features Section Geometric Accent */
.features-grid::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(24, 211, 180, 0.08) 0%, transparent 70%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: -50px;
    right: -100px;
    pointer-events: none;
    z-index: 0;
    animation: rotateShape 25s linear infinite;
}

.features-grid {
    position: relative;
}

@keyframes rotateShape {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== Curved Section Dividers ===== */

/* Hero to Dark Info curved divider */
.hero {
    position: relative;
    padding-bottom: 6rem;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--dark-green);
    clip-path: ellipse(60% 100% at 50% 100%);
    z-index: 1;
}

/* Dark Info to How It Works curved divider */
.dark-info {
    position: relative;
    padding-bottom: 6rem;
}

/* How It Works to Wing Detail curved divider */
.how-it-works {
    position: relative;
}

/* Features to Content Section curved divider */
.features {
    position: relative;
    padding-bottom: 6rem;
}

/* Content Section to Use Cases curved divider */
.content-section {
    position: relative;
    padding-bottom: 6rem;
}

.content-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--sand);
    clip-path: ellipse(60% 100% at 50% 100%);
    z-index: 1;
}

/* Use Cases to FAQ curved divider */
.use-cases-section {
    position: relative;
    /*padding-bottom: 6rem;*/
}

/* FAQ to CTA curved divider */
.faq-section {
    position: relative;
    padding-bottom: 6rem;
}

/* Ensure content stays above dividers */
.hero-container,
.dark-info-container,
.how-container,
.features-container,
.content-container,
.use-cases-container,
.faq-container,
.cta-container {
    position: relative;
    z-index: 2;
}

.features-grid,
.feature-card {
    position: relative;
    z-index: 3;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .hero::before {
        height: 50px;
    }
    .content-section::after {
        height: 50px;
    }
}
