/* ============================================================
   AlertEdge.io — Report Stylesheet
   Shared by all trade brief and analysis report pages.
   Assumes Space Grotesk + Inter + JetBrains Mono loaded
   in the HTML <head> via Google Fonts.
   ============================================================ */

:root {
  /* AlertEdge Brand Palette */
  --navy:     #0A0F2C;
  --surface:  #0f1535;
  --surface2: #131d42;
  --border:   rgba(255, 255, 255, 0.10);
  --text:     #C8D0E0;
  --muted:    #8892A4;
  --white:    #FFFFFF;

  /* Accent Colors */
  --green:    #00FF88;
  --blue:     #1E90FF;
  --orange:   #e3742e;
  --yellow:   #d29922;
  --red:      #FF4560;
  --purple:   #B06DFF;

  /* Risk Tier Colors */
  --risk-low:     #00FF88;
  --risk-low-med: #1E90FF;
  --risk-med:     #d29922;
  --risk-med-hi:  #e3742e;
  --risk-hi:      #FF4560;
  --risk-very-hi: #B06DFF;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── Report Header ───────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-img {
  height: 32px; /* Slightly smaller for reports to keep them compact */
  width: auto;
  display: block;
  object-fit: contain;
}

.report-type {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.meta { 
  color: var(--muted); 
  font-size: 12px; 
  text-align: right; 
  display: flex;
  align-items: center;
  gap: 16px;
}

.meta__info {
  display: flex;
  flex-direction: column;
}

.meta strong { color: var(--text); font-size: 14px; }

.ticker-logo {
  height: 36px;
  width: auto;
  display: block;
  opacity: 0.9;
}

/* ── Main Layout ─────────────────────────────────────────── */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 40px;
}

h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--blue);
  margin: 32px 0 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}

/* ── Banners ─────────────────────────────────────────────── */
.disclaimer {
  background: var(--surface);
  border: 1px solid rgba(255, 69, 96, 0.25);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--muted);
}
.disclaimer strong { color: var(--red); }

.setup-banner {
  background: var(--surface);
  border: 1px solid rgba(227, 116, 46, 0.25);
  border-left: 3px solid var(--orange);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 28px;
}
.setup-banner .setup-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 8px;
}
.setup-banner p  { color: var(--muted); font-size: 13px; line-height: 1.8; }
.setup-banner strong { color: var(--text); }

