/* HR Predictions Pro — style.css v2.0 — Light Theme */

:root {
  --bg:        #ffffff;
  --bg2:       #f8f9fb;
  --bg3:       #f0f2f5;
  --border:    #e2e6ed;
  --border2:   #cbd2db;
  --text:      #111827;
  --text2:     #4b5563;
  --text3:     #9ca3af;
  --blue:      #2563eb;
  --blue-bg:   #eff6ff;
  --blue-text: #1e40af;
  --green:     #16a34a;
  --green-bg:  #f0fdf4;
  --amber:     #b45309;
  --amber-bg:  #fffbeb;
  --red:       #dc2626;
  --red-bg:    #fef2f2;
  --purple:    #7c3aed;
}

#hrpred-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  line-height: 1.4;
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: border-box; }
input, select, button, textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1;
}

/* Brand bar */
.hrpred-brandbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.hrpred-brand-badge {
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  padding: 5px 11px;
  border-radius: 7px;
  text-transform: uppercase;
  line-height: 1;
  display: inline-block;
}
.hrpred-brand-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* Tabs */
.hrpred-tabs {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.hrpred-tab {
  background: none !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 16px 10px;
  cursor: pointer;
  transition: color .15s;
  margin-bottom: -1px;
  border-radius: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}
.hrpred-tab:hover { color: var(--text); }
.hrpred-tab.active { color: var(--blue) !important; border-bottom: 3px solid var(--blue) !important; }
.hrpred-tab:focus { outline: none !important; box-shadow: none !important; }
.hr-hit-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1.3;
}

/* Toolbar */
.hrpred-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.hrpred-date-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  flex-shrink: 0;
}
.hrpred-date-nav button {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 3px;
  margin: 0;
  height: auto;
  min-height: 0;
  box-shadow: none;
  border-radius: 0;
  display: inline-block;
  transition: color .1s;
}
.hrpred-date-nav button:hover { color: var(--blue-text); }
#hrpred-date { font-size: 13px; font-weight: 600; min-width: 138px; text-align: center; color: var(--text); }
.hrpred-filters { display: flex; gap: 7px; flex: 1; flex-wrap: wrap; }
.hrpred-filters input,
.hrpred-filters select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12px;
  outline: none;
  height: 32px;
  min-height: 0;
  line-height: 1;
  box-shadow: none;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.hrpred-filters input:focus,
.hrpred-filters select:focus { border-color: var(--blue); }
.hrpred-filters input::placeholder { color: var(--text3); }
.hrpred-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#hrpred-count { font-size: 11px; color: var(--text3); white-space: nowrap; }
#hrpred-refresh {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: 7px;
  padding: 0 10px;
  font-size: 14px;
  cursor: pointer;
  height: 32px;
  min-height: 0;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  transition: all .15s;
}
#hrpred-refresh:hover { color: var(--blue); border-color: var(--blue); }
#hrpred-refresh.spinning { animation: hrp-spin .6s linear infinite; }

/* Table */
.hrpred-scroll { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
#hrpred-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; background: transparent; }
#hrpred-table thead tr { background: var(--bg2); border-bottom: 1px solid var(--border); }
#hrpred-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text3);
  white-space: nowrap;
  user-select: none;
  background: transparent;
  border: none;
  vertical-align: middle;
}
#hrpred-table th.sortable { cursor: pointer; }
#hrpred-table th.sortable:hover,
#hrpred-table th.sort-active { color: var(--blue); }
#hrpred-table th.odds-head { color: var(--blue); }
.sort-icon { font-size: 9px; margin-left: 2px; }
#hrpred-tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; background: var(--bg); }
#hrpred-tbody tr:hover { background: var(--bg2); }
#hrpred-tbody td {
  padding: 10px 14px;
  white-space: nowrap;
  vertical-align: middle;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  line-height: 1.4;
  overflow: visible;
}
#hrpred-tbody td:first-child, #hrpred-table th:first-child { padding-left: 14px; }

