/* referrals.css — Referrals & Loyalty dashboard styles. Dark theme, Inter font. */

:root {
  --ref-bg:        #000000;
  --ref-surface:   #1A1A1A;
  --ref-surface-2: #0A0A0A;
  --ref-border:    #2A2A2A;
  --ref-cyan:      #00F2EA;
  --ref-coral:     #FF4D6D;
  --ref-text-1:    #FFFFFF;
  --ref-text-2:    #BBBBBB;
  --ref-text-3:    #666666;
  --ref-bronze:    #CD7F32;
  --ref-silver:    #C0C0C0;
  --ref-gold:      #FFD700;
  --ref-platinum:  #00F2EA;
}

body { background: var(--ref-bg); color: var(--ref-text-1); margin: 0; }

.ref-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */

.ref-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-topbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-topbar-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ref-text-1);
  letter-spacing: -0.02em;
}

.ref-handle {
  font-size: 0.85rem;
  color: var(--ref-cyan);
  font-weight: 600;
}

.ref-back-btn {
  font-size: 0.82rem;
  color: var(--ref-text-3);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--ref-border);
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
}
.ref-back-btn:hover { color: var(--ref-text-1); border-color: var(--ref-text-3); }

/* ── Login prompt ─────────────────────────────────────────────────────────── */

.ref-login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 64px 24px;
  text-align: center;
  background: var(--ref-surface);
  border: 1px solid var(--ref-border);
  border-radius: 12px;
}

.ref-login-prompt h2 { margin: 0; font-size: 1.3rem; }
.ref-login-prompt p  { margin: 0; color: var(--ref-text-2); font-size: 0.92rem; }

.ref-login-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--ref-cyan);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.ref-login-btn:hover { opacity: 0.88; }

/* ── Referral link panel ──────────────────────────────────────────────────── */

.ref-link-panel {
  background: var(--ref-surface);
  border: 1px solid var(--ref-border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ref-link-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ref-link-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ref-cyan);
}

.ref-link-sub {
  font-size: 0.85rem;
  color: var(--ref-text-2);
}

.ref-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-link-code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.83rem;
  color: var(--ref-text-1);
  background: var(--ref-surface-2);
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--ref-border);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-link-none {
  font-size: 0.85rem;
  color: var(--ref-text-3);
}

.ref-copy-btn {
  background: var(--ref-cyan);
  color: #0a0a0a;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 18px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.ref-copy-btn:hover { opacity: 0.85; }

/* ── Tier section ─────────────────────────────────────────────────────────── */

.ref-tier-section { margin-bottom: 20px; }

.ref-tier-card {
  background: var(--ref-surface);
  border: 1px solid var(--ref-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.ref-tier-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
}

.ref-tier-icon { font-size: 2rem; line-height: 1; }
.ref-tier-name { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

.ref-tier-bronze .ref-tier-name { color: var(--ref-bronze); }
.ref-tier-silver .ref-tier-name { color: var(--ref-silver); }
.ref-tier-gold   .ref-tier-name { color: var(--ref-gold); }
.ref-tier-platinum .ref-tier-name { color: var(--ref-platinum); }

.ref-tier-points {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.ref-points-big {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ref-text-1);
  line-height: 1;
}

.ref-points-label {
  font-size: 0.75rem;
  color: var(--ref-text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ref-tier-progress-wrap {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.ref-tier-progress-bar {
  height: 6px;
  background: var(--ref-border);
  border-radius: 3px;
  overflow: hidden;
}

.ref-tier-progress-fill {
  height: 100%;
  background: var(--ref-cyan);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.ref-tier-progress-label {
  font-size: 0.78rem;
  color: var(--ref-text-2);
}

.ref-tier-max {
  font-size: 0.85rem;
  color: var(--ref-cyan);
  font-weight: 600;
  align-self: center;
}

.ref-tier-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.ref-tier-perks li {
  font-size: 0.82rem;
  color: var(--ref-text-2);
}

.ref-perk-check {
  color: var(--ref-cyan);
  margin-right: 6px;
  font-weight: 700;
}

/* ── Stat row ─────────────────────────────────────────────────────────────── */

.ref-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 600px) {
  .ref-stats-row { grid-template-columns: 1fr; }
}

.ref-stat-card {
  background: var(--ref-surface);
  border: 1px solid var(--ref-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ref-text-3);
  font-weight: 700;
}

.ref-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ref-text-1);
  line-height: 1;
}

.ref-stat-cyan { color: var(--ref-cyan); }

/* ── Generic section ──────────────────────────────────────────────────────── */

.ref-section {
  margin-bottom: 32px;
}

.ref-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ref-text-1);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ref-border);
}

/* ── Tables ───────────────────────────────────────────────────────────────── */

.ref-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--ref-border);
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ref-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ref-text-3);
  background: var(--ref-surface-2);
  border-bottom: 1px solid var(--ref-border);
  font-weight: 700;
}

.ref-table tbody tr {
  border-bottom: 1px solid var(--ref-border);
  transition: background 0.1s;
}

.ref-table tbody tr:last-child { border-bottom: none; }
.ref-table tbody tr:hover { background: var(--ref-surface); }

.ref-table tbody td {
  padding: 12px 16px;
  color: var(--ref-text-1);
  vertical-align: middle;
}

.ref-empty-row {
  color: var(--ref-text-3) !important;
  font-style: italic;
  text-align: center;
  padding: 32px 16px !important;
}

.ref-muted { color: var(--ref-text-3); }
.ref-cyan  { color: var(--ref-cyan); font-weight: 600; }

.ref-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ref-border);
  color: var(--ref-cyan);
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: middle;
}

.ref-activity-type {
  text-transform: capitalize;
  color: var(--ref-text-2);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.ref-pagination {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ref-page-btn {
  background: var(--ref-surface);
  border: 1px solid var(--ref-border);
  color: var(--ref-text-2);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.ref-page-btn:hover { border-color: var(--ref-cyan); color: var(--ref-text-1); }
.ref-page-btn.active { background: var(--ref-cyan); color: #0a0a0a; border-color: var(--ref-cyan); font-weight: 700; }

/* ── Leaderboard ──────────────────────────────────────────────────────────── */

.ref-leaderboard-section {
  background: var(--ref-surface);
  border: 1px solid var(--ref-border);
  border-radius: 12px;
  padding: 20px 24px;
}

.ref-lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ref-border);
}

.ref-lb-row:last-child { border-bottom: none; }

.ref-lb-rank  { font-size: 1.1rem; min-width: 32px; }
.ref-lb-handle { font-size: 0.88rem; font-weight: 600; color: var(--ref-text-1); flex: 1; }
.ref-lb-count  { font-size: 0.8rem; color: var(--ref-cyan); font-weight: 700; }
