/* ===================================
   AI-Based Advanced Animations CSS
   Premium Visual Effects for Client Attraction & SEO
   =================================== */

/* ===================================
   Premium Entrance Animations
   =================================== */

@keyframes premiumFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes premiumSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-100px) rotate(-5deg);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0);
        filter: blur(0);
    }
}

@keyframes premiumZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
        filter: blur(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
        filter: blur(0);
    }
}

.premium-entrance {
    animation: premiumFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===================================
   Stunning Gradient Animations
   =================================== */

@keyframes rainbowGradient {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        filter: hue-rotate(180deg);
    }
    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

.rainbow-gradient {
    background: linear-gradient(
        -45deg,
        #ff0080,
        #ff8c00,
        #40e0d0,
        #9b59b6,
        #3498db,
        #e74c3c
    );
    background-size: 400% 400%;
    animation: rainbowGradient 8s ease infinite;
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(99, 102, 241, 0.5),
            0 0 10px rgba(99, 102, 241, 0.5),
            0 0 20px rgba(99, 102, 241, 0.5),
            0 0 40px rgba(99, 102, 241, 0.3),
            0 0 80px rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow: 
            0 0 10px rgba(99, 102, 241, 0.8),
            0 0 20px rgba(99, 102, 241, 0.8),
            0 0 40px rgba(99, 102, 241, 0.8),
            0 0 80px rgba(99, 102, 241, 0.5),
            0 0 160px rgba(99, 102, 241, 0.3);
    }
}

.neon-glow {
    animation: neonPulse 2s ease-in-out infinite;
}

/* ===================================
   Eye-Catching Hover Effects
   =================================== */

.premium-card-hover {
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-card-hover::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(99, 102, 241, 0.3) 0%,
        transparent 70%
    );
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-card-hover:hover::before {
    transform: scale(1);
}

.premium-card-hover:hover {
    transform: translateY(-20px) scale(1.05);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(99, 102, 241, 0.3);
}

/* ===================================
   Floating Animation (Premium)
   =================================== */

@keyframes premiumFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(2deg);
    }
    50% {
        transform: translateY(-10px) rotate(-2deg);
    }
    75% {
        transform: translateY(-15px) rotate(1deg);
    }
}

.premium-float {
    animation: premiumFloat 6s ease-in-out infinite;
}

/* ===================================
   Spotlight Effect
   =================================== */

@keyframes spotlight {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

.spotlight-effect {
    position: relative;
    overflow: hidden;
}

.spotlight-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    animation: spotlight 10s linear infinite;
    pointer-events: none;
}

/* ===================================
   3D Card Flip Effect
   =================================== */

.flip-card-3d {
    perspective: 1000px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.flip-card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg) scale(1.05);
}

@keyframes cardShine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: cardShine 3s infinite;
}


/* ===================================
   Holographic Effects
   =================================== */

[data-holographic] {
    position: relative;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
    --holographic-hue: 180;
}

[data-holographic]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        hsla(var(--holographic-hue), 100%, 50%, 0.3) 0%,
        hsla(calc(var(--holographic-hue) + 60), 100%, 50%, 0.3) 50%,
        hsla(calc(var(--holographic-hue) + 120), 100%, 50%, 0.3) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}

[data-holographic]:hover::before {
    opacity: 1;
}

[data-holographic]::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        #ff0080,
        #ff8c00,
        #40e0d0,
        #ff0080
    );
    background-size: 300% 300%;
    opacity: 0;
    filter: blur(10px);
    animation: holographicGlow 3s ease infinite;
    border-radius: inherit;
    z-index: -1;
}

[data-holographic]:hover::after {
    opacity: 0.6;
}

@keyframes holographicGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===================================
   Quantum Particle Effects
   =================================== */

.quantum-particle {
    animation: quantumFloat 2s ease-in-out infinite;
}

@keyframes quantumFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
}

[data-quantum] {
    position: relative;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-quantum].state-1 {
    transform: rotate(0deg) scale(1);
    filter: hue-rotate(0deg);
}

