/* --- 1. VARIABLES & THÈMES --- */
:root {
    /* Mode Normal : Neon Night */
    --main-bg: #0f0f12;
    --card-bg: #1e1e24;
    --text-color: #ffffff;
    --text-dim: #a0a0a0;
    --accent-color: #ff007a; /* Rose Neon */
    --accent-glow: 0 0 15px rgba(255, 0, 122, 0.4);
    --nav-bg: #16161a;
    --border-color: #33333b;
    --chat-them: #3d3d45;
    --font-main: 'Inter', 'Segoe UI', sans-serif;
    --danger: #e74c3c;
    --success: #2ecc71;
}

/* --- 2. OVERRIDE MODE DISCRET (Rapport de Gestion) --- */
body.discret {
    --main-bg: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-dim: #7f8c8d;
    --accent-color: #34495e; /* Bleu Gris Corporate */
    --accent-glow: none;
    --nav-bg: #ffffff;
    --border-color: #dcdde1;
    --chat-them: #ecf0f1;
    --font-main: 'Arial', 'Verdana', sans-serif;
}

/* --- 3. RESET & BASE --- */
* { box-sizing: border-box; transition: background 0.2s, color 0.2s, transform 0.2s; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--main-bg);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* --- 4. LAYOUT & GRILLES --- */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.grid-commu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 25px;
}

/* Cartes Utilisateurs */
.user-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.user-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.photo-frame {
    width: 100%;
    height: 280px;
    background: #111;
    position: relative;
    overflow: hidden;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dist-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

.info-card {
    padding: 18px;
    text-align: center;
}

/* --- 5. BOUTONS --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: var(--accent-color);
    color: white;
    box-shadow: var(--accent-glow);
    text-align: center;
    font-size: 0.9rem;
}

.btn:hover { opacity: 0.9; }

/* --- 6. SYSTÈME DE MULTI-CHAT (FENÊTRES MULTIPLES) --- */

/* Le container qui aligne les fenêtres en bas à droite */
#mini-chats-container {
    position: fixed;
    bottom: 0;
    right: 20px;
    display: flex;
    flex-direction: row-reverse; /* Aligne de droite à gauche */
    gap: 15px;
    align-items: flex-end;
    z-index: 10000;
    pointer-events: none; /* Permet de cliquer derrière si vide */
}

.mini-chat-window {
    width: 280px;
    height: 380px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    pointer-events: auto; /* Active le clic sur la fenêtre */
}

/* Quand une fenêtre est réduite */
.mini-chat-window.minimized {
    height: 42px;
}

.mini-chat-header {
    background: #c0392b; /* Rouge signature */
    color: white;
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.mini-chat-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #0f0f12;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-chat-footer {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 5px;
}

.mini-chat-footer input {
    flex: 1;
    background: #000;
    border: 1px solid #444;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Bulles mini-chat */
.mini-msg {
    max-width: 85%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.mini-msg.me {
    background: #c0392b;
    color: white;
    align-self: flex-end;
}

.mini-msg.them {
    background: #2c2c34;
    align-self: flex-start;
}

/* --- 7. MODALS & LIGHTBOX --- */
.modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center; justify-content: center;
}

.modal-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
}

/* --- 8. SPÉCIFICITÉS MODE DISCRET (RG) --- */

/* Floutage automatique des images */
body.discret img {
    filter: blur(40px) grayscale(100%);
    opacity: 0.2;
}

/* Boutons sobres style Windows */
body.discret .btn {
    background: #e1e1e1 !important;
    color: #333 !important;
    border: 1px solid #adadad !important;
    box-shadow: none !important;
    border-radius: 2px !important;
}