/* Cell contents */
.hrp-batter-name { font-weight: 700; font-size: 13px; color: var(--text); }
.hrp-batter-sub  { font-size: 11px; color: var(--text3); margin-top: 2px; }
.hrp-hand { display: inline-block; font-size: 8px; font-weight: 800; padding: 2px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; line-height: 1.3; }
.hrp-hand-R { background: #dbeafe; color: #1d4ed8; }
.hrp-hand-L { background: #d1fae5; color: #065f46; }
.hrp-hand-B { background: #f3e8ff; color: #6b21a8; }
.hrp-pitcher-name { font-size: 12px; color: var(--text2); }
.hrp-pitcher-hand { font-size: 10px; color: var(--text3); margin-top: 1px; }
.hrp-game  { font-size: 12px; font-weight: 600; color: var(--text); }
.hrp-venue { font-size: 10px; color: var(--text3); margin-top: 2px; }
.hrp-wx    { font-size: 11px; color: var(--text2); white-space: nowrap; }
.hrp-wx-icon { font-size: 14px; }
.hrp-odds  { font-size: 13px; font-weight: 700; color: var(--text); }

/* HR% pills */
.hrp-pct { display: inline-block; font-weight: 800; font-size: 13px; padding: 4px 11px; border-radius: 7px; min-width: 56px; text-align: center; line-height: 1.3; }
.hrp-pct-hi  { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.hrp-pct-mid { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }
.hrp-pct-lo  { background: var(--bg3);      color: var(--text3); border: 1px solid var(--border); }

/* Loading / empty / error */
.hrpred-loading, .hrpred-empty, .hrpred-error {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; min-height: 100px; font-size: 14px;
  color: var(--text3); padding: 28px 20px; text-align: center;
}
.hrpred-error { color: var(--red); flex-direction: column; }
.hrpred-spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: hrp-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes hrp-spin { to { transform: rotate(360deg); } }
.hrpred-note { font-size: 11px; color: var(--text3); text-align: center; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg2); }

/* Modal */
#hrpred-modal { position: absolute; top: 0; left: 0; width: 100%; min-height: 100%; z-index: 9000; }
.hrpred-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9001; }
.hrpred-modal-box {
  position: relative; z-index: 9002;
  width: min(680px, 96vw); max-height: 90vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; margin: 16px auto;
}
.hrpred-modal-close {
  position: sticky; top: 0; float: right;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text3); border-radius: 50%;
  width: 28px; height: 28px; font-size: 17px; line-height: 26px;
  text-align: center; cursor: pointer; z-index: 1;
  margin-bottom: 8px; display: block; box-shadow: none; transition: all .1s;
}
.hrpred-modal-close:hover { color: var(--text); background: var(--bg3); }
.hrpred-modal-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; color: var(--text3); font-size: 13px; }

