/*
 * Bursa Santai — web/public/style.css
 * Built by Rakit Studio.
 *
 * Private trading-desk track record. Deep warm-black canvas, restrained gold
 * accents that read like real metal (gradient + sheen), refined typography
 * and spacing. Gold is THE accent; the only non-gold accent is the RUNNING
 * pill (cool slate-blue), kept distinct on purpose.
 */

:root {
  /* Bursa Santai — exclusive gold-on-black premium theme (matches logo). */
  --bg: #070708;
  --bg-2: #0c0a0e;
  --surface: #121016;
  --surface-2: #181520;
  --surface-3: #1f1a28;
  --border: rgba(245, 184, 26, 0.085);
  --border-soft: rgba(245, 184, 26, 0.15);
  --hairline: rgba(245, 184, 26, 0.10);
  --text: #f6f1e7;
  --text-dim: #ab9f8b;
  --text-faint: #756b5a;
  --gold: #f5b81a;             /* gold — primary, from the logo */
  --gold-deep: #e6930a;        /* deep amber-gold (gradient end) */
  --gold-hi: #ffd566;          /* highlight (gradient start / sheen) */
  --accent-a: #f5b81a;         /* alias kept for compatibility */
  --accent-b: #e6930a;
  --accent-soft: rgba(245, 184, 26, 0.12);
  --gold-grad: linear-gradient(135deg, #ffd566, #f5b81a 45%, #e6930a);
  --gold-grad-soft: linear-gradient(135deg, rgba(255, 213, 102, 0.18), rgba(230, 147, 10, 0.10));
  --on-gold: #1a1205;          /* dark ink that sits on gold */
  --win: #34d399;
  --win-bg: rgba(52, 211, 153, 0.10);
  --win-bd: rgba(52, 211, 153, 0.34);
  --loss: #fb6f84;
  --loss-bg: rgba(251, 111, 132, 0.10);
  --loss-bd: rgba(251, 111, 132, 0.34);
  --break: #b9a98a;
  --break-bg: rgba(185, 169, 138, 0.10);
  --break-bd: rgba(185, 169, 138, 0.32);
  --run: #5ab0f0;              /* the ONLY non-gold accent — RUNNING pill */
  --run-bg: rgba(90, 176, 240, 0.11);
  --run-bd: rgba(90, 176, 240, 0.38);
  --pending: #8b8170;
  --pending-bg: rgba(139, 129, 112, 0.10);
  --pending-bd: rgba(139, 129, 112, 0.30);
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 4px 14px rgba(0, 0, 0, 0.5);
  --glow-gold: 0 0 30px rgba(245, 184, 26, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(245, 184, 26, 0.10), transparent 62%),
    radial-gradient(700px 420px at 88% -4%, rgba(230, 147, 10, 0.05), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint grain/texture overlay for warmth + depth. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image:
    radial-gradient(rgba(245, 184, 26, 0.025) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: screen;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #0a0809, #070708);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 0 rgba(245, 184, 26, 0.12), 0 12px 30px -18px rgba(0, 0, 0, 0.9);
}
.topbar__inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gold-grad-soft);
  border: 1px solid var(--border-soft);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.12; }
.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.015em;
  color: var(--text);
}
.brand__sub {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-top: 2px;
}
.topbar__right { display: flex; align-items: center; gap: 12px; }
.partner {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold);
  padding: 5px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--gold-grad-soft);
  white-space: nowrap;
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.live__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ── Layout ───────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

/* ── Kind toggle ──────────────────────────────────────────── */
.kindbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.kindbar__hint { margin: 0; color: var(--text-dim); font-size: 13px; }

