/* ===================================
   ANIMATIONS AVANCÉES & INTERACTIONS
   =================================== */

/* Scroll reveal animations */
@keyframes fadeInUp {
    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);
    }
}

/* Pulse effect for CTA */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 99, 235, 0.5);
    }
}

.btn-primary {
    animation: pulse 2s ease-in-out infinite;
}

/* Gradient animation for hero title */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-corporate h1 {
    background: linear-gradient(135deg, #fff 0%, #94a3b8 50%, #fff 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fix pour mobile - désactive l'effet gradient sur petits écrans */
@media (max-width: 768px) {
    .hero-corporate h1 {
        background: none !important;
        -webkit-background-clip: initial !important;
        -webkit-text-fill-color: initial !important;
        background-clip: initial !important;
        color: white !important;
        animation: none !important;
    }
}

/* Hover effects for cards */
.expertise-card,
.service-card-corporate,
.portfolio-item-corporate,
.contact-method {
    position: relative;
    overflow: hidden;
}

.expertise-card::before,
.service-card-corporate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.expertise-card:hover::before,
.service-card-corporate:hover::before {
    left: 100%;
}

/* Number animation for process steps */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.step-number {
    animation: rotateIn 0.6s ease-out;
}

/* Smooth transitions for all interactive elements */
a, button, .btn-primary, .btn-secondary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Link underline animation */
.service-link,
.portfolio-link-corporate {
    position: relative;
    display: inline-block;
}

.service-link::after,
.portfolio-link-corporate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.service-link:hover::after,
.portfolio-link-corporate:hover::after {
    width: 100%;
}

/* Stagger animation for grid items */
.expertise-card:nth-child(1) { animation-delay: 0.1s; }
.expertise-card:nth-child(2) { animation-delay: 0.2s; }
.expertise-card:nth-child(3) { animation-delay: 0.3s; }

.service-card-corporate:nth-child(1) { animation-delay: 0.1s; }
.service-card-corporate:nth-child(2) { animation-delay: 0.2s; }
.service-card-corporate:nth-child(3) { animation-delay: 0.3s; }
.service-card-corporate:nth-child(4) { animation-delay: 0.4s; }

/* Parallax effect for sections */
@media (prefers-reduced-motion: no-preference) {
    .section-header {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .expertise-card,
    .service-card-corporate {
        animation: fadeInUp 0.8s ease-out backwards;
    }
}

/* Loading state for lazy images */
.lazy, .lazy-video {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy.loaded, .lazy-video.loaded {
    opacity: 1;
}

/* Glow effect on hover for important elements */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(37, 99, 235, 0.6);
    }
}

.btn-primary:hover {
    animation: glow 1.5s ease-in-out infinite;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Micro-interactions for buttons */
.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, 
        var(--dark-light) 0%, 
        var(--gray) 50%, 
        var(--dark-light) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Tooltip animations */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 0.5rem 1rem;
    background: var(--dark);
    color: var(--text);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Responsive animations */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .btn-primary {
        animation: none;
    }
    
    /* Faster transitions on mobile */
    * {
        transition-duration: 0.2s !important;
    }
}

/* Print styles */
@media print {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    #hero-canvas {
        display: none;
    }
}
