/* ==================== FADE IN ANIMATIONS ==================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.3s ease forwards; /* Réduit de 0.8s à 0.3s pour LCP */
    will-change: transform, opacity; /* Optimiser les animations */
    contain: layout; /* Évite CLS */
}

/* Hero elements - pas d'animation pour optimiser LCP */
.hero-title.fade-in-up,
.hero-text .fade-in-up,
.hero .hero-subtitle-optimized.fade-in-up,
.hero .hero-description-optimized.fade-in-up,
.hero .hero-cta.fade-in-up,
.hero .trial-offer.fade-in-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInRight 0.8s ease forwards;
    will-change: transform, opacity; /* Optimiser les animations */
    contain: layout; /* Évite CLS */
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== REVEAL ON SCROLL ==================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ==================== PULSE ANIMATION ==================== */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* ==================== SHIMMER EFFECT ==================== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ==================== GLOW EFFECT ==================== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.8);
    }
}

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

/* ==================== BOUNCE ANIMATION ==================== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* ==================== ROTATE ANIMATION ==================== */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 20s linear infinite;
}

/* ==================== SCALE HOVER ==================== */
.scale-hover {
    transition: transform 0.3s ease;
}

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

/* ==================== SLIDE IN ANIMATIONS ==================== */
.slide-in-left {
    opacity: 0;
    transform: translateX(-100px);
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(100px);
    animation: slideInRight 0.8s ease forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== TYPING ANIMATION ==================== */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing {
    overflow: hidden;
    border-right: 3px solid;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* ==================== GRADIENT ANIMATION ==================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ==================== SHAKE ANIMATION ==================== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* ==================== FLIP ANIMATION ==================== */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

.flip {
    animation: flip 1s ease-in-out;
}

/* ==================== WAVE ANIMATION ==================== */
@keyframes wave {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(20px) translateY(-10px);
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

.wave {
    animation: wave 3s ease-in-out infinite;
}

/* ==================== BLUR IN ==================== */
@keyframes blurIn {
    from {
        filter: blur(10px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 1s ease forwards;
}

/* ==================== LOADING ANIMATION ==================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #4F46E5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

/* ==================== PROGRESS BAR ANIMATION ==================== */
@keyframes progressLoad {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-animate {
    animation: progressLoad 2s ease-in-out;
}

/* ==================== SMOOTH TRANSITIONS ==================== */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-slow {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== HOVER LIFT ==================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ==================== 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.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

/* ==================== PARALLAX ELEMENTS ==================== */
.parallax {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ==================== SMOOTH SCROLL ==================== */
html {
    scroll-behavior: smooth;
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}