/* ═══════════════════════════════════════
   TOPAZE PLATFORM — CSS COMMUN
   ═══════════════════════════════════════ */

:root {
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --primary-light: #a5b4fc;
    --accent:        #f59e0b;
    --accent-dark:   #d97706;
    --danger:        #ef4444;
    --success:       #10b981;
    --bg:            #0f0f1a;
    --bg-2:          #1a1a2e;
    --bg-3:          #252540;
    --surface:       #1e1e35;
    --surface-2:     #2a2a45;
    --border:        rgba(255,255,255,.08);
    --text:          #f1f5f9;
    --text-2:        #94a3b8;
    --text-3:        #64748b;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 4px 24px rgba(0,0,0,.4);
    --shadow-lg:     0 8px 48px rgba(0,0,0,.6);
    --font:          'Inter', system-ui, sans-serif;
    --transition:    .2s ease;

    /* rarités */
    --rarity-common:    #94a3b8;
    --rarity-uncommon:  #22c55e;
    --rarity-rare:      #3b82f6;
    --rarity-epic:      #a855f7;
    --rarity-legendary: #f59e0b;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ── NAV COMMUNE ───────────────────────────────────────────── */
.topaz-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: rgba(15,15,26,.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-light);
    letter-spacing: -.02em;
}
.nav-logo svg { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-2);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { background: var(--surface); color: var(--text); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-coins {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--accent);
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    background: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}
.nav-avatar:hover { transform: scale(1.08); }

/* ── BOUTONS ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,.4); }

.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); }

.btn-danger  { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-outline { background: transparent; color: var(--primary-light); border: 1px solid var(--primary-light); }
.btn-outline:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon:hover { background: var(--surface); color: var(--text); }

/* ── FORMULAIRES ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }

input, select, textarea {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .9rem;
    padding: 10px 14px;
    transition: var(--transition);
    width: 100%;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
input::placeholder { color: var(--text-3); }

/* ── CARDS / PANELS ─────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .15s ease;
}
.modal-overlay.hidden { display: none; }

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: slideUp .2s ease;
}
.modal-box.wide { max-width: 680px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1rem; font-weight: 700; }

.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

/* ── TOASTS ─────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp .2s ease;
    box-shadow: var(--shadow);
    max-width: 340px;
}
.toast.success { background: #065f46; color: #6ee7b7; border-left: 3px solid var(--success); }
.toast.error   { background: #7f1d1d; color: #fca5a5; border-left: 3px solid var(--danger); }
.toast.info    { background: var(--surface-2); color: var(--text-2); border-left: 3px solid var(--primary); }

/* ── BADGES RARITÉ ──────────────────────────────────────────── */
.rarity-common    { color: var(--rarity-common); }
.rarity-uncommon  { color: var(--rarity-uncommon); }
.rarity-rare      { color: var(--rarity-rare); }
.rarity-epic      { color: var(--rarity-epic); }
.rarity-legendary { color: var(--rarity-legendary); }

.badge-rarity {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.badge-rarity.common    { background: rgba(148,163,184,.15); color: var(--rarity-common); }
.badge-rarity.uncommon  { background: rgba(34,197,94,.15);  color: var(--rarity-uncommon); }
.badge-rarity.rare      { background: rgba(59,130,246,.15); color: var(--rarity-rare); }
.badge-rarity.epic      { background: rgba(168,85,247,.15); color: var(--rarity-epic); }
.badge-rarity.legendary { background: rgba(245,158,11,.15); color: var(--rarity-legendary); }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin    { to { transform: rotate(360deg); } }

.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-3);
    font-size: .9rem;
}
.empty-state svg { margin-bottom: 12px; opacity: .4; }

/* ── DIVIDER ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .topaz-nav { padding: 0 16px; }
    .nav-links { display: none; }
    #toast-container { bottom: 16px; right: 16px; left: 16px; }
    .toast { max-width: 100%; }
}

