/* ═══════════════════════════════════════════════
   THALES — sci-fi grey hologram finance terminal
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@500;600;700;900&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-panel: rgba(20, 24, 30, 0.55);
  --bg-panel-solid: #0e1216;
  --steel: #d8e0e8;
  --steel-bright: #f5f8fc;
  --steel-dim: #3a4450;
  --steel-faint: rgba(216, 224, 232, 0.08);
  --steel-glow: rgba(216, 224, 232, 0.6);
  --border: var(--steel-dim);
  --border-bright: rgba(216, 224, 232, 0.7);
  --text: #c8d0d8;
  --text-dim: #7a8490;
  --muted: #4a545e;
  --red: #ff4444;
  --cyan: #5dcfff;
  --amber: #ffaa00;
  --mono: 'Share Tech Mono', 'Courier New', monospace;
  --display: 'Orbitron', sans-serif;
  --glow-sm: 0 0 6px var(--steel-glow), 0 0 12px rgba(216, 224, 232, 0.2);
  --glow-md: 0 0 10px var(--steel-glow), 0 0 20px rgba(216, 224, 232, 0.25), 0 0 40px rgba(216, 224, 232, 0.1);
  --glow-lg: 0 0 14px var(--steel-glow), 0 0 28px rgba(216, 224, 232, 0.3), 0 0 56px rgba(216, 224, 232, 0.12);
  --glow-cyan: 0 0 10px rgba(93, 207, 255, 0.6), 0 0 22px rgba(93, 207, 255, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  background-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  text-shadow: var(--glow-sm);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  background-color: transparent;
}

button {
  cursor: pointer;
  background: transparent;
  border-radius: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--steel-bright);
  outline-offset: 2px;
}

/* Tabular monospace for all numeric readouts. */
.num,
.wl-price,
.wl-metric-value,
.wl-statusbar-label,
#status-clock {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ─── CRT scanlines overlay ─── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background: repeating-linear-gradient(to bottom, #fff 0, #fff 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}

/* ─── App shell / grid background ─── */
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--bg);
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Dark overlay on top of the background image for readability */
.app-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(10, 10, 10, 0.85);
  pointer-events: none;
}

/* Ensure all content sits above the overlay */
.topbar,
.layout,
.statusbar {
  position: relative;
  z-index: 1;
}

/* ─── Topbar ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(30, 38, 48, 0.55), transparent);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-mark {
  color: var(--steel-bright);
  font-size: 18px;
  text-shadow: var(--glow-md);
}

.brand h1 {
  margin: 0;
  color: var(--steel);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: var(--glow-lg);
  text-transform: uppercase;
}

.brand-sub {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ─── Top-right add-stock button ─── */
.btn-add-stock {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--steel);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
  background: var(--steel-faint);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-add-stock:hover {
  color: var(--steel-bright);
  background: rgba(184, 196, 208, 0.14);
  border-color: var(--steel);
  box-shadow: var(--glow-md);
}

/* ─── Layout: sidebar + main panel ─── */
.layout {
  display: grid;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 12px;
  background: linear-gradient(180deg, rgba(22, 28, 36, 0.5), transparent);
  border-right: 1px solid var(--border);
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  color: var(--text-dim);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-btn:hover {
  color: var(--steel);
  background: var(--steel-faint);
  border-color: var(--border-bright);
}

.nav-btn.is-active {
  color: var(--bg);
  background: var(--steel);
  border-color: var(--steel);
  text-shadow: none;
  box-shadow: var(--glow-md);
}

.nav-btn.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.nav-btn-tag {
  padding: 1px 6px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
}

/* ─── Main panel ─── */
.panel-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  background: var(--bg-panel);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  margin: 0;
  color: var(--steel);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-shadow: var(--glow-sm);
}

.panel-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* ─── Buttons ─── */
.btn {
  min-height: 34px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
}

.btn-dim {
  color: var(--text-dim);
  background: transparent;
}

.btn-dim:hover {
  color: var(--steel);
  background: var(--steel-faint);
  border-color: var(--border-bright);
}

.btn-primary {
  color: var(--steel);
  background: var(--steel-faint);
  border-color: var(--steel);
  box-shadow: inset 0 0 8px rgba(184, 196, 208, 0.1);
}

.btn-primary:hover {
  color: var(--steel-bright);
  background: rgba(184, 196, 208, 0.14);
}

.btn-ghost {
  min-height: 26px;
  padding: 2px 10px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--steel);
  border-color: var(--border-bright);
}

.btn-ghost:disabled {
  cursor: wait;
  opacity: 0.5;
}

/* ─── Statusbar ─── */
.statusbar {
  display: flex;
  justify-content: space-between;
  min-height: 26px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  border-top: 1px solid var(--border);
}

/* ─── Responsive fallback ─── */
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-btn {
    flex: 1 1 auto;
  }
}
