/* ---------------------------------
   GLOBAL STYLES
--------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background: #fafafa;
  color: #444;
  line-height: 1.6;
  padding: 20px;
}
/* centre the one‑line “support‑note” */
.support-note{
  text-align:center;
  margin:0.5rem auto;   /* optional spacing */
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 400;
  color: #333;
}
/* put this in style.css or <style> … */
.data-note{
  text-align:center;   /* centers the inline text */
  margin:0.5rem auto;  /* optional: gives a bit of space above/below */
}
.exv-player-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-align: left;
  color: #111;
}

.exv-subtitle {
  font-size: 1.2rem;
  font-weight: 400;
  color: #666;
  margin-bottom: 1rem;
}

/* ---------------------------------
   TABS STYLES
--------------------------------- */
.tabs-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 18vw;
  gap: 0;
  margin-bottom: 24px;
}

.tab-button {
  background: #161616;
  border: 2px solid #222;
  border-radius: 5px;  /* sharp, not oval! */
  padding: 7px 18px;
  font-size: 0.93rem;
  margin: 0 2px;
  color: #f3f6f4;  /* yellow text */
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 20px rgba(125, 128, 128, 0.25);
  transition:
    background 0.22s cubic-bezier(.51,.18,.82,.48),
    color 0.22s,
    box-shadow 0.25s,
    border-color 0.22s;
  position: relative;
  outline: none;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(243,246,244,0.28);
}

.tab-button:hover,
.tab-button:focus-visible {
  background: ##808080;  /* bright yellow */
  color: #161616;       /* black text on yellow */
  border-color: ##808080;
  box-shadow: 0 4px 24px 0 rgba(128, 128, 128, 0.25);
}

.tab-button.active {
  background: linear-gradient(100deg, #808080 90%, #fffbe3 100%);
  color: #161616;
  border-color: #808080;
  box-shadow: 0 6px 32px 0 rgba(128, 128, 128, 0.20);
  font-weight: 700;
  /* Optional: yellow underline/accent */
  box-shadow:
    0 6px 32px 0 rgba(128, 128, 128, 0.20),
    0 4px 0 0 #808080;
}

.tab-content {
  display: none; /* Only the active tab will be displayed via JS */
  padding: 20px;
}

/* ---------------------------------
   PANEL & CONTAINER STYLES
--------------------------------- */
.panel {
  background: #fff;
  border: none;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.exv-logs-container {
  display: flex;
  gap: 20px;
  margin: 0 5%;
}

.left-column,
.right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------------------------------
   FILTERS & DROPDOWN STYLES
--------------------------------- */
.filter-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.filter-item {
  flex: 1;
  min-width: 150px;
}

.filter-item label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #333;
}

.filter-item select,
.filter-item input[type="text"],
.filter-item input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #fff;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.filter-item select:focus,
.filter-item input[type="text"]:focus,
.filter-item input[type="number"]:focus {
  outline: none;
  border-color: #007BFF;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Legacy filter-group styles (for toggles, etc.) */
.filter-group {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group strong {
  margin-right: 10px;
  font-size: 1rem;
  color: #333;
}

.filter-group button {
  background-color: #007BFF;
  color: #fff;
  border: none;
  padding: 8px 15px;
  margin: 5px 5px 5px 0;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.filter-group button:hover {
  background-color: #0056b3;
}

.filter-group button.active {
  background-color: #0056b3;
}

/* ---------------------------------
   TABLE WRAPPER + TABLE STYLES
--------------------------------- */

/* The scrollable wrapper that keeps table within container */
.table-wrapper {
  width: 100%;
  overflow-x: auto; /* Allows horizontal scroll if columns can't fit */
  -webkit-overflow-scrolling: touch; /* Smoother iOS scrolling */
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

/* By default, we keep table-layout auto for larger screens */
/* We'll change to fixed on small screens in the media query */

thead {
  background: #f0f0f0;
}

th,
td {
  padding: 12px;
  text-align: left;
  white-space: nowrap;  /* We can choose to not wrap by default */
}

tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.3s;
}

tbody tr:hover {
  background: #f9f9f9;
  cursor: pointer;
}

/* ---------------------------------
   SHOW MORE BUTTON
--------------------------------- */
#show-more-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 30px;
  font-size: 1rem;
  cursor: pointer;
  background-color: #007BFF;
  color: #fff;
  border: none;
  border-radius: 25px;
  transition: background-color 0.3s;
}

#show-more-btn:hover {
  background-color: #0056b3;
}

/* Smaller "View More" button (for row actions) */
.view-more-btn {
  margin-left: 5px;
  font-size: 0.8rem;
  padding: 3px 7px;
  border-radius: 4px;
  background-color: #007BFF;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}
.view-more-btn:hover {
  background-color: #0056b3;
}
.header-tooltip {
  position: relative;
  cursor: help;
  /* Optional: subtle underline to hint at help */
  text-decoration: underline dotted #bbb 1.5px;
  text-underline-offset: 3px;
}

.help-tooltip-text {
  display: none;
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 125%; /* Show BELOW the label */
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  font-size: 0.85em;
  padding: 7px 13px;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  white-space: pre-line;
  min-width: 140px;
  max-width: 260px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}


.header-tooltip:hover .help-tooltip-text,
.header-tooltip:focus .help-tooltip-text {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(-6px) scale(1.02);
  animation: tooltipFadeIn 0.15s;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98);}
  to   { opacity: 1; transform: translateY(0) scale(1);}
}

/* ---------------------------------
   SORT INDICATORS
--------------------------------- */
#batters-table th,
#exv-table th {
  cursor: pointer;
  position: relative;
}

