/* ================================================
   SolAlpha Trading Terminal — Professional Theme
   Inspired by GMGN, BullX, Photon terminals
   ================================================ */

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

:root {
  --bg-0: #0c0d10;
  --bg-1: #12141a;
  --bg-2: #181b23;
  --bg-3: #1f222d;
  --bg-hover: #252836;
  --bg-active: #2a2e3d;

  --border: #1e2130;
  --border-light: #282c3c;

  --text-0: #e8e9ed;
  --text-1: #a9adb9;
  --text-2: #6b7084;
  --text-3: #454a5c;

  --green: #00c076;
  --green-bg: rgba(0, 192, 118, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --purple: #8b5cf6;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'Consolas', monospace;

  --topbar-h: 42px;
  --sidebar-w: 60px;
  --activity-w: 260px;
  --bottom-h: 28px;
}

html { font-size: 13px; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.45;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

/* === Top Bar === */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }

/* Auto Money Generator Badge */
.amg-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 6px;
  background: linear-gradient(135deg, rgba(0,192,118,0.08), rgba(139,92,246,0.08));
  border: 1px solid rgba(0,192,118,0.2);
  border-radius: 12px;
  font-size: 10px;
}

.amg-icon { font-size: 11px; }

.amg-text {
  color: var(--text-1);
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.amg-status {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  padding: 0 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  animation: amg-pulse 2s ease-in-out infinite;
}

@keyframes amg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Pipeline Strip */
.pipeline-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pipe-step {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--bg-3);
  transition: all 0.3s;
}

.pipe-step.active {
  background: var(--green-bg);
  border: 1px solid rgba(0,192,118,0.15);
}

.pipe-step.active .pipe-dot {
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
}

.pipe-step.active .pipe-label { color: var(--green); }
.pipe-step.active .pipe-count { color: var(--green); }

.pipe-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  transition: all 0.3s;
}

.pipe-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

.pipe-count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
}

.pipe-arrow {
  color: var(--text-3);
  font-size: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-0);
  letter-spacing: -0.3px;
}

.brand-tag {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.topbar-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.metric {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-label {
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-0);
}

.metric-value.positive { color: var(--green); }
.metric-value.negative { color: var(--red); }
.metric-value.neutral { color: var(--text-1); }

.metric-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.agent-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--bg-3);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-2);
}

.agent-pill.online { color: var(--green); }
.agent-pill.online .agent-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }

.agent-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.btn-agent {
  padding: 4px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-agent:hover {
  background: var(--bg-hover);
  color: var(--text-0);
  border-color: var(--text-3);
}

/* === Layout === */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  gap: 2px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
  position: relative;
}

.nav-item:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

.nav-item.active {
  color: var(--text-0);
  background: var(--bg-2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--green);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

.nav-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-top: 1px solid var(--border);
}

.ws-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-3);
}

.ws-dot.connected { background: var(--green); }
.ws-dot.disconnected { background: var(--red); }

.ws-label {
  font-size: 9px;
  color: var(--text-3);
}

/* === Main Panel === */
.main-panel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.panel.active {
  display: flex;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
}

.toolbar-search {
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-0);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  width: 200px;
  transition: border-color 0.15s;
}

.toolbar-search:focus {
  border-color: var(--text-3);
}

.toolbar-search::placeholder {
  color: var(--text-3);
}

.toolbar-select {
  padding: 4px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

.toolbar-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}

/* === Data Tables === */
.table-wrap {
  flex: 1;
  overflow: auto;
}

