@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════
   VARIABLES GLOBALES
═══════════════════════════════════════════════════ */
:root {
    --brand-1: #6366f1;
    --brand-2: #a855f7;
    --primary: #6366f1;
    --bg-main: #F8FAFC;
    --bg-white: #ffffff;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-1: #0f172a;
    --text-2: #64748b;
    --radius-card: 2rem;
}

body.dark-theme {
    --bg-main: #0f172a;
    --bg-white: #1e293b;
    --surface: #1e293b;
    --surface-2: #0f172a;
    --border: #334155;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-1: #f1f5f9;
    --text-2: #94a3b8;
}

/* ═══════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ═══════════════════════════════════════════════════
   DARK MODE — BACKGROUNDS
═══════════════════════════════════════════════════ */
body.dark-theme                          { background-color: #0f172a !important; }
body.dark-theme .bg-white                { background-color: #1e293b !important; }
body.dark-theme .bg-white\/80            { background-color: rgba(30, 41, 59, 0.8) !important; }
body.dark-theme .bg-\[#F8FAFC\]         { background-color: #0f172a !important; }
body.dark-theme .bg-slate-50             { background-color: #334155 !important; }
body.dark-theme .bg-slate-50\/50         { background-color: rgba(51, 65, 85, 0.5) !important; }
body.dark-theme .bg-slate-100            { background-color: #475569 !important; }
body.dark-theme .bg-slate-900            { background-color: #0c1222 !important; }
body.dark-theme .bg-indigo-50            { background-color: rgba(99, 102, 241, 0.15) !important; }
body.dark-theme .bg-indigo-100           { background-color: rgba(99, 102, 241, 0.2) !important; }
body.dark-theme .bg-emerald-50           { background-color: rgba(16, 185, 129, 0.15) !important; }
body.dark-theme .bg-emerald-100          { background-color: rgba(16, 185, 129, 0.15) !important; }
body.dark-theme .bg-amber-50             { background-color: rgba(245, 158, 11, 0.15) !important; }
body.dark-theme .bg-amber-100            { background-color: rgba(245, 158, 11, 0.15) !important; }
body.dark-theme .bg-red-50               { background-color: rgba(239, 68, 68, 0.1) !important; }
body.dark-theme .bg-red-100              { background-color: rgba(239, 68, 68, 0.15) !important; }
body.dark-theme .bg-indigo-600           { background-color: #6366f1 !important; }
body.dark-theme .backdrop-blur-md        { background-color: rgba(30, 41, 59, 0.8) !important; }
body.dark-theme main                     { background-color: #0f172a !important; }
body.dark-theme .rounded-\[2\.5rem\],
body.dark-theme .rounded-\[2rem\]        { background-color: #1e293b !important; }

/* ═══════════════════════════════════════════════════
   DARK MODE — TEXTES
═══════════════════════════════════════════════════ */
body.dark-theme .text-slate-900          { color: #f1f5f9 !important; }
body.dark-theme .text-slate-800          { color: #e2e8f0 !important; }
body.dark-theme .text-slate-700          { color: #e2e8f0 !important; }
body.dark-theme .text-slate-600          { color: #cbd5e1 !important; }
body.dark-theme .text-slate-500          { color: #94a3b8 !important; }
body.dark-theme .text-slate-400          { color: #64748b !important; }
body.dark-theme .text-slate-300          { color: #94a3b8 !important; }
body.dark-theme .text-indigo-600         { color: #818cf8 !important; }
body.dark-theme .text-indigo-500         { color: #818cf8 !important; }
body.dark-theme .text-indigo-400         { color: #a5b4fc !important; }
body.dark-theme .text-emerald-600        { color: #34d399 !important; }
body.dark-theme .text-emerald-500        { color: #34d399 !important; }
body.dark-theme .text-amber-600          { color: #fbbf24 !important; }
body.dark-theme .text-amber-500          { color: #fbbf24 !important; }
body.dark-theme .text-red-600            { color: #f87171 !important; }
body.dark-theme .text-red-500            { color: #f87171 !important; }
body.dark-theme .text-white              { color: #ffffff !important; }

/* ═══════════════════════════════════════════════════
   DARK MODE — BORDERS
═══════════════════════════════════════════════════ */
body.dark-theme .border-slate-200,
body.dark-theme .border-slate-100,
body.dark-theme .border-slate-50         { border-color: #334155 !important; }
body.dark-theme .border-slate-900        { border-color: #0c1222 !important; }
body.dark-theme .border-dashed           { border-color: #475569 !important; }
body.dark-theme .border-emerald-100      { border-color: rgba(16, 185, 129, 0.2) !important; }
body.dark-theme .divide-slate-100 > * + * { border-color: #334155 !important; }

/* ═══════════════════════════════════════════════════
   DARK MODE — SHADOWS
═══════════════════════════════════════════════════ */
body.dark-theme .shadow-sm               { box-shadow: 0 1px 2px 0 rgba(0,0,0,.3) !important; }
body.dark-theme .shadow-md               { box-shadow: 0 4px 6px -1px rgba(0,0,0,.3), 0 2px 4px -2px rgba(0,0,0,.2) !important; }
body.dark-theme .shadow-lg               { box-shadow: 0 10px 15px -3px rgba(0,0,0,.3), 0 4px 6px -4px rgba(0,0,0,.2) !important; }
body.dark-theme .shadow-xl               { box-shadow: 0 20px 25px -5px rgba(0,0,0,.3), 0 8px 10px -6px rgba(0,0,0,.2) !important; }
body.dark-theme .shadow-2xl              { box-shadow: 0 25px 50px -12px rgba(0,0,0,.5) !important; }
body.dark-theme .shadow-slate-200,
body.dark-theme .shadow-slate-200\/60,
body.dark-theme .shadow-slate-100        { box-shadow: 0 20px 25px -5px rgba(0,0,0,.3) !important; }
body.dark-theme .shadow-indigo-100,
body.dark-theme .shadow-indigo-200       { box-shadow: 0 10px 15px -3px rgba(99,102,241,.2), 0 4px 6px -4px rgba(99,102,241,.1) !important; }
body.dark-theme .shadow-indigo-300       { box-shadow: 0 10px 15px -3px rgba(99,102,241,.3) !important; }

/* ═══════════════════════════════════════════════════
   DARK MODE — HOVERS
═══════════════════════════════════════════════════ */
body.dark-theme .hover\:bg-slate-50:hover        { background-color: #334155 !important; }
body.dark-theme .hover\:bg-slate-50\/50:hover    { background-color: rgba(51,65,85,.5) !important; }
body.dark-theme .hover\:bg-slate-100:hover       { background-color: #475569 !important; }
body.dark-theme .hover\:bg-slate-800:hover       { background-color: #0c1222 !important; }
body.dark-theme .hover\:bg-slate-900:hover       { background-color: #0c1222 !important; }
body.dark-theme .hover\:bg-indigo-500:hover      { background-color: #6366f1 !important; }
body.dark-theme .hover\:bg-indigo-600:hover      { background-color: #6366f1 !important; }
body.dark-theme .hover\:bg-indigo-700:hover      { background-color: #6366f1 !important; }
body.dark-theme .hover\:bg-red-50:hover          { background-color: rgba(239,68,68,.1) !important; }
body.dark-theme .hover\:text-indigo-600:hover    { color: #818cf8 !important; }
body.dark-theme .hover\:border-indigo-300:hover  { border-color: rgba(99,102,241,.5) !important; }

/* ═══════════════════════════════════════════════════
   DARK MODE — LAYOUT
═══════════════════════════════════════════════════ */
body.dark-theme #sidebar,
body.dark-theme header,
body.dark-theme aside                    { background-color: #1e293b !important; border-color: #334155 !important; }

/* ═══════════════════════════════════════════════════
   DARK MODE — INPUTS
═══════════════════════════════════════════════════ */
body.dark-theme input[type="text"]               { background-color: #334155 !important; color: #f1f5f9 !important; }
body.dark-theme input[type="text"]::placeholder  { color: #64748b !important; }
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder            { color: #64748b !important; }
body.dark-theme select                           { color: #e2e8f0 !important; }
body.dark-theme select option                    { background-color: #1e293b !important; color: #e2e8f0 !important; }

/* ═══════════════════════════════════════════════════
   DARK MODE — LOADER
═══════════════════════════════════════════════════ */
body.dark-theme #loader-overlay          { background: #0f172a !important; }
body.dark-theme .spinner                 { border-color: #334155; border-top-color: #818cf8; }

/* ═══════════════════════════════════════════════════
   SIDEBAR — LIENS
═══════════════════════════════════════════════════ */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #64748b;
}
.sidebar-link:hover               { background-color: #f1f5f9; color: #6366f1; }
.sidebar-link.active              { background-color: #eef2ff; color: #6366f1; border-right: 3px solid #6366f1; }
body.dark-theme .sidebar-link:hover  { background-color: #334155; color: #818cf8; }
body.dark-theme .sidebar-link.active { background-color: #334155; color: #818cf8; border-right-color: #818cf8; }

/* ═══════════════════════════════════════════════════
   SIDEBAR — COLLAPSED
═══════════════════════════════════════════════════ */
#sidebar.collapsed { width: 72px !important; }
#sidebar.collapsed .link-text,
#sidebar.collapsed .logout-text,
#sidebar.collapsed nav > p,
#sidebar.collapsed .discord-section,
#sidebar.collapsed .support-section > p,
#sidebar.collapsed .admin-section > p,
#sidebar.collapsed .sidebar-brand-text,
#sidebar.collapsed .kbd-badge,
#sidebar.collapsed .section-title      { display: none !important; }
#sidebar.collapsed .admin-section      { display: none !important; }
#sidebar.collapsed .sidebar-link       { justify-content: center !important; padding: 0.85rem !important; }
#sidebar.collapsed .sidebar-link.active { border-right: none; }
#sidebar.collapsed .sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 55%;
    background: var(--brand-1, #6366f1);
    border-radius: 0 3px 3px 0;
}
#sidebar.collapsed > div:first-child   { justify-content: center; padding: 1.5rem 1rem; }
#mainContent                           { transition: margin-left .3s ease; }

/* ═══════════════════════════════════════════════════
   UTILITAIRES COMMUNS
═══════════════════════════════════════════════════ */
.gradient-brand {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}
body.dark-theme .glass-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.8);
}

/* ═══════════════════════════════════════════════════
   LOADER
═══════════════════════════════════════════════════ */
#loader-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: white;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════ */
.toast { min-width: 300px; animation: toastIn .3s ease-out; }
@keyframes toastIn  { from { transform: translateX(360px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to   { transform: translateX(360px); opacity: 0; } }
.toast.removing     { animation: toastOut .3s ease-out forwards; }
body.dark-theme .toast                  { background-color: #1e293b !important; border-color: #334155 !important; }
body.dark-theme .toast p                { color: #f1f5f9 !important; }

/* ═══════════════════════════════════════════════════
   KBD BADGE
═══════════════════════════════════════════════════ */
.kbd-badge {
    display: inline-flex; align-items: center;
    padding: 1px 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 9px; font-weight: 700; color: #64748b;
    font-family: monospace; letter-spacing: .05em;
}
body.dark-theme .kbd-badge { background: #334155; border-color: #475569; color: #94a3b8; }

/* ═══════════════════════════════════════════════════
   SCROLL PROGRESS
═══════════════════════════════════════════════════ */
#scrollProgress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--brand-1, #6366f1), var(--brand-2, #a855f7));
    transform-origin: left; transform: scaleX(0);
    z-index: 9999; transition: transform .08s linear;
}

/* ═══════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════ */
.modal { display: none; }
.modal.open { display: flex; animation: fadeIn 0.18s ease-out; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 9999; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════
   ANIMATIONS COMMUNES
═══════════════════════════════════════════════════ */
@keyframes notifPing { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.7);opacity:.3} }
.notif-dot { animation: notifPing 2.2s ease-in-out infinite; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.4s ease forwards; opacity: 0; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }

/* ═══════════════════════════════════════════════════
   FILTER BUTTONS
═══════════════════════════════════════════════════ */
.filter-btn {
    padding: 6px 14px; border-radius: 10px;
    font-size: 12px; font-weight: 700;
    cursor: pointer; border: none;
    transition: all 0.2s; color: #64748b; background: transparent;
}
.filter-btn.active,
.filter-btn:hover { background: #4f46e5; color: white; }

/* ═══════════════════════════════════════════════════
   DISCORD BLOCK
═══════════════════════════════════════════════════ */
body.dark-theme #commandPalette > div > div { background-color: #1e293b !important; border-color: #334155 !important; }

/* ═══════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════ */
@media print {
    .no-print { display: none !important; }
}