/* Modal: header — matches mHeader() JS output */
.hrpm-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.hrpm-player-info { flex: 1; min-width: 0; }
.hrpm-player-info h2 { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 5px; }
.hrpm-player-sub { font-size: 12px; color: var(--text3); line-height: 1.7; }
.hrpm-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.hrpm-badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); color: var(--text2); background: var(--bg2); }
.hrpm-badge-p { color: #6b21a8; border-color: #e9d5ff; background: #faf5ff; }
.hrpm-badge-b { color: var(--blue); border-color: #bfdbfe; background: var(--blue-bg); }
.hrpm-badge-g { color: var(--green); border-color: #bbf7d0; background: var(--green-bg); }
.hrpm-hr-pct { flex-shrink: 0; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; text-align: center; min-width: 100px; }
.hrpm-hr-pct-val   { font-size: 30px; font-weight: 800; color: var(--green); line-height: 1; display: block; }
.hrpm-hr-pct-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; display: block; }
.hrpm-switch-note { font-size: 12px; color: var(--text2); background: var(--blue-bg); border-left: 3px solid var(--blue); padding: 8px 12px; margin-bottom: 4px; border-radius: 0; }

/* Modal sections */
.hrpm-section { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; }
.hrpm-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }

/* 4-book grid — matches hrpm-odds-grid / hrpm-odds-book class names in JS */
.hrpm-odds-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.hrpm-odds-book { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; }
.hrpm-best-over { border-color: var(--green); background: var(--green-bg); }
.hrpm-book-name  { font-size: 10px; color: var(--text3); margin-bottom: 5px; }
.hrpm-book-over  { font-size: 18px; font-weight: 700; color: var(--text); }
.hrpm-best-over .hrpm-book-over { color: var(--green); }
.hrpm-book-na    { font-size: 18px; color: var(--text3); }
.hrpm-book-under { font-size: 11px; color: var(--red); margin-top: 2px; }
.hrpm-book-line  { font-size: 10px; color: var(--text3); margin-top: 3px; }

/* HRF — matches hrpm-hrf-row class name in JS */
.hrpm-hrf-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hrpm-hrf-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 11px 16px; min-width: 90px; text-align: center; }
.hrpm-hrf-val { font-size: 22px; font-weight: 700; color: var(--text); }
.hrpm-hrf-up  { color: var(--green); }
.hrpm-hrf-dn  { color: var(--red);   }
.hrpm-hrf-ev  { color: var(--text3); }
.hrpm-hrf-label { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; margin-top: 3px; }
.hrpm-hrf-formula { margin-top: 10px; padding: 10px 12px; background: var(--amber-bg); border-left: 3px solid var(--amber); border-radius: 0; font-size: 12px; color: var(--text2); line-height: 1.5; }

/* Stats tables */
.hrpm-stats-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hrpm-stats-table th { padding: 7px 10px; text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); border-bottom: 1px solid var(--border); background: transparent; }
.hrpm-stats-table td { padding: 9px 10px; text-align: center; color: var(--text); border-bottom: 1px solid var(--border); }
.hrpm-stats-table tr:last-child td { border-bottom: none; }
.hrpm-stat-good { color: var(--green); font-weight: 700; }
.hrpm-stat-bad  { color: var(--red);   font-weight: 700; }

/* Weather — matches hrpm-weather-row / hrpm-wx-item / hrpm-wx-val / hrpm-wx-label */
.hrpm-weather-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hrpm-wx-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; min-width: 80px; text-align: center; }
.hrpm-wx-icon { width: 36px; height: 36px; }
.hrpm-wx-val  { font-size: 16px; font-weight: 700; color: var(--text); }
.hrpm-wx-label { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }
.hrpm-wind-factor { margin-top: 10px; padding: 10px 12px; background: var(--blue-bg); border-left: 3px solid var(--blue); border-radius: 0; font-size: 12px; color: var(--text2); }

/* Gamelog */
.hrpm-gl-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.hrpm-gl-table th { padding: 6px 8px; text-align: center; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.hrpm-gl-table td { padding: 6px 8px; text-align: center; color: var(--text2); border-bottom: 1px solid var(--border); }
.hrpm-gl-table td:first-child { text-align: left; color: var(--text3); }
.hrpm-gl-hr { color: var(--green); font-weight: 700; }

/* Hits toolbar */
.hrpred-hits-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--bg2); border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text3); }
#hrpred-hits-refresh { background: none; border: 1px solid var(--border); color: var(--text3); border-radius: 7px; padding: 0 10px; font-size: 14px; height: 28px; cursor: pointer; transition: all .15s; }
#hrpred-hits-refresh:hover { color: var(--blue); border-color: var(--blue); }