/* On change la couleur du chat en bleu corporate */
body.discret .mini-chat-header { background: #34495e; }
body.discret .mini-msg.me { background: #34495e; }
body.discret .mini-chat-body { background: #f9f9f9; }
body.discret .mini-msg.them { background: #eee; color: #333; }

/* Masquage des éléments sensibles */
body.discret .role-tag { color: var(--text-dim); }

.timer-box {
    background: #f1c40f;
    color: #000;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* En mode discret, on le rend plus sobre */
body.discret .timer-box {
    background: #34495e;
    color: #fff;
    animation: none;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background: #95a5a6; /* Gris par défaut */
    transition: 0.3s;
}

/* Optionnel : petit effet pulsant pour les gens en ligne */
.status-dot.online-pulse {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    animation: pulse-green 2s infinite;
}

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

/* Style du lien Admin : discret mais distinct */
.admin-link { 
    color: #f1c40f !important; 
    border: 1px solid rgba(241, 196, 15, 0.3); 
    padding: 5px 10px; 
    border-radius: 6px; 
    transition: 0.3s;
}

.admin-link:hover { 
    background: rgba(241, 196, 15, 0.1); 
    border-color: #f1c40f; 
}

/* La pastille de notification Admin */
.admin-badge {
    background: #f1c40f !important;
    color: #000 !important;
    border-color: var(--nav-bg) !important;
    font-weight: bold;
}

.verify-banner {
    background: linear-gradient(90deg, rgba(255, 0, 128, 0.1), rgba(52, 152, 219, 0.1));
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.verify-content { display: flex; align-items: center; gap: 15px; }
.verify-icon { font-size: 2rem; }
.verify-text strong { color: var(--accent-color); display: block; margin-bottom: 5px; }
.verify-text p { color: var(--text-dim); font-size: 0.85rem; margin: 0; }

.btn-verify {
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.3s;
}
.btn-verify:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255, 0, 128, 0.4); }
/* MESSAGERIE */
.messenger-container {
    display: flex;
    max-width: 1200px;
    height: 80vh;
    margin: 20px auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
}

.conv-list { width: 300px; border-right: 1px solid var(--border-color); background: rgba(0,0,0,0.2); }
.list-header { padding: 20px; font-weight: bold; border-bottom: 1px solid var(--border-color); color: var(--accent-color); }
.conv-item { display: block; padding: 15px; text-decoration: none; color: white; border-bottom: 1px solid rgba(255,255,255,0.05); }
.conv-item.active { background: rgba(255, 0, 128, 0.1); border-left: 3px solid var(--accent-color); }

.chat-window { flex: 1; display: flex; flex-direction: column; background: #080808; }
.chat-header { padding: 15px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border-color); font-weight: bold; }
.chat-body { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

/* BULLES DE MESSAGE */
.msg-bubble { 
    max-width: 70%; 
    padding: 10px 15px; 
    border-radius: 15px; 
    font-size: 0.95rem; 
    position: relative; 
}
.msg-bubble.me { align-self: flex-end; background: var(--accent-color); color: white; border-bottom-right-radius: 2px; }
.msg-bubble.them { align-self: flex-start; background: #222; color: #eee; border-bottom-left-radius: 2px; }

/* MESSAGE SYSTÈME */
.msg-bubble.system { 
    align-self: center; 
    background: rgba(46, 204, 113, 0.1) !important; 
    border: 1px solid #2ecc71; 
    color: #2ecc71; 
    max-width: 90%; 
    text-align: center;
    font-style: italic;
}

.msg-time { display: block; font-size: 0.7rem; opacity: 0.5; margin-top: 5px; }

.chat-input { padding: 20px; display: flex; gap: 10px; background: #000; }
.chat-input input { flex: 1; background: #111; border: 1px solid #333; color: white; padding: 12px; border-radius: 8px; }

/* BADGE VÉRIFIÉ */
.badge-verified {
    color: #3498db;
    font-weight: bold;
    margin-left: 5px;
    text-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

















/* Mode Standard (Sombre/Neon) */
:root { --bg: #0a0a0b; --text: #fff; --accent: #ff0080; }

body { background: var(--bg); color: var(--text); transition: 0.3s; }

/* --- MODE DISCRET (Type Office/Admin) --- */
body.discret {
    --bg: #ffffff;
    --text: #333333;
    --accent: #2c3e50;
    filter: grayscale(0.5); /* Optionnel : rend tout plus sobre */
}

body.discret .main-header { background: #f8f9fa; border-bottom: 1px solid #ddd; }
body.discret .nav-menu a { color: #555 !important; }
body.discret .btn-primary { background: #7f8c8d !important; box-shadow: none; }
/* Cache les éléments trop explicites en mode discret */
body.discret .hero-logo { display: none; }