/* ═══════════════════════════════════════════════════════════════
   BapakBahagia Smart Trade — Professional Component Library
   ═══════════════════════════════════════════════════════════════ */

/* ── Typography ─────────────────────────────────────────────────── */
:root {
  --font-mono: 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
  --text-xs: 10px;  --text-sm: 11px;  --text-base: 12px;
  --text-md:  13px; --text-lg:  15px; --text-xl:   18px;
  --gap-xs: 4px; --gap-sm: 8px; --gap-md: 12px; --gap-lg: 20px;
  --row-h:  34px; --cell-px: 10px; --cell-py: 7px;
  --glow-green: 0 0 10px rgba(63,185,80,.35);
  --glow-red:   0 0 10px rgba(248,81,73,.35);
  --glow-blue:  0 0 10px rgba(0,212,255,.25);
  --tier-free:    #6b7280; --tier-starter: #3b82f6;
  --tier-pro:     #8b5cf6; --tier-elite:   #f59e0b; --tier-whale: #ec4899;
}

/* ── Number formatting ──────────────────────────────────────────── */
.num      { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num.up   { color: var(--green); }
.num.down { color: var(--red); }
.dim      { color: var(--muted); }

/* ── Dense data table (DexScreener style) ───────────────────────── */
.table-dense { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table-dense thead th {
  padding: var(--cell-py) var(--cell-px);
  font-size: var(--text-sm); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; background: var(--bg2); z-index: 1;
}
.table-dense tbody td {
  padding: 6px var(--cell-px); height: var(--row-h);
  border-bottom: 1px solid rgba(48,54,61,.5); white-space: nowrap;
  font-size: var(--text-base);
}
.table-dense tbody tr { transition: background .1s; }
.table-dense tbody tr:hover { background: rgba(255,255,255,.03); }
.table-dense .col-num  { text-align: right; font-family: var(--font-mono); }
.table-dense .col-rank { color: var(--muted); font-weight: 700; width: 36px; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text); }

/* ── Token logo/icon ─────────────────────────────────────────────── */
.tok-logo     { width: 20px; height: 20px; border-radius: 50%;
                object-fit: cover; background: var(--bg3); flex-shrink: 0;
                display: inline-block; vertical-align: middle; }
.tok-logo.lg  { width: 32px; height: 32px; }
.tok-logo.xl  { width: 48px; height: 48px; }
.tok-logo-fallback { display: flex; align-items: center; justify-content: center;
                     background: var(--bg3); border-radius: 50%;
                     font-size: 10px; font-weight: 700; color: var(--muted); }

/* ── Metric card ─────────────────────────────────────────────────── */
.metric-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.metric-card .mc-value { font-size: 22px; font-weight: 800; line-height: 1; font-family: var(--font-mono); }
.metric-card .mc-label { font-size: var(--text-sm); color: var(--muted); font-weight: 500; }
.metric-card .mc-sub   { font-size: var(--text-xs); color: var(--muted); margin-top: 2px; }
.metric-card.accent  { border-color: rgba(0,212,255,.3); background: rgba(0,212,255,.05); }
.metric-card.green   { border-color: rgba(63,185,80,.3); background: rgba(63,185,80,.05); }
.metric-card.red     { border-color: rgba(248,81,73,.3); background: rgba(248,81,73,.05); }
.metric-card.yellow  { border-color: rgba(210,153,34,.3); background: rgba(210,153,34,.05); }
.metric-card.blue    { border-color: rgba(59,130,246,.3); background: rgba(59,130,246,.05); }

/* ── Buy/Sell volume bar ─────────────────────────────────────────── */
.vol-bar      { height: 4px; border-radius: 2px; background: var(--bg3); overflow: hidden; position: relative; }
.vol-bar-buy  { position: absolute; left: 0; top: 0; height: 100%; background: var(--green); border-radius: 2px; }
.vol-bar-sell { position: absolute; right: 0; top: 0; height: 100%; background: var(--red); border-radius: 2px; }

/* ── Change badge ────────────────────────────────────────────────── */
.chg-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 6px; border-radius: 5px; font-size: var(--text-sm);
  font-weight: 700; font-family: var(--font-mono);
}
.chg-badge.up   { color: var(--green); background: rgba(63,185,80,.12); }
.chg-badge.down { color: var(--red);   background: rgba(248,81,73,.12); }
.chg-badge.flat { color: var(--muted); background: var(--bg3); }