#batters-table th::after,
#exv-table th::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 5px 0 5px;
  border-color: #888 transparent transparent transparent;
  transform: translateY(-50%);
  opacity: 0.5;
}

#batters-table th.sort-asc::after,
#exv-table th.sort-asc::after {
  border-width: 0 5px 6px 5px;
  border-color: transparent transparent #888 transparent;
  opacity: 0.8;
}

#batters-table th.sort-desc::after,
#exv-table th.sort-desc::after {
  border-width: 6px 5px 0 5px;
  border-color: #888 transparent transparent transparent;
  opacity: 0.8;
}
#batters-table th.col-playerName,
#batters-table td.col-playerName {
  width: 160px;     /* adjust as desired */
  min-width: 160px; /* ensures it doesn't shrink below this */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* If the name is too long, it will truncate */
}

/* ---------------------------------
   EXVSUM TILES (GRID CARDS)
--------------------------------- */
#exvsum-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 15px 0;
}

.exvsum-tile {
  background: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.exvsum-tile h3 {
  font-size: 1rem;
  margin-bottom: 5px;
  color: #333;
}

.exvsum-tile p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* ---------------------------------
   LAUNCH SPEED HIGHLIGHTING
--------------------------------- */
#exv-table td.launch-speed {
  background-color: transparent;
  transition: background-color 0.3s, color 0.3s;
}

/* ----------------------------------------------------------
   1. Never let the page grow wider than the iframe container
---------------------------------------------------------- */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: scrollbar;   /* clip any accidental overflow */
}

/* ----------------------------------------------------------
   2. Collapse the two‑column layout earlier (at 1200 px)
      — adjust the breakpoint to match your Wix strip
---------------------------------------------------------- */
@media (max-width: 1400px) {
  .exv-logs-container {
    flex-direction: column;   /* stack left & right columns */
    margin: 0;                /* kill the 5 % side margins */
  }
}

/* ----------------------------------------------------------
   3. Ensure every panel/table wrapper can shrink
---------------------------------------------------------- */
.panel,
.table-wrapper,
.tabs-container {
  width: 100%;
  max-width: 100%;
}

/* ----------------------------------------------------------
   4. Optional: shrink the desktop tab buttons sooner,
      so the row of buttons doesn’t push the width
---------------------------------------------------------- */
@media (max-width: 1200px) {
  .tab-button {
    font-size: 0.8rem;
    padding: 10px 18px;
  }
}

/* ---------------------------------
   RESPONSIVE DESIGN
--------------------------------- */
/* Ensure you have <meta name="viewport" content="width=device-width, initial-scale=1"> in your <head> */

@media (max-width: 992px) {
  body {
    padding: 15px;
  }

  h1 {
    font-size: 2rem;
    margin-bottom: 20px;
  }

  .exv-logs-container {
    flex-direction: column;
    margin: 0 2%;
  }
}

@media (max-width: 600px) {
  body {
    padding: 10px;
    font-size: 0.75rem; /* 15% smaller text on phones */
  }

  h1 {
    font-size: 1.1rem;
    margin-bottom: 15px;
  }

  .tab-button {
    font-size: 0.5rem;
    padding: 8px 16px;
  }

  .panel {
    padding: 15px;
    margin-bottom: 15px;
  }
  #batters-table th.col-playerName,
  #batters-table td.col-playerName {
    width: 120px;
    min-width: 120px;
  /* Tighter cell padding to fit more columns */
  table th,
  table td {
    padding: 8px;
  }

  /* 
    Force table-layout: fixed on phone,
    so columns don't expand too wide. 
    Truncate text with ellipses if it overflows.
  */
  #batters-table,
  #exv-table,
  table.game-log-table,
  table.bvp-table,
  table.offense-table,
  table.splits-table {
    table-layout: fixed;
  }

  #batters-table th,
  #batters-table td,
  #exv-table th,
  #exv-table td,
  table.game-log-table th,
  table.game-log-table td,
  table.bvp-table th,
  table.bvp-table td,
  table.offense-table th,
  table.offense-table td,
  table.splits-table th,
  table.splits-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px; /* adjust as needed for each column's data */
  }

  /* Even smaller "View More" button on phones */
  .view-more-btn {
    font-size: 0.5rem;
    padding: 2px 5px;
  }

  /* Auto-switch tabs: Hide desktop tabs, show mobile dropdown */
  .tabs-container {
    display: none !important;
  }
  #mobile-tabs-dropdown {
    display: block !important;
    font-size: 0.7rem;
    margin-bottom: 20px;
  }

  /* Collapsible filters: collapse by default on mobile */
  #filters-panel {
    display: none !important;
  }
  #filters-toggle-btn {
    display: inline-block !important;
    font-size: 0.7rem;
    margin-bottom: 10px;
  }

  #exvsum-container {
    gap: 8px;
    margin: 10px 0;
  }

  .exvsum-tile {
    padding: 10px;
  }

  .exvsum-tile h3 {
    font-size: 0.7rem;
  }

  .exvsum-tile p {
    font-size: 0.6rem;
  }
}

/* ---------------------------------------------
   GAME LOG, BVP, and OFFENSE TABLE STYLES
--------------------------------------------- */
table.game-log-table,
table.bvp-table,
table.offense-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

table.game-log-table th,
table.game-log-table td,
table.bvp-table th,
table.bvp-table td,
table.offense-table th,
table.offense-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
}

table.game-log-table th,
table.bvp-table th,
table.offense-table th {
  background-color: #f2f2f2;
}

/* ---------------------------------------------
   SPLITS TABLE (matching style above)
--------------------------------------------- */
table.splits-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

table.splits-table th,
table.splits-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

table.splits-table th {
  background-color: #f2f2f2;
}
