/* public/css/matrix.css  –  Thème Matrix Hacker Sombre */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@300;400;600;700&family=Orbitron:wght@400;700;900&display=swap');

/* ─── VARIABLES ─────────────────────────── */
:root {
    --bg-base:        #000000;
    --bg-surface:     #050f05;
    --bg-card:        #060e06;
    --bg-elevated:    #0a1a0a;
    --bg-input:       #020902;

    --green-bright:   #00ff41;
    --green-medium:   #00cc35;
    --green-dim:      #00882a;
    --green-faint:    #003d13;
    --green-ghost:    #001a08;

    --text-primary:   #c8ffc8;
    --text-secondary: #7dbd7d;
    --text-muted:     #3a6b3a;
    --text-link:      #00ff41;

    --border:         rgba(0, 255, 65, 0.15);
    --border-bright:  rgba(0, 255, 65, 0.4);
    --border-glow:    rgba(0, 255, 65, 0.6);

    --shadow-glow:    0 0 20px rgba(0, 255, 65, 0.15);
    --shadow-bright:  0 0 40px rgba(0, 255, 65, 0.3);

    --font-mono:      'Share Tech Mono', monospace;
    --font-body:      'Rajdhani', sans-serif;
    --font-display:   'Orbitron', sans-serif;

    --sidebar-width:  260px;
    --header-height:  60px;
    --radius:         4px;
    --radius-lg:      8px;
}

/* ─── RESET & BASE ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scanlines effect */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        rgba(0,0,0,0.06) 2px,
        rgba(0,0,0,0.06) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Matrix rain canvas */
#matrix-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
}

/* ─── TYPOGRAPHY ─────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--green-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
}
a:hover {
    color: var(--green-bright);
    text-shadow: 0 0 8px var(--green-bright);
}

code, pre, .mono {
    font-family: var(--font-mono);
}

/* ─── SCROLLBAR ──────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--green-faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

/* ─── LAYOUT ─────────────────────────────── */
.app-wrapper {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-areas:
        "header header header"
        "sidebar main aside";
    grid-template-rows: var(--header-height) 1fr;
    grid-template-columns: var(--sidebar-width) 1fr 260px;
    min-height: 100vh;
    gap: 0;
}

/* ─── HEADER ─────────────────────────────── */
.app-header {
    grid-area: header;
    height: var(--header-height);
    background: rgba(0,8,0,0.95);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--green-faint), var(--shadow-glow);
    max-width: 100vw;
    overflow: visible;
    box-sizing: border-box;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--green-bright);
    text-shadow: 0 0 20px var(--green-bright), 0 0 40px var(--green-bright);
    letter-spacing: 0.1em;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo span { color: var(--text-secondary); }

.search-bar {
    flex: 1;
    max-width: 420px;
    position: relative;
}
.search-bar input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.45rem 1rem 0.45rem 2.2rem;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar input:focus {
    border-color: var(--green-dim);
    box-shadow: 0 0 10px rgba(0,255,65,0.1);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0; /* ne pas rétrécir - garder les icônes visibles */
}

.icon-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}
.icon-btn:hover {
    border-color: var(--green-dim);
    color: var(--green-bright);
    box-shadow: 0 0 10px rgba(0,255,65,0.2);
}
.icon-btn .badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--green-bright);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: var(--font-mono);
    min-width: 16px; height: 16px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
}

.avatar-sm {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    object-fit: cover;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}
.avatar-sm:hover {
    border-color: var(--green-dim);
    box-shadow: 0 0 8px rgba(0,255,65,0.3);
}

/* ── Logo flexible ── */
.logo {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .header-actions { gap: .3rem; }
    .icon-btn { width: 32px; height: 32px; font-size: .9rem; }
    .avatar-sm { width: 30px; height: 30px; }
    .hamburger-btn { font-size: 1.1rem; padding: .25rem .35rem; }
    .app-header { padding: 0 .6rem; gap: .4rem; }
}