/* ── Status pill ─────────────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: var(--text-sm); font-weight: 700; letter-spacing: .02em;
}
.status-pill.live   { background: rgba(248,81,73,.15); color: var(--red);    border: 1px solid rgba(248,81,73,.3); }
.status-pill.dry    { background: rgba(210,153,34,.15); color: var(--yellow); border: 1px solid rgba(210,153,34,.3); }
.status-pill.ready  { background: rgba(63,185,80,.15);  color: var(--green);  border: 1px solid rgba(63,185,80,.3); }
.status-pill.paused { background: rgba(139,92,246,.15); color: #a78bfa;       border: 1px solid rgba(139,92,246,.3); }
.status-pill .live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }

/* ── Tier badge (inline) ─────────────────────────────────────────── */
.tier-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: 4px; font-size: var(--text-xs);
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.tier-badge.free    { background: rgba(107,114,128,.15); color: var(--tier-free); }
.tier-badge.starter { background: rgba(59,130,246,.15);  color: var(--tier-starter); }
.tier-badge.pro     { background: rgba(139,92,246,.15);  color: var(--tier-pro); }
.tier-badge.elite   { background: rgba(245,158,11,.15);  color: var(--tier-elite); }
.tier-badge.whale   { background: rgba(236,72,153,.15);  color: var(--tier-whale); }

/* ── Nav tier lock ───────────────────────────────────────────────── */
.nav-tier-lock {
  margin-left: auto; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; opacity: .75;
  text-transform: uppercase; letter-spacing: .04em;
}
.nav-tier-lock.pro     { background: rgba(139,92,246,.2); color: #c4b5fd; }
.nav-tier-lock.elite   { background: rgba(245,158,11,.2); color: #fcd34d; }
.nav-tier-lock.starter { background: rgba(59,130,246,.2); color: #93c5fd; }
.nav-item.locked { opacity: .5; cursor: not-allowed; }
.nav-item.locked:hover { background: transparent !important; }

/* ── Upgrade gate card ───────────────────────────────────────────── */
.upgrade-gate {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 64px 32px; min-height: 400px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; margin: 16px;
}
.upgrade-gate .gate-icon { font-size: 52px; margin-bottom: 16px; opacity: .6; }
.upgrade-gate h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.upgrade-gate p  { color: var(--muted); font-size: 13px; max-width: 400px; margin-bottom: 24px; }
.upgrade-gate .gate-features {
  list-style: none; text-align: left; margin-bottom: 28px;
  display: inline-block;
}
.upgrade-gate .gate-features li {
  font-size: 13px; color: var(--muted); padding: 4px 0 4px 22px;
  position: relative;
}
.upgrade-gate .gate-features li::before {
  content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700;
}
.upgrade-gate .gate-cta {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; border: none; padding: 12px 32px; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer; letter-spacing: .02em;
  transition: opacity .2s; text-decoration: none; display: inline-block;
}
.upgrade-gate .gate-cta:hover { opacity: .85; }

/* ── Pricing cards ───────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.pricing-card {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 24px 20px; background: var(--bg2);
  display: flex; flex-direction: column; gap: 6px;
}
.pricing-card.featured { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2); }
.pricing-tier  { font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.pricing-price { font-size: 34px; font-weight: 800; line-height: 1; margin: 8px 0 4px; font-family: var(--font-mono); }
.pricing-per   { font-size: var(--text-sm); color: var(--muted); margin-bottom: 16px; }
.pricing-feat  { list-style: none; font-size: var(--text-base); }
.pricing-feat li { padding: 5px 0 5px 20px; position: relative; border-bottom: 1px solid rgba(48,54,61,.5); }
.pricing-feat li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.pricing-feat li.locked::before { content: '✗'; color: var(--red); }
.pricing-btn {
  margin-top: auto; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; text-align: center;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  transition: all .15s;
}
.pricing-btn:hover { border-color: var(--accent); color: var(--accent); }
.pricing-btn.primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: none; color: #fff;
}

/* ── Row flash animations (for real-time data) ───────────────────── */
@keyframes flashGreen { 0%,100%{background:transparent} 30%{background:rgba(63,185,80,.15)} }
@keyframes flashRed   { 0%,100%{background:transparent} 30%{background:rgba(248,81,73,.15)} }
.row-flash-green { animation: flashGreen .8s ease; }
.row-flash-red   { animation: flashRed   .8s ease; }

/* ── Sparkline ───────────────────────────────────────────────────── */
.sparkline { width: 80px; height: 28px; display: inline-block; vertical-align: middle; }

/* ── Search / filter bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.filter-bar input[type="text"] {
  padding: 5px 10px; font-size: var(--text-base);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); outline: none; width: 180px;
}
.filter-bar input[type="text"]:focus { border-color: var(--accent); }
.filter-pill {
  padding: 3px 10px; border-radius: 20px; font-size: var(--text-sm);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all .15s;
}
.filter-pill.active { background: rgba(0,212,255,.1); border-color: var(--accent); color: var(--accent); }
.filter-pill:hover  { border-color: var(--muted); color: var(--text); }

/* ── Section header ──────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.section-header h3 { font-size: var(--text-md); font-weight: 700; }
.section-header .section-sub { font-size: var(--text-sm); color: var(--muted); margin-left: 2px; }
.section-header .section-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ── Collapsible log panel ───────────────────────────────────────── */
#log-panel {
  height: 80px; overflow-y: auto; font-size: 11px;
  border-top: 1px solid var(--border); padding: 4px 16px;
  background: var(--bg); transition: height .2s;
  font-family: var(--font-mono);
}
#log-panel.expanded { height: 180px; }
#log-panel .log-line { padding: 1px 0; border-bottom: 1px solid rgba(48,54,61,.3); }
#log-panel .log-line:last-child { border-bottom: none; }
.log-toggle {
  display: flex; align-items: center; gap: 6px; padding: 3px 16px;
  background: var(--bg2); border-top: 1px solid var(--border);
  cursor: pointer; font-size: var(--text-xs); color: var(--muted);
  user-select: none;
}
.log-toggle:hover { color: var(--text); }

/* ── TradingView chart embed ─────────────────────────────────────── */
.chart-frame {
  width: 100%; height: 400px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg2);
}

/* ── Quick-action floating panel ─────────────────────────────────── */
.quick-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.quick-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--accent); color: #000; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,212,255,.3); transition: transform .15s;
}
.quick-btn:hover { transform: scale(1.1); }

