/* ═══════════════════════════════════════════════════════════
   ETH Core AI — WAR ROOM Theme
   Dashboard-only. Loads after style.css.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&display=swap');

/* ── War Room body ───────────────────────────────────────── */
.wr-body {
  background: #03040a;
  padding-bottom: 0;
}
.wr-body::before {
  background:
    radial-gradient(ellipse 500px 350px at 0% 25%, rgba(245,183,49,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 100% 75%, rgba(255,45,107,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 50% 100%, rgba(0,212,255,0.02) 0%, transparent 70%);
  animation: none;
}
.wr-body::after {
  background-image:
    linear-gradient(rgba(245,183,49,0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,183,49,0.016) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ── Header ──────────────────────────────────────────────── */
.wr-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3,4,10,0.97);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid rgba(245,183,49,0.1);
  padding-top: calc(6px + var(--safe-top));
  box-shadow: 0 1px 30px rgba(245,183,49,0.04);
}
.wr-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px 8px;
  gap: 8px;
}
.wr-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  min-width: 0;
}
.wr-brand-name {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--orange);
  letter-spacing: 0.5px;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(245,183,49,0.35);
}
.wr-brand-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.wr-avatar-link {
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}
.wr-avatar-img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid rgba(245,183,49,0.4);
  filter: drop-shadow(0 0 8px rgba(245,183,49,0.25));
  transition: filter 0.25s, transform 0.25s;
}
.wr-avatar-img:hover {
  filter: drop-shadow(0 0 18px rgba(245,183,49,0.55));
  transform: scale(1.07);
}
.wr-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.wr-header-right::-webkit-scrollbar { display: none; }
.wr-nav-link {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-decoration: none;
}
.wr-nav-link:hover, .wr-nav-link--active {
  border-color: rgba(245,183,49,0.4);
  color: var(--orange);
  background: rgba(245,183,49,0.07);
  box-shadow: 0 0 10px rgba(245,183,49,0.1);
  text-decoration: none;
}
.wr-ticker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 7px;
  border-top: 1px solid rgba(255,255,255,0.03);
  font-size: 0.7rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.wr-ticker-bar::-webkit-scrollbar { display: none; }
.wr-ticker-price { color: var(--text-muted); }
.wr-bar-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,0.15); flex-shrink: 0; }
.wr-bar-item { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 0.67rem; }
.wr-hb { display: flex; align-items: center; gap: 3px; color: var(--text-muted); }

/* ── Layout ──────────────────────────────────────────────── */
.wr-layout {
  display: flex;
  flex-direction: column;
}
.wr-left, .wr-right {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 900px) {
  .wr-body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
  }
  .wr-header { flex-shrink: 0; }
  .wr-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 390px 1fr;
    min-height: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
  .wr-left {
    overflow-y: auto;
    scrollbar-width: none;
    border-right: 1px solid rgba(245,183,49,0.07);
    padding: 16px 14px 80px;
  }
  .wr-left::-webkit-scrollbar { display: none; }
  .wr-right {
    overflow-y: auto;
    padding: 16px 16px 80px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245,183,49,0.15) transparent;
  }
  .wr-right::-webkit-scrollbar { width: 4px; }
  .wr-right::-webkit-scrollbar-track { background: transparent; }
  .wr-right::-webkit-scrollbar-thumb { background: rgba(245,183,49,0.2); border-radius: 2px; }
}
@media (max-width: 899px) {
  .wr-layout { padding-bottom: calc(var(--safe-bot) + 60px); }
}

/* ── Panel (replaces .card) ──────────────────────────────── */
.wr-panel {
  background: rgba(255,255,255,0.016);
  border: 1px solid rgba(255,255,255,0.045);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}
.wr-panel:hover { border-color: rgba(245,183,49,0.08); }
.wr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}
.wr-panel-title {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(245,183,49,0.7);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.wr-panel-title::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 10px;
  background: var(--orange);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(245,183,49,0.5);
  flex-shrink: 0;
}

/* Section dividers between groups */
.wr-section-divider {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(245,183,49,0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 4px 0;
}
.wr-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(245,183,49,0.1);
}