.table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table th {
  padding: 6px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
  transition: background 0.1s;
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.data-table .col-rank { width: 32px; text-align: center; color: var(--text-3); }
.data-table .col-price { text-align: right; font-family: var(--mono); }
.data-table .col-change { text-align: right; font-family: var(--mono); width: 70px; }
.data-table .col-num { text-align: right; font-family: var(--mono); }
.data-table .col-score { text-align: center; width: 50px; }
.data-table .col-age { width: 60px; text-align: right; }
.data-table .col-signal { width: 60px; text-align: center; }
.data-table .col-action { width: 60px; text-align: center; }
.data-table .col-link { width: 30px; text-align: center; }
.data-table .col-checks { width: 180px; }
.data-table .col-token { min-width: 120px; }

.row-empty td {
  text-align: center;
  color: var(--text-3);
  padding: 40px 10px;
  font-style: italic;
}

/* Cell styles */
.cell-token {
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-icon-sm {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-3);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.token-icon-sm img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.token-sym {
  font-weight: 600;
  color: var(--text-0);
}

.token-name-sub {
  font-size: 10px;
  color: var(--text-3);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.val-positive { color: var(--green); }
.val-negative { color: var(--red); }

/* Signal badges */
.sig-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sig-buy { background: var(--green-bg); color: var(--green); }
.sig-watch { background: var(--yellow-bg); color: var(--yellow); }
.sig-avoid { background: var(--red-bg); color: var(--red); }
.sig-sell { background: var(--red-bg); color: var(--red); }

/* Score bars */
.score-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.score-bar-mini {
  width: 30px;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}

.score-fill-mini {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.score-num {
  font-family: var(--mono);
  font-size: 11px;
  min-width: 16px;
  text-align: right;
}

/* Checks summary */
.checks-row {
  display: flex;
  gap: 4px;
  font-size: 10px;
  color: var(--text-2);
  flex-wrap: nowrap;
  overflow: hidden;
}

.check-tag {
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--bg-3);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 9px;
}

.check-tag.pass { color: var(--green); background: var(--green-bg); }
.check-tag.warn { color: var(--yellow); background: var(--yellow-bg); }
.check-tag.fail { color: var(--red); background: var(--red-bg); }

/* Action buttons */
.btn-trade {
  padding: 3px 10px;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  background: var(--bg-3);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-trade:hover {
  border-color: var(--text-3);
  color: var(--text-0);
  background: var(--bg-hover);
}

.btn-trade.buy { border-color: rgba(0,192,118,0.3); color: var(--green); }
.btn-trade.buy:hover { background: var(--green-bg); }
.btn-trade.sell { border-color: rgba(239,68,68,0.3); color: var(--red); }
.btn-trade.sell:hover { background: var(--red-bg); }

.link-ext {
  color: var(--text-3);
  font-size: 11px;
  text-decoration: none;
}

.link-ext:hover { color: var(--text-1); text-decoration: none; }

/* === Activity Panel === */
.activity-panel {
  width: var(--activity-w);
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.activity-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}

.activity-filter {
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 10px;
  outline: none;
  cursor: pointer;
}

.activity-feed {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.activity-feed::-webkit-scrollbar { width: 4px; }
.activity-feed::-webkit-scrollbar-track { background: transparent; }
.activity-feed::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 2px; }

.activity-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-3);
  font-size: 11px;
  font-style: italic;
}

.act-item {
  display: flex;
  gap: 6px;
  padding: 4px 12px;
  font-size: 11px;
  line-height: 1.4;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.act-item:hover { background: var(--bg-2); }

.act-time {
  flex-shrink: 0;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10px;
  min-width: 45px;
}

.act-tag {
  flex-shrink: 0;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
  margin-top: 1px;
}

.act-tag.scan { background: var(--blue-bg); color: var(--blue); }
.act-tag.signal { background: rgba(139,92,246,0.12); color: var(--purple); }
.act-tag.trade { background: var(--green-bg); color: var(--green); }
.act-tag.system { background: var(--bg-3); color: var(--text-2); }
.act-tag.error { background: var(--red-bg); color: var(--red); }

.act-msg {
  color: var(--text-2);
  word-break: break-word;
}

/* === Bottom Bar === */
.bottombar {
  height: var(--bottom-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* === Responsive === */
@media (max-width: 900px) {
  .activity-panel { display: none; }
  .topbar-metrics { display: none; }
  :root { --sidebar-w: 46px; }
  .nav-label { display: none; }
}

@media (max-width: 600px) {
  .sidebar { display: none; }
  .topbar { gap: 8px; }
}
