/* markets-periscope page chrome — overrides + layout on top of the
 * Mad Markets theme. Theme owns colors, typography, panels, animations.
 * This file owns: the page spine, the header chrome, hero proportions,
 * "the why" chyron grid, the bottom-anchored ticker, and a few tweaks
 * that diverge from the theme's demo (no top ticker, full-bleed page). */

/* Override .mm-app — the demo caps width at 1600px, but a full-screen
 * markets desk wants the whole monitor. Keep horizontal padding for
 * narrow screens but let it stretch on big ones. The bottom padding
 * leaves headroom for the viewport-fixed ticker (height 38px + a hair
 * of breathing room). */
.mp-app {
  max-width: none;
  padding: 12px 24px 60px;
}

/* The body itself reserves space for the fixed bottom ticker so the
 * footer text + last section don't end up tucked underneath. */
body.mm-base {
  padding-bottom: 42px;
}

/* ── HEADER ──────────────────────────────────────────────────────── */

.mp-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 8px;
  flex-wrap: wrap;
}

.mp-header-titles {
  flex: 1;
  min-width: 320px;
}

.mp-chrome {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.mp-chrome-btn {
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 2px;
}

/* Fullscreen icon button — matches the sibling apps (ufc/weather/routing
 * all use the ⛶ glyph). Square-ish footprint, glyph oversized vs label
 * so it reads as an icon button. */
.mp-chrome-fs {
  padding: 6px 10px;
  min-width: 36px;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
}

/* ── STATUS BAR ──────────────────────────────────────────────────── */

.mp-status {
  margin-bottom: 16px;
}
.mp-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mp-stat-delay {
  /* Badge the delay loud — it's a feature, not a bug. */
  color: var(--mm-gold);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 200, 32, 0.4);
  letter-spacing: 3px;
}

/* ── HERO ────────────────────────────────────────────────────────── */

.mp-hero {
  margin-bottom: 22px;
}

.mp-hero-panel {
  /* The hero is the loudest thing on the page when we have data. */
}

.mp-hero-tag {
  font-size: 12px;
  letter-spacing: 3px;
}

.mp-hero-body {
  display: grid;
  grid-template-columns: minmax(380px, auto) 1fr;
  gap: 28px;
  align-items: center;
  padding: 22px 18px;
}

.mp-hero-big {
  flex-shrink: 0;
}

.mp-hero-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
}

.mp-hero-fields .mm-field {
  min-width: 0;
}

@media (max-width: 760px) {
  .mp-hero-body { grid-template-columns: 1fr; padding: 16px; }
}

/* ── THE WHY · CHYRON STACK ──────────────────────────────────────── */

.mp-why {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.mp-why-empty {
  padding: 18px;
  text-align: center;
  letter-spacing: 4px;
  font-size: 11px;
  border: 1px dashed var(--mm-border);
  background: var(--mm-panel-tint);
}

.mp-why-line {
  /* mm-lower-third subclass — the same chyron pattern, but bigger and
   * tagged for the why-stream. */
}

/* ── BIG MOVERS · ARROW CARD GRID ────────────────────────────────── */

.mp-movers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin-bottom: 28px;
}

/* ── SOUNDBOARD MOOD ─────────────────────────────────────────────── */

.mp-soundboard {
  margin-bottom: 28px;
}

/* Auto-mood: when a button has data-active, glow it like the user just
 * pressed it. When .data-dim, fade to suggest "off-state". */
.mm-sfx[data-active="true"] {
  filter: brightness(1.25) saturate(1.2);
  animation: mp-mood-pulse 1.6s ease-in-out infinite;
}
.mm-sfx[data-dim="true"] {
  filter: brightness(0.55) saturate(0.6);
  opacity: 0.55;
  pointer-events: none;
}

@keyframes mp-mood-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}

/* ── INTERCEPTS · ALERT STREAM ───────────────────────────────────── */

.mp-intercepts {
  margin-bottom: 28px;
  max-height: 460px;
  overflow-y: auto;
}

