/* DonutSMP Stats Hub — Shared Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --bg:         #111111;
  --surface:    #1e1e1e;
  --elevated:   #2a2a2a;
  --border:     rgba(255,255,255,0.08);
  --blue:       #036fff;
  --blue-light: #1698ff;
  --blue-glow:  rgba(46,156,255,0.12);
  --blue-dim:   rgba(46,156,255,0.06);
  --green:      #35d05b;
  --green-bg:   rgba(35,185,77,0.12);
  --red:        #f44336;
  --text:       #f4f4f5;
  --text-muted: #a4abb7;
  --text-dim:   #6b7280;
  --mono:       'JetBrains Mono', monospace;
  --sans:       'Inter', sans-serif;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  20px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── Nav ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17,17,17,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-right: 16px;
}

.nav-logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  image-rendering: pixelated;
}

.nav-logo .dot {
  color: var(--blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--blue-light); background: var(--blue-dim); }

.nav-badge {
  margin-left: auto;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

/* ── Page Shell ─────────────────────────────────────── */
.page {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Page Header ────────────────────────────────────── */
.page-header {
  margin-bottom: 36px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 14px;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.card-value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-family: var(--mono);
}

.card-value.blue { color: var(--blue-light); }
.card-value.green { color: var(--green); }

/* ── Stat Grid ──────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

/* ── Search Bar ─────────────────────────────────────── */
.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.search-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { border-color: var(--blue); }

.btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: filter 0.15s, transform 0.15s;
}

.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: var(--elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); background: #333; filter: none; transform: none; }
.btn-ghost.active { background: var(--blue-dim); color: var(--blue-light); border-color: rgba(46,156,255,0.3); }

/* ── Tabs ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
  flex-wrap: wrap;
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  transition: background 0.15s, color 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active { background: var(--blue); color: #fff; }

/* ── Table ──────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }

tbody td {
  padding: 11px 16px;
  color: var(--text);
}

.rank-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.rank-num.gold { color: #f59e0b; }
.rank-num.silver { color: #a4abb7; }
.rank-num.bronze { color: #cd7c2f; }

.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  image-rendering: pixelated;
}

.val-cell {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--blue-light);
}

/* ── Pagination ─────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.page-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 8px;
}

/* ── Auction Items ──────────────────────────────────── */
.auction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.auction-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auction-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 20px var(--blue-glow);
}

.auction-item-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auction-item-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.auction-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.auction-price {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
}

.auction-price span {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}

.auction-seller {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.auction-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  font-family: var(--mono);
}

.enchant-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.enchant-tag {
  background: rgba(103,73,255,0.15);
  color: #a78bfa;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.count-badge {
  background: var(--elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

/* ── Sort Row ───────────────────────────────────────── */
.sort-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── States ─────────────────────────────────────────── */
.state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-dim);
  font-size: 14px;
}

.state .icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}

.state p {
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.6;
}

.state.error .icon { color: var(--red); }
.state.loading .icon { animation: spin 1s linear infinite; display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Player Lookup Hero ─────────────────────────────── */
.lookup-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 28px;
}

.lookup-avatar {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  image-rendering: pixelated;
  border: 2px solid var(--border);
}

.lookup-hero-info h2 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.lookup-hero-info .rank-pill {
  display: inline-block;
  margin-top: 6px;
  background: var(--blue-dim);
  color: var(--blue-light);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.lookup-hero-info .location {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--mono);
}

/* ── Index Hero ─────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 72px 24px 56px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  image-rendering: pixelated;
  margin-bottom: 20px;
  border: 2px solid var(--border);
}

.hero h1 {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero h1 .accent { color: var(--blue-light); }

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 420px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  width: 180px;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: block;
}

.hero-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 30px var(--blue-glow);
  transform: translateY(-2px);
}

.hero-card .card-icon {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}

.hero-card .card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.hero-card .card-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── IP Bar ─────────────────────────────────────────── */
.ip-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.ip-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 20px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.ip-chip:hover { color: var(--blue-light); border-color: var(--blue); }
.ip-chip.copied { color: var(--green); border-color: var(--green); }

/* ── Footer ─────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 20px 24px;
  font-size: 12px;
  color: var(--text-dim);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .nav { padding: 0 16px; }
  .nav-badge { display: none; }
  .page { padding: 24px 16px 60px; }
  .hero h1 { font-size: 30px; }
  .hero-card { width: 140px; padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .search-row { flex-direction: column; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; }
  .auction-grid { grid-template-columns: 1fr; }
  .lookup-hero { flex-direction: column; text-align: center; }
}

/* ── Nav Dropdown ───────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropbtn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-light);
  background: var(--blue-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nav-dropbtn:hover { filter: brightness(1.2); }

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content {
  display: block;
}

.nav-dropdown-content a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
}

.nav-dropdown-content a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* ── Popular Searches ───────────────────────────────── */
.popular-searches {
  margin-bottom: 28px;
}

.popular-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.popular-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.popular-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px 6px 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.popular-btn:hover {
  border-color: var(--blue);
  color: var(--text);
  box-shadow: 0 2px 12px var(--blue-glow);
}

.popular-btn img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  image-rendering: pixelated;
}

.owner-btn {
  border-color: rgba(255,215,0,0.3);
  background: rgba(255,215,0,0.05);
}

.owner-btn:hover {
  border-color: gold;
  box-shadow: 0 2px 12px rgba(255,215,0,0.15);
}

@media (max-width: 640px) {
  .popular-grid { gap: 6px; }
  .popular-btn { font-size: 12px; }
}