/* ─── SIDEBAR ────────────────────────────── */
.app-sidebar {
    grid-area: sidebar;
    width: var(--sidebar-width);
    background: rgba(0,6,0,0.8);
    border-right: 1px solid var(--border);
    padding: 1rem 0.75rem;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.nav-section-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.75rem 0.5rem 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius);
    margin-bottom: 2px;
    font-size: 0.9rem;
    transition: all 0.15s;
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
}
.nav-item:hover {
    background: var(--green-ghost);
    color: var(--green-bright);
    border-color: var(--border);
}
.nav-item.active {
    background: var(--green-ghost);
    color: var(--green-bright);
    border-color: var(--border);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 25%; bottom: 25%;
    width: 2px;
    background: var(--green-bright);
    box-shadow: 0 0 6px var(--green-bright);
    border-radius: 2px;
}
.nav-item .icon { font-size: 1rem; width: 18px; text-align: center; }
.nav-item .label { flex: 1; }
.nav-item .count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    background: var(--green-faint);
    color: var(--green-medium);
    padding: 1px 6px;
    border-radius: 3px;
}

/* ─── MAIN CONTENT ───────────────────────── */
.app-main {
    grid-area: main;
    padding: 1.25rem;
    max-width: 680px;
    width: 100%;
    justify-self: center;
}

/* ─── RIGHT ASIDE ────────────────────────── */
.app-aside {
    grid-area: aside;
    width: 260px;
    padding: 1rem 0.75rem;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

/* ─── CARDS & SURFACES ───────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s;
}
.card:hover { border-color: rgba(0,255,65,0.25); }

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--green-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─── POST COMPOSER ──────────────────────── */
.composer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.composer-top {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.composer textarea {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    resize: none;
    height: 80px;
    outline: none;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}
.composer textarea:focus {
    border-color: var(--green-dim);
    box-shadow: inset 0 0 10px rgba(0,255,65,0.05);
}
.composer textarea::placeholder { color: var(--text-muted); }

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.composer-tools { display: flex; gap: 0.35rem; }
.composer-tool {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px; height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.composer-tool:hover { color: var(--green-bright); border-color: var(--green-dim); }

/* ─── BUTTONS ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: transparent;
    border-color: var(--green-medium);
    color: var(--green-bright);
    box-shadow: 0 0 10px rgba(0,255,65,0.1);
}
.btn-primary:hover {
    background: rgba(0,255,65,0.08);
    border-color: var(--green-bright);
    box-shadow: 0 0 20px rgba(0,255,65,0.2);
    color: var(--green-bright);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--green-dim); color: var(--green-bright); }

.btn-danger {
    background: transparent;
    border-color: rgba(255, 40, 40, 0.4);
    color: #ff4444;
}
.btn-danger:hover { background: rgba(255,40,40,0.08); border-color: #ff4444; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.7rem; }
.btn-lg { padding: 0.65rem 1.5rem; font-size: 0.9rem; }

/* ─── POST CARD ──────────────────────────── */
.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.post:hover { border-color: rgba(0,255,65,0.25); }

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}

.avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-lg { width: 80px; height: 80px; }

.post-author .name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.post-author .meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.post-content {
    padding: 0 1rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.post-media {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.post-actions {
    display: flex;
    border-top: 1px solid var(--border);
    padding: 0;
}

.post-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    border-right: 1px solid var(--border);
}
.post-action:last-child { border-right: none; }
.post-action:hover { color: var(--green-bright); background: rgba(0,255,65,0.04); }
.post-action.liked { color: var(--green-bright); }

/* ─── FORMS ──────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}
.form-label .required { color: var(--green-bright); margin-left: 3px; }

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    border-color: var(--green-dim);
    box-shadow: 0 0 0 2px rgba(0,255,65,0.08);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: rgba(255,40,40,0.5); }

.form-hint {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}
.form-error {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #ff4444;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ─── AUTH PAGES ─────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0,80,20,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(0,60,15,0.1) 0%, transparent 60%),
        var(--bg-base);
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: rgba(0,8,0,0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}
.auth-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green-bright), transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo h1 {
    font-size: 1.8rem;
    text-shadow: 0 0 30px var(--green-bright);
    margin-bottom: 0.25rem;
}
.auth-logo p {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* ─── ALERTS ─────────────────────────────── */
.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid;
}
.alert-success {
    background: rgba(0,255,65,0.06);
    border-color: var(--green-faint);
    color: var(--green-medium);
}
.alert-error {
    background: rgba(255,40,40,0.06);
    border-color: rgba(255,40,40,0.25);
    color: #ff6666;
}
.alert-info {
    background: rgba(0,100,200,0.06);
    border-color: rgba(0,100,200,0.25);
    color: #6699ff;
}

/* ─── ONLINE INDICATOR ───────────────────── */
.online-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green-bright);
    box-shadow: 0 0 6px var(--green-bright);
    animation: pulse 2s ease-in-out infinite;
    display: inline-block;
}
.offline-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green-bright); }
    50%       { opacity: 0.6; box-shadow: 0 0 2px var(--green-bright); }
}