.segmented {
  display: inline-flex;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  gap: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.segmented .seg {
  appearance: none;
  position: relative;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 19px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.segmented--sm .seg { padding: 7px 14px; font-size: 12px; }
.segmented .seg:hover { color: var(--text); }
.segmented .seg.active {
  color: var(--on-gold);
  background: var(--gold-grad);
  box-shadow: 0 3px 12px rgba(245, 184, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 700;
}
.segmented .seg:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Stat cards ───────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.card {
  position: relative;
  background:
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 124px;
  justify-content: center;
  overflow: hidden;
  animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.card:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2) { animation-delay: 0.07s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.17s; }
.card:nth-child(5) { animation-delay: 0.22s; }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* near-invisible top gold hairline */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 184, 26, 0.35), transparent);
  opacity: 0.7;
}
.card__label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}
.card__value {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.card__foot { font-size: 11px; color: var(--text-faint); letter-spacing: 0.01em; }

/* Win-rate ring is the focal point — larger, gold ring + soft outer glow. */
.card--ring {
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(245, 184, 26, 0.07), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: var(--border-soft);
}
.card--ring::after {
  content: "";
  position: absolute;
  inset: -30% 20% auto;
  height: 120px;
  background: radial-gradient(closest-side, rgba(245, 184, 26, 0.12), transparent 70%);
  pointer-events: none;
}
.card--ring .card__label { align-self: flex-start; position: relative; z-index: 1; }
.ring { position: relative; display: grid; place-items: center; z-index: 1; }
.ring__svg {
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 10px rgba(245, 184, 26, 0.25));
}
.ring__track { fill: none; stroke: rgba(245, 184, 26, 0.10); stroke-width: 9; }
.ring__bar {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring__value {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff0cc, #f5b81a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ring__sub { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; margin-top: 2px; }

.wlb { display: flex; gap: 16px; }
.wlb__seg { display: flex; flex-direction: column; gap: 2px; }
.wlb__seg b {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.wlb__seg small {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}
.wlb--win b { color: var(--win); }
.wlb--loss b { color: var(--loss); }
.wlb--break b { color: var(--break); }

/* Gold-tint the Hit-Rate / Total / Avg-RR headline numbers. */
#hitRateValue, #avgRRValue {
  background: linear-gradient(180deg, #fbe6b0, #e6930a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Filters ──────────────────────────────────────────────── */
.filters {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.filters__group { display: flex; flex-direction: column; gap: 8px; }
.filters__group--grow { flex: 1 1 200px; min-width: 180px; }
.filters__label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.select { position: relative; }
.select::after {
  content: "";
  position: absolute;
  right: 13px; top: 50%;
  width: 6px; height: 6px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  opacity: 0.8;
}
.select select {
  appearance: none;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 34px 10px 13px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-width: 160px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.select select:hover { border-color: rgba(245, 184, 26, 0.28); }
.select select:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 184, 26, 0.16);
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0 13px;
  color: var(--text-faint);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 0;
  outline: none;
}
.search input::placeholder { color: var(--text-faint); }
.search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 184, 26, 0.14);
  color: var(--gold);
}

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  appearance: none;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  background: var(--bg-2);
  color: var(--text-faint);
  transition: all 0.18s ease;
}
.chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.chip--win.active { background: var(--win-bg); color: var(--win); border-color: var(--win-bd); }
.chip--loss.active { background: var(--loss-bg); color: var(--loss); border-color: var(--loss-bd); }
.chip--break.active { background: var(--break-bg); color: var(--break); border-color: var(--break-bd); }
.chip--running.active { background: var(--run-bg); color: var(--run); border-color: var(--run-bd); }
.chip--pending.active { background: var(--pending-bg); color: #cabfa9; border-color: var(--pending-bd); }
.chip:not(.active) { opacity: 0.55; }
.chip:not(.active):hover { opacity: 0.85; border-color: rgba(245, 184, 26, 0.22); color: var(--text-dim); }

/* ── Table ────────────────────────────────────────────────── */
.tablewrap {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.tablewrap__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
  gap: 14px;
}
.tablewrap__titlewrap { display: flex; flex-direction: column; gap: 4px; }
.tablewrap__title {
  margin: 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tablewrap__running { margin: 0; font-size: 11.5px; color: var(--gold); font-weight: 600; }
.tablewrap__count { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tablescroll { overflow-x: auto; }
.jtable { width: 100%; border-collapse: collapse; min-width: 720px; }
.jtable thead th {
  position: sticky;
  top: 0;
  background: #14111a;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  padding: 13px 18px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  user-select: none;
  transition: color 0.16s;
}
.jtable th.num, .jtable td.num { text-align: right; }
.jtable th.sortable { cursor: pointer; }
.jtable th.sortable:hover { color: var(--gold); }
.jtable th.sort-asc, .jtable th.sort-desc { color: var(--gold); }
.sorticon {
  display: inline-block;
  width: 8px; height: 8px;
  margin-left: 4px;
  opacity: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  vertical-align: middle;
}
th.sort-asc .sorticon { opacity: 1; border-bottom: 5px solid var(--gold); }
th.sort-desc .sorticon { opacity: 1; border-top: 5px solid var(--gold); }

.jtable tbody td {
  padding: 15px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(245, 184, 26, 0.05);
  white-space: nowrap;
}
.jtable tbody tr { transition: background 0.14s; }
.jtable tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.012); }
.jtable tbody tr:hover { background: rgba(245, 184, 26, 0.05); }
.jtable tbody tr:last-child td { border-bottom: 0; }
.td-date { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.td-pair { font-weight: 700; color: var(--text); letter-spacing: 0.01em; }
.td-analyst { color: var(--text-dim); }
.td-num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }

.pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.pill--WIN {
  background: var(--win-bg); color: var(--win); border-color: var(--win-bd);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.14);
}
.pill--LOSS {
  background: var(--loss-bg); color: var(--loss); border-color: var(--loss-bd);
  box-shadow: 0 0 14px rgba(251, 111, 132, 0.13);
}
.pill--BREAK {
  background: var(--break-bg); color: var(--break); border-color: var(--break-bd);
}
.pill-running {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--run-bg);
  color: var(--run);
  border-color: var(--run-bd);
  box-shadow: 0 0 14px rgba(90, 176, 240, 0.15);
}
.pill-running__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--run);
  box-shadow: 0 0 0 0 rgba(90, 176, 240, 0.6);
  animation: pulse-run 1.8s infinite;
}
@keyframes pulse-run {
  0% { box-shadow: 0 0 0 0 rgba(90, 176, 240, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(90, 176, 240, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 176, 240, 0); }
}
.pill-pending {
  background: var(--pending-bg);
  color: #cabfa9;
  border-color: var(--pending-bd);
}
.rr-pos { color: var(--win); font-weight: 600; }
.rr-neg { color: var(--loss); font-weight: 600; }
.rr-running { color: var(--run); font-weight: 600; }

/* Locked level (Entry/SL) — frosted + non-selectable until the setup proves
 * itself at TP1. A subtle lock glyph signals intent, not a smudge. Stays
 * hidden regardless of hover (no reveal-on-hover). */
.lvl-hidden {
  position: relative;
  display: inline-block;
  filter: blur(5px);
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 1px;
  opacity: 0.7;
  transition: filter 0.2s;
}
.lvl-hidden::after {
  content: "🔒";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  filter: blur(0);
  opacity: 0.55;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-dim);
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: var(--gold-grad-soft);
  border: 1px solid var(--border-soft);
  color: var(--gold);
}
.empty h3 { margin: 0 0 6px; font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--text); }
.empty p { margin: 0 auto; font-size: 13px; max-width: 360px; }

/* ── Footer ───────────────────────────────────────────────── */
.foot { margin-top: 38px; text-align: center; }
.foot__brand { margin: 0 0 6px; font-size: 13px; color: var(--text-dim); }
.foot__brand strong {
  font-family: var(--display);
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.foot__note { margin: 0; font-size: 11.5px; color: var(--text-faint); }
.foot__link { text-decoration: none; transition: opacity 0.18s; }
.foot__link:hover { opacity: 0.82; }
.foot__link:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* ── Brand logo image ─────────────────────────────────────── */
.brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(245, 184, 26, 0.18), 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 940px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .card--ring { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .wrap { padding: 26px 16px 52px; }
  .topbar__inner { padding: 13px 16px; }
  .partner { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .card__value { font-size: 27px; }
  .filters { gap: 14px; }
}

/* ── Motion preferences ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
