.mlb-dashboard {
    padding: 1rem;
    padding-bottom: 48px;
    padding-top: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 2rem;
    color: #ffffff;
    background-color: #1a1a1a;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.mlb-single-player-root .mlb-dashboard {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

#mlb-container .mlb-dashboard {
    padding-top: 40px;
    padding-bottom: 48px;
}

#mlb-container #main-content {
    padding-top: 80px;
    padding-bottom: 48px;
}

.mlb-header {
    margin-top: 4rem;
}

.mlb-filters {
    display: flex;
    gap: 1rem;
}

.mlb-filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 1rem;
}

.dropdown-menu,
.dropdown-menu.zones-menu,
.dropdown-menu.pitchtype-menu {
  width: max-content;
  min-width: clamp(240px, 60vw, 320px);
  max-width: min(480px, 96vw);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  background: #232323;
  padding: 0.75em 1.15em;
  border-radius: 9px;
  border: 1px solid #444;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 4000;
  box-sizing: border-box;
}

.dropdown-btn, .mlb-filters .dropdown-btn {
  max-width: 110px;
  min-width: 80px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: inline-block;
  background: #2d2d2d;
  color: #eee;
  border: 1px solid #555;
  border-radius: 7px;
  font-size: 13px;
  padding: 5px 10px;
}

.mlb-filters .dropdown-menu li,
.mlb-filters .dropdown-menu label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: 100%;
}

.mlb-filters .dropdown-menu {
    width: max-content;
    min-width: clamp(240px, 60vw, 320px);
    max-width: min(480px, 96vw);
    padding: 0.75rem 1.15rem;
    overflow: visible;
}

.dropdown-menu label,
.dropdown-menu .menu-item,
.dropdown-menu li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  max-width: 100%;
  padding: 8px 14px;
  background: #333;
  color: #fff;
  border-radius: 18px;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 6px;
  margin-right: 8px;
  box-sizing: border-box;
  white-space: normal;
  word-break: keep-all;
  overflow: visible;
  text-overflow: unset;
  cursor: pointer;
}

.mlb-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.2rem;
}

.stat-content {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mlb-header {
        flex-direction: column;
        gap: 1rem;
    }

    .mlb-filters {
        width: 100%;
        flex-direction: column;
    }

    .mlb-stats-grid {
        grid-template-columns: 1fr;
    }
}

.search-section {
    margin: 2rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    position: relative;
    display: inline-block;
}

.search-bar input {
    width: 300px;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #ffffff;
}

.search-bar input::placeholder {
    color: #888;
}

.suggestion-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 4px 4px;
    min-height: 0; /* grow only to content */
    max-height: 360px; /* allow up to ~10 names visible */
    overflow-y: auto;
    z-index: 2000; /* ensure it overlays surrounding cards */
    display: none;
    max-height: 70vh; /* allow dropdown to extend beyond container */
}

.suggestion-box div {
    padding: 8px 12px;
    cursor: pointer;
    color: #ffffff;
}

.suggestion-box div:hover {
    background-color: #3a3a3a;
}

/* .plot-container {
    width: 400px;
    height: 400px;
    background: white;
    margin: 0 auto;
}

#plotContainer {
    width: 400px;
    height: 400px;
    background: white;
}

#plotDiv {
    width: 400px;
    height: 400px;
    background: white;
    visibility: visible !important;
} */

/* Plotly container styles */
.js-plotly-plot {
    width: 400px;
    height: 400px;
}

.js-plotly-plot .plotly {
    width: 100%;
    height: 100%;
}

.js-plotly-plot .plotly .main-svg {
    width: 100%;
    height: 100%;
}

/* Remove any transforms or transitions */
.js-plotly-plot, 
.js-plotly-plot .plotly, 
.js-plotly-plot .plotly .main-svg {
    transform: none !important;
    transition: none !important;
}

