/* ============================================
   STYLES POUR LES ANIMATIONS AVANCÉES
   ============================================ */

/* Curseur personnalisé */
.custom-cursor {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.15s ease;
}

/* Curseur personnalisé désactivé par défaut - décommentez pour activer */
/* @media (min-width: 968px) {
    * {
        cursor: none !important;
    }
} */

/* Loader de page */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Effet de gradient animé sur les boutons */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: var(--y, 50%);
    left: var(--x, 50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Effet de shine sur les cartes */
.service-card,
.portfolio-card {
    position: relative;
    overflow: hidden;
}

.service-card::after,
.portfolio-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: transform 0.6s;
}

.service-card:hover::after,
.portfolio-card:hover::after {
    transform: rotate(45deg) translate(50%, 50%);
}

/* Animation de pulse pour les badges */
.featured-badge,
.popular-badge {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* Effet de float sur les icônes */
.service-icon {
    animation: float 3s ease-in-out infinite;
}

.service-card:nth-child(1) .service-icon { animation-delay: 0s; }
.service-card:nth-child(2) .service-icon { animation-delay: 0.3s; }
.service-card:nth-child(3) .service-icon { animation-delay: 0.6s; }
.service-card:nth-child(4) .service-icon { animation-delay: 0.9s; }
.service-card:nth-child(5) .service-icon { animation-delay: 1.2s; }
.service-card:nth-child(6) .service-icon { animation-delay: 1.5s; }

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

/* Effet de glow sur le texte gradient */
.gradient-text {
    position: relative;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
    50% {
        text-shadow: 0 0 40px rgba(118, 75, 162, 0.8);
    }
}

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

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

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* Effet de reveal sur les images */
.reveal-image {
    position: relative;
    overflow: hidden;
}

.reveal-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, white, transparent);
    transform: translateX(-100%);
    animation: reveal 2s ease-in-out;
}

@keyframes reveal {
    to {
        transform: translateX(100%);
    }
}

/* Effet de morphing sur les stats */
.stat-number,
.stat-card-number {
    display: inline-block;
    transition: all 0.3s ease;
}

.stat-item:hover .stat-number,
.stat-card:hover .stat-card-number {
    transform: scale(1.1) rotate(5deg);
}

/* Animation des liens avec underline */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Effet de zoom sur les portfolio tags */
.portfolio-tag {
    transition: all 0.3s ease;
}

.portfolio-card:hover .portfolio-tag {
    transform: scale(1.1);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* Animation des features avec slide-in */
.about-feature {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.6s ease forwards;
}

.about-feature:nth-child(1) { animation-delay: 0.1s; }
.about-feature:nth-child(2) { animation-delay: 0.3s; }
.about-feature:nth-child(3) { animation-delay: 0.5s; }

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

/* Effet de particules - Override */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Animation du CTA avec wave */
.cta {
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: wave 3s linear infinite;
}

@keyframes wave {
    to {
        transform: translateX(50%);
    }
}

/* Effet de rotation 3D sur hover */
.service-card {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.service-card:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Animation du formulaire avec focus */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Effet de bounce sur les boutons */
.btn:active {
    animation: bounce 0.3s ease;
}

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

/* Animation de counter avec effet scale */
.stat-number.counting,
.stat-card-number.counting {
    animation: countScale 0.3s ease;
}

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

/* Effet de blur au scroll */
.blur-on-scroll {
    transition: filter 0.3s ease;
}

.scrolled .blur-on-scroll {
    filter: blur(2px);
}

/* Animation des social links */
.social-link {
    position: relative;
    transition: all 0.3s ease;
}

.social-link::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.social-link:hover::before {
    opacity: 1;
}

/* Effet de ripple sur les cartes */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.service-card:active::before,
.portfolio-card:active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.5);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* Animation des features icons */
.feature-icon {
    transition: all 0.3s ease;
}

.about-feature:hover .feature-icon {
    transform: rotate(360deg) scale(1.1);
}

/* Effet de gradient animé sur le background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(270deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Effet de parallax sur les sections */
.parallax-section {
    transform-style: preserve-3d;
}

.parallax-content {
    transform: translateZ(20px);
}

/* Animation des testimonials */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Effet de typewriter sur le hero */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary);
    animation: typing 4s steps(50) 1s normal both, blinkCursor 0.75s step-end infinite;
}

@keyframes blinkCursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary);
    }
}

/* Responsive - Désactiver certaines animations sur mobile */
@media (max-width: 768px) {
    .custom-cursor,
    .cursor-follower {
        display: none;
    }

    * {
        cursor: auto !important;
    }

    .service-card:hover,
    .portfolio-card:hover {
        transform: translateY(-5px);
    }

    .parallax-section,
    .parallax-content {
        transform: none !important;
    }
}

/* Performance - Optimisation GPU */
.service-card,
.portfolio-card,
.btn,
.stat-card {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Smooth transitions partout */
* {
    -webkit-tap-highlight-color: transparent;
}