.insider-notice {
  background: var(--surface);
  border: 1px solid rgba(30, 144, 255, 0.20);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 28px;
}
.insider-notice p { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.insider-notice p:first-child { color: var(--text); font-weight: 600; margin-bottom: 8px; font-size: 14px; }

/* ── Summary Cards ───────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.card-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.card-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Data Table ──────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; white-space: nowrap; }

thead tr { background: var(--surface2); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
thead th.right { text-align: right; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

td { padding: 12px 14px; vertical-align: middle; }
td.right { text-align: right; }

.ticker  { font-weight: 700; font-size: 15px; color: var(--text); }
.company { font-size: 12px; color: var(--muted); margin-top: 1px; max-width: 200px; white-space: normal; }

/* ── Price / Return Utilities ────────────────────────────── */
.entry-price { color: var(--blue);   font-weight: 600; }
.stop-price  { color: var(--red);    font-weight: 600; }
.tp-price    { color: var(--green);  font-weight: 600; }
.ret-pos     { color: var(--green);  font-weight: 700; }
.ret-neg     { color: var(--red);    font-weight: 700; }
.ret-mix     { color: var(--yellow); font-weight: 600; }
.beat        { color: var(--green); }
.miss        { color: var(--red); }

/* ── Play ID Cells ───────────────────────────────────────── */
.play-id   { font-weight: 800; font-size: 13px; letter-spacing: 0.5px; }
.play-name { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Risk Badges ─────────────────────────────────────────── */
.risk {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.risk-low     { background: rgba(0,255,136,0.10);   color: var(--risk-low);     border: 1px solid rgba(0,255,136,0.25); }
.risk-low-med { background: rgba(30,144,255,0.10);  color: var(--risk-low-med); border: 1px solid rgba(30,144,255,0.25); }
.risk-med     { background: rgba(210,153,34,0.10);  color: var(--risk-med);     border: 1px solid rgba(210,153,34,0.25); }
.risk-med-hi  { background: rgba(227,116,46,0.10);  color: var(--risk-med-hi);  border: 1px solid rgba(227,116,46,0.25); }
.risk-hi      { background: rgba(255,69,96,0.10);   color: var(--risk-hi);      border: 1px solid rgba(255,69,96,0.25); }
.risk-very-hi { background: rgba(176,109,255,0.10); color: var(--risk-very-hi); border: 1px solid rgba(176,109,255,0.25); }

/* ── Trend Badges ────────────────────────────────────────── */
.trend { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.bull  { background: rgba(0,255,136,0.08);   color: var(--green);  border: 1px solid rgba(0,255,136,0.20); }
.bear  { background: rgba(255,69,96,0.08);   color: var(--red);    border: 1px solid rgba(255,69,96,0.20); }
.neut  { background: rgba(210,153,34,0.08);  color: var(--yellow); border: 1px solid rgba(210,153,34,0.20); }

/* ── Signal Badges ───────────────────────────────────────── */
.sig {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.sig-short { background: rgba(255,69,96,0.10);    color: var(--red);    border: 1px solid rgba(255,69,96,0.25); }
.sig-aggr  { background: rgba(200,208,224,0.08);  color: #C8D0E0;       border: 1px solid rgba(200,208,224,0.20); }
.sig-cons  { background: rgba(0,255,136,0.10);    color: var(--green);  border: 1px solid rgba(0,255,136,0.25); }
.sig-momo  { background: rgba(227,116,46,0.10);   color: var(--orange); border: 1px solid rgba(227,116,46,0.25); }
.sig-past  { background: rgba(255,255,255,0.04);  color: var(--muted);  border: 1px solid rgba(255,255,255,0.10); }

/* ── Status Pills ────────────────────────────────────────── */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.status-live    { background: rgba(0,255,136,0.08);   color: var(--green); border: 1px solid rgba(0,255,136,0.20); }
.status-pending { background: rgba(30,144,255,0.08);  color: var(--blue);  border: 1px solid rgba(30,144,255,0.20); }
.status-past    { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid rgba(255,255,255,0.10); }

/* ── Detail Cards ────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.detail-card.short-card { border-top: 2px solid var(--red); }
.detail-card.long-card  { border-top: 2px solid var(--green); }

.dc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

/* Momentum uses dc-ticker/dc-company; trade briefs use dc-play/dc-name */
.dc-ticker,
.dc-play    { font-size: 18px; font-weight: 800; }
.dc-company,
.dc-name    { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 10px; }
.kv    { display: flex; flex-direction: column; }
.kv .k { font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.4px; }
.kv .v { font-size: 13px; font-weight: 600; margin-top: 1px; }

.dc-thesis {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.dc-thesis strong { color: var(--text); }

.dc-trigger {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.dc-trigger strong { color: var(--text); }

.dc-insider {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.20);
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
}
.dc-insider strong { color: var(--blue); }

/* ── Pattern / Level Map ─────────────────────────────────── */
.pattern-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.pattern-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.zone-marker {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.zone-marker:last-child { border-bottom: none; }

.zone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.zone-label  { font-size: 12px; }
.zl-title    { font-weight: 600; color: var(--text); }
.zl-price    { color: var(--blue); font-size: 11px; margin-top: 1px; }
.zl-desc     { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ── Pine Script Block ───────────────────────────────────── */
.pine-block {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  padding: 16px 20px;
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 24px;
}
.pine-comment { color: var(--green); }
.pine-key     { color: var(--blue); }
.pine-val     { color: var(--orange); }
.pine-signal  { color: var(--yellow); }

/* ── Tooltips ────────────────────────────────────────────── */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  margin-left: 4px;
}

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
}

.tooltip-content {
  visibility: hidden;
  width: 220px;
  background-color: var(--surface2);
  color: var(--text);
  text-align: left;
  border-radius: 6px;
  padding: 12px;
  border: 1px solid var(--blue);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  font-size: 12px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  
  /* Position the tooltip */
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  margin-left: -110px;
  
  /* Fade in */
  opacity: 0;
  transition: opacity 0.2s;
}

.tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--blue) transparent transparent transparent;
}

.tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* ── Report Footer ───────────────────────────────────────── */
footer {
  margin-top: 48px;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* ── Access Gating ───────────────────────────────────────── */
.subscriber-only {
  display: none;
}

body[data-access="subscriber"] .subscriber-only {
  display: inline;
}

body[data-access="subscriber"] .subscriber-only.block {
  display: block;
}

body[data-access="subscriber"] .free-only {
  display: none;
}

.locked-value {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  text-transform: uppercase;
}

.access-notice {
  background: var(--surface);
  border: 1px solid rgba(30, 144, 255, 0.24);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 24px;
  padding: 12px 16px;
}

.access-notice strong {
  color: var(--text);
}

.access-mode {
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  header { padding: 16px 24px; }
  main   { padding: 24px; }
  footer { padding: 20px 24px; }
}

@media (max-width: 760px) {
  header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pattern-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .detail-grid { grid-template-columns: 1fr; }
  .card-grid   { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .dc-kv       { grid-template-columns: 1fr; }
}
