/* Atlas Financial Terminal
   Put this file in your app's assets/ folder (Dash loads it automatically).
   Everything is scoped to .atlas-terminal / .atlas-* so other pages are untouched. */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap");

.atlas-terminal {
  --atlas-yellow: #FFD400;
  --atlas-dim: #8A7400;
  --atlas-grid: #2B2500;
  --atlas-red: #FF5C5C;
  --atlas-amber: #FF9F1C;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  color: var(--atlas-yellow);
  background: #000;
  padding: 14px 16px 24px;
}

/* ---------- command line ---------- */
.atlas-cmdbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--atlas-dim);
  background: #000;
}
.atlas-cmdbar:focus-within { border-color: var(--atlas-yellow); }

.atlas-brand {
  background: var(--atlas-yellow);
  color: #000;
  font-weight: 600;
  letter-spacing: 0.18em;
  padding: 2px 8px;
}
.atlas-prompt { color: var(--atlas-yellow); font-weight: 600; }

.atlas-cmd-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--atlas-yellow);
  caret-color: var(--atlas-yellow);
  caret-shape: block;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(255, 212, 0, 0.35);
}
.atlas-cmd-input::placeholder { color: var(--atlas-dim); text-shadow: none; }

.atlas-badge { color: var(--atlas-dim); white-space: nowrap; font-size: 0.85rem; }
.atlas-link {
  color: var(--atlas-yellow);
  border: 1px solid var(--atlas-dim);
  padding: 2px 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  text-decoration: none;
}
.atlas-link:hover { background: var(--atlas-yellow); color: #000; }

/* ---------- status line ---------- */
.atlas-statusrow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 1.6em;
  margin: 6px 2px 8px;
  font-size: 0.85rem;
}
.atlas-msg-ok { color: var(--atlas-yellow); }
.atlas-msg-err { color: var(--atlas-red); }
.atlas-tier-note a { color: var(--atlas-amber); text-decoration: none; }
.atlas-tier-note a:hover { text-decoration: underline; }

/* ---------- canvas ---------- */
.atlas-stage {
  position: relative;
  height: calc(100vh - 230px);
  min-height: 480px;
  overflow: auto;
  border: 1px solid var(--atlas-grid);
  background: #000;
}
/* faint CRT scanlines. Delete this block for a perfectly flat black. */
.atlas-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 212, 0, 0.035) 0,
    rgba(255, 212, 0, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
}
.atlas-canvas { position: relative; width: 100%; height: 100%; }

.atlas-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
  color: var(--atlas-dim);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  pointer-events: none;
}
.atlas-stage:has(.atlas-panel) .atlas-hint { display: none; }

