@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── DARK THEME (défaut) ─── */
:root {
    --green: #23a55a;
    --green-dark: #1a7a43;
    --green-light: #1a3a28;
    --green-xlight: #112318;

    --bg: #313338;
    --bg-2: #2b2d31;
    --surface: #383a40;
    --surface-2: #404249;
    --border: #3f4147;
    --border-strong: #565960;

    --text: #dbdee1;
    --text-muted: #949ba4;
    --text-soft: #6d737a;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* ─── LIGHT THEME ─── */
[data-theme="light"] {
    --green: #22c55e;
    --green-dark: #16a34a;
    --green-light: #dcfce7;
    --green-xlight: #f0fdf4;

    --bg: #f8fafc;
    --bg-2: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.2s, color 0.2s;
}

/* ─── NAVBAR ─── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand .logo-dot {
    width: 30px; height: 30px;
    background: var(--green);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
}

.navbar-spacer { flex: 1; }

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── THEME TOGGLE ─── */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
    font-size: 16px;
    flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-strong); }

/* ─── PROFILE DROPDOWN ─── */
.profile-menu { position: relative; }

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.profile-trigger:hover { background: var(--bg-2); border-color: var(--border-strong); }

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: white;
    overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-trigger .trigger-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron { transition: transform 0.2s; color: var(--text-muted); }
.profile-menu.open .chevron { transform: rotate(180deg); }

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
}
.profile-menu.open .dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.dropdown-banner {
    height: 64px;
    background: #5865f2;
    background-size: cover;
    background-position: center;
    position: relative;
}

.dropdown-avatar-wrap {
    position: absolute;
    bottom: -20px;
    left: 16px;
}

.dropdown-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 3px solid var(--surface);
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; color: white;
    overflow: hidden;
    position: relative;
}
.dropdown-avatar img { width: 100%; height: 100%; object-fit: cover; }