/* ── Data timestamp ──────────────────────────────────────────────── */
.ts-label {
  font-size: var(--text-xs); color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.ts-label::before { content: ''; width: 5px; height: 5px; border-radius: 50%;
                    background: var(--green); animation: livePulse 2s infinite; }

/* ── Copy address button ─────────────────────────────────────────── */
.copy-addr {
  font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted);
  cursor: pointer; transition: color .15s; display: inline-flex; align-items: center; gap: 4px;
}
.copy-addr:hover { color: var(--accent); }
.copy-addr.copied { color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   Alpha Hunt Components
   ═══════════════════════════════════════════════════════════════ */

/* ── Score tier badge ─────────────────────────────────────────────── */
.alpha-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  line-height: 1.5; white-space: nowrap;
}
.alpha-badge-alpha {
  background: rgba(124,58,237,.25); color: #c4b5fd;
  border: 1px solid rgba(124,58,237,.5);
  box-shadow: 0 0 6px rgba(124,58,237,.3);
}
.alpha-badge-good {
  background: rgba(34,197,94,.18); color: #4ade80;
  border: 1px solid rgba(34,197,94,.4);
}
.alpha-badge-watch {
  background: rgba(245,158,11,.18); color: #fcd34d;
  border: 1px solid rgba(245,158,11,.4);
}
.alpha-badge-weak {
  background: rgba(139,148,158,.1); color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Score breakdown bar (5 coloured segments) ────────────────────── */
.alpha-bar {
  display: flex; gap: 2px; height: 4px; border-radius: 2px;
  overflow: hidden; background: var(--bg3); width: 100%; min-width: 80px;
  margin-top: 4px;
}
.alpha-bar-seg { height: 100%; border-radius: 1px; min-width: 2px; }
.alpha-bar-seg.safety    { background: #22c55e; }
.alpha-bar-seg.momentum  { background: var(--accent); }
.alpha-bar-seg.community { background: #a78bfa; }
.alpha-bar-seg.liquidity { background: #38bdf8; }
.alpha-bar-seg.timing    { background: #fb923c; }

/* ── Compact select for filter bar ───────────────────────────────── */
.select-sm {
  padding: 4px 8px; font-size: 12px; height: 28px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); outline: none;
  cursor: pointer; transition: border-color .15s;
}
.select-sm:focus { border-color: var(--accent); }
