/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    --bg-dark: #0d0e15;
    --text-main: #ffffff;
    --text-muted: #a0a0b5;
    --accent-purple: rgba(138, 43, 226, 0.8);
    --accent-blue: rgba(56, 189, 248, 0.8);
    --container-width: 1200px;
    --header-height: 80px;
}

* {
    box-sizing: border-box;
}

/* =========================================
   STYLES COMMUNS (Globaux)
   ========================================= */
   
html {
    height: 100%;
}
body {
    font-family: 'Inter', 'Poppins', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-dark);
    
    /* Gradients immersifs fixes */
    background-image: 
        radial-gradient(circle at 15% 85%, rgba(138, 43, 226, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(56, 189, 248, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(13, 14, 21, 1) 0%, var(--bg-dark) 100%);
    
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    
}

/* Texture de grain */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Fondu de transition footer */
body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;              /* ← CORRIGÉ : 100vw au lieu de 100% */
    height: 15vh;
    background: linear-gradient(to bottom, transparent, var(--bg-dark) 95%);
    pointer-events: none;
    z-index: 5;
}

/* =========================================
   STRUCTURE & LAYOUT
   ========================================= */
main {
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 2;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

@media (min-width: 768px) {
    .container {
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* =========================================
   CLASSE UNIFORME POUR LES SECTIONS
   ========================================= */
.section-standard {
    padding-top:40px; 
    padding-bottom: 40px;
    margin-bottom: 60px; /* Espace mobile */
}

/* Le Hero (première section de page) */
.page-hero {
    padding-top: 100px !important; 
    padding-bottom: 20px !important;
    margin-bottom: 20px !important;
}

/* Ajustements Desktop */
@media (min-width: 992px) {
    .section-standard {
        margin-bottom: 00px; /* Plus d'air sur grand écran */
    }
    
    .page-hero {
        padding-top: 100px !important;
        margin-bottom: 20px !important;
    }
}

/* Empêche un trou vide en fin de page avant le footer */
section:last-of-type, 
.section-standard:last-of-type {
    margin-bottom: 0;
}

/* =========================================
   COMPOSANTS DE TITRE GÉNÉRIQUES
   ========================================= */
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    margin-bottom: 30px;
    position: relative;
}

/* --- BADGE STYLE GLASS AVEC EFFET NÉON --- */
.page-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 2px; /* Espace pour la bordure néon */
    border-radius: 50px;
    margin-bottom: 30px;
    overflow: hidden; /* Coupe ce qui dépasse du néon */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

/* L'élément interne qui contient le texte */
.badge-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    background: #0d0e15; /* Doit correspondre à ton bg-dark */
    padding: 4px 14px 4px 4px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Le faisceau néon (caché par défaut) */
.page-badge::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: conic-gradient(transparent, #7c5cff, #9b82f3, transparent 30%);
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Animation au hover */
.page-badge:hover::before {
    opacity: 1;
    animation: rotateNeon 2s linear infinite;
}

.page-badge:hover {
    transform: translateY(-2px);
}

@keyframes rotateNeon {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Éléments du badge */
.badge-tag {
    background: linear-gradient(135deg, #7c5cff, #9b82f3);
    color: white;
    padding: 2px 12px;
    border-radius: 50px;
    margin-right: 12px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.badge-text {
    color: #ffffff;
    font-weight: 500;
    font-size: 0.85rem;
}

.page-title {
    color: var(--text-main);
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    max-width: 950px;
    margin: 0 auto;
    letter-spacing: -1px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.9rem, 2vw, 1rem);
    max-width: 800px;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    margin: 10px 0 0 0;
}

/* =========================================
   LIENS GLOBAUX
   ========================================= */
a {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 1);
}

/* =========================================
   UTILS & MEDIA
   ========================================= */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.text-center { text-align: center; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   SCROLLBAR PERSONNALISÉE
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.5);
}


/* =========================================
   CYBER ADMIN BAR - GLASSMORPHISM (FIXED)
   ========================================= */
#cyber-admin-bar {
    position: sticky;
    top: 0;
    z-index: 999999;
    height: 40px;
    width: 100%;
    /* Couleur violette translucide cohérente avec ton thème */
    background: rgba(49, 28, 61, 0.6); 
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(155, 130, 243, 0.3);
    font-family: 'Inter', sans-serif;
    color: #fff;
}

.bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Boutons & Liens */
.bar-btn {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    border-radius: 8px;
    transition: 0.3s;
}

.bar-btn:hover {
    background: rgba(155, 130, 243, 0.25);
    color: #fff;
}

/* Section Utilisateur */
.user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 0 12px;
    height: 100%; /* Important pour la zone de survol */
    position: relative;
    transition: 0.3s;
}

.user-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bar-text {
    font-size: 13px;
    letter-spacing: 0.3px;
}

.bar-text strong {
    color: #9b82f3; /* Met en valeur le prénom/nom */
}

/* Style de l'Avatar */
.avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #9b82f3;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(155, 130, 243, 0.3);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dropdown Néon */
.cyber-dropdown {
    position: absolute;
    top: 40px; /* Aligné pile au bas de la barre */
    right: 0;
    width: 210px;
    background: rgba(15, 16, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 130, 243, 0.3);
    border-top: none; /* Fusion visuelle avec la barre */
    border-radius: 0 0 12px 12px;
    padding: 10px;
    display: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

/* LE PONT INVISIBLE (Indispensable pour le confort) */
.cyber-dropdown::before {
    content: "";
    position: absolute;
    top: -10px; 
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.user-trigger:hover .cyber-dropdown {
    display: block;
    animation: slideInFast 0.2s ease-out;
}

.cyber-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: 0.2s;
}

.cyber-dropdown a:hover {
    background: rgba(155, 130, 243, 0.15);
    color: #9b82f3;
    padding-left: 18px;
}

.cyber-dropdown a.logout:hover {
    background: rgba(255, 75, 75, 0.15);
    color: #ff4b4b;
}

.dropdown-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Animations */
@keyframes slideInFast {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pour mobile */
@media (max-width: 600px) {
    .bar-text { display: none; }
    .bar-inner { padding: 0 10px; }
}

/* Organisation des sections */
.bar-left, .bar-right, .bar-center {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
}

/* Séparateur discret */
.bar-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 5px;
}

/* Item avec dropdown (comme le bouton Nouveau) */
.bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    padding: 0 10px;
    height: 100%;
    position: relative;
    transition: 0.3s;
}
.bar-item:hover { background: rgba(255, 255, 255, 0.05); }
.bar-item:hover .cyber-dropdown { display: block; }

/* Badge Statut avec animation Pulse */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 204, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 204, 0.2);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #00ffcc;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ffcc;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 255, 204, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 204, 0); }
}

/* On réutilise ton style de dropdown pour les nouveaux menus */
.cyber-dropdown {
    top: 40px; /* Aligné au bas de la barre */
    /* ... reste de ton CSS précédent ... */
}

.status-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 12px;
    border-radius: 30px;
    border: 1px solid rgba(155, 130, 243, 0.2);
}

/* Couleurs du point Pulse */
.pulse-dot.mode-active { background: #00ffcc; box-shadow: 0 0 8px #00ffcc; animation: pulse-green 2s infinite; }
.pulse-dot.mode-maintenance { background: #ff4b4b; box-shadow: 0 0 8px #ff4b4b; animation: pulse-red 2s infinite; }

/* Switch Style */
.switch-btn {
    width: 34px;
    height: 18px;
    background: #333;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
}

.switch-handle {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 2px;
    transition: 0.3s;
}

.switch-btn.is-on { background: #9b82f3; }
.switch-btn.is-on .switch-handle { left: 16px; }

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 255, 204, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 204, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 75, 75, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0); }
}

@media (max-width: 991px) {
    body::after {
        display: none;
    }
}