/* ============================================
   SGTCI — EFFETS MODERNES 2026
   UI/UX Design — Animations & Interactions
   ============================================ */

/* ============================================
   VARIABLES D'ANIMATION
   ============================================ */
:root {
    --ease-expo:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-back:    cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast:   0.25s;
    --duration-mid:    0.5s;
    --duration-slow:   0.8s;
    --red:    #E30613;
    --red-glow: rgba(227, 6, 19, 0.35);
    --blue:   #002B56;
    --gold:   #FF6B35;
}

/* ============================================
   SCROLLBAR MODERNE
   ============================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--red), var(--blue));
    border-radius: 5px;
}

/* ============================================
   BARRE DE PROGRESSION SCROLL
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
    background-size: 200% 100%;
    z-index: 99999;
    animation: gradientFlow 3s linear infinite;
    pointer-events: none;
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 10px var(--red-glow);
}
@keyframes gradientFlow {
    0%   { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   CURSEUR PERSONNALISÉ
   ============================================ */
.cursor-dot {
    position: fixed;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease, background 0.2s ease;
    will-change: left, top;
}
.cursor-ring {
    position: fixed;
    width: 38px; height: 38px;
    border: 1.5px solid rgba(227, 6, 19, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99997;
    transform: translate(-50%, -50%);
    will-change: left, top, width, height;
    transition: width 0.3s var(--ease-expo),
                height 0.3s var(--ease-expo),
                border-color 0.3s ease,
                background 0.3s ease;
}
.cursor-ring.is-hovering {
    width: 60px; height: 60px;
    border-color: var(--red);
    background: rgba(227, 6, 19, 0.06);
}
.cursor-ring.is-clicking {
    width: 20px; height: 20px;
    background: rgba(227, 6, 19, 0.2);
}
@media (max-width: 768px) {
    .cursor-dot, .cursor-ring { display: none !important; }
}

/* ============================================
   PAGE LOADER
   ============================================ */
.page-loader {
    position: fixed;
    inset: 0;
    background: #030d1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.6s var(--ease-smooth),
                visibility 0.6s var(--ease-smooth);
}
.page-loader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-brand {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 10px;
    color: #fff;
    margin-bottom: 8px;
    animation: fadeSlideUp 0.7s var(--ease-expo) both;
}
.loader-brand em {
    font-style: normal;
    color: var(--red);
}
.loader-sub {
    font-size: 0.72rem;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    margin-bottom: 40px;
    animation: fadeSlideUp 0.7s var(--ease-expo) 0.1s both;
}
.loader-track {
    width: 220px; height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    animation: fadeSlideUp 0.5s var(--ease-expo) 0.2s both;
}
.loader-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 2px;
    box-shadow: 0 0 12px var(--red-glow);
    animation: loaderFill 1.6s var(--ease-smooth) 0.3s forwards;
}
@keyframes loaderFill {
    0%   { width: 0%; }
    60%  { width: 80%; }
    100% { width: 100%; }
}

/* ============================================
   HERO — EFFETS AVANCÉS
   ============================================ */

/* Le hero garde son layout original intact — on n'écrase aucun positionnement */
.hero {
    overflow: hidden; /* clip les formes flottantes */
}

/* Canvas particules — inséré par JS APRÈS .hero-overlay dans le DOM
   z-index: 0 = au-dessus de .hero-overlay (auto) grâce à l'ordre DOM,
   en dessous de .hero-content (z-index: 1 dans style.css) */
#particles-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Titre hero — animation mot par mot */
.hero-title .word-wrap {
    overflow: hidden;
    display: inline-block;
    margin-right: 0.28em;
}
.hero-title .word-inner {
    display: inline-block;
    transform: translateY(110%);
    opacity: 0;
    animation: wordReveal 0.9s var(--ease-expo) both;
}
@keyframes wordReveal {
    to { transform: translateY(0); opacity: 1; }
}

/* Ligne décorative sous le titre hero */
.hero-title-line {
    display: block;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold));
    margin: 16px auto 0;
    border-radius: 3px;
    box-shadow: 0 0 14px var(--red-glow);
    animation: lineExpand 0.8s var(--ease-expo) 0.9s both;
}
@keyframes lineExpand {
    to { width: 80px; }
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp 0.8s var(--ease-expo) 0.7s both;
}
.hero-buttons {
    opacity: 0;
    animation: fadeSlideUp 0.8s var(--ease-expo) 0.9s both;
}

/* Badge flottant */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 6px 18px;
    font-size: 0.78rem;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeSlideUp 0.7s var(--ease-expo) 0.2s both;
}
.hero-badge::before {
    content: '';
    width: 8px; height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
    animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* Formes géométriques flottantes */
.hero-shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.07;
    animation: floatShape var(--float-dur, 8s) ease-in-out infinite alternate;
}
@keyframes floatShape {
    from { transform: translate(0, 0) rotate(0deg); }
    to   { transform: translate(var(--tx, 30px), var(--ty, -30px)) rotate(180deg); }
}

/* ============================================
   HEADER GLASSMORPHISM
   ============================================ */
.header {
    transition: background 0.4s ease,
                backdrop-filter 0.4s ease,
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}
.header.is-scrolled {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(255,255,255,0.5), 0 8px 32px rgba(0,0,0,0.12) !important;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

/* Nav links — underline animé */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px; left: 50%;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.35s var(--ease-expo);
    box-shadow: 0 0 8px var(--red-glow);
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ============================================
   BOUTONS — RIPPLE + GLOW + MAGNETIC
   ============================================ */
.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.15s ease,
                box-shadow 0.3s ease;
}
/* Ripple */
.btn .btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: rippleAnim 0.65s linear;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* Glow au hover */
.btn-primary:hover {
    box-shadow: 0 0 0 2px rgba(227,6,19,0.3),
                0 12px 40px rgba(227,6,19,0.4),
                0 4px 12px rgba(0,0,0,0.2);
}
.btn-secondary:hover {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5),
                0 8px 30px rgba(255,255,255,0.15);
}

