/**
 * Modern Animated Flowing Curves Background
 * Smooth bezier curves with fluid animation
 * Premium SaaS/AI landing page style
 */

/* Animated Background Container */
.animated-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
}

/* Hero section - no clip path */
.hero .animated-bg-container {
    clip-path: none;
}

/* Services section - no clip path */
.services-overview .animated-bg-container {
    clip-path: none;
}

/* Glass overlay layer for depth - reduced blur */
.animated-bg-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(3, 86, 163, 0.02) 0%, transparent 50%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1;
    pointer-events: none;
}

/* Additional glass layer - minimal blur */
.animated-bg-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 50%, rgba(26, 115, 232, 0.015) 0%, transparent 50%);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    z-index: 2;
    pointer-events: none;
}

/* Flowing Curves Layer */
.flowing-curves-layer {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    opacity: 0.12;
}

/* Individual Curve Elements */
.curve-line {
    position: absolute;
    width: 100%;
    height: 2.5px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(3, 86, 163, 0.7) 20%, 
        rgba(26, 115, 232, 0.5) 50%, 
        rgba(3, 86, 163, 0.7) 80%, 
        transparent 100%);
    transform-origin: left center;
    filter: blur(0.5px);
    box-shadow: 0 0 10px rgba(3, 86, 163, 0.2);
}

.curve-line-1 {
    top: 15%;
    animation: flowWave1 12s ease-in-out infinite;
}

.curve-line-2 {
    top: 30%;
    animation: flowWave2 14s ease-in-out infinite;
    animation-delay: -2s;
    opacity: 0.9;
}

.curve-line-3 {
    top: 45%;
    animation: flowWave3 16s ease-in-out infinite;
    animation-delay: -4s;
    opacity: 0.8;
}

.curve-line-4 {
    top: 60%;
    animation: flowWave4 18s ease-in-out infinite;
    animation-delay: -6s;
    opacity: 0.7;
}

.curve-line-5 {
    top: 75%;
    animation: flowWave5 20s ease-in-out infinite;
    animation-delay: -8s;
    opacity: 0.6;
}

/* Smooth Wave Animations */
@keyframes flowWave1 {
    0%, 100% {
        transform: translateY(0) scaleY(1) rotate(0deg);
        clip-path: ellipse(100% 50% at 50% 50%);
    }
    25% {
        transform: translateY(-20px) scaleY(1.5) rotate(1deg);
        clip-path: ellipse(100% 60% at 40% 50%);
    }
    50% {
        transform: translateY(0) scaleY(1) rotate(0deg);
        clip-path: ellipse(100% 50% at 60% 50%);
    }
    75% {
        transform: translateY(20px) scaleY(1.5) rotate(-1deg);
        clip-path: ellipse(100% 60% at 50% 50%);
    }
}

@keyframes flowWave2 {
    0%, 100% {
        transform: translateY(0) scaleY(1) rotate(0deg);
        clip-path: ellipse(100% 50% at 50% 50%);
    }
    33% {
        transform: translateY(25px) scaleY(1.8) rotate(-1deg);
        clip-path: ellipse(100% 70% at 60% 50%);
    }
    66% {
        transform: translateY(-25px) scaleY(1.8) rotate(1deg);
        clip-path: ellipse(100% 70% at 40% 50%);
    }
}

@keyframes flowWave3 {
    0%, 100% {
        transform: translateY(0) scaleY(1) rotate(0deg);
        clip-path: ellipse(100% 50% at 50% 50%);
    }
    30% {
        transform: translateY(-30px) scaleY(2) rotate(1.5deg);
        clip-path: ellipse(100% 80% at 45% 50%);
    }
    60% {
        transform: translateY(30px) scaleY(2) rotate(-1.5deg);
        clip-path: ellipse(100% 80% at 55% 50%);
    }
}

@keyframes flowWave4 {
    0%, 100% {
        transform: translateY(0) scaleY(1) rotate(0deg);
        clip-path: ellipse(100% 50% at 50% 50%);
    }
    40% {
        transform: translateY(20px) scaleY(1.6) rotate(-1deg);
        clip-path: ellipse(100% 65% at 55% 50%);
    }
    80% {
        transform: translateY(-20px) scaleY(1.6) rotate(1deg);
        clip-path: ellipse(100% 65% at 45% 50%);
    }
}

@keyframes flowWave5 {
    0%, 100% {
        transform: translateY(0) scaleY(1) rotate(0deg);
        clip-path: ellipse(100% 50% at 50% 50%);
    }
    50% {
        transform: translateY(-15px) scaleY(1.4) rotate(0.5deg);
        clip-path: ellipse(100% 60% at 50% 50%);
    }
}

/* Glowing Orbs for Depth */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: floatOrb 20s ease-in-out infinite;
    pointer-events: none;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(3, 86, 163, 0.3) 0%, rgba(3, 86, 163, 0.08) 50%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(26, 115, 232, 0.25) 0%, rgba(26, 115, 232, 0.06) 50%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(3, 86, 163, 0.2) 0%, rgba(3, 86, 163, 0.05) 50%, transparent 70%);
    top: 40%;
    left: 40%;
    animation-delay: -14s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.15);
    }
    50% {
        transform: translate(0, 0) scale(1);
    }
    75% {
        transform: translate(-50px, 50px) scale(0.85);
    }
}

/* Subtle Grid Pattern Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(3, 86, 163, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(3, 86, 163, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Shimmer Effect */
.shimmer-overlay {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(3, 86, 163, 0.04) 50%,
        transparent 70%
    );
    animation: shimmer 15s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%);
    }
    100% {
        transform: translateX(100%) translateY(100%);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .curve-line {
        height: 1.5px;
    }
    
    .bg-orb-1 {
        width: 300px;
        height: 300px;
        filter: blur(60px);
    }
    
    .bg-orb-2 {
        width: 250px;
        height: 250px;
        filter: blur(60px);
    }
    
    .bg-orb-3 {
        width: 280px;
        height: 280px;
        filter: blur(60px);
    }
    
    .grid-overlay {
        background-size: 30px 30px;
    }
}

/* Performance Optimization */
.animated-bg-container {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.curve-line,
.bg-orb {
    will-change: transform, opacity;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .curve-line,
    .bg-orb,
    .grid-overlay,
    .shimmer-overlay {
        animation: none;
    }
}
