/* ═══════════════════════════════════════════════════════════════════════
   SYNTRAX — "Aurora" Design System v2
   Premium Web3 dashboard aesthetic — Linear / Stripe / Magic Eden inspired

   ⚠️ DROP-IN REPLACEMENT: every variable name, class name, and selector
   from the original core.css is preserved. No HTML or JS anywhere in the
   project needs to change for this to apply. Only the *values* + a handful
   of additive rules (glass blur, glow, gradients, motion) changed.
═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:wght@300;400;500&family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  /* ── Base surfaces — deep indigo/navy instead of flat black ── */
  --bg:          #05050F;
  --bg2:         #0A0B1A;
  --surface:     rgba(255,255,255,.035);
  --surface2:    rgba(255,255,255,.055);

  /* ── Brand: purple → blue gradient is now the primary interactive hue ── */
  --brand-a:     #A78BFA;   /* violet   */
  --brand-b:     #60A5FA;   /* sky blue */
  --brand-grad:  linear-gradient(135deg, #8B5CF6 0%, #6366F1 45%, #3B82F6 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(139,92,246,.16), rgba(59,130,246,.10));

  /* ── Legacy names kept so nothing breaks — remapped to the new palette ── */
  --border:      rgba(255,255,255,.09);
  --accent:      #EAB308;                 /* gold — still used for rewards/OG/prizes */
  --accent-dim:  rgba(234,179,8,.10);
  --blue:        #60A5FA;
  --blue-dim:    rgba(96,165,250,.12);
  --text:        #F3F4FF;
  --muted:       #9CA3C4;
  --dim:         #262A45;
  --gold:        #EAB308;
  --green:       #34D399;
  --red:         #F87171;
  --purple:      #A78BFA;
  --orange:      #FB923C;
  --font:        'Syne', 'Inter', sans-serif;
  --mono:        'DM Mono', monospace;
  --sidebar-w:   248px;

  /* ── New tokens for the glass system ── */
  --glass-bg:     rgba(255,255,255,.045);
  --glass-bg-hi:  rgba(255,255,255,.075);
  --glass-border: rgba(255,255,255,.10);
  --glow-brand:   0 0 0 1px rgba(139,92,246,.12), 0 8px 32px rgba(99,102,241,.10);
  --glow-brand-hover: 0 0 0 1px rgba(139,92,246,.28), 0 16px 48px rgba(99,102,241,.22), 0 0 40px rgba(139,92,246,.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.16,1,.3,1);
}