/* ─── CHAT ───────────────────────────────── */
.chat-window {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 2rem);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.chat-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,8,0,0.5);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.message-bubble {
    max-width: 75%;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
}
.message-bubble.sent {
    background: var(--green-ghost);
    border: 1px solid var(--green-faint);
    color: var(--text-primary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
.message-bubble.received {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.message-bubble .time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: block;
}
.chat-input-bar {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    background: rgba(0,8,0,0.5);
}
.chat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--green-dim); }

/* ─── ADMIN PANEL ────────────────────────── */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - var(--header-height));
    gap: 0;
}
.admin-sidebar {
    background: rgba(0,5,0,0.9);
    border-right: 1px solid var(--border);
    padding: 1rem 0.75rem;
}
.admin-main { padding: 1.5rem; }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s;
}
.stat-card:hover {
    border-color: var(--green-dim);
    box-shadow: var(--shadow-glow);
}
.stat-card .value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--green-bright);
    text-shadow: 0 0 20px var(--green-bright);
    display: block;
}
.stat-card .label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ─── DROPDOWN ───────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: rgba(0,8,0,0.97);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-bright);
    z-index: 1000;
    overflow: hidden;
    display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 1px solid var(--border);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--green-ghost); color: var(--green-bright); }
.dropdown-item.danger { color: #ff6666; }
.dropdown-item.danger:hover { background: rgba(255,40,40,0.06); }

/* ─── NOTIFICATIONS PANEL ────────────────── */
.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    cursor: pointer;
}
.notif-item:hover { background: var(--green-ghost); }
.notif-item.unread { background: rgba(0,255,65,0.03); }
.notif-item .content { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.4; }
.notif-item .time { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ─── PROFILE ────────────────────────────── */
.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--green-ghost) 0%, rgba(0,20,5,0.8) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    overflow: hidden;
}
.profile-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,255,65,0.02) 10px,
        rgba(0,255,65,0.02) 20px
    );
}
.profile-info {
    padding: 0 1.5rem 1.5rem;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border: 1px solid var(--border);
    border-top: none;
    margin-bottom: 1rem;
}
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-top: -50px;
    margin-bottom: 0.5rem;
}
.profile-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(0,255,65,0.2);
}

/* ─── MODAL ──────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    width: 100%;
    max-width: 520px;
    background: rgba(0,10,0,0.97);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-bright);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--green-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.modal-body { padding: 1.25rem; }
.modal-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ─── LOADING / SKELETON ─────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 0%, rgba(0,255,65,0.04) 50%, var(--bg-elevated) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── PLUGIN BADGE ───────────────────────── */
.plugin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--green-dim);
    border: 1px solid var(--green-faint);
    padding: 1px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ─── GLITCH ANIMATION ───────────────────── */