.online-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 11px; height: 11px;
    background: var(--green);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.dropdown-info {
    padding: 28px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.dropdown-info .global-name { font-weight: 700; font-size: 15px; color: var(--text); font-family: 'Bricolage Grotesque', sans-serif; }
.dropdown-info .username { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.dropdown-info .badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

[data-theme="light"] .badge-nitro { background: #2a2040; color: #a78bfa; border: 1px solid #3d2f6e; }
[data-theme="light"] .badge-trial { background: #112318; color: var(--green); border: 1px solid #1a3a28; }
.badge-nitro { background: linear-gradient(135deg, #5865f220, #eb459e20); color: #5865f2; border: 1px solid #5865f230; }
.badge-trial { background: var(--green-light); color: var(--green-dark); border: 1px solid #bbf7d0; }

.dropdown-items { padding: 6px; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    transition: background 0.12s;
    cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-2); }
.dropdown-item svg { color: var(--text-muted); flex-shrink: 0; }

.dropdown-separator { height: 1px; background: var(--border); margin: 4px 6px; }

.dropdown-item.logout {
    background: var(--green);
    color: white;
    font-weight: 500;
    margin: 6px;
    border-radius: var(--radius-sm);
    justify-content: center;
}
.dropdown-item.logout:hover { background: var(--green-dark); }
.dropdown-item.logout svg { color: white; }

/* ─── MAIN ─── */
.main { flex: 1; padding: 32px 28px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ─── BTNS ─── */
.btn-discord {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 32px; background: var(--green); color: white;
    border-radius: 40px; font-weight: 600; font-size: 15px;
    text-decoration: none; transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(34,197,94,0.35);
}
.btn-discord:hover { background: var(--green-dark); transform: translateY(-2px); }

.btn-connect-nav {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px; background: var(--green); color: white;
    border-radius: 40px; font-weight: 500; font-size: 14px;
    text-decoration: none; transition: background 0.15s;
}
.btn-connect-nav:hover { background: var(--green-dark); }

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 520px; margin: 20px;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.05rem; font-weight: 700; color: var(--text);
}
.modal-close {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--border); background: transparent;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all 0.15s;
}
.modal-close:hover { background: var(--bg-2); color: var(--text); }

.modal-body {
    padding: 16px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

.modal-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-radius: var(--radius);
    text-decoration: none; border: 1px solid var(--border);
    background: var(--surface-2); transition: all 0.15s; color: var(--text);
}
.modal-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.modal-btn-icon { width: 20px; height: 20px; flex-shrink: 0; color: currentColor; }
.modal-btn-label { font-size: 14px; font-weight: 600; flex: 1; }
.modal-btn-arrow { color: var(--text-soft); flex-shrink: 0; transition: transform 0.15s; }
.modal-btn:hover .modal-btn-arrow { transform: translateX(3px); }

.modal-btn--messages:hover  { background: #eff6ff; border-color: #93c5fd; }
.modal-btn--commandes:hover { background: #fffbeb; border-color: #fcd34d; }
.modal-btn--sanctions:hover { background: #fff1f2; border-color: #fca5a5; }
.modal-btn--kills:hover     { background: #fdf2f8; border-color: #f9a8d4; }
.modal-btn--spawner:hover   { background: var(--green-xlight); border-color: #86efac; }
.modal-btn--nick:hover      { background: #f5f3ff; border-color: #c4b5fd; }
.modal-btn--boutique:hover  { background: #fff7ed; border-color: #fdba74; }
.modal-btn--erreurs:hover   { background: var(--bg-2); border-color: var(--border-strong); }

[data-theme="light"] .modal-btn--messages:hover  { background: #172a47; border-color: #2563eb; }
[data-theme="light"] .modal-btn--commandes:hover { background: #2e2207; border-color: #d97706; }
[data-theme="light"] .modal-btn--sanctions:hover { background: #2e1313; border-color: #dc2626; }
[data-theme="light"] .modal-btn--kills:hover     { background: #2e1322; border-color: #db2777; }
[data-theme="light"] .modal-btn--spawner:hover   { background: #052e16; border-color: var(--green); }
[data-theme="light"] .modal-btn--nick:hover      { background: #1e1540; border-color: #7c3aed; }
[data-theme="light"] .modal-btn--boutique:hover  { background: #2e1c0c; border-color: #ea580c; }
[data-theme="light"] .modal-btn--erreurs:hover   { background: var(--surface-2); border-color: var(--border-strong); }

/* ─── LANDING ─── */
.landing {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: calc(100vh - 64px);
    text-align: center; gap: 24px; padding: 40px 20px;
}
.landing-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; background: var(--green-light); color: var(--green-dark);
    border-radius: 20px; font-size: 13px; font-weight: 600; border: 1px solid #bbf7d0;
}
[data-theme="light"] .landing-badge { background: #112318; color: var(--green); border-color: #1a3a28; }
.landing h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 700; line-height: 1.08; max-width: 640px; color: var(--text);
}
.landing h1 span { color: var(--green); }
.landing-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 420px; line-height: 1.65; }

/* ─── DASHBOARD ─── */
.dash-header { margin-bottom: 32px; }
.dash-header h1 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--text); }
.dash-header p { color: var(--text-muted); font-size: 15px; margin-top: 4px; }

.modules-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 20px; margin-bottom: 32px;
}
@media (max-width: 1100px) { .modules-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .modules-grid { grid-template-columns: 1fr; } }

.module-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    text-decoration: none; color: var(--text);
    box-shadow: var(--shadow-sm); transition: all 0.18s;
    display: flex; flex-direction: column; gap: 12px;
    position: relative; overflow: hidden; cursor: pointer;
}
.module-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--green); background: var(--surface-2); }
.module-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--green); opacity: 0; transition: opacity 0.18s;
}
.module-card:hover::after { opacity: 1; }

.module-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    flex-shrink: 0;
}
.module-card h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1rem; font-weight: 700; color: var(--text); }
.module-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.module-arrow { margin-top: auto; display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--green-dark); }
[data-theme="light"] .module-arrow { color: var(--green); }

/* Remplace les règles module-card--admin */
.module-card--admin { border-color: var(--border); background: var(--surface); }
.module-card--admin:hover { border-color: var(--green); background: var(--surface-2); }
.module-card--admin::after { background: var(--green); }
.module-card--admin .module-icon { background: var(--surface); border-color: var(--border); color: var(--green); }
.module-card--admin .module-arrow { color: var(--green); }
.module-card--admin h3 { color: var(--text); }
.module-card--admin p { color: var(--text-muted); }
[data-theme="light"] .module-card--admin { border-color: var(--border); background: var(--surface); }
[data-theme="light"] .module-card--admin:hover { border-color: var(--green); background: var(--surface-2); }
[data-theme="light"] .module-card--admin .module-icon { background: var(--surface); border-color: var(--border); color: var(--green); }
[data-theme="light"] .module-card--admin .module-arrow { color: var(--green); }
[data-theme="light"] .module-card--admin h3 { color: var(--text); }
[data-theme="light"] .module-card--admin p { color: var(--text-muted); }

/* ─── DASH BOTTOM ─── */
.dash-bottom { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
@media (max-width: 900px) { .dash-bottom { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 0.95rem; font-weight: 700; color: var(--text); }

.discord-profile { display: flex; flex-direction: column; }
.discord-banner { height: 90px; background: #5865f2; background-size: cover; background-position: center top; position: relative; }
.discord-profile-avatar {
    position: absolute; bottom: -28px; left: 20px;
    width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--surface);
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 22px; color: white; overflow: hidden;
}
.discord-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.discord-profile-body { padding: 36px 20px 20px; }
.discord-profile-name { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.discord-profile-username { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.discord-profile-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.discord-profile-divider { height: 1px; background: var(--border); margin: 16px 0; }
.discord-profile-info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px; }
.discord-profile-info-value { font-size: 14px; color: var(--text); margin-bottom: 12px; }
.discord-profile-id { font-size: 12px; color: var(--text-soft); font-family: monospace; background: var(--bg-2); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); display: inline-block; margin-top: 4px; }

.activity-list { padding: 8px 0; }
.activity-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-2); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; margin-top: 5px; }
.activity-title { font-size: 14px; font-weight: 500; color: var(--text); }
.activity-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* ─── ADMIN PANEL ─── */
.admin-container {
    max-width: 600px;
    margin: 0 auto;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card-header h2 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.admin-card-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: #fff1f2;
    border: 1px solid #fca5a5;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}

[data-theme="light"] .admin-card-icon {
    background: #2e1313;
    border-color: #dc2626;
}

.admin-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── FORM FIELDS ─── */
.admin-card-body div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-card-body label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-card-body input[type="text"],
.admin-card-body input[type="search"],
.admin-card-body textarea,
.admin-card-body select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.admin-card-body input[type="text"]:focus,
.admin-card-body textarea:focus,
.admin-card-body select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
    background: var(--surface);
}

.admin-card-body input[type="text"]::placeholder,
.admin-card-body textarea::placeholder {
    color: var(--text-soft);
}

/* ─── SUBMIT BTN ─── */
.admin-card-body button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    margin-top: 4px;
}

.admin-card-body button[type="submit"]:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

/* ─── FLASH MESSAGES ─── */
.flash-success {
    padding: 12px 16px;
    background: var(--green-light);
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    color: var(--green-dark);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.flash-error {
    padding: 12px 16px;
    background: #fff1f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

[data-theme="light"] .flash-success {
    background: #112318;
    border-color: #1a3a28;
    color: var(--green);
}

[data-theme="light"] .flash-error {
    background: #2e1313;
    border-color: #7f1d1d;
    color: #f87171;
}

/* ─── BOARD SHOW ─── */
.main {
    overflow-x: auto;
}

.board-columns::-webkit-scrollbar {
    height: 6px;
}
.board-columns::-webkit-scrollbar-track {
    background: var(--bg-2);
    border-radius: 3px;
}
.board-columns::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}
.board-columns::-webkit-scrollbar-thumb:hover {
    background: var(--text-soft);
}

.card-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
