/* Flex container for layout with plot and table side by side */
.content-container {
    display: flex;
    /*justify-content: space-between;*/
    align-items: stretch; /* Stretch both containers to the same height */
    gap: 30px;  /* Increase the gap between the plot and the table */
    margin: 20px 0;
    background-color: #fff; /* Both elements will share the same background */
    padding: 24px 28px; /* Adds padding around both elements */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Adds shadow for a unified effect */
}

/* Plot container styling */
.plot-container {
    flex: 1;
    max-width: 60%; /* Ensures the plot container doesn't take more than 60% of the space */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: 100%; /* Makes sure the plot container is stretched to fill the height */
    display: flex;
    flex-direction: column; /* Ensures that the plot and annotations stay in a column layout */
    justify-content: space-between; /* Stretches the content vertically */
}


/* Responsive adjustments for smaller screens */
@media screen and (max-width: 768px) {
    .plot-container {
        max-width: 100%; /* Takes up full width on small screens */
        padding: 10px; /* Reduce padding for smaller screens */
    }
}



/* Table container specific styling */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 0.75rem 0 1rem;
    border-collapse: collapse;
}

/* Table styling */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;

}

/* ──────────────────────────────────────────────────────────────
   Shared .table-splits — single source of truth for player + team
   stats tables. Dark header, tabular numbers, right-aligned numeric
   columns, zebra striping, sticky row-label column for wide tables.
   ────────────────────────────────────────────────────────────── */
