/* =================
   1. ROOT VARIABLES & GLOBAL RESETS
   ================= */
:root {
    --bg-primary: #0A0A10;
    --bg-secondary: #121218; /* Légèrement plus clair */
    --accent-primary: #00BFFF; /* Deep Sky Blue */
    --accent-secondary: #8A2BE2; /* Royal Purple */
    --text-primary: #EAEAEA;
    --text-secondary: #888899;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --glow-border: conic-gradient(from 180deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, var(--accent-primary) 50deg, rgba(255, 255, 255, 0) 100deg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
}
body.nav-open {
    overflow-y: hidden; /* Empêche le scroll quand le menu mobile est ouvert */
}

/* =================
   2. FUTURISTIC FEATURES & MICRO-INTERACTIONS
   ================= */

/* --- Aurora Background & Cursor Glow --- */
/* --- Aurora Background & Cursor Glow (Version modernisée) --- */

/* 
  ÉTAPE 1 : Déclaration des propriétés personnalisées animables.
  @property indique au navigateur le type de notre variable (couleur, pourcentage...).
  Ceci est essentiel pour garantir des animations de dégradés parfaitement fluides.
*/
@property --aurora-pos-1-x {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 70%;
}
@property --aurora-pos-1-y {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 20%;
}
@property --aurora-color-1 {
  syntax: '<color>';
  inherits: false;
  initial-value: hsla(195, 100%, 50%, 0.15);
}
@property --aurora-pos-2-x {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 30%;
}
@property --aurora-pos-2-y {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 80%;
}
@property --aurora-color-2 {
  syntax: '<color>';
  inherits: false;
  initial-value: hsla(260, 100%, 50%, 0.15);
}


/* 
  ÉTAPE 2 : Application des variables et de la nouvelle animation.
  Le 'background' utilise maintenant les variables que nous avons définies.
*/

.aurora-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* Source lumineuse 1 */
        radial-gradient(ellipse at var(--aurora-pos-1-x) var(--aurora-pos-1-y), var(--aurora-color-1), transparent 50%),
        
        /* Source lumineuse 2 */
        radial-gradient(ellipse at var(--aurora-pos-2-x) var(--aurora-pos-2-y), var(--aurora-color-2), transparent 50%);
        
    z-index: -2;
    /* L'ancienne animation (rotation/zoom) est remplacée par celle-ci */
    animation: aurora-hub-anim 25s infinite ease-in-out; 
}

/* --- Network Canvas Styling --- */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 
      z-index: -1 place le canvas ENTRE le fond d'aurore (-2) 
      et le contenu de la page (0).
      On met la lueur du curseur par-dessus, à z-index: 0, 
      et le contenu de la page à z-index: 1 ou plus.
    */
    z-index: -1; 
    pointer-events: none; /* Crucial pour pouvoir cliquer à travers */
}

/* 
  ÉTAPE 3 : Définition de l'animation complexe.
  Au lieu de simplement tourner, on anime directement la position et la couleur
  de chaque source lumineuse pour un effet de flux organique.
*/
@keyframes aurora-hub-anim {
    0% {
        /* État initial */
        --aurora-pos-1-x: 70%;
        --aurora-pos-1-y: 20%;
        --aurora-color-1: hsla(195, 100%, 50%, 0.15); /* Cyan */

        --aurora-pos-2-x: 30%;
        --aurora-pos-2-y: 80%;
        --aurora-color-2: hsla(260, 100%, 50%, 0.15); /* Violet */
    }

    33% {
        /* Les sources se déplacent et la couleur change subtilement */
        --aurora-pos-1-x: 80%;
        --aurora-pos-1-y: 40%;
        --aurora-color-1: hsla(220, 100%, 60%, 0.18); /* Dérive vers un bleu plus profond */

        --aurora-pos-2-x: 20%;
        --aurora-pos-2-y: 60%;
        --aurora-color-2: hsla(280, 100%, 60%, 0.12); /* Dérive vers un magenta */
    }

    66% {
        /* Nouveau déplacement et nouvelle teinte */
        --aurora-pos-1-x: 60%;
        --aurora-pos-1-y: 70%;
        --aurora-color-1: hsla(180, 100%, 50%, 0.12); /* Revient vers un turquoise */

        --aurora-pos-2-x: 40%;
        --aurora-pos-2-y: 30%;
        --aurora-color-2: hsla(250, 100%, 60%, 0.18); /* Revient vers un indigo */
    }

    100% {
        /* Retour à l'état initial pour une boucle parfaite */
        --aurora-pos-1-x: 70%;
        --aurora-pos-1-y: 20%;
        --aurora-color-1: hsla(195, 100%, 50%, 0.15); /* Cyan */

        --aurora-pos-2-x: 30%;
        --aurora-pos-2-y: 80%;
        --aurora-color-2: hsla(260, 100%, 50%, 0.15); /* Violet */
    }
}


