/* ============================================
   AIZONIQ - WOW Visual Effects
   ============================================ */

/* ========== Neural Network Canvas ========== */
#neural-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.hero {
    position: relative;
    overflow: hidden;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ========== Typewriter Effect ========== */
.typewriter-wrap {
    display: inline-block;
    min-width: 300px;
}

html[dir="rtl"] .typewriter-wrap {
    min-width: 320px;
}

.typewriter-cursor {
    display: inline-block;
    width: 3px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    animation: cursorBlink 0.7s step-end infinite;
    margin-inline-start: 2px;
    vertical-align: middle;
    border-radius: 2px;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========== 3D Card Tilt ========== */
.service-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.service-card .card-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover .card-shine {
    opacity: 0;
}

/* ========== Cursor Particle Trail ========== */
.cursor-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    animation: particleFade 0.6s ease-out forwards;
}

@keyframes particleFade {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
}

/* ========== Glitch Effect on Logo ========== */
.logo a {
    position: relative;
    display: inline-block;
}

.logo-ai {
    position: relative;
    display: inline-block;
    animation: logoGlitch 6s infinite;
}

@keyframes logoGlitch {
    0%, 90%, 100% {
        text-shadow: none;
        clip-path: none;
    }
    92% {
        text-shadow: -2px 0 #ec4899, 2px 0 #6366f1;
        clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
        transform: translate(-2px, 0);
    }
    94% {
        text-shadow: 2px 0 #ec4899, -2px 0 #6366f1;
        clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
        transform: translate(2px, 0);
    }
    96% {
        text-shadow: none;
        clip-path: none;
        transform: translate(0, 0);
    }
}

/* ========== Floating Orbs Enhanced ========== */
.gradient-orb {
    animation: orbFloat 8s ease-in-out infinite;
    filter: blur(80px);
}

.orb-1 { animation-delay: 0s; }
.orb-2 { animation-delay: -3s; }
.orb-3 { animation-delay: -6s; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -30px) scale(1.05); }
    66%       { transform: translate(-20px, 20px) scale(0.95); }
}

/* ========== Hero Badge Pulse ========== */
.hero-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3); }
    50%       { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

/* ========== Stat Items Glow on Hover ========== */
.stat-item {
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item:hover .stat-number {
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

/* ========== CTA Button Shimmer ========== */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.15);
    transform: skewX(-20deg);
    animation: btnShimmer 3s ease-in-out infinite;
}

@keyframes btnShimmer {
    0%   { left: -75%; }
    100% { left: 125%; }
}

/* ========== Section Reveal Glow Line ========== */
.section-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    margin: 16px auto 0;
    border-radius: 2px;
    animation: lineGrow 1s ease-out forwards;
    transform-origin: left;
}

@keyframes lineGrow {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}

/* ========== Testimonial Card Hover ========== */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.2);
}

/* ========== Floating Card Animation ========== */
.floating-card {
    animation: floatCard 3s ease-in-out infinite;
}

.card-1 { animation-delay: 0s; }
.card-2 { animation-delay: -1s; }
.card-3 { animation-delay: -2s; }

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

/* ========== Scroll Indicator Bounce ========== */
.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* ========== Text Reveal Animation ========== */
.hero-title {
    overflow: hidden;
}

.hero-title span {
    display: block;
    animation: textReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-title span:nth-child(2) {
    animation-delay: 0.15s;
}

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

/* ========== Feature Icon Spin on Hover ========== */
.feature-icon {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.feature-item:hover .feature-icon {
    transform: rotate(360deg) scale(1.1);
}

/* ========== Gradient Text Animated ========== */
.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 30%, #ec4899 60%, #6366f1 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradientFlow 3s linear infinite;
}

@keyframes textGradientFlow {
    from { background-position: 0% center; }
    to   { background-position: 200% center; }
}

/* ========== Mobile Performance Optimizations ========== */
@media (max-width: 768px) {
    /* Reduce blur on orbs - huge GPU saver */
    .gradient-orb {
        filter: blur(40px);
        will-change: transform;
        contain: layout style;
    }

    /* GPU-promote animated elements */
    .hero-badge,
    .btn-primary,
    .gradient-text,
    .service-card {
        will-change: auto;
    }

    /* Simplify button shimmer on mobile */
    .btn-primary::after {
        animation-duration: 5s;
    }

    /* Reduce badge pulse frequency */
    .hero-badge {
        animation-duration: 4s;
    }
}
