.hero-animation-container {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    overflow: visible;
}

/* Central Engine */
.engine-outer {
    position: relative;
    width: 120px;
    height: 120px;
    z-index: 10;
}

.engine-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: corePulse 3s ease-in-out infinite;
    z-index: 2;
}

.engine-core i {
    color: white;
    width: 48px;
    height: 48px;
    animation: coreScale 3s ease-in-out infinite;
}

.core-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border: 1px dashed rgba(79, 70, 229, 0.3);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

.core-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border: 2px solid rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    animation: coreRingPulse 3s ease-in-out infinite;
}

/* Lead Nodes (Flying In) */
.lead-node {
    position: absolute;
    width: 160px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(79, 70, 229, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    z-index: 5;
}

.lead-node .icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lead-node .info {
    display: flex;
    flex-direction: column;
}

.lead-node .name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
}

.lead-node .source {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* Animations for Leads */
@keyframes leadInLeft {
    0% {
        transform: translate(-300px, -50px) scale(0.8);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        transform: translate(-60px, 0px) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(-40px, 0px) scale(0);
        opacity: 0;
    }
}

@keyframes leadInRight {
    0% {
        transform: translate(300px, 50px) scale(0.8);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        transform: translate(60px, 0px) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(40px, 0px) scale(0);
        opacity: 0;
    }
}

.lead-1 {
    animation: leadInLeft 4s infinite;
}

.lead-2 {
    animation: leadInRight 4s infinite 2s;
}

/* Result Nodes (Flying Out) */
.result-node {
    position: absolute;
    padding: 10px 16px;
    border-radius: 99px;
    background: #10b981;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    z-index: 5;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

@keyframes resultOutUp {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }

    20% {
        transform: translate(0, -40px) scale(1);
        opacity: 1;
    }

    80% {
        transform: translate(100px, -150px) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(120px, -180px) scale(0.8);
        opacity: 0;
    }
}

@keyframes resultOutDown {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }

    20% {
        transform: translate(0, 40px) scale(1);
        opacity: 1;
    }

    80% {
        transform: translate(-100px, 150px) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-120px, 180px) scale(0.8);
        opacity: 0;
    }
}

.res-1 {
    animation: resultOutUp 4s infinite 1s;
}

.res-2 {
    animation: resultOutDown 4s infinite 3s;
}

/* Engine Core Animations */
@keyframes corePulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.4);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 60px rgba(79, 70, 229, 0.6);
    }
}

@keyframes coreScale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes coreRingPulse {

    0%,
    100% {
        width: 150px;
        height: 150px;
        opacity: 0.5;
    }

    50% {
        width: 220px;
        height: 220px;
        opacity: 0;
    }
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Floating Particle Background for the visual */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(79, 70, 229, 0.2);
    border-radius: 50%;
    pointer-events: none;
}

/* Connectors (CSS lines) */
.connector-line {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.2), transparent);
    transform-origin: left center;
    z-index: 1;
}

/* Responsive Scaling */
@media (max-width: 768px) {
    .hero-animation-container {
        transform: scale(0.5);
        height: 250px;
        margin-top: -80px;
        margin-bottom: -40px;
        width: 100%;
        overflow: hidden;
        /* Prevent nodes from causing overflow */
    }

    .lead-node {
        width: 120px;
        padding: 8px;
    }

    .lead-node .name {
        font-size: 0.75rem;
    }

    @keyframes leadInLeft {
        0% {
            transform: translate(-220px, -40px) scale(0.8);
            opacity: 0;
        }

        20% {
            opacity: 1;
        }

        80% {
            transform: translate(-50px, 0px) scale(0.5);
            opacity: 1;
        }

        100% {
            transform: translate(-30px, 0px) scale(0);
            opacity: 0;
        }
    }

    @keyframes leadInRight {
        0% {
            transform: translate(220px, 40px) scale(0.8);
            opacity: 0;
        }

        20% {
            opacity: 1;
        }

        80% {
            transform: translate(50px, 0px) scale(0.5);
            opacity: 1;
        }

        100% {
            transform: translate(30px, 0px) scale(0);
            opacity: 0;
        }
    }
}