/* --- Le code du curseur reste inchangé --- */
#cursor-glow {
    position: fixed;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(0, 191, 255, 0.1) 0%, rgba(0, 191, 255, 0) 50%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.1s ease-out;
    z-index: 0;
}

/* --- On-Scroll Reveal Animation --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }

/* --- Glitch Effect --- */
.glitch { position: relative; color: var(--text-primary); }
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-primary); overflow: hidden;
}
.glitch::before { left: 2px; text-shadow: -2px 0 var(--accent-primary); animation: glitch-anim-1 2.5s infinite linear alternate-reverse; }
.glitch::after { left: -2px; text-shadow: -2px 0 var(--accent-secondary), 2px 2px var(--accent-primary); animation: glitch-anim-2 2s infinite linear alternate-reverse; }
@keyframes glitch-anim-1 { 0% { clip: rect(42px, 9999px, 44px, 0); } 100% { clip: rect(90px, 9999px, 98px, 0); } }
@keyframes glitch-anim-2 { 0% { clip: rect(65px, 9999px, 119px, 0); } 100% { clip: rect(40px, 9999px, 130px, 0); } }

/* =================
   3. REUSABLE COMPONENTS
   ================= */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.btn { display: inline-block; padding: 12px 28px; text-decoration: none; border-radius: 6px; font-weight: 500; transition: all 0.3s ease; position: relative; overflow: hidden; border: 1px solid transparent; }
.btn-primary { background-color: var(--accent-primary); color: var(--bg-primary); font-weight: 700; }
.btn-primary:hover { box-shadow: 0 0 25px var(--accent-primary); transform: translateY(-3px); }
.btn-nav { border-color: var(--accent-primary); color: var(--accent-primary); }
.btn-nav:hover { background-color: var(--accent-primary); color: var(--bg-primary); }

/* =================
   4. PAGE STRUCTURE & SECTIONS
   ================= */

/* --- Barre sticky --- */
.sticky-phone {
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1001;
    background-color: rgba(10, 10, 16, 0.5);
    backdrop-filter: blur(5px);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; justify-content: center; align-items: center; gap: 24px;
    font-size: 0.9rem;
}
.sticky-phone a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s ease; }
.sticky-phone a:hover { color: var(--accent-primary); }
.sticky-phone .separator { margin: 0 8px; font-weight: 400; opacity: 0.6; }