[data-quantum].state-2 {
    transform: rotate(180deg) scale(1.1);
    filter: hue-rotate(120deg);
}

[data-quantum].state-3 {
    transform: rotate(360deg) scale(0.9);
    filter: hue-rotate(240deg);
}

/* ===================================
   Morphing Animations
   =================================== */

@keyframes morphShape {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
    }
    75% {
        border-radius: 60% 40% 60% 40% / 70% 30% 50% 60%;
    }
}

.morph-shape {
    animation: morphShape 8s ease-in-out infinite;
}

@keyframes morphColor {
    0% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(180deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.morph-color {
    animation: morphColor 10s linear infinite;
}

/* ===================================
   Fluid Dynamics Effects
   =================================== */

@keyframes fluidWave {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(10px) translateY(-10px);
    }
    50% {
        transform: translateX(0) translateY(-20px);
    }
    75% {
        transform: translateX(-10px) translateY(-10px);
    }
}

.fluid-element {
    animation: fluidWave 4s ease-in-out infinite;
}

@keyframes fluidBlob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 60% 40% 60% 40% / 70% 30% 50% 60%;
        transform: rotate(270deg) scale(1.05);
    }
}

.fluid-blob {
    animation: fluidBlob 15s ease-in-out infinite;
}

/* ===================================
   Neural Network Visualization
   =================================== */

.neural-node {
    position: relative;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    border-radius: 50%;
    animation: neuralPulse 2s ease-in-out infinite;
}

@keyframes neuralPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 20px 10px rgba(99, 102, 241, 0);
    }
}

.neural-connection {
    stroke: #6366f1;
    stroke-width: 2;
    fill: none;
    animation: neuralFlow 3s linear infinite;
    stroke-dasharray: 10 5;
}

@keyframes neuralFlow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 100;
    }
}

/* ===================================
   3D Depth Perception
   =================================== */

[data-depth] {
    transition: transform 0.3s ease-out;
    transform-style: preserve-3d;
}

.depth-layer-1 {
    transform: translateZ(10px);
}

.depth-layer-2 {
    transform: translateZ(20px);
}

.depth-layer-3 {
    transform: translateZ(30px);
}

/* ===================================
   Glitch Effects (AI-Enhanced)
   =================================== */

@keyframes glitchAI {
    0% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    20% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    40% {
        transform: translate(-2px, -2px);
        filter: hue-rotate(180deg);
    }
    60% {
        transform: translate(2px, 2px);
        filter: hue-rotate(270deg);
    }
    80% {
        transform: translate(2px, -2px);
        filter: hue-rotate(360deg);
    }
    100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
}

.glitch-ai {
    position: relative;
    animation: glitchAI 0.3s infinite;
}

.glitch-ai::before,
.glitch-ai::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-ai::before {
    animation: glitchTop 0.3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    transform: translate(-2px, -2px);
    opacity: 0.8;
}

.glitch-ai::after {
    animation: glitchBottom 0.3s infinite;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    transform: translate(2px, 2px);
    opacity: 0.8;
}

@keyframes glitchTop {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(-2px, 2px);
    }
    66% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitchBottom {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(2px, -2px);
    }
    66% {
        transform: translate(-2px, 2px);
    }
}

/* ===================================
   Magnetic Field Effect
   =================================== */

.magnetic-field {
    position: relative;
    transition: transform 0.2s ease-out;
}

.magnetic-field::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.magnetic-field:hover::before {
    opacity: 1;
    animation: magneticPulse 1.5s ease-in-out infinite;
}

@keyframes magneticPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ===================================
   Energy Field Animation
   =================================== */

@keyframes energyField {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(99, 102, 241, 0.5),
            0 0 20px rgba(99, 102, 241, 0.3),
            0 0 30px rgba(99, 102, 241, 0.1);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(99, 102, 241, 0.8),
            0 0 40px rgba(99, 102, 241, 0.5),
            0 0 60px rgba(99, 102, 241, 0.3);
    }
}

.energy-field {
    animation: energyField 2s ease-in-out infinite;
}

/* ===================================
   Particle Trail Effect
   =================================== */

