/**
 * Micro-Interactions Xtranumerik Contrôle
 * Animations subtiles pour améliorer l'expérience utilisateur
 */

/* ========== RIPPLE EFFECT BOUTONS ========== */
.glass-button,
.btn,
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
}

.glass-button::before,
.btn::before,
.btn-primary::before,
.btn-secondary::before {
    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%);
    transition: width 0.6s, height 0.6s;
}

.glass-button:active::before,
.btn:active::before,
.btn-primary:active::before,
.btn-secondary:active::before {
    width: 300px;
    height: 300px;
    transition: width 0s, height 0s;
}

/* ========== MAGNETIC HOVER BUTTONS ========== */
@media (hover: hover) {
    .btn-primary,
    .btn-secondary,
    .glass-button {
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                    box-shadow 0.3s ease,
                    background 0.3s ease;
    }

    .btn-primary:hover {
        transform: translateY(-2px) scale(1.02);
    }

    .btn-secondary:hover {
        transform: translateY(-2px) scale(1.02);
    }
}

/* ========== SMOOTH SCROLL BEHAVIOR ========== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Offset pour header fixed */
}

/* Fallback pour navigateurs anciens */
@supports not (scroll-behavior: smooth) {
    html {
        scroll-behavior: auto;
    }
}

/* ========== GLASS CARDS HOVER ========== */
.glass-card {
    transition: transform 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(0, 168, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 168, 255, 0.2);
}

/* ========== LINK HOVER UNDERLINE ANIMATION ========== */
a:not(.btn):not(.glass-button) {
    position: relative;
    transition: color 0.3s ease;
}

a:not(.btn):not(.glass-button)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:not(.btn):not(.glass-button):hover::after {
    width: 100%;
}

/* ========== SECTION BADGE HOVER ========== */
.section-badge {
    transition: all 0.3s ease;
}

.section-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 168, 255, 0.3);
}

/* ========== IMAGE ZOOM ON HOVER ========== */
.tech-partner-logo,
.partner-logo-item img {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ========== SCROLL REVEAL STAGGER ========== */
.scroll-reveal.stagger-item:nth-child(1) {
    transition-delay: 0.1s;
}

.scroll-reveal.stagger-item:nth-child(2) {
    transition-delay: 0.2s;
}

.scroll-reveal.stagger-item:nth-child(3) {
    transition-delay: 0.3s;
}

.scroll-reveal.stagger-item:nth-child(4) {
    transition-delay: 0.4s;
}

.scroll-reveal.stagger-item:nth-child(5) {
    transition-delay: 0.5s;
}

.scroll-reveal.stagger-item:nth-child(6) {
    transition-delay: 0.6s;
}

/* ========== FOCUS VISIBLE POUR ACCESSIBILITÉ ========== */
:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 4px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 4px;
}

/* ========== LOADING SKELETON ANIMATION ========== */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0px,
        rgba(255, 255, 255, 0.2) 40px,
        rgba(255, 255, 255, 0.1) 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.2s ease-in-out infinite;
}

/* ========== PULSE SUBTLE POUR ÉLÉMENTS IMPORTANTS ========== */
@keyframes pulse-subtle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.pulse-subtle {
    animation: pulse-subtle 3s ease-in-out infinite;
}

/* ========== ICON BOUNCE ON SCROLL ========== */
@keyframes icon-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.icon-bounce {
    animation: icon-bounce 2s ease infinite;
}

/* ========== GLOW EFFECT ON HOVER ========== */
.glow-on-hover {
    position: relative;
    z-index: 0;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(
        circle at center,
        rgba(0, 168, 255, 0.3) 0%,
        transparent 70%
    );
    z-index: -1;
}

.glow-on-hover:hover::before {
    opacity: 1;
}

/* ========== REDUCE MOTION POUR ACCESSIBILITÉ ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ========== DARK MODE SUPPORT (FUTUR) ========== */
@media (prefers-color-scheme: dark) {
    /* Déjà en dark mode par défaut */
}