/* --- Header --- */
header {
    position: fixed; width: 100%;
    top: 38px; /* Ajusté pour la barre sticky */
    left: 0; padding: 20px 0;
    z-index: 1000;
    background: rgba(10, 10, 16, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
nav { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 45px; width: auto; transition: opacity 0.3s ease; }
.logo:hover img { opacity: 0.8; }
nav .desktop-nav { display: flex; list-style: none; gap: 40px; align-items: center; }
nav .desktop-nav a { color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
nav .desktop-nav a:hover { color: var(--accent-primary); }

/* --- Main Content --- */
main { padding-top: 140px; }
section { padding: 100px 0; }
h1, h2, h3 { font-family: var(--font-heading); }

/* --- Hero Section --- */
#hero { min-height: calc(90vh - 140px); display: flex; align-items: center; justify-content: center; text-align: center; }
#hero h1 { font-size: 3.8rem; line-height: 1.2; margin-bottom: 20px; max-width: 800px; }
#hero p { font-size: 1.2rem; color: var(--text-secondary); max-width: 650px; margin: 0 auto 40px; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 60px; font-family: var(--font-heading); }

/* --- Section Solutions --- */
.solutions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.solution-card {
    background: var(--bg-secondary);
    padding: 40px; border-radius: 12px;
    transition: all 0.4s ease;
    text-align: center;
    position: relative; /* Pour la bordure animée */
    overflow: hidden; /* Pour la bordure animée */
}
/* Bordure néon animée */
.solution-card::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 150%; height: 150%;
    background: var(--glow-border);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}
@keyframes rotate { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }
.solution-card:hover::before { opacity: 1; }
.solution-card > * { position: relative; z-index: 2; } /* Pour que le contenu soit au-dessus de la bordure */
.solution-card::after { /* Crée un fond solide sous le contenu pour cacher l'animation de la bordure */
    content: '';
    position: absolute;
    z-index: 1;
    inset: 1px; /* Espace pour la bordure */
    background: var(--bg-secondary);
    border-radius: 11px;
}
.solution-icon { font-size: 2.5rem; color: var(--accent-primary); margin-bottom: 20px; }
.solution-card h3 { color: var(--text-primary); margin-bottom: 15px; }
.solution-card p { color: var(--text-secondary); }

/* --- Section Avantages --- */
#avantages { background: var(--bg-secondary); padding: 80px 0; }
.stats-container { display: flex; justify-content: space-around; align-items: flex-start; text-align: center; flex-wrap: wrap; gap: 20px; }
.stat-item { display: flex; flex-direction: column; min-width: 250px; }
.stat-number { font-size: 4rem; font-weight: 700; font-family: var(--font-heading); color: var(--accent-primary); }
.stat-suffix { font-size: 2.5rem; color: var(--accent-primary); margin-left: 2px; }
.stat-item > span:first-of-type { display: inline-flex; align-items: baseline; justify-content: center; }
.stat-item p { color: var(--text-secondary); font-size: 1rem; margin-top: 10px; max-width: 200px; margin-left: auto; margin-right: auto; }

/* --- Section Contact --- */
#contact .section-header { text-align: center; margin-bottom: 4rem; }
#contact .section-subtitle { max-width: 600px; margin: 0.5rem auto 0; color: var(--text-secondary); }
.contact-wrapper { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3rem; align-items: flex-start; }
.contact-info { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-info h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.contact-details { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.contact-details li { display: flex; align-items: flex-start; gap: 1rem; }
.contact-details li i { font-size: 1.2rem; color: var(--accent-primary); margin-top: 4px; width: 20px; text-align: center; }
.contact-details li div strong { display: block; font-weight: 500; color: var(--text-primary); margin-bottom: 0.25rem; }
.contact-details li div a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s ease; }
.contact-details li div a:hover { color: var(--accent-primary); text-decoration: underline; }
.contact-info .btn-primary { margin-top: 1rem; align-self: flex-start; }
.contact-map { position: relative; height: 100%; min-height: 400px; border-radius: 12px; overflow: hidden; }

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: none;
    transition: none;
}
.contact-map:hover iframe { filter: none; }

/* --- Pied de page --- */
footer { padding: 40px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center; color: var(--text-secondary); }

/* =================================
   5. RESPONSIVE DESIGN & MOBILE MENU (CORRECTED SECTION)
   ================================= */

/* Par défaut, sur desktop, on cache les éléments mobiles */
.hamburger, .mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Cacher la nav desktop et afficher le hamburger sur mobile */
    nav .desktop-nav, nav .desktop-nav-btn {
        display: none;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        /* Z-index très élevé pour être TOUJOURS au-dessus de tout */
        z-index: 1010; 
        position: relative; /* Nécessaire pour que z-index soit appliqué correctement */
    }

    .hamburger span {
        width: 30px;
        height: 3px;
        background: var(--text-primary);
        border-radius: 10px;
        transition: all 0.3s linear;
        position: relative;
        transform-origin: 1px;
    }

    /* Animation du hamburger en croix quand il est actif */
    .hamburger.is-active span:nth-child(1) { transform: rotate(45deg); }
    .hamburger.is-active span:nth-child(2) { opacity: 0; transform: translateX(20px); }
    .hamburger.is-active span:nth-child(3) { transform: rotate(-45deg); }

    /* Style du panneau de navigation mobile */
    .mobile-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3rem;
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px; /* Limite la largeur sur les tablettes */
        height: 100vh;
        padding: 20px;
        background: rgba(10, 10, 16, 0.8);
        backdrop-filter: blur(15px);
        /* Z-index plus bas que le hamburger mais plus haut que le header */
        z-index: 1005;
        /* État initial : complètement caché */
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.4s;
    }

    /* État actif : visible et à sa place */
    .mobile-nav.is-active {
        transform: translateX(0);
        visibility: visible;
    }

    .mobile-nav a {
        color: var(--text-primary);
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: 600;
        font-family: var(--font-heading);
    }

    .mobile-nav .btn {
        font-size: 1.2rem;
        padding: 14px 30px;
    }

    /* Ajustements généraux pour mobile */
    .sticky-phone { gap: 12px; font-size: 0.8rem; padding: 10px 0; }
    .sticky-phone .separator { display: none; }

    main { padding-top: 120px; }
    section { padding: 60px 0; }
    .logo img { height: 35px; }

    #hero { min-height: auto; padding: 40px 0; }
    #hero h1 { font-size: 2.2rem; }
    #hero p { font-size: 1rem; }
    .section-title { font-size: 1.8rem; margin-bottom: 40px; }

    .solutions-grid { grid-template-columns: 1fr; }
    .stats-container { flex-direction: column; align-items: center; gap: 50px; }
    
    .contact-wrapper { grid-template-columns: 1fr; gap: 3rem; }
    .contact-info .btn-primary { align-self: center; }
}  
/* =================
   6. HUB PAGE STYLES
   ================= */