.data-table {
    width: 100%;
    min-width: max-content;
    margin: 0;
    border-collapse: collapse;
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.data-table th,
.data-table td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #444;
    font-size: 13px;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Ensure table text is visible on dark background */
.data-table td { color: #e6e6e6; }
.data-table th { color: #ffffff; }
.data-table th.num, .data-table td.num { text-align: right; }

/* Sticky first columns (Rank and Player) */
.data-table th.col-rank, .data-table td.col-rank { width: 60px; min-width: 60px; }
.data-table th.col-player, .data-table td.col-player { width: 220px; min-width: 220px; }

.data-table th.sticky-col-1, .data-table td.sticky-col-1 {
    position: sticky;
    left: 0;
    z-index: 3; /* above regular cells */
}
.data-table th.sticky-col-2, .data-table td.sticky-col-2 {
    position: sticky;
    left: 60px; /* width of rank col */
    z-index: 3;
}

/* Ensure sticky cells have visible background over scrolled content */
.data-table th.sticky-col-1, .data-table th.sticky-col-2 { background-color: #1a1a1a; }
.data-table td.sticky-col-1, .data-table td.sticky-col-2 { background-color: #2a2a2a; }
.data-table td.sticky-col-1 { border-right: 1px solid #444; }
.data-table td.sticky-col-2 { border-right: 1px solid #444; }

.data-table th {
    background-color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:not(.sticky-col-1):not(.sticky-col-2),
.data-table th.has-popover {
    position: relative;
}

.data-table th.has-popover.sticky-col-1,
.data-table th.has-popover.sticky-col-2 {
    position: sticky;
}

.data-table th.sortable::after {
    content: '\21C5'; /* up-down arrow */
    font-size: 10px;
    margin-left: 6px;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.data-table th.sorted-asc::after,
.data-table th.sorted-desc::after {
    opacity: 0.85;
}

.data-table th.sorted-asc::after {
    content: '\25B2';
}

.data-table th.sorted-desc::after {
    content: '\25BC';
}

.min-max-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translate(-50%, -6px);
    background: #111;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 15;
    white-space: nowrap;
    min-width: 120px;
}

.min-max-popover.visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.min-max-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.min-max-row + .min-max-row {
    margin-top: 4px;
}

.min-max-row span {
    color: #bbbbbb;
    letter-spacing: 0.4px;
}

.min-max-row strong {
    color: #ffffff;
    font-weight: 600;
}

.data-table th[colspan] {
    color: #888;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}



/* Pitch type colors */
.pitch-type {
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.pitch-type.FF { background-color: #ff4444; }
.pitch-type.SL { background-color: #9c27b0; }
.pitch-type.CH { background-color: #4caf50; }
.pitch-type.SI { background-color: #2196f3; }
.pitch-type.CB { background-color: #ff9800; }
.pitch-type.FC { background-color: #e91e63; }
.pitch-type.FS { background-color: #00bcd4; }
.pitch-type.ST { background-color: #03a9f4; }

/* Loading spinner */
.spinner {
    border: 6px solid #444;
    border-top: 6px solid #ffffff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Smooth transitions for content */
.data-table,
.plot-controls,
#locationPlotContainer,
#movementPlotContainer {
    transition: opacity 0.3s ease-in-out;
}

.data-table.loading,
.plot-controls.loading,
#locationPlotContainer.loading,
#movementPlotContainer.loading {
    opacity: 0.5;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Plotly customization */
.js-plotly-plot .plotly .main-svg {
    background-color: white !important;
}

.js-plotly-plot .plotly .bg {
    fill: white !important;
}

.js-plotly-plot .plotly .ytick text,
.js-plotly-plot .plotly .xtick text {
    fill: #000000 !important;
}

.js-plotly-plot .plotly .gtitle,
.js-plotly-plot .plotly .xtitle,
.js-plotly-plot .plotly .ytitle {
    fill: #000000 !important;
}

.pitch-locations-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.location-plot {
    background: #222;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    min-height: 400px;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.location-plot canvas {
    background: white;
    border-radius: 4px;
    min-width: 350px;
    min-height: 350px;
    width: 100% !important;
    height: auto !important;
}

.location-plot-title {
    text-align: center;
    color: #fff;
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.2em;
    width: 100%;
}

.movement-plot {
    background: #222;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
}

.movement-plot canvas {
    background: white;
    border-radius: 4px;
    width: 100% !important;
    height: auto !important;
}

/* Update legend styles */
.js-plotly-plot .plotly .legend {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 12px;
}

.js-plotly-plot .plotly .legend .legend-title {
    font-weight: bold;
    margin-bottom: 4px;
}

/* Ensure proper spacing in the plot container */
#locationPlotContainer {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem;
    padding-bottom: 48px;
    background-color: #1a1a1a;
    justify-content: center;
}

.location-plot {
    background: #000000;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    width: 500px;
    height: 600px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.location-plot canvas {
    background: #000000;
    border-radius: 4px;
    /* Remove all sizing properties to avoid scaling issues */
    /* width: 100% !important; */
    /* height: calc(100% - 30px) !important; */
    /* min-width: 350px; */
    /* min-height: 350px; */
    display: block;
    margin: 0 auto;
}

.location-plot-title {
    text-align: center;
    color: #fff;
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.2em;
    width: 100%;
}

/* Update movement plot to match */
.movement-plot {
    background: #000000;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    width: 500px;
    height: 600px;
}

.movement-plot canvas {
    background: #000000;
    border-radius: 4px;
    width: 100% !important;
    height: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    #locationPlotContainer {
        max-width: 500px;
    }
}

.pitch-summary-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    padding-bottom: 48px;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pitch-metrics-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 2rem;
    padding-bottom: 48px;
    margin: 2rem auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: inline-block;
    min-width: min-content;
    max-width: 95%;
}

.metrics-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

/* Remove duplicate styles since they're now unified */
.pitch-metrics-container .data-table {
    margin: 0;
    width: 100%;
    min-width: max-content;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pitch-metrics-container .data-table th[colspan] {
    background-color: #1a1a1a;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 8px 6px;
    border-bottom: 2px solid #888;
    border-right: 2px solid #888;
    border-left: 2px solid #888;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pitch-metrics-container .data-table th[colspan]:first-child {
    border-left: none;
}

.pitch-metrics-container .data-table th[colspan]:last-child {
    border-right: none;
}

/* Pitch Log table grouped headers styling - matching Counting Stats */
.pitch-by-pitch-container .data-table th[colspan] {
    background-color: #1a1a1a;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 8px 6px;
    border-bottom: 2px solid #888;
    border-right: 2px solid #888;
    border-left: 2px solid #888;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pitch-by-pitch-container .data-table th[colspan]:first-child {
    border-left: none;
}

.pitch-by-pitch-container .data-table th[colspan]:last-child {
    border-right: none;
}

.pitch-metrics-container .data-table td {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
    padding: 6px 8px;
    white-space: nowrap;
    color: #e6e6e6; /* ensure visible on dark bg */
}

.mlb-leaderboard-root {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: stretch;
    padding-bottom: 48px;
}

/* Update the table wrapper div styles */
.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    margin: 32px auto 2rem;
    padding: 0;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #444; /* subtle outline so table is visible */
    min-height: 240px;
}

.mlb-leaderboard-root .table-wrapper {
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    padding: 0;
}

.mlb-leaderboard-root .filter-toolbar,
.mlb-leaderboard-root .mlb-leaderboard-footer {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.mlb-leaderboard-root .filter-toolbar {
    justify-content: center;
    margin-top: 2rem;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    width: 100%;
}

.table-scroll table.dynamic-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.table-scroll::-webkit-scrollbar {
    height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#mlb-leaderboard-table {
    padding: 24px 0;
    min-height: 200px;
    color: #ddd;
    margin-top: 1rem;
    width: 100%;
    overflow: visible;
}

#mlb-leaderboard-table .table-scroll {
    padding: 0 0 12px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
}

#mlb-leaderboard-table .data-table {
    width: max-content;
    min-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

#mlb-leaderboard-table .data-table thead th {
    background-color: #111;
    text-align: center;
    border-bottom: 2px solid #333;
}

#mlb-leaderboard-table .data-table tbody tr:nth-child(odd) {
    background-color: #242424;
}

#mlb-leaderboard-table .data-table tbody tr:nth-child(even) {
    background-color: #1e1e1e;
}

#mlb-leaderboard-table .data-table tbody tr:hover {
    background-color: #303030;
}

#mlb-leaderboard-table .data-table td.sticky-col-1,
#mlb-leaderboard-table .data-table td.sticky-col-2 {
    position: static;
    background-color: inherit;
    box-shadow: none;
}

#mlb-leaderboard-table .data-table th.sticky-col-1,
#mlb-leaderboard-table .data-table th.sticky-col-2 {
    position: static;
    background-color: #111;
    box-shadow: none;
}

#mlb-leaderboard-table .data-table td.col-player {
    text-align: left;
    padding-left: 10px;
}

/* Ensure the table scroll starts at the leftmost position */
#mlb-leaderboard-table .table-scroll {
    scroll-snap-align: start;
    scroll-behavior: auto;
}

#mlb-leaderboard-table .table-scroll::-webkit-scrollbar {
    height: 8px;
}

#mlb-leaderboard-table .table-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#mlb-leaderboard-table .table-scroll::-webkit-scrollbar-track {
    background-color: rgba(255, 255, 255, 0.1);
}

.mlb-leaderboard-footer {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 4px 8px;
}

.mlb-leaderboard-footer .pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mlb-leaderboard-footer .pagination .btn {
    padding: 6px 12px;
}

.plot-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.plot-type-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.filter-row {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: center;
}

.compact-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 13px;
    min-width: 150px;
    cursor: pointer;
}

.compact-select:hover {
    border-color: #999;
}

.compact-select:focus {
    outline: none;
    border-color: #666;
}

.plot-dropdown-container {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 2.5rem auto;
    text-align: center;
}

.plot-dropdown-container.show-dropdown {
    display: flex !important;
    margin: 2.5rem auto !important;
}

.plot-type-selector {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 1rem 3.5rem 1rem 1.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    color: #7bd6ff !important;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 55%),
                linear-gradient(160deg, #0d111a 0%, #131b2a 100%) !important;
    background-color: transparent !important;
    border: 2px solid #33bfff !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 24px rgba(51, 191, 255, 0.25) !important;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 260px !important;
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237bd6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1.5rem) 50%;
    background-size: 12px 8px;
}

.plot-type-selector:hover {
    border-color: #63e0ff !important;
    box-shadow: 0 14px 28px rgba(99, 224, 255, 0.35) !important;
    transform: translateY(-1px);
}

.plot-type-selector:focus {
    outline: none;
    border-color: #9bf0ff !important;
    box-shadow: 0 0 0 3px rgba(155, 240, 255, 0.25) !important;
}

.plot-type-selector option {
    background: #0d111a;
    color: #e0f7ff;
}

.plot-dropdown-container select.plot-type-selector {
    padding: 1rem 3.5rem 1rem 1.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #7bd6ff !important;
    border: 2px solid #33bfff !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 24px rgba(51, 191, 255, 0.25) !important;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 55%),
                linear-gradient(160deg, #0d111a 0%, #131b2a 100%) !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237bd6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1.5rem) 50%;
    background-size: 12px 8px;
}

@media (max-width: 640px) {
    .plot-dropdown-container {
        width: 100%;
    }
    .plot-type-selector {
        width: 100% !important;
        min-width: 0 !important;
    }
}

.date-range-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.date-input-group label {
    color: #ccc;
    font-size: 14px;
}

.date-input {
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #ffffff;
    font-size: 14px;
}

.date-input:focus {
    outline: none;
    border-color: #666;
    box-shadow: none;
}

.date-update-btn {
    padding: 10px 16px;
    background-color: #0063B1;     /* match NCAA color */
    color: #fff;
    border: 2px solid #007acc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.date-update-btn:hover { background-color: #007acc; border-color: #0099ff; }
.date-update-btn:active { background-color: #0060a8; }
 
.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #222;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Filter Group Container */
.filter-group {
    position: relative;
    display: inline-block;
}

/* Count Dropdown Styles */
.count-dropdown-btn {
    padding: 4px 8px;
    font-size: 12px;
    background-color: #333;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    min-width: 100px;
    white-space: nowrap;
}

.count-dropdown-btn:hover {
    background-color: #444;
}

.count-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 12px;
    z-index: 1000;
    min-width: 250px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Reset Filters Button */
.reset-filters-btn {
    background: var(--accent-color);
    border: none;
    color: #fff;
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}
.reset-filters-btn:hover {
    background: #ff3333;
}

.count-dropdown-content.show {
    display: block;
}

.count-filter-grid, .zone-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.count-filter-grid label,
.zone-filter-grid label,
.dropdown-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 9999px; /* pill */
    border: 1px solid #444;
    background: #222;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: normal;
    line-height: 1.35;
    text-align: center;
    min-height: 36px;
}

.count-filter-grid label:hover, .zone-filter-grid label:hover, .dropdown-pill:hover { background-color: #333; }

.count-filter-grid label input[type="checkbox"],
.zone-filter-grid label input[type="checkbox"],
.dropdown-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.count-filter-grid label:has(input:checked),
.zone-filter-grid label:has(input:checked),
.dropdown-pill:has(input:checked) {
    background: #0063B1;
    border-color: #0099ff;
}

.filter-row {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: center;
}

.compact-select {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background-color: #222;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

.compact-select:hover {
    background-color: #333;
} 

.spray-chart-container {
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
    position: relative;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

.spray-chart-container canvas {
    width: 100% !important;
    height: auto !important;
    background-color: #000;
    border-radius: 8px;
}

.react-spraychart-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    background: #141414;
    border-radius: 12px;
    padding: 24px 20px 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.react-spraychart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.4px;
}

.react-spraychart-root {
    width: 100%;
    display: flex;
    justify-content: center;
}

.react-spraychart-root .visualization-container {
    width: 100%;
}

/* Plot controls dark theme matching Baseball Savant */
.plot-controls {
    background-color: #111;
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #333;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}


.compact-select {
    background-color: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: Arial, sans-serif;
    min-width: 100px;
    white-space: nowrap;
}


.compact-select:hover {
    background-color: #333;
    border-color: #555;
}

.count-filter-container {
    background-color: #222;
    padding: 15px;
    border-radius: 4px;
    margin-top: 10px;
    border: 1px solid #333;
}

.count-filter-header {
    color: #fff;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.count-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 5px;
}

.count-filter-grid label {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: Arial, sans-serif;
}

.count-filter-grid input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #666;
    border-radius: 3px;
    background: #222;
    cursor: pointer;
    position: relative;
}

.count-filter-grid input[type="checkbox"]:checked {
    background: #0063B1;
    border-color: #0063B1;
}

.count-filter-grid input[type="checkbox"]:checked::after {
    content: '✓';
    color: #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
} 

.data-table th.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 20px;  /* Make room for the sort indicator */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.data-table th.sortable-header:hover {
    background-color: #2a2a2a;
}

.data-table th.sortable-header::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.data-table th.sortable-header.sort-asc::after {
    border-bottom: 6px solid #888;
    border-top: none;
}

.data-table th.sortable-header.sort-desc::after {
    border-top: 6px solid #888;
    border-bottom: none;
} 

/* Game Logs Table Styles */
#gameLogsTable {
    width: 100%;
    min-width: max-content;
    margin: 0;
    border-collapse: collapse;
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#gameLogsTable th,
#gameLogsTable td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #444;
    font-size: 13px;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#gameLogsTable th {
    background-color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#gameLogsTable tbody tr:hover {
    background-color: #3a3a3a;
}

/* Sortable headers for game logs */
#gameLogsTable th.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#gameLogsTable th.sortable-header:hover {
    background-color: #2a2a2a;
}

#gameLogsTable th.sort-asc::after {
    border-bottom: 6px solid #888;
    border-top: none;
}

#gameLogsTable th.sort-desc::after {
    border-top: 6px solid #888;
    border-bottom: none;
} 

/* Ensure consistent font styling across all tables and override inline styles */
.data-table,
.data-table *,
.pitch-metrics-container .data-table,
.pitch-metrics-container .data-table *,
.pitch-by-pitch-container .data-table,
.pitch-by-pitch-container .data-table *,
#gameLogsTable,
#gameLogsTable * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* Override any inline font styles for table elements */
.data-table th,
.data-table td,
.pitch-metrics-container .data-table th,
.pitch-metrics-container .data-table td,
.pitch-by-pitch-container .data-table th,
.pitch-by-pitch-container .data-table td,
#gameLogsTable th,
#gameLogsTable td {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* Ensure consistent font sizes for all table elements */
.data-table th,
.pitch-metrics-container .data-table th,
.pitch-by-pitch-container .data-table th,
#gameLogsTable th {
    font-size: 11px !important;
}

.data-table td,
.pitch-metrics-container .data-table td,
.pitch-by-pitch-container .data-table td,
#gameLogsTable td {
    font-size: 13px !important;
}

/* Override sequence dropdown font styling to match */
.sequence-dropdown,
.sequence-dropdown * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

.sequence-dropdown {
    font-size: 12px !important;
} 

/* Ensure consistent font styling for table titles */
.clean-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 1.2em !important;
    font-weight: bold !important;
    color: #fff !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
} 

/* Ensure consistent font styling for table controls and pagination */
.table-controls,
.table-controls *,
.table-footer,
.table-footer *,
.entries-control,
.entries-control *,
.search-control,
.search-control *,
.pagination,
.pagination * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* Style table control elements consistently */
.table-controls label,
.table-controls select,
.table-controls input,
.table-footer .showing-info,
.pagination button {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 14px !important;
}

/* Ensure consistent styling for table wrapper elements */
.table-wrapper,
.table-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* Heatmap Container Styles */
.heatmap-container {
    background: #222 !important;
    border-radius: 8px !important;
    padding: 40px !important;
    padding-bottom: 88px !important;
    margin: 3em auto !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    width: 90% !important;
    max-width: 90% !important;
}

.heatmap-container h3 {
    color: #ffffff !important;
    text-align: center !important;
    margin-bottom: 30px !important;
    font-size: 20px !important;
    font-weight: 600 !important;
} 

/* --- EMBED/PLAYER-COMPARISON STRICT CARD CONTAINMENT OVERRIDE --- */
.embed-pc-table-outer, .embed-pc-table-outer * {
  box-sizing: border-box !important;
}
.embed-pc-table-outer .pitch-metrics-container,
.embed-pc-table-outer .pitch-by-pitch-container {
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}
.embed-pc-table-outer table,
.embed-pc-table-outer .data-table,
.embed-pc-table-outer #gameLogsTable {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
} 

/* --- EMBED/PLAYER-COMPARISON: Make tables horizontally scrollable, no forced wrapping. --- */
.embed-pc-table-outer .data-table th,
.embed-pc-table-outer .data-table td {
  white-space: nowrap !important;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: none;
}
.embed-pc-table-scroll {
  width: 100%;
  max-width: 700px;
  overflow-x: auto;
}
.embed-pc-table-outer table,
.embed-pc-table-outer .data-table,
.embed-pc-table-outer #gameLogsTable {
  width: max-content !important;
  min-width: 100px;
  max-width: none !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

/* Player comparison tables should respect header width and scroll horizontally when needed */
#metricsTableContainer .table-container,
#pitchByPitchTableContainer .table-container,
#sequenceTableContainer .table-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#metricsTableContainer .pitch-metrics-container,
#sequenceTableContainer .pitch-metrics-container,
#pitchByPitchTableContainer .pitch-by-pitch-container {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Download Report Button */
.download-report-btn {
  position: fixed;
  top: calc(var(--navbar-offset, 70px) + 12px);
  right: clamp(16px, 3vw, 32px);
  padding: 10px 22px;
  background-color: #0f9d58;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
  z-index: 1200;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.download-report-btn:hover {
  background-color: #128647;
}

.download-report-btn:disabled {
  cursor: default;
  background-color: #1a6c49;
  opacity: 0.65;
}

.download-report-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}
