/* ==========================================================================
   1. VARIABLES ET THÈMES SÉCURISÉS (Charte HARRY.U)
   ========================================================================== */
:root, [data-theme="light"] {
    --bg-main: #f4f6f9;
    --bg-surface: rgba(255, 255, 255, 0.65);
    --bg-drawer: rgba(255, 255, 255, 0.95);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-blur: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 32px rgba(31, 38, 135, 0.07);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --font-sans: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --service-color: #7000ff;
    --badge-color: #7000ff;
}

[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-surface: rgba(17, 24, 39, 0.6);
    --bg-drawer: rgba(13, 18, 30, 0.98);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.07);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --badge-color: #a855f7;
}

/* Base & Reset global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Arrière-plan luminescent */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.background-decor .circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
}

[data-theme="dark"] .background-decor .circle { opacity: 0.22; }
.circle-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: #00e5ff; }
.circle-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: #7000ff; }
.circle-3 { top: 40%; left: 50%; width: 35vw; height: 35vw; background: #ff007f; transform: translate(-50%, -50%); }

/* ==========================================================================
   3. BARRE DE NAVIGATION PRINCIPALE (NAVBAR)
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.navbar .logo { font-weight: 800; font-size: 1.4rem; letter-spacing: 1px; }
.navbar .logo i { color: #7000ff; margin-right: 6px; }
.navbar .logo-dot { color: #ff007f; }

.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-main); background: rgba(112, 0, 255, 0.1); }

.nav-actions { display: flex; align-items: center; gap: 1.2rem; }
.icon-btn, .avatar-btn { background: transparent; border: 1px solid var(--border-color); cursor: pointer; color: var(--text-main); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* Conteneur de l'avatar corrigé */
.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #7000ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #e2e8f0;
}
.avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   4. HERO HEADER
   ========================================================================== */
.hero-section { padding: 4rem 5% 2rem; text-align: center; max-width: 900px; margin: 0 auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px; background: rgba(112, 0, 255, 0.12);
    color: var(--badge-color); padding: 0.5rem 1.2rem; border-radius: 100px; font-size: 0.85rem; font-weight: 600; margin-bottom: 1.5rem; border: 1px solid rgba(112, 0, 255, 0.2);
}
.hero-section h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.hero-section p { color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; }

/* ==========================================================================
   5. GRILLE BENTO INTERACTIVE ASYMÉTRIQUE
   ========================================================================== */
.main-content { padding: 2rem 5% 6rem; }
.container { max-width: 1400px; margin: 0 auto; }
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(160px, auto); gap: 20px; }

.bento-item {
    background: var(--bg-surface); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.bento-w2 { grid-column: span 2; }
.bento-h2 { grid-row: span 2; min-height: 340px; }
.bento-content { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.bento-icon { font-size: 2.2rem; margin-bottom: auto; color: var(--text-main); opacity: 0.85; }
.bento-item h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.bento-item p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.4; }
.bento-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: rgba(255, 255, 255, 0.25); }

.bento-item::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), rgba(255,255,255,0.06), transparent 40%); pointer-events: none;
}

/* ==========================================================================
   6. NETTOYAGE COMPLET DE L'OVERLAY (PLUS DE FLOU ADÉQUAT !)
   ========================================================================== */
.bento-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4); /* Assombrissement tamisé uniforme chic sans flou */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.bento-drawer-overlay.active { opacity: 1; pointer-events: auto; }

.bento-drawer {
    position: fixed; top: 0; right: 0; width: 480px; max-width: 100vw; height: 100vh;
    background: var(--bg-drawer); border-left: 1px solid var(--border-color); box-shadow: var(--shadow-lg); z-index: 999;
    display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.bento-drawer.active { transform: translateX(0); }

.drawer-header { padding: 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); }
.drawer-brand-zone { display: flex; align-items: center; gap: 16px; }
.drawer-icon-box { width: 46px; height: 46px; border-radius: 14px; background: rgba(112, 0, 255, 0.1); color: var(--service-color); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
#drawer-title { font-size: 1.5rem; font-weight: 800; }
.drawer-close-btn { background: transparent; border: none; cursor: pointer; font-size: 1.3rem; color: var(--text-muted); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }

.drawer-body { padding: 32px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 28px; }
.drawer-section h4 { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.drawer-text-large { font-size: 1.05rem; line-height: 1.6; color: var(--text-main); }
.drawer-text-specs { font-size: 0.95rem; line-height: 1.6; color: var(--text-muted); background: rgba(0, 0, 0, 0.02); padding: 16px; border-radius: 14px; }
[data-theme="dark"] .drawer-text-specs { background: rgba(255, 255, 255, 0.02); }

.drawer-footer { padding: 24px 32px 32px; border-top: 1px solid var(--border-color); }
.btn-drawer-launch { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 16px; background: var(--service-color); color: #ffffff; text-decoration: none; font-weight: 600; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

/* ==========================================================================
   7. DROPDOWNS & MENUS PROFIL
   ========================================================================== */
.dropdown-container { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 12px); right: 0; background: var(--bg-drawer); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 8px; min-width: 160px; box-shadow: var(--shadow-lg); display: none; flex-direction: column; gap: 4px; z-index: 1000;
}
.dropdown-menu.active { display: flex; animation: fadeInDropdown 0.2s ease-out; }
.dropdown-menu button { background: transparent; border: none; color: var(--text-main); padding: 8px 12px; text-align: left; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 0.9rem; width: 100%; font-family: var(--font-sans); }
.dropdown-menu button:hover { background: rgba(112, 0, 255, 0.1); }

.profile-menu { min-width: 260px; padding: 16px; }
.profile-menu-header { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; }
.profile-menu-header img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #7000ff; }
.profile-info { display: flex; flex-direction: column; gap: 2px; }
.profile-name { font-weight: 700; font-size: 0.95rem; }
.profile-status { font-size: 0.8rem; color: #ffd700; font-weight: 600; }
.profile-menu-divider { height: 1px; background: var(--border-color); margin: 8px 0; }
.profile-menu-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.profile-menu-links a, .profile-menu-links button { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-muted); background: transparent; border: none; padding: 10px 12px; border-radius: 10px; width: 100%; text-align: left; cursor: pointer; font-size: 0.9rem; font-family: var(--font-sans); }
.profile-menu-links a:hover, .profile-menu-links button:hover { color: var(--text-main); background: rgba(112, 0, 255, 0.08); }
.profile-menu-links .logout-btn { color: #ff4d4d; }

/* ==========================================================================
   8. CORRECTION DRUSTIQUE DU HUB RESEAU (EXTIRPÉ DU BAS DE PAGE)
   ========================================================================== */
#network-hub-container,
.network-exploration-zone,
body > div:has(> h2) {
    display: none !important; /* Disparaît complètement du flux normal de la page */
}

/* Devient une vraie fenêtre Pop-up centrée uniquement lorsqu'il est actif */
#network-hub-container.active,
.network-exploration-zone.active {
    display: block !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: calc(100% - 40px);
    max-width: 800px;
    max-height: 85vh;
    background: var(--bg-drawer) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 28px !important;
    padding: 32px !important;
    box-shadow: var(--shadow-lg), 0 20px 50px rgba(0,0,0,0.4) !important;
    z-index: 10005 !important;
    overflow-y: auto !important;
}