/* Hits table */
#hrpred-hits-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#hrpred-hits-table thead tr { background: var(--bg2); border-bottom: 1px solid var(--border); }
#hrpred-hits-table th { padding: 9px 12px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); white-space: nowrap; background: transparent; border: none; }
#hrpred-hits-table th.odds-head { color: var(--blue); }
#hrpred-hits-table tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; background: var(--bg); }
#hrpred-hits-table tbody tr:hover { background: var(--bg2); }
#hrpred-hits-table tbody td { padding: 9px 12px; vertical-align: middle; border: none; border-bottom: 1px solid var(--border); background: transparent; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.hr-batter-name { font-weight: 700; font-size: 13px; color: var(--text); }
.hr-team-name   { font-size: 11px; color: var(--text3); }
.hr-game-name   { font-size: 11px; color: var(--text2); }
.hr-inning      { font-size: 11px; color: var(--text3); }
.hr-pitcher     { font-size: 12px; color: var(--text2); }
.hr-dk          { font-weight: 700; font-size: 13px; color: var(--text); }
.hr-none        { color: var(--text3); font-size: 12px; }
.hr-velo        { font-size: 12px; color: var(--text2); }
.hr-velo-hot    { color: var(--amber); font-weight: 700; }
.hr-distance    { font-size: 12px; color: var(--text); font-weight: 600; }

/* Pitch Mix */
.pmix-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pmix-table th { padding: 7px 10px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); border-bottom: 1px solid var(--border); white-space: nowrap; background: transparent; }
.pmix-table td { padding: 8px 10px; border-bottom: 1px solid var(--bg3); color: var(--text); white-space: nowrap; vertical-align: middle; }
.pmix-table tr:last-child td { border-bottom: none; }
.pmix-bar-wrap { display: flex; align-items: center; gap: 6px; min-width: 90px; }
.pmix-bar { height: 5px; background: var(--blue); border-radius: 3px; min-width: 3px; flex-shrink: 0; }
.pmix-bold { font-weight: 700; }
.pmix-good { color: var(--green); font-weight: 700; }
.pmix-bad  { color: var(--red);   font-weight: 700; }
.pmix-edge-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; }
.pmix-edge-good    { background: var(--green-bg); color: var(--green); }
.pmix-edge-ok      { background: #dcfce7; color: #15803d; }
.pmix-edge-bad     { background: var(--red-bg);   color: var(--red);   }
.pmix-edge-warn    { background: var(--amber-bg); color: var(--amber); }
.pmix-edge-neutral { background: var(--bg3);      color: var(--text3); }

/* Odds Movers */
.mv-odds { font-size: 13px; font-weight: 700; color: #111827; }
.mv-open { color: #6b7280; font-weight: 500; }
.mv-curr { color: #111827; font-weight: 700; }
.mv-move { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.mv-steam { background: #f0fdf4; color: #16a34a; }
.mv-drift { background: #fef2f2; color: #dc2626; }

/* HR hit grading */
.hrp-hr-hit { font-size: 14px; margin-left: 5px; vertical-align: middle; }

/* Legend bar */
.hrpred-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 7px 18px;
  background: #f8f9fb;
  border-bottom: 1px solid #e2e6ed;
  font-size: 11px;
  color: #6b7280;
  flex-wrap: wrap;
}
.hrpred-legend span + span { opacity: .6; }

/* Movers table — mirrors hits table styling */
#hrpred-movers-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#hrpred-movers-table thead tr { background: var(--bg2); border-bottom: 1px solid var(--border); }
#hrpred-movers-table th { padding: 9px 12px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); white-space: nowrap; background: transparent; border: none; }
#hrpred-movers-table th.odds-head { color: var(--blue); }
#hrpred-movers-table tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; background: var(--bg); }
#hrpred-movers-table tbody tr:hover { background: var(--bg2); }
#hrpred-movers-table tbody td { padding: 9px 12px; vertical-align: middle; border: none; border-bottom: 1px solid var(--border); background: transparent; font-size: 13px; line-height: 1.3; white-space: nowrap; }
