/* segment-stats.css — styling for the Trend page's "Segment Stats" view
   (js/segment-stats.js). Scoped under #segstats-root, same convention as
   css/situations.css, so nothing here can collide with site-wide classes. */

#segstats-root {
  font-family: 'Rubik', sans-serif;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

#segstats-root .segstats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}
#segstats-root .segstats-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
#segstats-root .segstats-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Section buttons: Segment Stats (this table) and the Segment Report's
   sections (js/segment-report.js), League Stats' category-row look. */
#segstats-root .segstats-sections {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  padding: 0 0 0.45rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
#segstats-root .segstats-sections > * { flex-shrink: 0; }
#segstats-root .segstats-seg-select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.28rem 0.4rem; font: 400 0.75rem 'Rubik', sans-serif; max-width: 22rem;
}

#segstats-root .segstats-note {
  color: var(--text2);
  font-size: 0.75rem;
  margin: 0 0 0.3rem;
}
#segstats-root .segstats-empty,
#segstats-root .segstats-loading {
  color: var(--text3);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
}

#segstats-root .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }

/* Font/padding kept small and tight on purpose -- with ~27 stat rows,
   this is the difference between the whole table fitting the modal at
   once (the point of this view) and it needing a vertical scrollbar. */
#segstats-root .segstats-table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 0.74rem; }
#segstats-root .segstats-table th, #segstats-root .segstats-table td {
  padding: 2px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: center; line-height: 1.15;
}
#segstats-root .segstats-table thead th {
  color: var(--text3); font: 700 11px 'Rubik', sans-serif; letter-spacing: .04em;
  text-transform: uppercase; background: var(--surface2); position: sticky; top: 0;
}
#segstats-root .segstats-table tbody th {
  text-align: left; color: var(--text); font-weight: 600; background: var(--surface);
  position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--border);
}
#segstats-root .segstats-row-label-col { text-align: left; position: sticky; left: 0; z-index: 2; }
#segstats-root .segstats-table tbody tr:hover td { background: var(--highlight-bg); }
#segstats-root .segstats-seg-label { font-size: 0.78rem; }
#segstats-root .segstats-seg-sub { font-size: 0.66rem; color: var(--text3); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ---- Input panel ---- */
#segstats-root .segstats-input-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#segstats-root .segstats-input-status { color: var(--text2); font-size: 0.78rem; }
#segstats-root .segstats-input-status.ok { color: var(--good-text); font-weight: 600; }
#segstats-root .segstats-input-status.err { color: var(--bad-text); font-weight: 600; }
#segstats-root .segstats-input-wrap { max-height: 60vh; overflow-y: auto; }
#segstats-root .segstats-input-table thead th { position: sticky; top: 0; z-index: 1; }
#segstats-root .segstats-input-table td:nth-child(-n+4) { text-align: left; }
#segstats-root .segstats-input-field {
  width: 72px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 6px; font: 400 12.5px 'Rubik', sans-serif; text-align: right;
  -moz-appearance: textfield;
}
/* Typed entry only -- no spinner up/down arrows on these number inputs. */
#segstats-root .segstats-input-field::-webkit-outer-spin-button,
#segstats-root .segstats-input-field::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
#segstats-root .segstats-input-field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#segstats-root .btn { border-radius: 7px; padding: 8px 16px; font: 600 13.5px 'Rubik', sans-serif; cursor: pointer; border: 1px solid transparent; }
#segstats-root .btn-primary { background: var(--oilers-orange); color: #fff; }
#segstats-root .btn-primary:hover { background: #b8391a; }
#segstats-root .btn-primary:disabled { background: var(--border); color: var(--text3); cursor: not-allowed; }

/* ---- Print (Segment Stats table only, landscape, one sheet) ----
   Scoped to body.segstats-print-mode, toggled on/off around window.print()
   in segment-stats.js's printSegmentStats() -- nothing here affects
   printing anywhere else in the site. Hides every other top-level element
   (sidebar, other overlays) and the Trend modal's own chrome, leaving just
   the segment-stats-content subtree, then shrinks the table's type down
   small enough that 18-ish columns fit one landscape page. */
@media print {
  body.segstats-print-mode > *:not(#trend-overlay) { display: none !important; }
  body.segstats-print-mode #trend-overlay {
    position: static !important;
    background: none !important;
    display: block !important;
  }
  body.segstats-print-mode #trend-overlay .trend-modal {
    position: static !important;
    width: auto !important; max-width: none !important;
    height: auto !important; max-height: none !important;
    box-shadow: none !important; border-radius: 0 !important;
    padding: 0 !important; overflow: visible !important;
  }
  body.segstats-print-mode .trend-modal-header,
  body.segstats-print-mode #trend-chart,
  body.segstats-print-mode #trend-stats-panel { display: none !important; }
  body.segstats-print-mode #segment-stats-content {
    display: block !important; overflow: visible !important; padding: 0 !important;
  }
  body.segstats-print-mode #segstats-root .segstats-header-actions,
  body.segstats-print-mode #segstats-root .segstats-note { display: none !important; }
  body.segstats-print-mode #segstats-root .table-wrap { border: none; overflow: visible; }
  body.segstats-print-mode #segstats-root .segstats-table { font-size: 8px; width: 100%; }
  body.segstats-print-mode #segstats-root .segstats-table th,
  body.segstats-print-mode #segstats-root .segstats-table td { padding: 2px 3px; }
  body.segstats-print-mode #segstats-root .segstats-table thead th,
  body.segstats-print-mode #segstats-root .segstats-table tbody th { position: static; }
  body.segstats-print-mode #segstats-root .segstats-seg-sub { font-size: 6.5px; }
  body.segstats-print-mode #segstats-root .segstats-title { font-size: 13px; margin-bottom: 4px; }

  @page { size: landscape; margin: 0.35in; }
}