/* Shimmer interne sur btn-primary */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.25),
        transparent
    );
    transform: skewX(-20deg);
    transition: none;
    pointer-events: none;
}
.btn-primary:hover::before {
    animation: btnShimmer 0.7s ease;
}
@keyframes btnShimmer {
    to { left: 125%; }
}

/* ============================================
   CARTES EXPERTISE — 3D TILT + GLOW
   ============================================ */
.expertise-card,
.value-card {
    position: relative;
    transition: box-shadow 0.35s ease;
    will-change: transform;
    transform-style: preserve-3d;
}

/* Bordure lumineuse */
.expertise-card::before,
.value-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(227,6,19,0.5) 50%,
        transparent 60%
    );
    background-size: 300% 300%;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    pointer-events: none;
}
.expertise-card:hover::before,
.value-card:hover::before {
    opacity: 1;
    animation: borderGlow 2s linear infinite;
}
@keyframes borderGlow {
    0%   { background-position: 0% 0%; }
    100% { background-position: 300% 300%; }
}

.expertise-card:hover,
.value-card:hover {
    box-shadow:
        0 20px 60px rgba(0,0,0,0.15),
        0 0 0 1px rgba(227,6,19,0.15),
        0 0 30px rgba(227,6,19,0.05);
}

/* Icône — rotation au hover */
.expertise-icon,
.value-icon {
    transition: transform 0.5s var(--ease-back),
                background 0.3s ease,
                box-shadow 0.3s ease;
}
.expertise-card:hover .expertise-icon,
.value-card:hover .value-icon {
    transform: scale(1.15) rotateY(15deg);
    box-shadow: 0 10px 30px rgba(227,6,19,0.3);
}

/* ============================================
   STATS — GRADIENT TEXT
   ============================================ */
.stat-number {
    background: linear-gradient(135deg, var(--red) 0%, var(--gold) 50%, var(--red) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradientShift 4s linear infinite;
}
@keyframes textGradientShift {
    to { background-position: 200% center; }
}

/* ============================================
   SECTION REVEAL — ANIMATIONS
   ============================================ */
.reveal-el {
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-expo),
                transform var(--duration-slow) var(--ease-expo);
}
.reveal-el.from-up    { transform: translateY(50px); }
.reveal-el.from-left  { transform: translateX(-50px); }
.reveal-el.from-right { transform: translateX(50px); }
.reveal-el.from-scale { transform: scale(0.88); }
.reveal-el.from-fade  { transform: none; }

.reveal-el.visible {
    opacity: 1;
    transform: translate(0) scale(1) !important;
}

/* Stagger delays */
.reveal-el[data-delay="1"] { transition-delay: 0.1s; }
.reveal-el[data-delay="2"] { transition-delay: 0.2s; }
.reveal-el[data-delay="3"] { transition-delay: 0.3s; }
.reveal-el[data-delay="4"] { transition-delay: 0.4s; }
.reveal-el[data-delay="5"] { transition-delay: 0.5s; }
.reveal-el[data-delay="6"] { transition-delay: 0.6s; }

/* ============================================
   SECTION DIVIDER — GLOW ANIMÉ
   ============================================ */
.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
    background-size: 200% 100%;
    border-radius: 3px;
    margin: 12px auto 0;
    box-shadow: 0 0 12px var(--red-glow);
    animation: gradientFlow 3s linear infinite;
}

/* ============================================
   SECTION TITLES — GRADIENT
   ============================================ */
.section-title {
    position: relative;
    display: inline-block;
}

/* ============================================
   HERO SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
    animation: scrollBounce 2.2s ease-in-out infinite;
}
@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%       { transform: translateY(12px); opacity: 0.4; }
}

/* ============================================
   CTA SECTION — GRADIENT ANIMÉ
   ============================================ */
.cta-section {
    position: relative;
}
.cta-section .cta-overlay {
    animation: heroAmbient 7s ease-in-out infinite alternate;
}

/* ============================================
   NEWS CARDS
   ============================================ */
.news-card {
    transition: transform 0.35s var(--ease-expo),
                box-shadow 0.35s ease;
}
.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15),
                0 0 0 1px rgba(227,6,19,0.1);
}

/* ============================================
   WHATSAPP — PULSE AMÉLIORÉ
   ============================================ */
.whatsapp-float {
    animation: waPulse 2.5s ease-in-out infinite !important;
}
@keyframes waPulse {
    0%, 100% { box-shadow: 0 5px 20px rgba(37,211,102,0.4); }
    50%       { box-shadow: 0 5px 20px rgba(37,211,102,0.4),
                            0 0 0 12px rgba(37,211,102,0.1); }
}

/* ============================================
   TAGS / BADGES
   ============================================ */
.news-highlight-badge {
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* ============================================
   FOOTER LINKS HOVER
   ============================================ */
.footer-links a {
    position: relative;
    padding-left: 0;
    transition: padding-left 0.25s ease, color 0.25s ease;
}
.footer-links a::before {
    content: '→';
    position: absolute;
    left: -18px;
    opacity: 0;
    transition: opacity 0.25s ease, left 0.25s ease;
    color: var(--red);
}
.footer-links a:hover {
    padding-left: 18px;
    color: var(--red) !important;
}
.footer-links a:hover::before {
    opacity: 1;
    left: 0;
}

/* ============================================
   KEYFRAMES UTILITAIRES
   ============================================ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .cursor-dot, .cursor-ring { display: none !important; }
}