.mp-intercept {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 200, 32, 0.10);
  font-family: var(--mm-font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.mp-intercept:last-child {
  border-bottom: none;
}

.mp-intercept-time {
  color: var(--mm-text-dim);
  font-family: var(--mm-font-display);
  font-size: 10px;
  letter-spacing: 2px;
}

.mp-intercept-text {
  color: var(--mm-text);
}

.mp-intercept-why {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--mm-gold-dim);
  letter-spacing: 0.5px;
  font-style: italic;
}

.mp-intercept-sev {
  font-family: var(--mm-font-display);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 900;
  padding: 2px 10px;
  white-space: nowrap;
}

.mp-intercept-sev.mp-sev-CRIT { background: var(--mm-red);    color: var(--mm-white); box-shadow: var(--mm-glow-red); }
.mp-intercept-sev.mp-sev-HIGH { background: var(--mm-hold);   color: #000; }
.mp-intercept-sev.mp-sev-MED  { background: var(--mm-gold);   color: #000; }
.mp-intercept-sev.mp-sev-LOW  { background: rgba(255,200,32,.15); color: var(--mm-gold); border: 1px solid var(--mm-border); }

.mp-intercept.mp-sev-row-CRIT { background: rgba(255, 31, 46, 0.06); }
.mp-intercept.mp-sev-row-HIGH { background: rgba(255, 132, 16, 0.04); }

/* ── GLOBAL TAPE GRID ────────────────────────────────────────────── */

.mp-tape {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  margin-bottom: 28px;
}

.mp-tape-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px 12px;
  background: rgba(255, 200, 32, 0.04);
  border: 1px solid var(--mm-border);
  font-family: var(--mm-font-mono);
  font-size: 12px;
  position: relative;
  overflow: hidden;
}
.mp-tape-cell::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--mm-gold-dim);
}
.mp-tape-cell.mp-up::before   { background: var(--mm-bull); box-shadow: 0 0 6px var(--mm-bull); }
.mp-tape-cell.mp-down::before { background: var(--mm-red);  box-shadow: 0 0 6px var(--mm-red); }

.mp-tape-sym {
  font-family: var(--mm-font-display);
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--mm-text);
}
.mp-tape-name {
  font-size: 9px;
  color: var(--mm-text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  grid-column: 1 / -1;
}
.mp-tape-price {
  font-family: var(--mm-font-display);
  font-weight: 900;
  color: var(--mm-gold);
  text-align: right;
}
.mp-tape-pct {
  text-align: right;
  font-family: var(--mm-font-display);
  font-size: 11px;
  font-weight: 700;
}
.mp-tape-cell.mp-up   .mp-tape-pct { color: var(--mm-bull); }
.mp-tape-cell.mp-down .mp-tape-pct { color: var(--mm-red); }

.mp-region-chip {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--mm-text-dim);
  background: rgba(255, 250, 236, 0.04);
  border: 1px solid rgba(255, 250, 236, 0.15);
  padding: 1px 5px;
  margin-left: 6px;
  text-transform: uppercase;
}

/* ── BOTTOM TICKER · CNBC POSITION ───────────────────────────────── */
/* Ticker is anchored to the BOTTOM OF THE VIEWPORT, not the bottom of
 * the document. Two reasons we override the no-floating-chrome rule
 * here specifically:
 *   1. CNBC / Bloomberg / cable-news convention — the genre demands a
 *      ticker that's always visible, anchored low, ambient.
 *   2. Most visitors won't scroll to the document footer; if the tape
 *      isn't pinned, the look-and-feel signature disappears off-screen.
 * The body has bottom padding so document content doesn't end up under
 * the ticker. */
.mp-ticker-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--mm-bg);
  border-top: 1px solid var(--mm-border-bright);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}

.mp-ticker {
  height: 38px;
}

/* ── FOOTER ──────────────────────────────────────────────────────── */

.mp-footer {
  font-size: 9px;
  letter-spacing: 3px;
  text-align: center;
  padding: 24px 0 16px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .mp-app { padding: 10px 12px 50px; }
  .mp-header { flex-direction: column; align-items: flex-start; }
  .mp-chrome { width: 100%; justify-content: flex-end; }
  .mp-tape { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* When fullscreen-mode is active, kill body scroll padding so the dashboard
 * fills the monitor edge-to-edge. */
:fullscreen .mp-app { padding-top: 8px; }