/* ── Signal card ─────────────────────────────────────────── */
.wr-signal-block {
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.012);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wr-signal-block::before {
  content: "";
  position: absolute;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(245,183,49,0.05);
  filter: blur(70px);
  pointer-events: none;
}
.wr-signal--long {
  border-color: rgba(0,255,136,0.22);
  background: linear-gradient(160deg, rgba(0,255,136,0.045) 0%, rgba(3,4,10,0.85) 65%);
}
.wr-signal--long.wr-signal--exec {
  box-shadow: 0 0 60px rgba(0,255,136,0.12);
  animation: longGlow 2.5s ease-in-out infinite;
}
.wr-signal--short {
  border-color: rgba(255,45,107,0.22);
  background: linear-gradient(160deg, rgba(255,45,107,0.045) 0%, rgba(3,4,10,0.85) 65%);
}
.wr-signal--short.wr-signal--exec {
  animation: shortGlow 2.5s ease-in-out infinite;
}
.wr-signal--wait {
  border-color: rgba(245,183,49,0.18);
  background: linear-gradient(160deg, rgba(245,183,49,0.03) 0%, rgba(3,4,10,0.85) 65%);
}
.wr-exec-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 5px 14px;
  border-radius: 4px;
  background: rgba(0,255,136,0.1);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.25);
  box-shadow: 0 0 16px rgba(0,255,136,0.2);
  animation: execPulse 1.5s ease-in-out infinite;
  text-transform: uppercase;
  align-self: flex-start;
}

/* Gauge */
.wr-signal-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.wr-gauge-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}
.wr-gauge-spin {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: wr-spin-slow 12s linear infinite;
  opacity: 0.18;
}
@keyframes wr-spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.wr-gauge-svg {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  transform: rotate(-90deg);
}
.wr-gauge-wrap .gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.wr-gauge-wrap .gauge-val {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}
.wr-gauge-wrap .gauge-val-denom {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.wr-gauge-wrap .gauge-unit {
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* Decision word — matches mockup text-8xl font-black */
.wr-decision-label {
  font-size: 5.8rem;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 0.9;
  text-align: center;
}
/* WAIT is WHITE per mockup, LONG=green, SHORT=red */
.wr-body .decision--wait  {
  color: #ffffff !important;
  text-shadow: 0 0 40px rgba(255,255,255,0.12);
}
.wr-body .decision--long  {
  color: var(--green) !important;
  text-shadow: 0 0 40px rgba(0,255,136,0.3);
}
.wr-body .decision--short {
  color: var(--red) !important;
  text-shadow: 0 0 40px rgba(255,45,107,0.3);
}

.wr-decision-message {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 280px;
}
/* Reasoning panel — glass card with left orange border (matches mockup) */
.wr-reasoning-panel {
  width: 100%;
  max-width: 340px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--orange);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: left;
  backdrop-filter: blur(8px);
}
.wr-reasoning-panel strong {
  color: var(--text-hi);
  font-weight: 600;
}

.wr-signal-block .gate-row {
  justify-content: center;
}
.wr-hint {
  font-size: 0.72rem;
  color: rgba(245,183,49,0.6);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(245,183,49,0.04);
  border: 1px solid rgba(245,183,49,0.1);
  border-radius: 6px;
}
.wr-signal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  flex-wrap: wrap;
}
.wr-meta-price { color: var(--blue); }
.wr-trade-id { color: var(--blue); font-size: 0.62rem; }

/* ── Trade Plan ──────────────────────────────────────────── */
.wr-levels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.wr-level {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}
.wr-level-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
}
.wr-level-value {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-hi);
  word-break: break-word;
}
.wr-level--entry { border-left: 2px solid var(--blue); }
.wr-level--entry .wr-level-value { color: var(--blue); }
.wr-level--sl { border-left: 2px solid var(--red); }
.wr-level--sl .wr-level-value { color: var(--red); }
.wr-level--tp1 { border-left: 2px solid var(--green); }
.wr-level--tp1 .wr-level-value { color: var(--green); }
.wr-level--tp2 { border-left: 2px solid var(--green-dim); }
.wr-level--tp2 .wr-level-value { color: var(--green-dim); }
.wr-rr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 9px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
}
.wr-rr-req { font-size: 0.63rem; color: var(--text-muted); }
.wr-plan-note {
  margin-top: 9px;
  font-size: 0.67rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 7px 10px;
  background: rgba(245,183,49,0.03);
  border: 1px solid rgba(245,183,49,0.08);
  border-radius: 5px;
  line-height: 1.5;
}

/* ── MTF matrix overrides ────────────────────────────────── */
.wr-panel .mtf-table {
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
}
.wr-panel .mtf-table th {
  font-size: 0.58rem;
  color: rgba(245,183,49,0.5);
  border-bottom-color: rgba(245,183,49,0.1);
  letter-spacing: 1px;
  padding: 6px 8px;
}
.wr-panel .mtf-table td {
  padding: 8px 8px;
  border-bottom-color: rgba(255,255,255,0.025);
}
.wr-panel .mtf-table td:first-child {
  color: var(--orange);
}
.wr-panel .mtf-table tbody tr:hover {
  background: rgba(245,183,49,0.02);
}
.wr-mtf-reason {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ── Intelligence grid ───────────────────────────────────── */
.wr-intel-group { margin-bottom: 12px; }
.wr-intel-group:last-child { margin-bottom: 0; }
.wr-intel-label {
  font-size: 0.57rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: rgba(245,183,49,0.4);
  margin-bottom: 7px;
  font-weight: 800;
}
.wr-intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 5px;
}
.wr-intel-grid--3 { grid-template-columns: repeat(3, 1fr); }
.wr-intel-tile {
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}
.wr-intel-tile:hover { border-color: rgba(245,183,49,0.1); }
.wr-intel-key {
  font-size: 0.57rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}