/* ---------- windows ---------- */
.atlas-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 200px;
  max-width: calc(100vw - 32px);
  background: #000;
  border: 1px solid var(--atlas-yellow);
  box-shadow: 0 0 14px rgba(255, 212, 0, 0.15);
  resize: both;
  overflow: hidden;
}
.atlas-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px 3px 10px;
  background: var(--atlas-yellow);
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.atlas-panel-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-panel-close {
  background: transparent;
  border: 1px solid #000;
  color: #000;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}
.atlas-panel-close:hover { background: #000; color: var(--atlas-yellow); }
.atlas-panel-close:focus-visible { outline: 2px solid #000; outline-offset: 1px; }

.atlas-panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.atlas-panel-body .dash-graph { height: 100%; width: 100%; }

/* ---------- description window ---------- */
.atlas-des { padding: 12px 14px; font-size: 0.85rem; line-height: 1.5; }
.atlas-des-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.atlas-des-logo { height: 44px; }
.atlas-des-ticker { font-size: 1.6rem; font-weight: 600; letter-spacing: 0.08em; }
.atlas-des-name { color: var(--atlas-dim); }
.atlas-des-text { margin-top: 10px; color: #E8C800; }

/* ---------- help window ---------- */
.atlas-help-syntax {
  margin: 0;
  padding: 10px 14px;
  color: var(--atlas-yellow);
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.atlas-help-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.atlas-help-table th {
  text-align: left;
  padding: 4px 14px;
  color: var(--atlas-dim);
  border-bottom: 1px solid var(--atlas-dim);
  font-weight: 500;
}
.atlas-help-table td { padding: 4px 14px; border-bottom: 1px solid var(--atlas-grid); }
.atlas-help-code { font-weight: 600; white-space: nowrap; }

/* ---------- line items window ---------- */
.atlas-items { padding: 12px 14px; font-size: 0.8rem; }
.atlas-items-note { color: var(--atlas-dim); margin-bottom: 10px; }
.atlas-items-list { display: flex; flex-wrap: wrap; gap: 6px; }
.atlas-item-chip { border: 1px solid var(--atlas-dim); padding: 2px 8px; }

/* ---------- Domo Lab model report ---------- */
.atlas-report { padding: 8px 14px; font-size: 0.8rem; }
.atlas-report-table { width: 100%; border-collapse: collapse; }
.atlas-report-table td { padding: 5px 4px; border-bottom: 1px solid var(--atlas-grid); }
.atlas-report-table td:first-child { color: var(--atlas-dim); white-space: nowrap; padding-right: 16px; }
.atlas-report-hi { color: var(--atlas-amber); font-weight: 600; }
.atlas-report-note { padding: 14px; font-size: 0.85rem; color: var(--atlas-dim); }


/* ===== retro pages (Value Finder, Screener) ===== */
.atlas-terminal { --atlas-green: #5CFF6B; --atlas-cyan: #4DD9FF; }

.atlas-brand { text-decoration: none; }
.atlas-brand:hover { color: #000; }

.atlas-page-bar { flex-wrap: wrap; margin-bottom: 10px; }
.atlas-page-title { flex: 1; letter-spacing: 0.14em; font-weight: 600; text-transform: uppercase; }
.atlas-page-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.atlas-link-active { background: var(--atlas-yellow); color: #000; }
.atlas-link-active:hover { color: #000; }

.atlas-note { color: var(--atlas-dim); font-size: 0.78rem; font-style: italic; margin: 6px 2px 12px; }
.atlas-dim { color: var(--atlas-dim); }
.atlas-up { color: var(--atlas-green) !important; }
.atlas-down { color: var(--atlas-red) !important; }
.atlas-open { color: var(--atlas-amber); font-weight: 600; }
.atlas-status-center { text-align: center; margin-top: 14px; }

/* boxes with a yellow title bar */
.atlas-panelbox { border: 1px solid var(--atlas-dim); background: #000; padding: 12px 14px; min-width: 0; }
.atlas-panelbox-title {
  background: var(--atlas-yellow);
  color: #000;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  margin: -12px -14px 12px;
}

/* page grids */
.atlas-grid-top { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 12px; }
.atlas-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.atlas-grid-main { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 12px; align-items: start; }
.atlas-screener-filters { display: grid; gap: 12px; margin-top: 12px; }
@media (max-width: 900px) {
  .atlas-grid-top, .atlas-kpis, .atlas-grid-main { grid-template-columns: 1fr; }
}

/* KPI + stat blocks */
.atlas-kpi-value { font-size: 1.9rem; font-weight: 600; letter-spacing: 0.04em; text-shadow: 0 0 6px rgba(255, 212, 0, 0.25); }
.atlas-big-ticker { font-size: 2.2rem; font-weight: 600; letter-spacing: 0.08em; margin: 4px 0 6px; color: var(--atlas-yellow); }
.atlas-spy { color: var(--atlas-cyan); font-weight: 600; }
.atlas-stat-label { color: var(--atlas-dim); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.atlas-stat-value { font-size: 1.15rem; font-weight: 600; }

/* ON THE LIST tiles */
.atlas-tiles { display: flex; flex-direction: column; gap: 8px; max-height: 780px; overflow-y: auto; padding-right: 4px; }
.atlas-tile {
  display: block;
  width: 100%;
  text-align: left;
  background: #000;
  border: 1px solid var(--atlas-dim);
  color: var(--atlas-yellow);
  font-family: inherit;
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: none;
}
.atlas-tile:hover { border-color: var(--atlas-yellow); color: var(--atlas-yellow); }
.atlas-tile:focus-visible { outline: 2px solid var(--atlas-yellow); outline-offset: 1px; }
.atlas-tile-selected { background: #1A1600; border-color: var(--atlas-yellow); box-shadow: 0 0 10px rgba(255, 212, 0, 0.2); }
.atlas-tile-locked { border-style: dashed; text-align: center; }
.atlas-tile-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.atlas-tile-ticker { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.06em; }
.atlas-tile-ret { font-weight: 600; }
.atlas-tile-sub { color: var(--atlas-dim); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* selected stock */
.atlas-detail-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.atlas-detail-ticker { font-size: 1.6rem; font-weight: 600; letter-spacing: 0.08em; }
.atlas-detail-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 8px; }

.atlas-signal-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 10px; }
.atlas-signal-table th { text-align: left; padding: 4px 10px; color: var(--atlas-dim); border-bottom: 1px solid var(--atlas-dim); font-weight: 500; }
.atlas-signal-table td { padding: 5px 10px; border-bottom: 1px solid var(--atlas-grid); white-space: nowrap; }

/* screener controls */
.atlas-label { display: block; color: var(--atlas-dim); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
.atlas-input {
  background: #000;
  color: var(--atlas-yellow);
  border: 1px solid var(--atlas-dim);
  border-radius: 0;
  padding: 5px 8px;
  font-family: inherit;
  outline: none;
}
.atlas-input:focus { border-color: var(--atlas-yellow); }
.atlas-input::placeholder { color: var(--atlas-dim); }
.atlas-checklist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; font-size: 0.82rem; }
@media (max-width: 900px) { .atlas-checklist { grid-template-columns: 1fr; } }

/* dropdowns. The menu can render outside .atlas-terminal, so these hang off the
   body class that atlas_terminal.js sets on retro pages. */
body.atlas-retro .atlas-dropdown, body.atlas-retro .atlas-dropdown * { font-family: inherit; }
body.atlas-retro .atlas-dropdown .Select-control,
body.atlas-retro .dash-dropdown {
  background: #000; border: 1px solid var(--atlas-dim, #8A7400); border-radius: 0; color: #FFD400;
}
body.atlas-retro .atlas-dropdown .Select-control:hover,
body.atlas-retro .dash-dropdown:hover { border-color: #FFD400; }
body.atlas-retro .Select-menu-outer,
body.atlas-retro .dash-dropdown-content {
  background: #000; border: 1px solid #FFD400; border-radius: 0; color: #FFD400;
}
body.atlas-retro .Select-option,
body.atlas-retro .dash-dropdown-option { background: #000; color: #FFD400; }
body.atlas-retro .Select-option.is-focused,
body.atlas-retro .Select-option:hover,
body.atlas-retro .dash-dropdown-option:hover,
body.atlas-retro .dash-dropdown-option[data-highlighted] { background: #1A1600; color: #FFD400; }
body.atlas-retro .Select-value-label,
body.atlas-retro .Select-placeholder,
body.atlas-retro .Select-input > input,
body.atlas-retro .dash-dropdown-value,
body.atlas-retro .dash-dropdown-placeholder,
body.atlas-retro .dash-dropdown-search { color: #FFD400 !important; background: transparent; }
body.atlas-retro .Select-placeholder, body.atlas-retro .dash-dropdown-placeholder { color: #8A7400 !important; }
body.atlas-retro .Select--multi .Select-value,
body.atlas-retro .dash-dropdown-value-item { background: #1A1600; border: 1px solid #8A7400; color: #FFD400; border-radius: 0; }
body.atlas-retro .Select-arrow { border-top-color: #FFD400; }

/* ---------- Value Finder: free-tier upsell ---------- */
.atlas-upsell { border: 1px dashed var(--atlas-yellow); padding: 22px; text-align: center; max-width: 720px; margin: 8px auto 4px; }
.atlas-upsell-title { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.04em; }
.atlas-cta { display: inline-block; background: var(--atlas-yellow); color: #000; font-weight: 600; padding: 6px 18px; }
.atlas-cta:hover { background: #000; color: var(--atlas-yellow); }

/* ---------- two-up KPI row (YouDomo Fund) ---------- */
.atlas-kpis-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .atlas-kpis-2 { grid-template-columns: 1fr; } }

/* ---------- Account page ---------- */
.atlas-welcome { font-size: 1.6rem; font-weight: 600; letter-spacing: 0.06em; margin: 6px 0 14px; text-shadow: 0 0 6px rgba(255, 212, 0, 0.25); }
.atlas-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 1100px; }
@media (max-width: 900px) { .atlas-grid-2 { grid-template-columns: 1fr; } }

.atlas-row { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--atlas-grid); font-size: 0.85rem; }
.atlas-row-label { color: var(--atlas-dim); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; align-self: center; }
.atlas-row-value { font-weight: 600; }

.atlas-code-input { width: 100%; box-sizing: border-box; font-size: 0.8rem; letter-spacing: 0.02em; }
.atlas-api-message { display: block; margin-top: 12px; color: var(--atlas-amber); font-size: 0.8rem; line-height: 1.45; }

.atlas-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  padding: 8px 14px;
  background: var(--atlas-yellow);
  color: #000;
  border: 1px solid var(--atlas-yellow);
  border-radius: 0;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.atlas-btn:hover { background: #000; color: var(--atlas-yellow); }
.atlas-btn:focus-visible { outline: 2px solid var(--atlas-yellow); outline-offset: 2px; }
.atlas-btn:disabled, .atlas-btn:disabled:hover { background: #000; color: var(--atlas-dim); border-color: var(--atlas-dim); cursor: not-allowed; }

/* ===== navbar (components/navbar.py) =====
   Global on purpose: the navbar sits outside .atlas-terminal and shows on every page. */
.atlas-navbar {
  background: #000 !important;
  border-bottom: 1px solid #8A7400;
  box-shadow: none !important;
  font-family: "IBM Plex Mono", "Courier New", monospace;
}
.atlas-navbar .atlas-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  flex-grow: 1;
  min-width: 200px;
}
.atlas-navbar .dropdown-toggle,
.atlas-navbar .nav-link {
  color: #FFD400 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(255, 212, 0, 0.3);
}
.atlas-navbar .dropdown-toggle:hover,
.atlas-navbar .dropdown-toggle.show,
.atlas-navbar .nav-link:hover,
.atlas-navbar .nav-link.show {
  background: #FFD400 !important;
  color: #000 !important;
  text-shadow: none;
}
.atlas-navbar .dropdown-toggle:focus-visible,
.atlas-navbar .nav-link:focus-visible { outline: 2px solid #FFD400; outline-offset: 2px; }
.atlas-navbar .dropdown-menu {
  min-width: 200px;
  padding: 4px 0;
  background: #000;
  border: 1px solid #FFD400;
  border-radius: 0;
  box-shadow: 0 0 16px rgba(255, 212, 0, 0.18);
}
.atlas-navbar .dropdown-item {
  padding: 7px 16px;
  color: #FFD400;
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.atlas-navbar .dropdown-item:hover,
.atlas-navbar .dropdown-item:focus,
.atlas-navbar .dropdown-item.active { background: #FFD400; color: #000; }

/* ===== snapping windows + sound button ===== */
.atlas-panel.atlas-dragging { box-shadow: 0 0 24px rgba(255, 212, 0, 0.38); }

/* the click: a ring of light that fades out from both windows */
@keyframes atlas-snap-ring {
  0%   { box-shadow: 0 0 0 0 rgba(255, 212, 0, 0.9), 0 0 14px rgba(255, 212, 0, 0.5); }
  100% { box-shadow: 0 0 0 14px rgba(255, 212, 0, 0), 0 0 14px rgba(255, 212, 0, 0.15); }
}
.atlas-panel.atlas-snap-pulse { animation: atlas-snap-ring 0.3s ease-out; }
@media (prefers-reduced-motion: reduce) { .atlas-panel.atlas-snap-pulse { animation: none; } }

/* glowing line along the edge two windows are touching while you drag */
.atlas-snap-guide {
  position: absolute;
  display: none;
  z-index: 99998;
  background: var(--atlas-yellow);
  box-shadow: 0 0 10px 2px rgba(255, 212, 0, 0.7);
  pointer-events: none;
}

/* SOUND: ON / OFF (the label is a CSS suffix driven by a data attribute) */
button.atlas-link { background: transparent; font-family: inherit; cursor: pointer; }
button.atlas-link:hover { background: var(--atlas-yellow); color: #000; }
.atlas-sound::after { content: ": ON"; }
.atlas-sound[data-sound="off"]::after { content: ": OFF"; }
.atlas-sound[data-sound="off"] { color: var(--atlas-dim); }

/* ---------- SEC filing window ----------
   Filings are designed for white paper. This flips them to light-on-dark so they sit in the
   terminal. Delete the filter line to show them exactly as filed. */
.atlas-filing-frame { background: #fff; filter: invert(0.92) hue-rotate(180deg); }