/* --- Lien actif spécial pour le hub dans la nav --- */
.active-hub-link {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 700;
}

/* --- Layout principal du hub --- */
#hub {
    padding-top: 60px; /* Moins d'espace en haut car le titre est déjà là */
    padding-bottom: 100px;
}
.hub-container {
    display: grid;
    grid-template-columns: 260px 1fr; /* Colonne fixe pour le filtre, le reste pour le contenu */
    gap: 40px;
    align-items: flex-start;
}

/* --- Panneau latéral de filtres --- */
.hub-sidebar {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    position: sticky; /* Le panneau reste visible au scroll */
    top: 140px; /* header height + un peu de marge */
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.hub-sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.filter-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.filter-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
}
.filter-link:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}
.filter-link.active {
    background-color: rgba(0, 191, 255, 0.1);
    color: var(--accent-primary);
}
.filter-link i {
    width: 20px;
    text-align: center;
}

/* --- Contenu principal (recherche + grille) --- */
.hub-content {
    min-width: 0; /* Correction pour flex/grid box */
}

/* --- Barre de recherche élégante --- */
.search-bar {
    position: relative;
    margin-bottom: 40px;
}
.search-bar i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none; /* L'icône n'est pas cliquable */
}
.search-bar input {
    width: 100%;
    padding: 16px 20px 16px 55px; /* Espace pour l'icône à gauche */
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}
.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.2);
}

/* --- Grille d'applications --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* --- Carte d'application (inspirée de .solution-card) --- */
.app-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    display: flex; /* Permet d'aligner le bouton en bas */
    flex-direction: column;
    border: 1px solid transparent; /* Pour la transition */
    text-align: left; /* Aligne le texte à gauche */
}
.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* On réutilise l'effet néon de .solution-card */
.app-card::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 150%; height: 150%;
    background: var(--glow-border);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.app-card:hover::before { opacity: 1; }
.app-card > * { position: relative; z-index: 2; }
.app-card::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 1px;
    background: var(--bg-secondary);
    border-radius: 11px;
}
.app-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.app-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background-color: rgba(0, 191, 255, 0.1);
    color: var(--accent-primary);
    border-radius: 8px;
}
.app-title h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-family: var(--font-heading);
}
.app-category-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.app-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    flex-grow: 1; /* Pousse le bouton en bas */
    margin-bottom: 20px;
}
.app-card .btn {
    align-self: flex-start; /* Le bouton ne prend pas toute la largeur */
}

/* ============================
   7. HUB RESPONSIVE STYLES
   ============================ */

@media (max-width: 992px) {
    .hub-container {
        grid-template-columns: 220px 1fr; /* Réduit un peu la sidebar */
        gap: 30px;
    }
}


@media (max-width: 768px) {
    .hub-container {
        grid-template-columns: 1fr; /* La sidebar passe au-dessus du contenu */
    }
    .hub-sidebar {
        position: static; /* Annule le sticky sur mobile */
        width: 100%;
    }
    .filter-list {
        flex-direction: row; /* Filtres en ligne */
        flex-wrap: wrap; /* Passage à la ligne si nécessaire */
        justify-content: center;
    }
    #hub {
        padding-top: 40px;
    }
    .app-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
    }


}