/* =============================================================================
   ROB E BANK AI — Auto Differs Search Workspace
   Risk-Controlled Auto Mode · Digit Differs scanner
   Dark glass · Gold/orange glow · Neon-green profit · Purple detail accents.
   Reuses the shared .card / .tx-* primitives; only ADS-specific classes here.
   ============================================================================= */

.ads-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ads-sub { line-height: 1.45; }

/* ── Control card: field grid (2-col desktop, 1-col mobile) ─────────────────── */
.ads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.ads-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ads-field > span {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Toggle rows ───────────────────────────────────────────────────────────── */
.ads-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(208, 149, 48, 0.13);
}

.ads-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
/* The global .toggle-switch is pointer-events:none by default (nav rows enable
   it via .strategy-row.unlocked). Re-enable it for these in-card toggles so
   they are actually clickable. */
.ads-toggle-row .toggle-switch { pointer-events: auto; cursor: pointer; }

/* ── Action buttons ────────────────────────────────────────────────────────── */
.ads-btn-row {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ads-btn-row .btn {
  flex: 1;
  min-width: 96px;
}

.ads-msg { font-weight: 600; line-height: 1.4; }

/* ── Scanner intelligence grid ─────────────────────────────────────────────── */
.ads-intel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.ads-intel-grid > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  padding: 7px 10px;
  min-width: 0;
}

