/* Cointracker - palette is intentionally cool/teal/cyan to differentiate
   from the cryptexhub amber/orange branding. */

:root {
  --bg:        #020617;   /* slate-950 */
  --surface:   #0f172a;   /* slate-900 */
  --surface-2: #1e293b;   /* slate-800 */
  --border:    #1e293b;
  --border-2:  #334155;   /* slate-700 */
  --text:      #f1f5f9;   /* slate-100 */
  --text-2:    #cbd5e1;   /* slate-300 */
  --muted:     #94a3b8;   /* slate-400 */
  --primary:   #06b6d4;   /* cyan-500 */
  --primary-2: #0891b2;   /* cyan-600 */
  --accent:    #10b981;   /* emerald-500 */
  --rose:      #f43f5e;   /* rose-500 */
  --max-w:     1200px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--text); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ─── Header ───────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0;
  background: rgba(2,6,23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; }
.brand-text { background: linear-gradient(90deg, #67e8f9, #06b6d4); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.primary-nav { display: flex; gap: 24px; }
.primary-nav a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.primary-nav a:hover { color: var(--text); }

/* ─── Hero / coin stats ────────────────────────────────────────── */
.hero { padding: 56px 24px 40px; }
.hero h1 {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 28px; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em;
}
.ticker-symbol {
  background: linear-gradient(90deg, #67e8f9, #06b6d4);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-suffix { color: var(--text); }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.45);
  color: var(--accent); border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em;
}
.live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.hero-credentials { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.credential::before { content: "✓ "; color: var(--accent); margin-right: 4px; font-weight: 700; }

.hero-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.stat { display: flex; align-items: baseline; gap: 12px; }
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; font-weight: 600; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }

/* ─── Tabs ─────────────────────────────────────────────────────── */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 28px 0 16px;
}
.tab {
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  border-radius: 8px; cursor: pointer; transition: all .15s;
  letter-spacing: 0.02em;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 4px 12px rgba(6,182,212,0.25); }

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 28px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.card-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.muted { color: var(--muted); font-size: 13px; }
.badge {
  background: rgba(6,182,212,0.12);
  border: 1px solid rgba(6,182,212,0.45);
  color: #67e8f9;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}

/* ─── Table ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  min-width: 820px;
}
thead th {
  text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  position: relative;
}
thead th:hover { color: var(--text); }
thead th .sort-arrow { margin-left: 6px; opacity: 0.5; font-size: 10px; }
thead th.is-sort-asc .sort-arrow,
thead th.is-sort-desc .sort-arrow { opacity: 1; color: var(--primary); }
.col-rank { width: 56px; }

tbody td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
.exchange-link { color: var(--text); font-weight: 600; }
.exchange-link:hover { color: var(--primary); }
.pair-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text);
}
.muted-cell { color: var(--muted); }

/* ─── Pagination ───────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.pagination button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.pagination button:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Chart ────────────────────────────────────────────────────── */
.chart-card .card-head { padding: 18px 22px; }
.chart-mount {
  height: 480px;
  background: var(--surface);
}

/* ─── About + FAQ ──────────────────────────────────────────────── */
.about-section, .faq-section { padding-top: 16px; padding-bottom: 32px; max-width: 800px; }
.about-section h2, .faq-section h2 {
  font-size: 24px; font-weight: 700; letter-spacing: -0.01em;
  margin: 12px 0 18px;
}
.about-section p { color: var(--text-2); margin: 0 0 14px; }
.faq-section details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.faq-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
  content: "+";
  position: absolute; right: 0; top: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 16px; font-weight: 700;
  transition: transform .15s;
}
.faq-section details[open] summary::after { content: "−"; transform: rotate(0deg); }
.faq-section details[open] { border-color: var(--primary-2); }
.faq-section details p {
  color: var(--text-2);
  margin: 12px 0 0;
}

/* ─── Footer ───────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 32px;
}
.site-footer p { color: var(--muted); font-size: 13px; margin: 0; }

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .primary-nav { display: none; }
  .hero h1 { font-size: 22px; gap: 10px; }
  .hero-credentials { gap: 12px; font-size: 12px; }
  .stat { gap: 8px; }
  .stat-value { font-size: 16px; }
  .chart-mount { height: 360px; }
}
