/* ============================================================
   SCATTER CHART
   ============================================================ */

.scatter-chart-container {
  width: 100%;
  height: 600px;
  margin: 1.5rem 0 2rem 0;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background-color: #F9FAFB;
  overflow: hidden;
}

.chart-search-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.chart-search-wrapper {
  position: relative;
  width: 260px;
}

.chart-search-inline {
  margin-left: auto;
}

.chart-search-input {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.875rem;
  color: #111827;
  background-color: #ffffff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.chart-search-input:focus {
  border-color: #1E3A8A;
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.12);
}

.chart-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: #ffffff;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 220px;
  overflow-y: auto;
}

.chart-search-dropdown.hidden {
  display: none;
}

.chart-search-option {
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  color: #111827;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
}

.chart-search-option:hover {
  background-color: #EFF6FF;
  color: #1E3A8A;
}

.power-ratings-table tbody tr.row-highlighted {
  background-color: rgba(245, 158, 11, 0.12);
  outline: 2px solid #F59E0B;
  outline-offset: -2px;
}


/* ============================================================
   HISTOGRAM
   ============================================================ */

.histogram-chart-container {
  width: 100%;
  height: 420px;
  margin: 0 0 1rem 0;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background-color: #F9FAFB;
}

.histogram-section {
  margin-top: 40px;
  position: relative;
}

.histogram-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hist-info-btn {
  background: none;
  border: 1.5px solid #CBD5E1;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 13px;
  color: #64748B;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}
.hist-info-btn:hover {
  border-color: #1E3A8A;
  color: #1E3A8A;
}

.hist-info-popover {
  position: relative;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
  max-width: 620px;
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.hist-info-popover p {
  margin: 0 0 8px;
}
.hist-info-popover p:last-child {
  margin-bottom: 0;
}

.hist-info-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 14px;
  color: #94A3B8;
  cursor: pointer;
}
.hist-info-close:hover { color: #1E3A8A; }

.histogram-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 12px;
  overflow-x: visible;
  overflow-y: visible;
}

.histogram-controls label {
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  color: #64748B;
}

.series-toggle-btn {
  padding: 4px 14px;
  border-radius: 6px;
  border: 1.5px solid #E2E8F0;
  background: #F9FAFB;
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  color: #64748B;
}
.series-toggle-btn.active { color: #fff; border-color: transparent; }
.series-toggle-btn.active.btn-season  { background: #1E3A8A; }
.series-toggle-btn.active.btn-offense { background: #10B981; }
.series-toggle-btn.active.btn-defense { background: #EF4444; }

.hist-team-list {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-top: 12px;
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  overflow: hidden;
}
.hist-team-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #F1F5F9;
  border-bottom: 1px solid #E2E8F0;
  font-weight: 600;
  color: #1E3A8A;
}
.hist-team-list-close {
  background: none;
  border: none;
  font-size: 14px;
  color: #94A3B8;
  cursor: pointer;
}
.hist-team-list-close:hover { color: #1E3A8A; }

.hist-team-list-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
}

.hist-team-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #F9FAFB;
  border: 1px solid #E2E8F0;
  font-size: 12px;
  color: #374151;
}
.hist-team-pill img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.hist-team-pill .pill-rating {
  font-weight: 600;
  color: #1E3A8A;
}


/* ============================================================
   GAME IMPACT SCATTER — chart-specific filters & section
   Add these to impact.css (or charts.css alongside the
   existing .scatter-chart-container rules)
   ============================================================ */

.scatter-section {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 0 16px;
}

/* Filter row — independent from the table's form */
.scatter-chart-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  color: #64748B;
}

.scatter-chart-filters label {
  color: #64748B;
  font-size: 13px;
  white-space: nowrap;
}

.scatter-chart-filters select {
  padding: 5px 10px;
  border: 1.5px solid #CBD5E1;
  border-radius: 6px;
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  color: #111827;
  background: #ffffff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.scatter-chart-filters select:focus {
  border-color: #1E3A8A;
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.10);
}

/* Search sits at the right end of the filter row */
.scatter-search {
  margin-left: auto;
  width: 240px;
}