.glitch {
    position: relative;
    animation: glitch 5s infinite;
}
@keyframes glitch {
    0%, 94%, 100% { transform: translate(0); }
    95%  { transform: translate(-2px, 1px); }
    96%  { transform: translate(2px, -1px); }
    97%  { transform: translate(-1px, 2px); }
    98%  { transform: translate(1px, -1px); }
}

/* ─── RESPONSIVE (MOBILE) ────────────────── */
@media (max-width: 1024px) {
    .app-wrapper {
        grid-template-areas:
            "header header"
            "main   main";
        grid-template-columns: 1fr;
    }
    .app-sidebar { display: none; }
    .app-aside   { display: none; }
    .app-main    { max-width: 100%; padding: 0.75rem; }
}

/* ─── HAMBURGER ──────────────────────────── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.35rem;
    cursor: pointer;
    padding: .3rem .45rem;
    border-radius: var(--radius);
    transition: background .15s;
    line-height: 1;
    flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--green-ghost); }

@media (max-width: 1024px) {
    .hamburger-btn { display: flex; align-items: center; }
}

/* ─── SIDEBAR DRAWER (mobile/tablette) ────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    backdrop-filter: blur(2px);
    animation: fade-in .2s ease;
}
.sidebar-overlay.open { display: block; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.app-sidebar.drawer-open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(280px, 82vw);
    z-index: 201;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 32px rgba(0,0,0,.85);
    animation: slide-in .2s cubic-bezier(.25,.46,.45,.94);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 0;
    box-sizing: border-box;
}
/* Spacer pour passer sous le header fixe */
.app-sidebar.drawer-open::before {
    content: '';
    display: block;
    height: var(--header-height);
    flex-shrink: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}
/* S'assurer que le contenu de la sidebar est bien visible dans le drawer */
.app-sidebar.drawer-open .nav-item,
.app-sidebar.drawer-open .nav-section-title,
.app-sidebar.drawer-open a {
    width: 100%;
    box-sizing: border-box;
}
@keyframes slide-in {
    from { transform: translateX(-100%); opacity: .6; }
    to   { transform: translateX(0);     opacity: 1;  }
}

/* Masquer l'avatar dans le header — accessible via le drawer sidebar */
.header-avatar-wrap { display: none !important; }

@media (max-width: 768px) {
    :root { --header-height: 54px; }

    .logo { font-size: 1rem; }
    .search-bar { display: none; }

    /* Serrer les icônes du header */
    .app-header { padding: 0 .75rem; gap: .4rem; }
    .header-actions { gap: .25rem; }
    .icon-btn { padding: .35rem .4rem; font-size: 1.1rem; }

    .app-main { padding: 0.75rem; }
    .post { border-radius: 0; border-left: none; border-right: none; }
    .auth-box { padding: 1.75rem 1.25rem; }
}

/* ─── UTILITIES ──────────────────────────── */
.text-green  { color: var(--green-bright); }
.text-muted  { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-mono   { font-family: var(--font-mono); }
.text-xs     { font-size: 0.75rem; }
.text-sm     { font-size: 0.85rem; }

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.gap-1       { gap: 0.25rem; }
.gap-2       { gap: 0.5rem; }
.gap-3       { gap: 0.75rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4  { padding: 1rem; }

.hidden      { display: none; }
.block       { display: block; }
.w-full      { width: 100%; }
.text-center { text-align: center; }
.rounded     { border-radius: var(--radius); }

.matrix-glow { box-shadow: var(--shadow-glow); }
.matrix-text-glow { text-shadow: 0 0 10px var(--green-bright); }

/* ─── TERMINAL EFFECT ────────────────────── */
.terminal {
    background: var(--bg-base);
    border: 1px solid var(--green-faint);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--green-medium);
    position: relative;
}
.terminal::before {
    content: '● ● ●';
    display: block;
    color: var(--text-muted);
    font-size: 0.6rem;
    margin-bottom: 0.75rem;
    letter-spacing: 3px;
}
.terminal .prompt::before { content: '❯ '; color: var(--green-bright); }
.cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