.wr-intel-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-hi);
  font-family: 'JetBrains Mono', monospace;
  word-break: break-word;
}

/* ── Sentiment ───────────────────────────────────────────── */
.wr-sentiment-body { display: flex; flex-direction: column; gap: 8px; }
.wr-fg-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-hi);
  text-align: center;
}
.wr-fg-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.wr-fg-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--orange) 50%, var(--green) 100%);
  transition: width 0.8s ease;
}
.wr-fg-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.57rem;
  color: var(--text-muted);
}

/* ── Macro ───────────────────────────────────────────────── */
.wr-macro-event {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-hi);
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── News ────────────────────────────────────────────────── */
.wr-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.wr-headline {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.55;
  padding: 8px 11px;
  background: rgba(0,0,0,0.22);
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 8px;
}
.wr-footnote {
  font-size: 0.67rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
}
.wr-no-data {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.wr-ai-unavailable {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(245,183,49,0.04);
  border: 1px solid rgba(245,183,49,0.12);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--orange);
  line-height: 1.5;
}

/* ── Component overrides ─────────────────────────────────── */
/* Deriv / SM / CQ cards → War Room tile style */
.wr-panel .deriv-card,
.wr-panel .sm-cell {
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.04);
  border-radius: 6px;
}
.wr-panel .deriv-card:hover { border-color: rgba(245,183,49,0.1); }
.wr-panel .deriv-label,
.wr-panel .sm-label { color: rgba(245,183,49,0.45); letter-spacing: 0.8px; }
.wr-panel .deriv-value,
.wr-panel .sm-value { font-family: 'JetBrains Mono', monospace; }
.wr-panel .deriv-reason { background: rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.04); }
.wr-panel .sm-score-gauge { font-family: 'JetBrains Mono', monospace; }

/* Perf tabs → orange accent */
.wr-right .perf-tab.active,
.wr-right .perf-tab:hover {
  border-color: rgba(245,183,49,0.4);
  color: var(--orange);
  background: rgba(245,183,49,0.07);
  box-shadow: 0 0 10px rgba(245,183,49,0.1);
}
.wr-right .perf-stat {
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.04);
  border-radius: 6px;
}
.wr-right .perf-value { font-family: 'JetBrains Mono', monospace; }

/* Marker toggles → orange */
.wr-right .marker-toggle.active,
.wr-right .marker-toggle:hover {
  border-color: rgba(245,183,49,0.35);
  color: var(--orange);
  background: rgba(245,183,49,0.06);
}
.wr-right .trade-marker {
  background: rgba(0,0,0,0.22);
  border-color: rgba(255,255,255,0.04);
  border-radius: 6px;
}

/* AI output */
.wr-panel .ai-output {
  background: rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.04);
}
.wr-panel details > summary::after { color: rgba(245,183,49,0.4); }

/* Chart panel */
.wr-panel--chart { padding-bottom: 0; overflow: hidden; }

/* Hide CryptoQuant (premium unavailable) */
#cq-card { display: none !important; }

/* ── Footer ──────────────────────────────────────────────── */
.wr-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(3,4,10,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(245,183,49,0.08);
  padding: 6px 16px;
  padding-bottom: calc(6px + var(--safe-bot));
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  z-index: 50;
  flex-wrap: wrap;
  gap: 6px;
}
.wr-footer-links { display: flex; gap: 12px; }
.wr-footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.62rem;
  transition: color 0.15s;
  letter-spacing: 0.3px;
}
.wr-footer-link:hover { color: var(--orange); text-decoration: none; }

/* ── Chat FAB → orange ───────────────────────────────────── */
.chat-widget { bottom: 52px; }
.chat-fab {
  background: var(--orange);
  box-shadow: 0 0 20px rgba(245,183,49,0.4);
  animation: none;
}
.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(245,183,49,0.65);
}
.chat-panel {
  border-color: rgba(245,183,49,0.2);
  box-shadow: 0 0 50px rgba(245,183,49,0.07), 0 28px 70px rgba(0,0,0,0.7);
}
.chat-panel-header {
  border-bottom-color: rgba(245,183,49,0.1);
  background: rgba(245,183,49,0.03);
}
.widget-send { background: var(--orange); color: #03040a; }
.widget-send:hover { background: #ffc83d; }
.widget-input:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(245,183,49,0.1); }
.sugg-chip:hover { border-color: var(--orange); color: var(--orange); background: rgba(245,183,49,0.06); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 380px) {
  .wr-levels-grid { grid-template-columns: repeat(2, 1fr); }
  .wr-intel-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
