/* ---- Shared base: design tokens, reset, body ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #252542;
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;
  --text-dim: #6b6b8d;
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #eab308;
  --border-color: #3a3a5c;
  --border-subtle: #2a2a44;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a0a2e 100%);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
}

/* ---- Unified navigation bar ---- */
.unified-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Left: logo + page links */
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
}

.nav-links {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35em 0.65em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
}

.nav-links a.active {
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
}

/* Right: auth buttons + affiliate */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-auth {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Shared button base */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1;
  white-space: nowrap;
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* GitHub */
.nav-btn-github {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.nav-btn-github:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }

/* LINK Donate */
.nav-btn-donate {
  background: rgba(43, 108, 176, 0.2);
  color: #4a90d9;
  border: 1px solid rgba(43, 108, 176, 0.4);
}
.nav-btn-donate:hover { background: rgba(43, 108, 176, 0.35); color: #6ab0ff; }

/* Discord */
.nav-btn-discord {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 4px 10px rgba(88, 101, 242, 0.25);
}
.nav-btn-discord:hover { background: #6d78f5; }

.nav-btn-discord.connected {
  background: var(--bg-tertiary);
  color: var(--success);
  border: 1px solid var(--success);
  box-shadow: none;
}

/* Wallet */
.nav-btn-wallet {
  background: #f6851b;
  color: #fff;
  box-shadow: 0 4px 10px rgba(246, 133, 27, 0.25);
}
.nav-btn-wallet:hover { background: #ff9a2e; }

.nav-btn-wallet.connected {
  background: var(--bg-tertiary);
  color: var(--success);
  border: 1px solid var(--success);
  box-shadow: none;
}

/* Affiliate panel */
.nav-affiliate {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  justify-content: flex-end;
  padding-top: 0.3rem;
}

.nav-affiliate.hidden { display: none; }

.nav-affiliate input {
  height: 26px;
  width: 130px;
  padding: 0 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: #fff;
  font-family: inherit;
  font-size: 0.72rem;
}

.nav-affiliate input::placeholder {
  color: var(--text-dim);
}

.nav-affiliate select {
  height: 26px;
  padding: 0 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: #fff;
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.nav-affiliate button {
  height: 26px;
  padding: 0 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: #fff;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.nav-affiliate button:hover {
  border-color: var(--accent-primary);
}

.nav-affiliate .aff-status {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.nav-affiliate .aff-status.success { color: var(--success); }
.nav-affiliate .aff-status.error { color: var(--error); }

.nav-affiliate .aff-display {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.nav-affiliate .aff-display strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Mobile */
@media (max-width: 640px) {
  .nav-logo { width: 30px; height: 30px; }
  .nav-links a { font-size: 0.72rem; padding: 0.3em 0.45em; }
  .nav-btn { padding: 0.3rem 0.45rem; font-size: 0.68rem; }
  .nav-btn .btn-label { display: none; }
  .nav-affiliate input { width: 100px; }
}