.table-splits {
    width: 100%;
    border-collapse: separate;        /* required so sticky first col borders render correctly */
    border-spacing: 0;
    font-size: 0.78rem;
    background-color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Header — flat dark grey, small uppercase. */
.table-splits thead th,
.table-splits-header th {
    background-color: #4a4a4a;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    font-size: 0.68rem;
    padding: 7px 7px;
    border-bottom: 1px solid #2a2a2a;
    text-align: right;
    white-space: nowrap;
    position: sticky;                 /* stick header to top of any scrolling container */
    top: 0;
    z-index: 2;
}

/* Body cells — right-align numbers, light row borders. */
.table-splits td {
    padding: 6px 7px;
    border-bottom: 1px solid #ececec;
    text-align: right;
    color: #2f2f2f;
    white-space: nowrap;
    line-height: 1.3;
}

/* Row-label (first) column: left aligned, bolder, sticky so it stays
   visible when the table scrolls horizontally on wide screens. */
.table-splits th:first-child,
.table-splits td:first-child {
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    position: sticky;
    left: 0;
    z-index: 1;                       /* below the header but above other cells */
    background-color: inherit;        /* inherit the row's stripe color */
    box-shadow: inset -1px 0 0 #d8dde6; /* subtle divider after row label */
}
.table-splits thead th:first-child {
    z-index: 3;                       /* corner cell sits above both axes */
    background-color: #4a4a4a;
    box-shadow: inset -1px 0 0 #5a5a5a;
}

/* Zebra striping — slightly stronger so rows are easier to follow.
   Set explicit bg on every row so the sticky first col inherits it. */
.table-splits tbody tr {
    background-color: #ffffff;
}
.table-splits tbody tr:nth-child(even) {
    background-color: #f4f6fa;
}

/* Hover — highlight the whole row, including the sticky label cell. */
.table-splits tbody tr:hover,
.table-splits tbody tr:hover td:first-child {
    background-color: #e6efff;
    transition: background-color 0.12s ease;
}

/* History table — slightly more breathing room. */
.table-splits.history td,
.table-splits.history th {
    padding: 8px 10px;
}

/* Tri-state game-type segmented control (Regular / Playoff / Both).
   Applies to both splits tables and the season-history table. */
.player-stats-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.stats-mode-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
.stats-mode-pill {
    display: inline-flex;
    background: #eef1f6;
    border: 1px solid #d8dde6;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    font-size: 0.78rem;
}
.stats-mode-pill__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #4b5563;
    padding: 5px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color 0.12s, color 0.12s;
}
.stats-mode-pill__btn:hover { color: #1f2937; }
.stats-mode-pill__btn.is-active {
    background: #1f2937;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.splits-empty {
    text-align: center !important;
    color: #9ca3af;
    font-style: italic;
    padding: 18px 10px !important;
}

/* New styles */
.player-stats {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.splits-container {
    flex: 0 1 70%;
    min-width: 0;            /* allow flex item to shrink so overflow-x on inner tables works */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.current-season,
.last-season {
    width: 100%;
    background-color: #fff;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 0;
}

.current-season h2,
.last-season h2,
.History-seasson-stats h2 {
    font-size: 0.9rem;
    margin: 0 0 4px 0;
}

.History-seasson-stats {
    flex: 0 1 30%;
    min-width: 0;            /* same fix on the right column */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.history-table-wrapper {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

@media (max-width: 1100px) {
    /* Tight viewports — stack so the 16-column splits tables get full width. */
    .player-stats { flex-direction: column; }
    .splits-container,
    .History-seasson-stats { flex-basis: 100%; }
    .history-table-wrapper { max-height: 420px; }
}

.History-seasson-stats .table-splits thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.History-seasson-stats .table-splits thead th {
    background-color: #4a4a4a;
}

/* Add a subtle scrollbar style */
.history-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.history-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.history-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.history-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

player-odds.content-container {
  width: 100%;
  box-sizing: border-box;
}

/* Main dashboard container */
.dashboard-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  gap: 20px;
  padding: 20px;
}

/* Filters bar — soft toolbar card, filters left, buttons right. */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 18px;
  background: #f7f8fb;
  border: 1px solid #e6e9ef;
  border-radius: 10px;
  padding: 12px 16px;
}

/* Each filter group is a horizontal set of fields */
.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

/* Filter labels — small uppercase, sit inline with the select. */
.filter-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4b5563;
  font-weight: 600;
  white-space: nowrap;
}

/* Modern custom-styled selects (no native chevron). */
.filters-bar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%234b5563' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 7px 30px 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.filters-bar select:hover { border-color: #94a3b8; }
.filters-bar select:focus {
  outline: none;
  border-color: #0ea5a4;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.18);
}

/* Filter buttons — primary (teal) + secondary (ghost). */
.filter-buttons {
  display: flex;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}
.filter-buttons button {
  appearance: none;
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s, transform 0.04s;
}
.filter-buttons #applyFilters {
  background: #0ea5a4;
  color: #fff;
}
.filter-buttons #applyFilters:hover { background: #0d9488; }
.filter-buttons #applyFilters:active { transform: translateY(1px); }
.filter-buttons #modeToggle {
  background: #fff;
  color: #374151;
  border-color: #d8dde6;
}
.filter-buttons #modeToggle:hover {
  background: #f4f6fa;
  border-color: #94a3b8;
  color: #1f2937;
}
.filter-buttons #modeToggle:active { transform: translateY(1px); }

/* Charts container: side-by-side on wide screens, stacked on mobile. */
.charts-container {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Chart wrapper — clean card around each canvas. Fixed height per
   breakpoint so Chart.js (running with maintainAspectRatio:false)
   always has a real container height to fill. No aspect-ratio to
   avoid box-sizing / padding interactions with the canvas. */
.chart-wrapper {
  flex: 1 1 360px;
  min-width: 0;
  height: 340px;
  position: relative;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 10px;
  padding: 12px 14px;
}

.chart-wrapper > canvas {
  display: block;
  /* Chart.js manages canvas.style.width/height from the parent's
     clientWidth/clientHeight — don't force it here. */
}


.table-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 10px;
  padding: 12px 14px;
  gap: 4px;
}

