/* =============================================
   ANIMATIONS & EFFECTS PROFESSIONNELLES - VERSION AMÉLIORÉE
   Animations optimisées pour une meilleure performance
============================================= */

/* =============================================
   CUSTOM PROFESSIONAL VARIABLES
============================================= */
:root {
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
    --duration-slower: 0.8s;
}

/* =============================================
   ANIMATIONS D'ENTRÉE PROFESSIONNELLES
============================================= */
@keyframes professionalFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes professionalFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes professionalFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes professionalFadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes luxuryZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes elegantRotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* =============================================
   EFFETS DE SURVOL AMÉLIORÉS
============================================= */
.hover-lift {
    transition: all var(--duration-normal) var(--smooth);
    will-change: transform, box-shadow;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.12),
        0 10px 20px rgba(0, 0, 0, 0.08);
}

.hover-grow {
    transition: all var(--duration-normal) var(--smooth);
    will-change: transform;
}

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

.hover-glow {
    position: relative;
    transition: all var(--duration-normal) var(--smooth);
    will-change: box-shadow, transform;
}

.hover-glow:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 20px rgba(37, 99, 235, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

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

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s var(--ease-out-expo);
    z-index: 1;
}

.hover-shine:hover::before {
    left: 100%;
}

/* =============================================
   ANIMATION DU NOM DU HÉROS
============================================= */
@keyframes heroNameGlow {
    0%, 100% {
        filter: brightness(1);
        transform: scale(1);
    }
    50% {
        filter: brightness(1.1);
        transform: scale(1.02);
    }
}

.hero-name-highlight {
    animation: heroNameGlow 3s ease-in-out infinite;
    will-change: filter, transform;
}

/* =============================================
   ANIMATIONS DE GRADIENT
============================================= */
@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 6s ease infinite;
}

/* =============================================
   ANIMATIONS DE PULSATION
============================================= */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05);
    }
    45% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* =============================================
   ANIMATIONS DE VAGUE
============================================= */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

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

@keyframes blinkCursor {
    0%, 50% { 
        opacity: 1; 
    }
    51%, 100% { 
        opacity: 0; 
    }
}

.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid;
    animation: typing 3s steps(40, end), blinkCursor 1s infinite;
}

/* =============================================
   ANIMATIONS DE CHARGEMENT
============================================= */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce-loading {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.bounce-loading {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: bounce-loading 1.4s infinite ease-in-out both;
}

.bounce-loading:nth-child(1) {
    animation-delay: -0.32s;
}

.bounce-loading:nth-child(2) {
    animation-delay: -0.16s;
}

/* =============================================
   EFFET DE RIPPLE
============================================= */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.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%);
    animation: ripple 0.6s ease-out;
}

/* =============================================
   ANIMATIONS DE GLISSEMENT
============================================= */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =============================================
   ANIMATIONS DE CARTES
============================================= */
@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.card-float {
    animation: cardFloat 6s ease-in-out infinite;
}

/* =============================================
   ANIMATIONS D'ICÔNES
============================================= */
@keyframes iconSpin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

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

.icon-spin:hover {
    animation: iconSpin 1s ease-in-out;
}

.icon-bounce:hover {
    animation: iconBounce 0.5s ease-in-out;
}

/* =============================================
   ANIMATIONS DE TEXTE
============================================= */
@keyframes textGlow {
    0% {
        text-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(37, 99, 235, 0.8), 
                     0 0 30px rgba(37, 99, 235, 0.6);
    }
    100% {
        text-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    }
}

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

@keyframes textPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.text-pop:hover {
    animation: textPop 0.3s ease-in-out;
}

/* =============================================
   MORPHING ANIMATIONS
============================================= */
@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

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

/* =============================================
   INTERACTIONS DE BOUTONS
============================================= */
@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.btn:active {
    animation: buttonPress 0.2s ease-out;
}

/* =============================================
   ANIMATIONS DE NOTIFICATION
============================================= */
@keyframes notificationSlideIn {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

.notification {
    animation: notificationSlideIn 0.5s var(--ease-out-expo);
}

.notification.removing {
    animation: notificationSlideOut 0.3s var(--ease-out-expo);
}

/* =============================================
   BARRE DE PROGRESSION
============================================= */
@keyframes progressFill {
    0% {
        width: 0;
    }
    100% {
        width: var(--progress-width, 100%);
    }
}

.progress-animated {
    animation: progressFill 2s var(--ease-out-expo);
}

/* =============================================
   ANIMATIONS DE MODAL
============================================= */
@keyframes modalZoomIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes modalZoomOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

.modal-content {
    animation: modalZoomIn 0.3s var(--ease-out-expo);
}

.modal-content.closing {
    animation: modalZoomOut 0.2s var(--ease-out-expo);
}

/* =============================================
   EFFETS DE PARALLAXE
============================================= */
.parallax {
    transition: transform 0.1s linear;
    will-change: transform;
}

.parallax-slow {
    transform: translateY(calc(var(--scroll) * -0.3px));
}

.parallax-medium {
    transform: translateY(calc(var(--scroll) * -0.5px));
}

.parallax-fast {
    transform: translateY(calc(var(--scroll) * -0.8px));
}

/* =============================================
   ANIMATIONS DE FOCUS
============================================= */
@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    }
}

.form-control:focus {
    animation: focusGlow 0.3s var(--ease-out-expo);
}

/* =============================================
   CLASSES D'ANIMATION SUPPLÉMENTAIRES
============================================= */
.fade-in {
    animation: professionalFadeInUp 0.8s ease-out;
}

.fade-in-delayed {
    animation: professionalFadeInUp 0.8s ease-out 0.3s both;
}

.slide-in-left {
    animation: slideInFromLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInFromRight 0.8s ease-out;
}

.slide-in-bottom {
    animation: slideInFromBottom 0.8s ease-out;
}

.zoom-in {
    animation: luxuryZoomIn 0.5s ease-out;
}

.rotate-in {
    animation: elegantRotateIn 0.8s ease-out;
}

/* =============================================
   OPTIMISATIONS DE PERFORMANCE
============================================= */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

/* Force l'accélération matérielle */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* =============================================
   SUPPORT POUR MOUVEMENT RÉDUIT
============================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hover-lift:hover,
    .hover-grow:hover,
    .hover-glow:hover {
        transform: none;
    }
}

/* =============================================
   ANIMATIONS SPÉCIFIQUES AU DARK MODE
============================================= */
body.dark-theme .hero-name-highlight {
    animation: heroNameGlow 3s ease-in-out infinite;
    filter: brightness(1.2);
}

body.dark-theme .hover-glow:hover {
    box-shadow: 
        0 0 30px rgba(96, 165, 250, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.3);
}

/* =============================================
   EFFET DE SCINTILLEMENT
============================================= */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.sparkle {
    position: relative;
}

.sparkle::before,
.sparkle::after {
    content: '✦';
    position: absolute;
    top: -10px;
    animation: sparkle 2s linear infinite;
}

.sparkle::before {
    left: -10px;
    animation-delay: 0s;
}

.sparkle::after {
    right: -10px;
    animation-delay: 1s;
}

/* =============================================
   GLOW EFFECT
============================================= */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.8), 
                    0 0 30px rgba(37, 99, 235, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
    }
}

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