/* Effets avancés et optimisations pour MN Automation */

/* Performance optimizations */
* {
    will-change: auto;
}

.animate-gpu {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Morphing cards effect */
.morphing-card {
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.morphing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.6s ease;
    border-radius: inherit;
    pointer-events: none;
}

.morphing-card:hover::before {
    opacity: 1;
    animation: morph-sweep 1.5s ease-in-out;
}

@keyframes morph-sweep {
    0% { transform: translateX(-100%) rotateZ(45deg); }
    50% { transform: translateX(0%) rotateZ(45deg); }
    100% { transform: translateX(100%) rotateZ(45deg); }
}

/* Liquid loading bars */
.liquid-progress {
    position: relative;
    overflow: hidden;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 20px;
}

.liquid-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #7c3aed, #00d4ff);
    background-size: 200% 100%;
    border-radius: 20px;
    animation: liquid-flow 3s linear infinite;
    position: relative;
}

.liquid-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: liquid-shine 2s ease-in-out infinite;
}

@keyframes liquid-flow {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes liquid-shine {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Magnetic hover effect */
.magnetic {
    transition: transform 0.2s ease-out;
}

.magnetic:hover {
    transform: scale(1.05);
}

/* Glassmorphism effects */
.glass-card {
    background: rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Text reveal animations */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.text-reveal.animate span {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations */
.text-reveal.animate span:nth-child(1) { transition-delay: 0.1s; }
.text-reveal.animate span:nth-child(2) { transition-delay: 0.2s; }
.text-reveal.animate span:nth-child(3) { transition-delay: 0.3s; }
.text-reveal.animate span:nth-child(4) { transition-delay: 0.4s; }
.text-reveal.animate span:nth-child(5) { transition-delay: 0.5s; }

/* Particle system */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.7;
    animation: float-particle 10s linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-10vh) translateX(100px);
        opacity: 0;
    }
}

/* Advanced button effects */
.btn-advanced {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-advanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-advanced:hover::before {
    left: 100%;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Magnetic field effect */
.magnetic-field {
    position: relative;
}

.magnetic-field::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: conic-gradient(from 0deg, #00d4ff, #7c3aed, #00d4ff);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    animation: magnetic-rotate 3s linear infinite;
}

.magnetic-field:hover::before {
    opacity: 1;
}

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

/* Subtle gradient pulse text - replaces neon effect */
.neon-text {
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-pulse 3s ease-in-out infinite;
}

@keyframes gradient-pulse {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.9;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
}

/* Holographic effect */
.holographic {
    background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff, #06ffa5, #ffbe0b);
    background-size: 300% 300%;
    animation: holographic-shift 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes holographic-shift {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 50% 0%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 100%; }
}

/* Scroll-triggered reveals */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.320, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* CSS-only typing effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: 
        typing 3s steps(30, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* Responsive design enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .magnetic:hover {
        transform: none;
    }
    
    .morphing-card:hover {
        transform: none;
    }
    
    .btn-advanced:hover::before {
        left: -100%;
    }
}