/* ══════════════════════════════════════════════════════════════════════════
   joke.css — Prediction/Joke page only.
   Controls, tabs, table, status badges, stats, detail rows,
   Human Reference scenarios, Judgement Criteria tables.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Joke controls ────────────────────────────────────────────────────── */
.joke-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.joke-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.joke-controls label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.joke-controls select {
  background: #0f1117;
  border: 1px solid #3a3d4e;
  color: #e0e0e0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  min-width: 110px;
}
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.btn-action {
  padding: 5px 13px;
  font-size: 12px;
  border-radius: 5px;
  border: 1px solid #3a3d4e;
  background: #1a1d27;
  color: #e0e0e0;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-action:hover { background: #2a2d3e; }
.btn-action.primary { background: #1e3a2e; border-color: #4ade80; color: #4ade80; }
.btn-action.primary:hover { background: #26503d; }
.btn-action.warning { background: #3a2a1e; border-color: #FF9800; color: #FF9800; }
.btn-action.warning:hover { background: #503820; }
.progress-info { font-size: 11px; color: #888; margin-left: 6px; }

/* ── Joke tabs ────────────────────────────────────────────────────────── */
.joke-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid #2a2d3e;
}
.joke-tab {
  padding: 7px 18px;
  font-size: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}
.joke-tab:hover { color: #c0c0c0; }
.joke-tab.active { color: #4ade80; border-bottom-color: #4ade80; }
.joke-tab-panel { display: none; padding-top: 10px; }
.joke-tab-panel.active { display: block; }

/* ── Prediction table ─────────────────────────────────────────────────── */
.joke-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 260px);
}
.joke-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
  min-width: 860px;
}
.joke-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f1117;
  color: #888;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 2px solid #2a2d3e;
  white-space: nowrap;
  overflow: hidden;
}
.joke-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #1e2130;
  vertical-align: middle;
  color: #c0c0c0;
  overflow: hidden;
}
.joke-table tr.pred-row { cursor: pointer; }
.joke-table tr.pred-row:hover td { background: #1a1d27; }

/* Group header */
.exp-group-header td {
  background: #111420;
  color: #aaa;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-top: 2px solid #2a2d3e;
  border-bottom: 1px solid #2a2d3e;
  cursor: pointer;
  white-space: nowrap;
}
.exp-group-header td:first-child { color: #4ade80; }

/* Status badges */
.status-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.status-achieved { background: #1e3a2e; color: #4ade80; border: 1px solid #4ade8044; }
.status-partial  { background: #3a2e1e; color: #FF9800; border: 1px solid #FF980044; }
.status-failed   { background: #3a1e1e; color: #EF5350; border: 1px solid #EF535044; }
.status-open     { background: #1e1e2e; color: #888;    border: 1px solid #3a3d4e;   }

.pct-bar {
  display: block;
  height: 3px;
  border-radius: 2px;
  margin-top: 3px;
}
.signal-chip {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #2a2d3e;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.dir-bull  { color: #4ade80; font-weight: 600; white-space: nowrap; }
.dir-bear  { color: #EF5350; font-weight: 600; white-space: nowrap; }
.dir-range { color: #FF9800; font-weight: 600; white-space: nowrap; }
.dir-neut  { color: #888;    font-weight: 600; white-space: nowrap; }

.joke-cell {
  font-size: 11px;
  line-height: 1.4;
  color: #c0c0c0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.real-cell {
  font-size: 11px;
  color: #aaa;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Expandable detail row */
.detail-row { display: none; }
.detail-row.open { display: table-row; }
.detail-row td {
  background: #0f1117;
  padding: 10px 14px;
  cursor: default;
}
.detail-notes-table {
  font-size: 10px;
  border-collapse: collapse;
  width: 100%;
  margin-top: 6px;
}
.detail-notes-table th {
  color: #666;
  padding: 3px 8px;
  border-bottom: 1px solid #2a2d3e;
  text-align: left;
}
.detail-notes-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #1a1d27;
  color: #aaa;
}
.empty-state {
  text-align: center;
  color: #555;
  padding: 40px;
  font-size: 13px;
}

/* ── Joke statistics tab ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 4px;
}
.stats-card {
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 14px 16px;
}
.stats-card h3 {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.stats-table th {
  color: #666;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-bottom: 1px solid #2a2d3e;
  text-align: left;
  white-space: nowrap;
}
.stats-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #1e2130;
  color: #c0c0c0;
  white-space: nowrap;
}
.stats-table tr:hover td { background: #111420; }
.hit-bar-bg {
  display: inline-block;
  width: 60px;
  height: 5px;
  background: #2a2d3e;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 5px;
}
.hit-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
}

/* ── Human Reference tab ──────────────────────────────────────────────── */
.hr-scenarios { display: flex; flex-direction: column; gap: 16px; }
.hr-scenario-row {
  display: grid;
  grid-template-columns: 260px 1fr 1fr 1fr;
  gap: 14px;
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 14px;
  align-items: start;
}
.hr-scenario-highlight { border-color: #4ade8044; }
.hr-chart { position: relative; }
.hr-chart img { width: 100%; border-radius: 6px; border: 1px solid #2a2d3e; cursor: pointer; }
.hr-chart-full-btn {
  position: absolute; top: 6px; right: 6px;
  padding: 2px 8px; font-size: 10px; font-weight: 600;
  background: rgba(15,17,23,0.85); color: #b0bec5;
  border: 1px solid #3a3d4e; border-radius: 4px;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.hr-chart:hover .hr-chart-full-btn { opacity: 1; }
.hr-chart-full-btn:hover { color: #fff; border-color: #4ade80; }

/* Image lightbox overlay */
.hr-lightbox {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92); align-items: center; justify-content: center;
  cursor: zoom-out;
}
.hr-lightbox.open { display: flex; }
.hr-lightbox img {
  max-width: 95vw; max-height: 92vh; border-radius: 8px;
  border: 1px solid #3a3d4e; box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.hr-lightbox-close {
  position: absolute; top: 16px; right: 24px;
  font-size: 14px; color: #b0bec5; background: rgba(15,17,23,0.85);
  border: 1px solid #3a3d4e; border-radius: 4px; padding: 4px 12px;
  cursor: pointer;
}
.hr-lightbox-close:hover { color: #fff; border-color: #4ade80; }
.hr-scenario-num {
  font-size: 10px; color: #546e7a; text-transform: uppercase;
  letter-spacing: 0.06em; margin-top: 4px; text-align: center;
}
.hr-obs-title { font-size: 13px; font-weight: 600; color: #e0e0e0; margin-bottom: 4px; }
.hr-obs-cn { font-size: 11px; color: #546e7a; margin-bottom: 8px; font-style: italic; }
.hr-obs-body { font-size: 12px; color: #90a4ae; line-height: 1.6; }
.hr-pred-label {
  font-size: 10px; color: #546e7a; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 6px;
}
.hr-pred-body { font-size: 12px; color: #b0bec5; line-height: 1.6; }
.hr-reason-body { font-size: 11px; color: #78909c; line-height: 1.6; font-style: italic; }
.hr-engine-tag {
  font-size: 10px; background: #0f1117; border: 1px solid #2a2d3e;
  border-radius: 3px; padding: 2px 6px; color: #78909c;
  display: inline-block; margin-top: 8px;
}
.hr-engine-new { border-color: #4ade8044; color: #4ade80; }
.hr-matrix { margin-top: 20px; }

/* Source tags */
.hr-source-tag {
  display: inline-block; font-size: 9px; padding: 1px 6px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em;
  margin-left: 6px; font-weight: 600; vertical-align: middle;
}
.hr-source-human   { background: #1e3a2e; color: #4ade80; border: 1px solid #4ade8044; }
.hr-source-engine  { background: #1a2744; color: #90caf9; border: 1px solid #90caf944; }
.hr-source-industry { background: #2e2a1e; color: #FFB74D; border: 1px solid #FFB74D44; }
.hr-source-new     { background: #1e3a2e; color: #4ade80; border: 1px solid #4ade8044; }

/* ── Judgement Criteria tab ────────────────────────────────────────────── */
.jc-container { display: flex; flex-direction: column; gap: 18px; }
.jc-section {
  background: #1a1d27; border: 1px solid #2a2d3e;
  border-radius: 8px; padding: 14px;
}
.jc-section-header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.jc-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px;
}
.jc-table th {
  background: #0f1117; color: #90a4ae; font-weight: 600; text-align: left;
  padding: 6px 8px; border-bottom: 1px solid #2a2d3e; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.jc-table td { padding: 6px 8px; border-bottom: 1px solid #1e2130; color: #b0bec5; }
.jc-table tr:last-child td { border-bottom: none; }
.jc-highlight td { background: #1e3a2e22; }

/* ── Responsive for Human Reference ───────────────────────────────────── */
@media (max-width: 1000px) {
  .hr-scenario-row { grid-template-columns: 1fr; }
  .hr-gs-grid { grid-template-columns: 1fr; }
}

/* ── Gamma Squeeze Case Study ────────────────────────────────────────── */
.hr-gs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.hr-gs-card {
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 10px;
}
.hr-gs-card-wide {
  grid-column: 1 / -1;
}
.hr-gs-step {
  font-size: 11px;
  font-weight: 700;
  color: #FF9800;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hr-gs-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #2a2d3e;
  margin-bottom: 8px;
}
.hr-gs-caption {
  font-size: 11px;
  color: #b0bec5;
  line-height: 1.5;
}