.ads-intel-grid > div > b {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-intel-grid > div > b.green { color: var(--green); }

.ads-il {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ads-reason {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.17);
  border-radius: 7px;
  padding: 7px 10px;
}

/* ── Live digit map ────────────────────────────────────────────────────────── */
.ads-scan-count { white-space: nowrap; }

.ads-digit-map {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.ads-map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 46px 30px 62px;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  padding: 7px 10px;
  transition: border-color 0.2s;
}

.ads-map-row.stale { opacity: 0.45; }

.ads-map-sym {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-map-digit { font-size: 9.5px; color: var(--text-muted); text-align: left; white-space: nowrap; }
.ads-map-conf  { font-size: 11px; font-weight: 800; color: var(--gold-bright); text-align: right; font-variant-numeric: tabular-nums; }
.ads-map-dur   { font-size: 9.5px; color: var(--text-muted); text-align: center; }

.ads-map-tier {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: right;
}

.ads-map-tier.green { color: var(--green); }
.ads-map-tier.gold  { color: var(--gold-bright); }
.ads-map-tier.red   { color: #ff6b6b; }
.ads-map-tier.muted { color: var(--text-muted); }

/* ── Live status bar (modern; replaces the old activity log) ───────────────── */
.ads-statusbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.ads-sb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.ads-sb-state {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  color: var(--text-muted);
}

.ads-sb-text {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* state variants */
.ads-statusbar.live  { background: rgba(34, 197, 94, 0.07);  border-color: rgba(34, 197, 94, 0.32); }
.ads-statusbar.live  .ads-sb-state { color: var(--green); }
.ads-statusbar.live  .ads-sb-dot { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.8); animation: ads-sb-pulse 1.6s ease-in-out infinite; }

.ads-statusbar.warn  { background: rgba(208, 149, 48, 0.07); border-color: rgba(208, 149, 48, 0.32); }
.ads-statusbar.warn  .ads-sb-state { color: var(--gold-bright); }
.ads-statusbar.warn  .ads-sb-dot { background: var(--gold-bright); box-shadow: 0 0 8px rgba(234,170,54,0.75); animation: ads-sb-pulse 1.6s ease-in-out infinite; }

.ads-statusbar.stop  { background: rgba(239, 68, 68, 0.06);  border-color: rgba(239, 68, 68, 0.30); }
.ads-statusbar.stop  .ads-sb-state { color: #ff6b6b; }
.ads-statusbar.stop  .ads-sb-dot { background: #ff6b6b; }

@keyframes ads-sb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.72); }
}

/* ── Trade history rows (Trade X look, ADS-scoped) ─────────────────────────── */
.ads-hist-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color 0.2s;
}

.ads-hist-row.won     { border-left-color: var(--green); }
.ads-hist-row.lost    { border-left-color: #ff5c5c; }
.ads-hist-row.pending { border-left-color: var(--gold-bright); }
.ads-hist-row.error   { border-left-color: #ff5c5c; }

.ads-hist-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ads-hist-sym {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-hist-badge {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.ads-hist-badge.won     { background: rgba(34, 197, 94, 0.13);  color: var(--green);       border: 1px solid rgba(34, 197, 94, 0.30); }
.ads-hist-badge.lost    { background: rgba(255, 68, 68, 0.12);  color: #ff6b6b;            border: 1px solid rgba(255, 68, 68, 0.28); }
.ads-hist-badge.pending { background: rgba(208, 149, 48, 0.12); color: var(--gold-bright); border: 1px solid rgba(208, 149, 48, 0.28); }
.ads-hist-badge.error   { background: rgba(255, 68, 68, 0.12);  color: #ff6b6b;            border: 1px solid rgba(255, 68, 68, 0.28); }

.ads-hist-profit { font-size: 12px; font-weight: 800; flex-shrink: 0; }
.ads-hist-profit.green { color: var(--green); }
.ads-hist-profit.red   { color: #ff6b6b; }

.ads-hist-mid {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ads-hist-mid b { color: var(--text-secondary); }

.ads-hist-reason {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
  opacity: 0.85;
}

/* =============================================================================
   Premium polish — denser, sharper, aligned to the other strategy workspaces.
   Scoped under .ads-workspace so the shared .card / .tx-* primitives used by
   Trade X stay untouched.
   ============================================================================= */

/* Header card — gold-lit premium gradient + soft glow */
.ads-workspace > .card:first-child {
  background:
    radial-gradient(130% 150% at 88% -30%, rgba(208, 149, 48, 0.14), transparent 52%),
    radial-gradient(90% 100% at 4% 130%, rgba(124, 58, 237, 0.07), transparent 60%),
    linear-gradient(168deg, #15110a 0%, #080604 100%);
  border-color: rgba(208, 149, 48, 0.32);
  box-shadow: 0 0 30px rgba(208, 149, 48, 0.11), 0 14px 34px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(245, 220, 170, 0.09);
}

/* Card titles + icons — crisp and consistent across the workspace */
.ads-workspace .card-title { letter-spacing: 0.015em; font-weight: 800; }
.ads-workspace .card-icon { filter: drop-shadow(0 0 6px rgba(208, 149, 48, 0.35)); }

/* Stat boxes (header + history) — compact, vertically centered, even height */
.ads-workspace .tx-stats-row { gap: 8px; }
.ads-workspace .tx-stat-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 9px 12px;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}
.ads-workspace .tx-stat-value { font-size: 17px; font-weight: 800; line-height: 1.05; }
.ads-workspace .tx-stat-label { letter-spacing: 0.05em; opacity: 0.92; }

/* Scanner intel — tighter, value-forward, confidence tile highlighted */
.ads-intel-grid { gap: 7px; }
.ads-intel-grid > div { min-height: 42px; padding: 7px 11px; border-radius: 8px; }
.ads-intel-grid > div > b { font-size: 14px; }
.ads-intel-grid > div:nth-child(3) {     /* Signal Confidence */
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.18);
}

/* Reason plate + status bar — a touch more presence */
.ads-reason { font-size: 11px; }
.ads-statusbar { padding: 10px 13px; border-radius: 10px; }

/* Digit map — subtle row hover for a live feel */
.ads-map-row:hover { border-color: rgba(208, 149, 48, 0.28); }
.ads-map-conf { font-size: 11.5px; }

/* ── Mobile: single-column ─────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .ads-grid { grid-template-columns: 1fr; }
  .ads-btn-row .btn { min-width: 0; flex: 1 1 30%; font-size: 11px; padding-left: 6px; padding-right: 6px; }
  .ads-digit-map { max-height: 220px; }
  .ads-map-row { grid-template-columns: minmax(0, 1fr) 54px 42px 26px 54px; gap: 5px; padding: 6px 8px; }
  .ads-map-sym { font-size: 10.5px; }
  .ads-workspace .tx-stat-value { font-size: 15px; }
}
