/* ============================================
   ANIMATIONS - Effets modernes et fluides
   ============================================ */

/* KEYFRAMES DE BASE */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ANIMATIONS POUR BOUTONS */

@keyframes buttonRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ANIMATIONS POUR CARTES */

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 
            0 12px 48px rgba(79, 195, 247, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
}

/* ANIMATIONS POUR BACKGROUNDS */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

@keyframes waveMove {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(50px) translateY(-30px);
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

/* ANIMATIONS POUR TEXTE */

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes letterSpacing {
    from {
        letter-spacing: -0.05em;
        opacity: 0;
    }
    to {
        letter-spacing: -0.02em;
        opacity: 1;
    }
}

/* ANIMATIONS POUR LIGNES DÃ‰CORATIVES */

@keyframes drawLine {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes slideInLine {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

/* ANIMATIONS POUR ICÃ”NES */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* CLASSES UTILITAIRES D'ANIMATION */

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* DELAYS POUR ANIMATIONS STAGGERED */

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ANIMATIONS AU SCROLL (Ã  activer avec Intersection Observer si JS autorisÃ©) */

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* HOVER EFFECTS AVANCÃ‰S */

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    filter: brightness(1.1) saturate(1.2);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* LOADING ANIMATIONS */

@keyframes loadingSpinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 195, 247, 0.2);
    border-top-color: #4FC3F7;
    border-radius: 50%;
    animation: loadingSpinner 0.8s linear infinite;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    background: #4FC3F7;
    border-radius: 50%;
    animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* MICRO-INTERACTIONS */

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(0.9);
    }
    20%, 40%, 60%, 80% {
        transform: scale(1.1);
    }
    50%, 70% {
        transform: scale(1.05);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* TRANSITIONS GLOBALES */

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* SMOOTH SCROLL */

html {
    scroll-behavior: smooth;
}

/* PRÃ‰FÃ‰RENCES UTILISATEUR - Respecter reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ANIMATIONS POUR MODALS/OVERLAYS */

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-enter {
    animation: fadeInModal 0.3s ease-out;
}

/* SKELETON LOADING */

@keyframes skeletonLoading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0px,
        #f8f8f8 40px,
        #f0f0f0 80px
    );
    background-size: 200px 100%;
    animation: skeletonLoading 1.5s infinite;
}

/* PARALLAX EFFECT (CSS only) */

.parallax {
    transform: translateZ(0);
    transition: transform 0.3s ease-out;
}

@media (hover: hover) and (pointer: fine) {
    .parallax:hover {
        transform: translateZ(0) scale(1.02);
    }
}

/* GLITCH EFFECT (subtil) */

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(79, 195, 247, 0.75),
                    -0.025em -0.05em 0 rgba(255, 152, 0, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(79, 195, 247, 0.75),
                    -0.025em -0.05em 0 rgba(255, 152, 0, 0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 rgba(79, 195, 247, 0.75),
                    0.025em 0.025em 0 rgba(255, 152, 0, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(79, 195, 247, 0.75),
                    0.025em 0.025em 0 rgba(255, 152, 0, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(79, 195, 247, 0.75),
                    0.05em 0 0 rgba(255, 152, 0, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(79, 195, 247, 0.75),
                    0.05em 0 0 rgba(255, 152, 0, 0.75);
    }
    100% {
        text-shadow: none;
    }
}

/* PERFORMANCE OPTIMIZATIONS */

.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.smooth-edges {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ANIMATIONS SPÉCIFIQUES HOME PAGE
   ============================================ */

/* Rotation ultra lente pour formes hero */
@keyframes rotateUltraSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Float lent pour formes décoratives */
@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-10px) translateX(5px); }
    50% { transform: translateY(-15px) translateX(0px); }
    75% { transform: translateY(-10px) translateX(-5px); }
}

/* Pulse subtil pour shapes */
@keyframes pulseSubtle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* Rotation standard pour CTA */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fade message alternés hero */
@keyframes fadeMessage {
    0% { opacity: 0; visibility: hidden; transform: translate(-50%, -40%); }
    5%, 20% { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
    25%, 100% { opacity: 0; visibility: hidden; transform: translate(-50%, -60%); }
}

/* Pulse glass pour bouton hero */
@keyframes btnPulseGlass {
    0%, 100% {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 
            0 8px 32px rgba(79, 195, 247, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
        transform: translateY(0) scale(1);
    }
    50% {
        background: rgba(255, 255, 255, 0.32);
        border-color: rgba(255, 255, 255, 0.5);
        box-shadow: 
            0 10px 40px rgba(79, 195, 247, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.5),
            0 0 30px rgba(79, 195, 247, 0.2);
        transform: translateY(-2px) scale(1.02);
    }
}

/* Pulse badge évaluation TDAH */
@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 152, 0, 0.6);
    }
}
