/* /static/css/research-hub.css — Research Hub landing page */

/* Hide workbench content-section (glass-panel borders) on any research-hub route */
body.rh-active #content-section { display: none !important; }

.research-hub-landing {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 60px 16px 32px;
}

.cs-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 480px;
  width: 100%;
}

.cs-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  aspect-ratio: 1 / 1;
  padding: 24px 16px;
  border-radius: 16px;
  background: var(--theme-card-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cs-card:hover {
  transform: translateY(-2px);
  border-color: var(--theme-accent, #00D3BD);
  box-shadow: 0 4px 20px rgba(0, 211, 189, 0.12);
}

.cs-card:active {
  transform: scale(0.97);
}

.cs-card-icon {
  font-size: 40px;
  color: var(--theme-accent, #00D3BD);
  line-height: 1;
}

.cs-card-label {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--theme-text-primary, #E6EDF3);
  text-align: center;
}

.cs-card-desc {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--theme-text-secondary, #8B949E);
  text-align: center;
  line-height: 1.35;
}

/* Three-card grid (NBA: 3 square cards in a row) */
.cs-cards--three {
  grid-template-columns: repeat(3, 1fr);
  max-width: 680px;
}

/* Four-card grid (NBA: 4 cards in a row) */
.cs-cards--four {
  grid-template-columns: repeat(4, 1fr);
  max-width: 860px;
}

/* Five-card grid (NBA: 5 cards in a row) */
.cs-cards--five {
  grid-template-columns: repeat(5, 1fr);
  max-width: 1060px;
}

/* Six-card grid (NBA: 3 per row, 2 rows) */
.cs-cards--six {
  grid-template-columns: repeat(3, 1fr);
  max-width: 660px;
}

/* Light theme */
[data-theme="light"] .cs-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .cs-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Mobile */
@media (max-width: 1000px) {
  .research-hub-landing {
    padding: 24px 16px;
    min-height: 100vh;
  }

  .cs-cards {
    max-width: 100%;
    gap: 16px;
  }

  .cs-cards--three {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-cards--four {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-cards--five {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-cards--six {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-card {
    padding: 20px 12px;
  }

  .cs-card-icon {
    font-size: 48px;
  }

  .cs-card-label {
    font-size: 32px;
  }

  .cs-card-desc {
    font-size: 26px;
  }
}

/* ====================================================================
   MLB rich landing — 2-col grid where each card carries a top-3 preview.
   Cards stay clickable as a whole; the "OPEN X >" CTA is decorative.
   Accent colors per section:
     weather  = cyan      pitchers = violet
     hrz      = teal      parks    = amber
==================================================================== */

.cs-cards--mlb-rich {
  grid-template-columns: repeat(2, 1fr);
  max-width: 1380px;
  gap: 20px;
}

.cs-card-rich {
  position: relative;
  aspect-ratio: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  text-align: left;
}
.cs-card-rich:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* Top accent stripe — single-pixel band that rides above each card. */
.cs-card-rich .cs-card-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 16px 16px 0 0;
}
.cs-card-stripe-weather  { background: linear-gradient(90deg, #22d3ee, rgba(34,211,238,0)); }
.cs-card-stripe-pitchers { background: linear-gradient(90deg, #a78bfa, rgba(167,139,250,0)); }
.cs-card-stripe-hrz      { background: linear-gradient(90deg, #34d399, rgba(52,211,153,0)); }
.cs-card-stripe-parks    { background: linear-gradient(90deg, #fbbf24, rgba(251,191,36,0)); }

/* Header row — icon tile + title block + top-right launch glyph */
.cs-card-rich .cs-card-rich-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 12px;
}
.cs-card-rich .cs-card-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
}
.cs-card-icon-weather  { color: #22d3ee; background: rgba(34,211,238,.10); border-color: rgba(34,211,238,.30) !important; }
.cs-card-icon-pitchers { color: #a78bfa; background: rgba(167,139,250,.10); border-color: rgba(167,139,250,.30) !important; }
.cs-card-icon-hrz      { color: #34d399; background: rgba(52,211,153,.10); border-color: rgba(52,211,153,.30) !important; }
.cs-card-icon-parks    { color: #fbbf24; background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.30) !important; }

.cs-card-rich .cs-card-rich-titles {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  text-align: left;
}
.cs-card-rich .cs-card-label  { text-align: left; font-size: 17px; }
.cs-card-rich .cs-card-desc   { text-align: left; font-size: 12px; line-height: 1.3; }

.cs-card-rich .cs-card-rich-arrow {
  flex-shrink: 0;
  font-size: 14px; color: rgba(255,255,255,.35);
  margin-top: 4px;
  transition: color 120ms ease;
}
.cs-card-rich:hover .cs-card-rich-arrow { color: rgba(255,255,255,.7); }

/* Summary line just below the head — badge + headline text */
.cs-card-rich .cs-card-rich-summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 0 20px 12px;
  font-size: 12px; color: #cbd5e1; line-height: 1.4;
}
.cs-card-rich .cs-card-rich-summary-text { color: #cbd5e1; }
.cs-card-rich .cs-card-rich-summary-text strong { color: #f1f5f9; font-weight: 600; }

.cs-card-rich .cs-card-rich-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  padding: 3px 7px; border-radius: 4px;
  white-space: nowrap;
}
.cs-badge-weather  { background: rgba(34,211,238,.14);  color: #67e8f9; border: 1px solid rgba(34,211,238,.35); }
.cs-badge-pitchers { background: rgba(167,139,250,.14); color: #c4b5fd; border: 1px solid rgba(167,139,250,.35); }
.cs-badge-hrz      { background: rgba(52,211,153,.14);  color: #6ee7b7; border: 1px solid rgba(52,211,153,.35); }
.cs-badge-parks    { background: rgba(251,191,36,.14);  color: #fcd34d; border: 1px solid rgba(251,191,36,.35); }

/* Top-N list label */
.cs-card-rich .cs-card-rich-list-label {
  padding: 12px 20px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  color: #64748b; text-transform: uppercase;
  border-top: 1px solid rgba(255,255,255,.05);
}

/* The 3-row preview list */
.cs-card-rich .cs-card-rich-list {
  display: flex; flex-direction: column;
  padding: 0 20px 12px;
}
.cs-card-rich .cs-card-rich-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.cs-card-rich .cs-card-rich-row:last-child { border-bottom: none; }

.cs-card-rich .cs-card-rich-rank {
  flex-shrink: 0;
  width: 22px;
  font-size: 11px; font-weight: 700;
  color: #64748b; letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.cs-card-rich .cs-card-rich-row-name {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.cs-card-rich .cs-card-rich-row-name-main {
  font-size: 13px; font-weight: 600; color: #f1f5f9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-card-rich .cs-card-rich-row-name-meta-inline { color: #94a3b8; font-weight: 500; font-size: 12px; }
.cs-card-rich .cs-card-rich-row-name-meta {
  font-size: 11px; color: #64748b; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-card-rich .cs-card-rich-row-metrics {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.cs-card-rich .cs-card-rich-row-metric-primary {
  font-size: 14px; font-weight: 700; color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}
.cs-card-rich .cs-card-rich-row-metric-primary.cs-metric-good { color: #6ee7b7; }
.cs-card-rich .cs-card-rich-row-metric-primary.cs-metric-bad  { color: #fca5a5; }
.cs-card-rich .cs-card-rich-row-metric-sub {
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  color: #64748b; text-transform: uppercase;
}
.cs-card-rich .cs-card-rich-row-metric-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,.06); color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.cs-card-rich .cs-card-rich-row-metric-pill.cs-badge-pitchers {
  /* Score pill on pitcher rows reuses the section accent. */
  font-size: 13px; padding: 3px 8px;
}

/* Tiny park-factor bar */
.cs-card-rich .cs-card-rich-row-bar {
  display: inline-block;
  width: 64px; height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
}
.cs-card-rich .cs-card-rich-row-bar > .cs-bar-good,
.cs-card-rich .cs-card-rich-row-bar > .cs-bar-bad {
  display: block; height: 100%;
}
.cs-card-rich .cs-card-rich-row-bar > .cs-bar-good { background: #34d399; }
.cs-card-rich .cs-card-rich-row-bar > .cs-bar-bad  { background: #fb7185; }

/* Footer */
.cs-card-rich .cs-card-rich-footer {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.cs-card-rich .cs-card-rich-footer-summary {
  font-size: 11px; color: #64748b; font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-card-rich .cs-card-rich-footer-cta {
  font-size: 11px; font-weight: 800; letter-spacing: .8px;
  color: #cbd5e1; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.cs-card-rich:hover .cs-card-rich-footer-cta { color: #f8fafc; }
.cs-card-rich-weather:hover  .cs-card-rich-footer-cta { color: #67e8f9; }
.cs-card-rich-pitchers:hover .cs-card-rich-footer-cta { color: #c4b5fd; }
.cs-card-rich-hrz:hover      .cs-card-rich-footer-cta { color: #6ee7b7; }
.cs-card-rich-parks:hover    .cs-card-rich-footer-cta { color: #fcd34d; }

/* Skeleton placeholders shown until the fetch lands. */
@keyframes cs-skel-pulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: .7; }
}
.cs-card-rich .cs-card-rich-skel {
  background: rgba(148,163,184,.08);
  border-radius: 4px;
  border-bottom: none;
  height: 40px;
  margin: 6px 0;
  animation: cs-skel-pulse 1.4s ease-in-out infinite;
}
.cs-card-rich .cs-card-rich-skel-line {
  display: inline-block;
  width: 70%; height: 12px;
  background: rgba(148,163,184,.10);
  border-radius: 4px;
  animation: cs-skel-pulse 1.4s ease-in-out infinite;
}
.cs-card-rich .cs-card-rich-empty {
  padding: 16px 0;
  font-size: 12px; color: #64748b; font-style: italic;
  text-align: center;
}

/* Mobile collapse — single column, tighter padding */
@media (max-width: 1000px) {
  .cs-cards--mlb-rich {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .cs-card-rich .cs-card-rich-head    { padding: 14px 16px 8px; }
  .cs-card-rich .cs-card-rich-summary { padding: 0 16px 10px; }
  .cs-card-rich .cs-card-rich-list,
  .cs-card-rich .cs-card-rich-list-label { padding-left: 16px; padding-right: 16px; }
  .cs-card-rich .cs-card-rich-footer  { padding: 10px 16px 14px; }
}