@keyframes particleTrail {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0);
        opacity: 0;
    }
}

.particle-trail {
    animation: particleTrail 1s ease-out forwards;
}

/* ===================================
   AI Loading Animations
   =================================== */

.ai-loader {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.ai-loader div {
    position: absolute;
    border: 4px solid #6366f1;
    opacity: 1;
    border-radius: 50%;
    animation: aiLoaderRipple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.ai-loader div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes aiLoaderRipple {
    0% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: 0;
        left: 0;
        width: 72px;
        height: 72px;
        opacity: 0;
    }
}

/* ===================================
   Neural Network Loader
   =================================== */

.neural-loader {
    display: flex;
    gap: 10px;
}

.neural-loader span {
    width: 15px;
    height: 15px;
    background: #6366f1;
    border-radius: 50%;
    animation: neuralLoaderBounce 1.4s infinite ease-in-out both;
}

.neural-loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.neural-loader span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes neuralLoaderBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ===================================
   Quantum State Transitions
   =================================== */

@keyframes quantumState {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(-10px) rotate(90deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(0) rotate(180deg);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-10px) rotate(270deg);
        opacity: 0.7;
    }
}

.quantum-state {
    animation: quantumState 2s ease-in-out infinite;
}

/* ===================================
   AI Gradient Backgrounds
   =================================== */

.ai-gradient-1 {
    background: linear-gradient(
        135deg,
        #667eea 0%,
        #764ba2 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.ai-gradient-2 {
    background: linear-gradient(
        135deg,
        #f093fb 0%,
        #f5576c 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.ai-gradient-3 {
    background: linear-gradient(
        135deg,
        #4facfe 0%,
        #00f2fe 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.ai-gradient-animated {
    background: linear-gradient(
        -45deg,
        #ee7752,
        #e73c7e,
        #23a6d5,
        #23d5ab
    );
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===================================
   Smart Hover Effects
   =================================== */

.smart-hover {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.smart-hover::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;
}

.smart-hover:hover::before {
    width: 300%;
    height: 300%;
}

/* ===================================
   Predictive Animation States
   =================================== */

.ai-state-scanning {
    animation: scanningPulse 1s ease-in-out infinite;
}

.ai-state-reading {
    animation: readingGlow 2s ease-in-out infinite;
}

.ai-state-engaging {
    animation: engagingBounce 0.5s ease-in-out infinite;
}

@keyframes scanningPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes readingGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
}

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

/* ===================================
   Responsive AI Animations
   =================================== */

@media (max-width: 768px) {
    [data-holographic]::after {
        filter: blur(5px);
    }
    
    .neural-node {
        width: 15px;
        height: 15px;
    }
    
    .ai-loader {
        width: 60px;
        height: 60px;
    }
}

/* ===================================
   Performance Optimization
   =================================== */

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

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===================================
   AI Text Effects
   =================================== */

.ai-text-shimmer {
    background: linear-gradient(
        90deg,
        #6366f1 0%,
        #8b5cf6 25%,
        #ec4899 50%,
        #8b5cf6 75%,
        #6366f1 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 3s linear infinite;
}

@keyframes shimmerText {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

.ai-text-glow {
    text-shadow: 
        0 0 10px rgba(99, 102, 241, 0.5),
        0 0 20px rgba(99, 102, 241, 0.3),
        0 0 30px rgba(99, 102, 241, 0.1);
    animation: textGlowPulse 2s ease-in-out infinite;
}

@keyframes textGlowPulse {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(99, 102, 241, 0.5),
            0 0 20px rgba(99, 102, 241, 0.3),
            0 0 30px rgba(99, 102, 241, 0.1);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(99, 102, 241, 0.8),
            0 0 40px rgba(99, 102, 241, 0.5),
            0 0 60px rgba(99, 102, 241, 0.3);
    }
}

/* ===================================
   Cursor Effects
   =================================== */

.ai-cursor-trail {
    pointer-events: none;
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.8) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: cursorPulse 1s ease-in-out infinite;
}

@keyframes cursorPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.4;
    }
}