.table-wrapper h3 {
  margin: 6px 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b5563;
}
.table-scroll {
  overflow-y: auto;
  scrollbar-gutter: stable; /* Ensures layout doesn’t shift */
  max-height: 300px;
}

  
.odds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0; /* zero spacing to mimic the ‘collapsed’ look */
}
  
.odds-table th,
.odds-table td {
  text-align: center;
  border: 1px solid #ddd;
}

.odds-table th {
  position: sticky;
  top: 0;
  z-index: 10;             /* ensure it stays above table rows */
  background-color: #4a4a4a;
  color: #fff;
  font-weight: bold;
  /*padding: 8px; */
  border: 1px solid #ddd;
  /* optional shadow so it looks “above” scrolling rows */
  box-shadow: 0 2px 2px -1px rgba(0,0,0,0.4);
  
}

/* Row backgrounds */
.odds-table tr {
  background-color: #fff;
}
.odds-table tr:nth-child(even) {
  background-color: #f9f9f9;
}
  
  .odds-table tr:nth-child(even) {
    background-color: #f9f9f9;
  }
  
  .hidden {
    display: none;
  }
  
  #oddsPlot {
    margin: 0 auto;     /* center horizontally */
    vertical-align: middle !important;
  }

  /* Responsive Adjustments */
  @media (max-width: 768px) {
    .table-scroll {
      max-height: 200px; /* Adjust for smaller screens */
    }

    /* Stack charts/tables vertically and give each chart a tall-enough
       card to be readable on phone. */
    .charts-container { gap: 14px; }
    .chart-wrapper,
    .charts-container .table-wrapper { flex-basis: 100%; }
    .chart-wrapper { height: 300px; padding: 10px; }

    /* Tighten the dashboard so charts don't lose 40px to nested padding. */
    .dashboard-container { padding: 8px 0; gap: 14px; }
    .filters-bar { padding: 10px 12px; gap: 10px 12px; }
    .filter-group { gap: 8px 12px; }
  }
  
  @media (min-width: 769px) {
    .table-scroll {
      max-height: 300px; /* Adjust for larger screens */
    }
  }
  .hidden { display: none; }
  
  .filter-section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
  }
  
  .filter-list_stats ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .filter-list_stats li {
    padding: 10px 20px;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
  }
  
  .filter-list_stats li:hover,
  .filter-list_stats li.active {
    background-color: #007BFF;
    color: white;
  }
  
  .filter-type_stat button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: background-color 0.3s, color 0.3s;
    margin: 10px;
  }
  
  .filter-type_stat button.active,
  .filter-type_stat button:hover {
    background-color: #007BFF;
    color: white;
  }
  
  .filter-league_stat {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
  }
  
  .filter-league_stat button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: background-color 0.3s, color 0.3s;
  }
  
  .filter-league_stat button.active,
  .filter-league_stat button:hover {
    background-color: #28a745;
    color: white;
  }
  
  #data-display, #league-data-display {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 100px;
    margin-top: 20px;
    background-color: #fafafa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .team-stats-block, 
  .league-stats-block {
    width: 50%;
  }

  /* Responsive Design */
  @media (max-width: 768px) {
    .filter-section, .filter-league_stat {
      flex-direction: column;
      align-items: flex-start;
    }
    
    .filter-list_stats ul {
      flex-wrap: wrap;
    }
  }

  


  .divisions-container {
    display: flex;
    flex-wrap: wrap; /* in case you want responsiveness */
    gap: 2rem;       /* spacing between columns */
  }

  .division-column {
    flex: 1;         /* each column will stretch equally */
    min-width: 200px; /* ensure some minimum width for smaller screens */
  }

  .division-header {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
  }

  .team-box {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    background-color: #f8f8f8;
    padding: 0.5rem;
    border-radius: 5px;
    font-weight: bold; /* Default color for links */
  }

  .team-box img {
    width: 40px;   /* adjust as needed */
    height: 40px;  /* adjust as needed */
    margin-right: 0.5rem;
  }