/* PulseMint Design System - Shared styles across all pages */

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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a26;
  --surface-3: #222233;
  --border: #2a2a3a;
  --border-hover: #3a3a4a;
  --green: #00ff88;
  --green-dim: #00cc6a;
  --green-glow: rgba(0, 255, 136, 0.15);
  --green-bg: rgba(0, 255, 136, 0.08);
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.15);
  --red: #ff4466;
  --red-glow: rgba(255, 68, 102, 0.15);
  --yellow: #fbbf24;
  --yellow-glow: rgba(251, 191, 36, 0.15);
  --blue: #38bdf8;
  --blue-glow: rgba(56, 189, 248, 0.15);
  --text: #e4e4ef;
  --text-dim: #8888a0;
  --text-muted: #555566;
  --sol: #9945ff;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* Animated grid background */
.grid-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.content { position: relative; z-index: 1; }

/* ======== NAV BAR ======== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--green);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--green);
  background: var(--green-glow);
}

/* ======== PAGE LAYOUT ======== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-dim);
  font-size: 1rem;
}

.page-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--green);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* ======== STATS CARDS ======== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.3s;
}

.stat-card:hover {
  border-color: var(--border-hover);
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
}

.stat-card .value.purple { color: var(--purple); }
.stat-card .value.yellow { color: var(--yellow); }
.stat-card .value.blue { color: var(--blue); }
.stat-card .value.red { color: var(--red); }

.stat-card .sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ======== FILTERS ======== */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.filter-btn.active {
  background: var(--green-glow);
  border-color: rgba(0,255,136,0.3);
  color: var(--green);
}

/* ======== TABLE ======== */
.data-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(42,42,58,0.5);
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ======== BADGES ======== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.badge.green {
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
}

.badge.purple {
  background: var(--purple-glow);
  color: var(--purple);
  border: 1px solid rgba(139,92,246,0.2);
}

.badge.red {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(255,68,102,0.2);
}

.badge.yellow {
  background: var(--yellow-glow);
  color: var(--yellow);
  border: 1px solid rgba(251,191,36,0.2);
}

.badge.blue {
  background: var(--blue-glow);
  color: var(--blue);
  border: 1px solid rgba(56,189,248,0.2);
}

.badge.dim {
  background: rgba(136,136,160,0.1);
  color: var(--text-dim);
  border: 1px solid rgba(136,136,160,0.15);
}

/* ======== VELOCITY BAR ======== */
.velocity-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  width: 100px;
}

.velocity-bar .fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green), var(--purple));
  transition: width 0.5s ease;
}

/* ======== CHART CONTAINER ======== */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.chart-container .chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.chart-container .chart-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* Simple bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-top: 1rem;
}

.bar-chart .bar {
  flex: 1;
  min-width: 20px;
  background: linear-gradient(180deg, var(--green), rgba(0,255,136,0.3));
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: all 0.3s;
  cursor: pointer;
}

.bar-chart .bar:hover {
  filter: brightness(1.3);
}

.bar-chart .bar .tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 4px;
}

.bar-chart .bar:hover .tooltip {
  display: block;
}

.bar-labels {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.bar-labels span {
  flex: 1;
  text-align: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ======== GRID LAYOUTS ======== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

/* ======== LOADING ======== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======== TICKER SCROLL ======== */
.live-ticker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.live-ticker .live-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse-dot 1s ease-in-out infinite;
  flex-shrink: 0;
}

.live-ticker .ticker-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.live-ticker .ticker-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.live-ticker .ticker-scroll::-webkit-scrollbar { display: none; }

.live-ticker .ticker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.live-ticker .ticker-item .sym {
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.live-ticker .ticker-item .pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.live-ticker .ticker-item .pct.up { color: var(--green); }
.live-ticker .ticker-item .pct.down { color: var(--red); }

/* ======== RESPONSIVE ======== */
@media (max-width: 768px) {
  .page { padding: 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .nav { padding: 0 1rem; }
  .data-table { overflow-x: auto; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.5rem; }
}

/* ======== EMPTY STATE ======== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* ======== FOOTER ======== */
.app-footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.app-footer .brand {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.app-footer .sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sol-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
  padding: 4px 12px;
  background: var(--purple-glow);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--purple);
  font-family: 'JetBrains Mono', monospace;
}

/* ======== TREND CARD (Mobile) ======== */
.trend-cards {
  display: none;
}

@media (max-width: 768px) {
  .trend-cards { display: grid; gap: 12px; }
  .data-table.hide-mobile { display: none; }

  .trend-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
  }

  .trend-card .tc-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
  }

  .trend-card .tc-topic {
    font-weight: 600;
    font-size: 0.95rem;
  }

  .trend-card .tc-meta {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
    flex-wrap: wrap;
  }
}

/* ======== TARGET TRACKER ======== */
.target-tracker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.target-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.target-header .target-val {
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
  font-size: 0.85rem;
}

.target-bar {
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.target-bar .target-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  transition: width 1s ease;
  position: relative;
}

.target-bar .target-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--yellow);
  z-index: 2;
}

.target-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}
