/* ================================
   ANIMATIONS & TRANSITIONS
   Système d'animations avancées pour Novania
   ================================ */

/* ==================
   REVEAL ON SCROLL
   ================== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Variations de reveal */
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

.reveal-fade {
    opacity: 0;
    transition: opacity 1s ease;
}

.reveal-fade.active {
    opacity: 1;
}

/* Délais pour effet en cascade */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ==================
   CARD ANIMATIONS
   ================== */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-animate {
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.card-animate:nth-child(1) { animation-delay: 0.05s; }
.card-animate:nth-child(2) { animation-delay: 0.1s; }
.card-animate:nth-child(3) { animation-delay: 0.15s; }
.card-animate:nth-child(4) { animation-delay: 0.2s; }
.card-animate:nth-child(5) { animation-delay: 0.25s; }
.card-animate:nth-child(6) { animation-delay: 0.3s; }
.card-animate:nth-child(7) { animation-delay: 0.35s; }
.card-animate:nth-child(8) { animation-delay: 0.4s; }
.card-animate:nth-child(9) { animation-delay: 0.45s; }

/* ==================
   HOVER EFFECTS
   ================== */
.hover-lift {
    /* Pas de transition sur l'élément de base */
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-glow {
    position: relative;
    /* Pas de transition sur l'élément de base */
}

.hover-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.6);
    pointer-events: none;
    /* Pas de transition sur l'état de base */
}

.hover-glow:hover::after {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.hover-scale {
    /* Pas de transition sur l'élément de base */
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-tilt {
    /* Pas de transition sur l'élément de base */
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
    transition: transform 0.3s ease;
}

/* ==================
   BUTTON ANIMATIONS
   ================== */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-animated:hover::before {
    width: 300px;
    height: 300px;
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnimation 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnimation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.btn-bounce {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ==================
   PARALLAX EFFECTS
   ================== */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.parallax-slow {
    transition: transform 0.5s ease-out;
}

.parallax-fast {
    transition: transform 0.05s ease-out;
}

/* ==================
   FLOATING ELEMENTS
   ================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-slow {
    animation: float 8s ease-in-out infinite;
}

.floating-fast {
    animation: float 4s ease-in-out infinite;
}

/* Variations avec délai */
.floating-delay-1 { animation-delay: 0.5s; }
.floating-delay-2 { animation-delay: 1s; }
.floating-delay-3 { animation-delay: 1.5s; }

/* ==================
   GRADIENT ANIMATIONS
   ================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* ==================
   SHINE EFFECTS
   ================== */
.shine {
    position: relative;
    overflow: hidden;
}

.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
    );
    /* Pas de transition sur l'état de base */
}

.shine:hover::before {
    left: 100%;
    transition: left 0.7s ease;
}

.shine-continuous::before {
    animation: shineMove 3s infinite;
}

@keyframes shineMove {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ==================
   FADE TRANSITIONS
   ================== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ==================
   SLIDE TRANSITIONS
   ================== */
.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-in-up {
    animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-in-down {
    animation: slideInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==================
   ROTATE ANIMATIONS
   ================== */
@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate-continuous {
    animation: rotate360 3s linear infinite;
}

.rotate-slow {
    animation: rotate360 6s linear infinite;
}

.rotate-hover {
    /* Pas de transition sur l'élément de base */
}

.rotate-hover:hover {
    transform: rotate(360deg);
    transition: transform 0.3s ease;
}

/* ==================
   ELASTIC EFFECTS
   ================== */
@keyframes elasticIn {
    0% {
        transform: scale(0);
    }
    55% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.elastic-in {
    animation: elasticIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==================
   FLIP ANIMATIONS
   ================== */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ==================
   BOUNCE ENTRANCE
   ================== */
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.36, 0, 0.66, -0.56);
}

/* ==================
   SHAKE ANIMATION
   ================== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ==================
   GLOW PULSE
   ================== */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.8), 0 0 30px rgba(52, 152, 219, 0.6);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* ==================
   TEXT ANIMATIONS
   ================== */
@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-animate {
    animation: textFadeIn 0.8s ease-out backwards;
}

.text-animate-delay-1 { animation-delay: 0.1s; }
.text-animate-delay-2 { animation-delay: 0.2s; }
.text-animate-delay-3 { animation-delay: 0.3s; }

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 3s steps(40, end);
}

/* ==================
   UNDERLINE ANIMATION
   ================== */
.underline-animated {
    position: relative;
    display: inline-block;
}

.underline-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    /* Pas de transition sur l'état de base */
}

.underline-animated:hover::after {
    width: 100%;
    transition: width 0.3s ease;
}

/* ==================
   PROGRESS INDICATOR
   ================== */
@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-animated {
    animation: progress 2s ease-out;
}

/* ==================
   BLUR IN
   ================== */
@keyframes blurIn {
    from {
        filter: blur(10px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 1s ease-out;
}

/* ==================
   PERFORMANCE OPTIMIZATIONS
   ================== */
.will-animate {
    will-change: transform, opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==================
   RESPONSIVE ADJUSTMENTS
   ================== */
@media (max-width: 768px) {
    /* Réduire les animations sur mobile pour les performances */
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        transition-duration: 0.5s;
    }
    
    .hover-lift:hover {
        transform: translateY(-5px);
    }
    
    /* Désactiver certaines animations complexes sur mobile */
    .parallax-layer {
        transform: none !important;
    }
    
    .hover-tilt:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Respecter les préférences d'accessibilité */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================
   UTILITY CLASSES
   ================== */
.no-animation {
    animation: none !important;
    transition: none !important;
}

.animation-paused {
    animation-play-state: paused;
}

.smooth-transition {
    /* Transition uniquement au hover */
}

.smooth-transition:hover {
    transition: all 0.3s ease;
}

.smooth-transition-slow {
    /* Transition uniquement au hover */
}

.smooth-transition-slow:hover {
    transition: all 0.6s ease;
}

.smooth-transition-fast {
    /* Transition uniquement au hover */
}

.smooth-transition-fast:hover {
    transition: all 0.15s ease;
}