html { scroll-behavior: smooth; height: 100%; -webkit-overflow-scrolling: touch; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  overflow-y: auto;
  background-image:
    radial-gradient(ellipse 90% 55% at 15% -10%, rgba(139,92,246,.14) 0%, transparent 60%),
    radial-gradient(ellipse 70% 45% at 100% 10%, rgba(59,130,246,.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(99,102,241,.08) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Subtle animated aurora line instead of flat gold bar */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8B5CF6, #60A5FA, #EAB308, #8B5CF6, transparent);
  background-size: 200% 100%;
  animation: auroraFlow 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 9999;
  opacity: .9;
}
@keyframes auroraFlow { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

body::after {
  content: '';
  position: fixed;
  top: -220px; right: -220px;
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(139,92,246,.09) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(10px);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,.28); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,.48); }

/* ── Focus states (accessibility) ── */
:focus-visible {
  outline: 2px solid rgba(139,92,246,.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Utilities ── */
.font-mono    { font-family: var(--mono); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--muted); }
.text-gold    { color: var(--gold); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-blue    { color: var(--blue); }
.hidden       { display: none !important; }

/* ── Animations ── */
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.35} }
@keyframes fadeUp   { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@keyframes scaleIn  { from{opacity:0;transform:scale(.96)} to{opacity:1;transform:scale(1)} }
@keyframes shimmer  { 0%{opacity:1} 50%{opacity:.4} 100%{opacity:1} }
@keyframes spin     { to{transform:rotate(360deg)} }
@keyframes goldPulse{ 0%,100%{box-shadow:0 0 0 0 rgba(234,179,8,.3)} 50%{box-shadow:0 0 20px 4px rgba(234,179,8,.15)} }
@keyframes brandPulse{ 0%,100%{box-shadow:0 0 0 0 rgba(139,92,246,.35)} 50%{box-shadow:0 0 22px 5px rgba(139,92,246,.18)} }
@keyframes floatY   { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }

.animate-pulse-dot { animation: pulse 2s infinite; }
.animate-fade-up   { animation: fadeUp .5s var(--ease) both; }
.animate-shimmer   { animation: shimmer 1.5s infinite; }

/* ── App Layout ── */
.app-layout { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR — glass panel, floating, rounded
═══════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(15,14,32,.92), rgba(9,9,22,.96));
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform .35s var(--ease);
}
.sidebar-logo {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 19px; font-weight: 800;
  color: var(--text); text-decoration: none;
  display: block; cursor: pointer;
  letter-spacing: -.3px;
}
.sidebar-logo span {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 38px; height: 38px;
  background: var(--brand-grad);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
.sidebar-stats { padding: 12px 16px; border-bottom: 1px solid var(--glass-border); display: flex; gap: 8px; }
.stat-chip {
  flex: 1; padding: 10px 10px; border-radius: var(--radius-sm); text-align: center;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.stat-chip:hover { transform: translateY(-1px); border-color: rgba(139,92,246,.3); }
.stat-chip.accent { background: rgba(234,179,8,.06); border-color: rgba(234,179,8,.18); }
.stat-chip.green  { background: rgba(52,211,153,.06); border-color: rgba(52,211,153,.18); }
.stat-value { font-size: 13px; font-weight: 800; font-family: var(--mono); }
.stat-label { font-size: 9px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.sidebar-nav { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
.nav-section { font-size: 9px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 1.6px; padding: 14px 12px 6px; opacity: .65; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; text-decoration: none;
  transition: background .22s var(--ease), color .22s var(--ease), transform .18s var(--ease);
  border: 1px solid transparent; background: transparent; width: 100%; text-align: left;
  font-family: var(--font); position: relative;
}
.nav-item:hover { background: var(--glass-bg); color: var(--text); transform: translateX(2px); }
.nav-item.active {
  background: var(--brand-grad-soft);
  color: #fff;
  border-color: rgba(139,92,246,.28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 3px;
  background: var(--brand-grad);
}
.nav-item .nav-icon { font-size: 15px; flex-shrink: 0; }

/* Discord / X footer links — now identical pill design (fixes mismatch) */
.sidebar-discord {
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-discord a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  font-family: var(--font);
  transition: all .22s var(--ease);
}
.sidebar-discord a:hover {
  color: var(--text);
  border-color: rgba(139,92,246,.32);
  background: var(--brand-grad-soft);
  transform: translateY(-1px);
}

.sidebar-signout  { padding: 12px 16px 16px; border-top: 1px solid var(--glass-border); }
.btn-signout {
  width: 100%; padding: 10px;
  background: transparent; border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: var(--font); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .22s var(--ease);
}
.btn-signout:hover { border-color: rgba(248,113,113,.4); color: var(--red); background: rgba(248,113,113,.06); }

/* Mobile sidebar */
.sidebar-toggle {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 100;
  background: var(--glass-bg); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 8px 10px;
  cursor: pointer; font-size: 18px; color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  transition: all .22s var(--ease);
}
.sidebar-toggle:hover, .sidebar-toggle:active {
  border-color: rgba(139,92,246,.4);
  box-shadow: 0 0 16px -2px rgba(139,92,246,.4);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(2,2,10,.72); backdrop-filter: blur(2px); z-index: 49;
}

/* ── Page Content ── */
.page-main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }
.page-header {
  padding: 22px 32px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(5,5,15,.72);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
}
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.page-body  { padding: 32px; }

/* ═══════════════════════════════════════════════════════════════════
   CARDS — glassmorphism, soft glow border, hover lift
═══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--glow-brand);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.card:hover {
  border-color: rgba(139,92,246,.22);
  box-shadow: var(--glow-brand-hover);
  transform: translateY(-2px);
}
.card-sm { padding: 16px; border-radius: var(--radius-md); }
.card + .card { margin-top: 16px; }

.card-gold {
  background: linear-gradient(160deg, var(--glass-bg), rgba(234,179,8,.05));
  border: 1px solid rgba(234,179,8,.22);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: 0 0 0 1px rgba(234,179,8,.06), 0 8px 32px rgba(234,179,8,.06);
  backdrop-filter: blur(18px);
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS — gradient, rounded, micro-interactions
═══════════════════════════════════════════════════════════════════ */
.btn {
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; transition: all .22s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 4px 18px rgba(99,102,241,.32), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(99,102,241,.42), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-blue {
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,.3);
}
.btn-blue:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 8px 26px rgba(59,130,246,.4); }

.btn-outline {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-outline:hover { border-color: rgba(139,92,246,.4); color: #fff; background: var(--brand-grad-soft); }

.btn-danger  {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.3);
  color: var(--red);
}
.btn-danger:hover { background: rgba(248,113,113,.16); }

.bf { width: 100%; justify-content: center; padding: 13px; font-size: 14px; }

/* Loading state helper (add class="btn-loading" via JS if desired — no JS required) */
.btn[disabled]::after { content: none; }

/* ── Input ── */
.input {
  width: 100%; padding: 11px 15px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--mono); font-size: 13px;
  outline: none; transition: border .22s var(--ease), box-shadow .22s var(--ease), background .22s var(--ease);
  -webkit-appearance: none;
}
.input:focus {
  border-color: rgba(139,92,246,.55);
  box-shadow: 0 0 0 3px rgba(139,92,246,.10);
  background: rgba(255,255,255,.045);
}
.input::placeholder { color: var(--muted); opacity: .7; }
label.input-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px; display: block; }

/* ── Badge ── */
.badge { padding: 4px 11px; border-radius: 8px; font-size: 11px; font-weight: 700; font-family: var(--mono); backdrop-filter: blur(6px); }
.badge-gold   { background: rgba(234,179,8,.12);  border: 1px solid rgba(234,179,8,.28);  color: var(--gold); }
.badge-accent { background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.3);  color: var(--brand-a); }
.badge-blue   { background: var(--blue-dim);      border: 1px solid rgba(96,165,250,.28); color: var(--blue); }
.badge-green  { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.28); color: var(--green); }
.badge-red    { background: rgba(248,113,113,.12);border: 1px solid rgba(248,113,113,.28);color: var(--red); }
.badge-muted  { background: rgba(255,255,255,.05);border: 1px solid rgba(255,255,255,.12);color: var(--muted); }

/* ── Tab bar ── */
.tab-bar {
  display: flex; gap: 3px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 5px; width: fit-content; margin-bottom: 28px;
  backdrop-filter: blur(14px);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 8px 20px; border-radius: 10px; font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; background: transparent; color: var(--muted);
  font-family: var(--font); transition: all .22s var(--ease); text-transform: capitalize;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

/* ── Toast ── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: rgba(14,13,28,.85);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 13px 18px;
  font-family: var(--mono); font-size: 13px;
  max-width: 340px; animation: scaleIn .3s var(--ease);
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.toast.success { border-color: rgba(52,211,153,.35); box-shadow: 0 12px 40px rgba(52,211,153,.1), 0 12px 40px rgba(0,0,0,.4); }
.toast.error   { border-color: rgba(248,113,113,.35); box-shadow: 0 12px 40px rgba(248,113,113,.1), 0 12px 40px rgba(0,0,0,.4); }
.toast-icon    { font-size: 16px; flex-shrink: 0; }

/* ── Loading ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(139,92,246,.15);
  border-top-color: var(--brand-a);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.loading-overlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9999; flex-direction: column; gap: 16px; }
.loading-logo { font-size: 28px; font-weight: 800; }

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .page-main { margin-left: 0; }
  .page-body { padding: 20px 16px 92px; }
  .page-header { padding: 16px 16px 16px 56px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   MASTER BOTTOM NAV — injected by ui.js's renderSidebar() on every page.
   Desktop: hidden (sidebar covers navigation). Mobile: fixed, glass,
   always visible regardless of which page/tab is open.
═══════════════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none;
  align-items: stretch; justify-content: space-around;
  background: rgba(7,7,18,.88);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--glass-border);
  padding: 7px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; text-decoration: none; color: var(--muted);
  font-size: 10px; font-family: var(--font); font-weight: 700;
  border-radius: 12px; transition: color .2s var(--ease), transform .15s var(--ease);
  min-width: 0;
}
.bn-item .bn-icon { font-size: 19px; line-height: 1; transition: transform .2s var(--ease); }
.bn-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bn-item:active { transform: scale(.92); }
.bn-item.active { color: var(--accent); }
.bn-item.active .bn-icon { transform: translateY(-1px); filter: drop-shadow(0 0 8px rgba(234,179,8,.65)); }
.bn-item:not(.active):hover { color: var(--text); }

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
}
