/*
 * ANIMATIONS ULTRA MODERNES - Fastclean.lu
 * Système complet d'animations et micro-interactions
 */

/* ========================================
   KEYFRAMES - ANIMATIONS DE BASE
   ======================================== */

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

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

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

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

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

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

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* ========================================
   SCROLL REVEAL ANIMATIONS
   ======================================== */

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Délais pour effet 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; }

/* ========================================
   GLASSMORPHISM
   ======================================== */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
}

/* ========================================
   HOVER EFFECTS AVANCÉS
   ======================================== */

.hover-lift {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hover-glow {
    position: relative;
    transition: all 0.3s ease;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, #2dd4bf, #fbbf24, #2dd4bf);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-glow:hover::before {
    opacity: 1;
    animation: gradientShift 3s ease infinite;
}

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

.hover-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

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

/* ========================================
   GRADIENT ANIMÉ - DÉSACTIVÉ
   ======================================== */

/* .gradient-animated {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #2dd4bf, #14b8a6);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
} */

.gradient-text {
    background: linear-gradient(45deg, #2dd4bf, #fbbf24, #2dd4bf);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animation gradient désactivée sur mobile pour performance */
@media (min-width: 769px) {
    .gradient-text {
        animation: gradientShift 3s ease infinite;
    }
}

/* ========================================
   BOUTON CTA FLOTTANT
   ======================================== */

.floating-cta {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.4);
    will-change: transform, opacity;
    transition: transform 0.3s ease;
}

.floating-cta:hover {
    transform: scale(1.1);
}

/* Animation float désactivée sur mobile pour performance */
@media (min-width: 769px) {
    .floating-cta {
        animation: float 3s ease-in-out infinite;
    }
    .floating-cta:hover {
        animation: none;
    }
}

/* ========================================
   SCROLL PROGRESS BAR
   ======================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #2dd4bf, #fbbf24);
    width: 0%;
    z-index: 9999;
    will-change: width;
}

/* ========================================
   COMPTEURS ANIMÉS
   ======================================== */

.counter {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-accent);
    font-family: var(--font-heading);
}

/* ========================================
   SKELETON LOADING
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ========================================
   CURSEUR PERSONNALISÉ
   ======================================== */

.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.15s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    width: 40px;
    height: 40px;
    background: rgba(45, 212, 191, 0.2);
}

/* ========================================
   MENU MOBILE MODERNE
   ======================================== */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 2rem;
}

.mobile-menu-link {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-overlay.active .mobile-menu-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu-link:nth-child(4) { transition-delay: 0.4s; }
.mobile-menu-link:nth-child(5) { transition-delay: 0.5s; }

/* ========================================
   DARK MODE
   ======================================== */

.dark-mode-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--color-bg);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--color-text-light);
}

.dark-mode-toggle::after {
    content: '🌙';
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: var(--color-accent);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.dark-mode-toggle.active::after {
    content: '☀️';
    left: calc(100% - 27px);
}

body.dark-mode {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #e2e8f0;
    --color-text-light: #cbd5e1;
    --color-text-heading: #ffffff;
    background-color: #0f172a;
    color: #e2e8f0;
}

body.dark-mode .header {
    background-color: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .header.scrolled {
    background-color: rgba(30, 41, 59, 0.98);
}

body.dark-mode .glass-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .glass-card:hover {
    background: rgba(30, 41, 59, 0.95);
}

body.dark-mode .btn-secondary {
    background-color: rgba(45, 212, 191, 0.9);
    color: #0f172a;
}

body.dark-mode .btn-primary {
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.3);
}

body.dark-mode footer {
    background-color: #1e293b !important;
}

body.dark-mode .nav-link {
    color: #e2e8f0;
}

body.dark-mode .nav-link:hover {
    color: var(--color-accent);
}

/* ========================================
   SHAPES FLOTTANTS (BLOBS)
   ======================================== */

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(45deg, #2dd4bf, #14b8a6);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

/* ========================================
   RESPONSIVE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    .floating-cta {
        bottom: 20px;
        right: 20px;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }

    .counter {
        font-size: 2rem;
    }

    .mobile-menu-link {
        font-size: 2rem;
    }

    .blob {
        width: 200px;
        height: 200px;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.animate-on-scroll {
    opacity: 0;
}

.no-scroll {
    overflow: hidden;
}

/* ========================================
   BUBBLES ANIMATION
   ======================================== */

.bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -100px;
    border-radius: 50%;
    opacity: 0;
    animation: bubble-rise 12s infinite ease-in-out;
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 255, 255, 0.6),
        rgba(45, 212, 191, 0.3) 40%,
        rgba(45, 212, 191, 0.1));
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(45, 212, 191, 0.3);
    border: 1px solid rgba(45, 212, 191, 0.3);
    will-change: transform, opacity;
}

.bubble:nth-child(1) { width: 60px; height: 60px; left: 5%; animation-delay: 0s; }
.bubble:nth-child(2) { width: 40px; height: 40px; left: 15%; animation-delay: 2s; }
.bubble:nth-child(3) { width: 80px; height: 80px; left: 25%; animation-delay: 4s; }
.bubble:nth-child(4) { width: 50px; height: 50px; left: 40%; animation-delay: 1s; }
.bubble:nth-child(5) { width: 35px; height: 35px; left: 55%; animation-delay: 3s; }
.bubble:nth-child(6) { width: 70px; height: 70px; left: 65%; animation-delay: 5s; }
.bubble:nth-child(7) { width: 45px; height: 45px; left: 75%; animation-delay: 2.5s; }
.bubble:nth-child(8) { width: 55px; height: 55px; left: 85%; animation-delay: 1.5s; }
.bubble:nth-child(9) { width: 30px; height: 30px; left: 90%; animation-delay: 4.5s; }
.bubble:nth-child(10) { width: 65px; height: 65px; left: 95%; animation-delay: 3.5s; }
.bubble:nth-child(11) { width: 25px; height: 25px; left: 10%; animation-delay: 5.5s; }
.bubble:nth-child(12) { width: 38px; height: 38px; left: 35%; animation-delay: 0.5s; }

@keyframes bubble-rise {
    0% {
        transform: translateX(0) translateY(0) scale(0.8);
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    50% {
        transform: translateX(20px) translateY(-50vh) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translateX(-10px) translateY(-110vh) scale(0.9);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    /* Désactiver toutes les bulles sur mobile pour performance */
    .bubble {
        display: none;
    }

    .blob {
        display: none;
    }
}
