
/* =========================================================
   Fashionably Late Live Terminal - Shared Styles (v16)
   - Theme-safe: uses CSS variables from the HTML (dark/light)
   - Keeps original .alert-row / .badge semantics
   ========================================================= */

.alert-row{
  padding: 10px;
  margin-bottom: 6px;
  border-left: 5px solid var(--border, #3a3a3a);
  background: var(--panel, rgba(255,255,255,0.04));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--text, #eaeaea);
  border-radius: 10px;
}

/* Entry/Exit emphasis */
.alert-row.entry{
  border-left-color: var(--green, #2ecc71);
  background: color-mix(in srgb, var(--green, #2ecc71) 10%, var(--panel, rgba(255,255,255,0.04)));
}
.alert-row.exit{
  border-left-color: var(--red, #e74c3c);
  background: color-mix(in srgb, var(--red, #e74c3c) 10%, var(--panel, rgba(255,255,255,0.04)));
  opacity: 0.88;
}

/* Badges */
.badge{
  background: color-mix(in srgb, var(--text, #eaeaea) 10%, transparent);
  color: var(--text, #eaeaea);
  padding: 2px 7px;
  border-radius: 7px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border: 1px solid var(--border, #3a3a3a);
}

/* Make tooltips readable in both themes */
[data-tip]{
  position: relative;
  cursor: help;
}

* =========================================================
   LIGHT THEME TEXT CONTRAST HARD FIX
   ========================================================= */

/* Default text everywhere */
html[data-theme="light"] body,
html[data-theme="light"] table,
html[data-theme="light"] td,
html[data-theme="light"] th {
  color: #1a1f2b !important;
}

/* All numeric cells must be dark */
html[data-theme="light"] .num,
html[data-theme="light"] .bigNum,
html[data-theme="light"] .biggerNum,
html[data-theme="light"] .shares,
html[data-theme="light"] .rrCell,
html[data-theme="light"] .profitCell,
html[data-theme="light"] .deltaStop,
html[data-theme="light"] .deltaTarget {
  color: #000000 !important;
  font-weight: 600;
}

/* Labels / secondary text (still readable) */
html[data-theme="light"] .muted,
html[data-theme="light"] .badge,
html[data-theme="light"] .subtext {
  color: #3b4252 !important;
  opacity: 1 !important;
}

/* Headers stronger */
html[data-theme="light"] th {
  color: #0f172a !important;
  font-weight: 700;
}

/* Exit rows: muted BACKGROUND, not text */
html[data-theme="light"] .alert-row.exit {
  background: #f4f4f6 !important;
}
html[data-theme="light"] .alert-row.exit td {
  color: #2b2f38 !important;
}

/* Tooltips: max contrast */
html[data-theme="light"] [data-tip]::after {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 500;
}

/* Inputs */
html[data-theme="light"] input,
html[data-theme="light"] select {
  color: #0f172a !important;
  font-weight: 600;
}
/* ============================
   EXIT ROW READABILITY FIX
   ============================ */

/* 1) Remove any opacity dimming on exit rows/cells */
.alert-row.exit,
.alert-row.exit td,
.alert-row.exit .mono,
.alert-row.exit .muted,
.alert-row.exit .badge,
.alert-row.exit .grade {
  opacity: 1 !important;
}

/* Force these colors to persist and use the theme variables */
.up, .slope-up, .trend-up {
    color: var(--green) !important;
    font-weight: 800 !important;
}

.down, .slope-down, .trend-down {
    color: var(--red) !important;
    font-weight: 800 !important;
}

/* Mirror your exit-row logic but for entries */
tr.entry-row td {
    /* Optional: you could give entry rows a very subtle green tint in light mode */
}

/* Force the text colors inside these specific row types */
html[data-theme="light"] tr.entry-row td .entry {
    color: var(--green) !important;
}

html[data-theme="light"] tr.exit-row td.exit-long {
    color: var(--yellow) !important;
}
html[data-theme="light"] tr.exit-row td.exit-short {
    color: var(--orange) !important;
}

/* 1. Force Entry/Exit Action text to use theme variables */
.entry-long, .status-pill.open {
    color: var(--green) !important;
}
.entry-short {
    color: var(--red) !important;
}

.exit-long, .status-pill.closed {
    color: var(--yellow) !important;
}
.exit-short {
    color: var(--orange) !important;
}

/* 2. Ensure specifically that Action cells don't revert to black in Light Mode */
html[data-theme="light"] td.entry-long,
html[data-theme="light"] td .up,
html[data-theme="light"] td.profitCell {
    color: var(--green) !important;
}

html[data-theme="light"] td.entry-short,
html[data-theme="light"] td .down {
    color: var(--red) !important;
}
html[data-theme="light"] td.exit-long {
    color: var(--yellow) !important;
}
html[data-theme="light"] td.exit-short {
    color: var(--orange) !important;
}

/* 3. If "Action" is a class on the TD itself, use this: */
td.actionCell .entry-long { color: var(--green) !important; }
td.actionCell .entry-short { color: var(--red) !important; }
td.actionCell .exit-long { color: var(--yellow) !important; }
td.actionCell .exit-short { color: var(--orange) !important; }

/* Fix for the profit and RR cells specifically */
html[data-theme="light"] td.profitCell { color: var(--green) !important; }
html[data-theme="light"] td.rrCell { color: var(--yellow) !important; }

/* 2) Use a muted BACKGROUND only (not muted text) */
html[data-theme="light"] .alert-row.exit{
  background: #f3f4f6 !important;
}
html[data-theme="dark"] .alert-row.exit{
  background: rgba(255,255,255,0.06) !important;
}

/* 3) Force exit text to a readable color */
html[data-theme="light"] .alert-row.exit td{
  color: #1f2937 !important;   /* dark slate */
}

html[data-theme="dark"] .alert-row.exit td{
  color: #e5e7eb !important;   /* light gray */
}

/* Keep slope badges colored even inside exit rows in LIGHT theme */
html[data-theme="light"] tr.exit-row .badge.green { color: var(--green) !important; border-color: rgba(14,203,129,0.55) !important; }
html[data-theme="light"] tr.exit-row .badge.red { color: var(--red) !important; border-color: rgba(246,70,93,0.55) !important; }
html[data-theme="light"] tr.exit-row .badge.yellow { color: var(--yellow) !important; border-color: rgba(240,185,11,0.55) !important; }

/* 4) Keep the “closed” feel via a LEFT border + badge instead of opacity */
.alert-row.exit{
  border-left: 4px solid rgba(220, 38, 38, 0.55) !important;
}

/* Optional: make the ACTION cell still look “inactive” but readable */
html[data-theme="light"] .alert-row.exit td.actionCell{
  color: #374151 !important;
  font-weight: 600;
}
html[data-theme="light"] .statusClosed{
  background: #e5e7eb !important;
  color: #111827 !important;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}

/* Updated Loading Indicator (Top Right Corner) */
.loading-indicator {
  position: fixed;
  inset: 0;                     /* = top:0 right:0 bottom:0 left:0 */

  display: flex;                /* changed from display: none */
  justify-content: center;
  align-items: center;

  /* When you want to hide it → use visibility or opacity instead */
  /* display: none; */           /* ← remove or comment this out */
  /* visibility: hidden; */     /* alternative hiding method */
  pointer-events: none;         /* lets clicks go through when visible but "disabled" */

  gap: 8px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  z-index: 1000;
}
/* Theme-specific overrides */
html[data-theme="light"] .loading-indicator {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

/* Smaller Spinner */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-top-color: var(--yellow); /* Highlight color from your root */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* ============================
   LOADING INDICATOR VISIBILITY
   ============================ */
.table-scroll { position: relative; }

html[data-theme="light"] .loading-indicator {
  color: #334155;
}

html[data-theme="light"] .spinner {
  border: 2px solid rgba(0,0,0,0.18);
  border-top-color: #3b82f6;
}

html[data-theme="dark"] .spinner {
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #3b82f6;
}
