@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* ---------------- Global ---------------- */
html, body {
  height: 100%;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
  font-family: "Inter", "Roboto", "Helvetica Neue", sans-serif;
  background-color: #f9f9f9;
  color: #333;
}

#app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ---------------- Headers ---------------- */
h1 { text-align: center; margin: 2rem 0 1rem; font-size: 2.5rem; color: #222; }
h2 { font-family: 'Inter', sans-serif; text-align: center; }

/* ---------------- Navbar / Tabs area ---------------- */
#tabs-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  margin-top: 0.5rem;
  background-color: #fff;
  padding: 2rem;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ---------------- DataTable base ---------------- */
.dash-spreadsheet {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #1e3a8a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.dash-spreadsheet-inner td,
.dash-spreadsheet-inner th {
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.dash-spreadsheet-inner th {
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  background-color: #cfe2f3;
  color: #1a1a1a;
  border-top: 2px solid #4a6f94;
  border-left: 2px solid #4a6f94;
  border-right: 2px solid #4a6f94;
  border-bottom: 3px solid #2e4a67;
  transition: background-color 0.2s ease;
}
.dash-spreadsheet-inner th:hover { background-color: #b7d0e8; }
.dash-spreadsheet-inner thead { border-bottom: 3px solid #2e4a67; }

.dash-spreadsheet-inner td[data-dash-column="Player"] .dash-cell-value {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0;
}

.dash-spreadsheet-inner td[data-dash-column="Player"] .dash-cell-value > * {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.dash-spreadsheet-inner tr:nth-child(even) { background-color: #fafafa; }
.dash-spreadsheet-inner tr:hover { background-color: #f1f1f1; }

.dash-table-container {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  padding-bottom: 20px;
}

.dash-table-container .dash-table {
  height: auto !important;
  max-height: none !important;
}

/* ---------------- Page Structure ---------------- */
#page-content,
#page-container,
.page-container-inner {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.page-container-inner { overflow-y: auto; padding-bottom: 10px; }

/* ---------------- Header ---------------- */
.header-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 36px;
  color: #1E3A8A;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 2px solid #C8102E;
  display: inline-block;
  padding-bottom: 4px;
  margin: 0;
  transition: font-size 0.2s ease;
}

.header-league-img {
  height: 70px;
  transition: height 0.2s ease;
}

@media screen and (max-width: 768px) {
  .header-title { font-size: 24px; }
  .header-league-img { height: 46px; }
}

/* ---------------- Navbar ---------------- */
.navbar {
  position: relative;
  background-color: white;
  overflow: hidden;
  padding-left: 0.3rem !important;
  padding-right: 0.5rem !important;
}

.navbar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 3px;
  background-color: #1E3A8A;
  transition: width 0.4s ease-in-out;
}
.navbar:hover::after { width: 100%; }

.nav-link-animated {
  position: relative;
  color: #1E3A8A !important;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}
.nav-link-animated::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #C8102E;
  transition: width 0.3s ease-in-out;
}
.nav-link-animated:hover::after { width: 100%; }
.nav-link-animated:hover { color: #C8102E !important; }

.navbar-logo { height: 100px; }
.navbar-logotext { height: 75px; margin-left: 25px; }

@media (max-width: 768px) {
  .navbar-logo { height: 35px; }
  .navbar-logotext { height: 25px; }
}

/* ---------------- Mobile adjustments ---------------- */
@media (max-width: 768px) {
  #app-container { padding: 0.5rem; }
  #tabs-content { padding: 0.5rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.1rem; }

  .desktop-only { display: none; }
  .mobile-only  { display: block; margin-bottom: 1rem; }

  .dash-spreadsheet-inner td,
  .dash-spreadsheet-inner th {
    padding: 2px 4px;
    font-size: 10px;
  }

  .dash-spreadsheet-inner td[data-dash-column="hex_color_primary"],
  .dash-spreadsheet-inner td[data-dash-column="hex_color_secondary"],
  .dash-spreadsheet-inner td[data-dash-column="game_sort"],
  .dash-spreadsheet-inner td[data-dash-column="team_sort"],
  .dash-spreadsheet-inner td[data-dash-column="player_sort"],
  .dash-spreadsheet-inner th[data-dash-column="hex_color_primary"],
  .dash-spreadsheet-inner th[data-dash-column="hex_color_secondary"],
  .dash-spreadsheet-inner th[data-dash-column="game_sort"],
  .dash-spreadsheet-inner th[data-dash-column="team_sort"],
  .dash-spreadsheet-inner th[data-dash-column="player_sort"] {
    display: none;
  }

  .mobile-only .dash-spreadsheet-inner th,
  .mobile-only .dash-spreadsheet-inner td,
  .mobile-only td[data-dash-column="Player"] .dash-cell-value,
  .mobile-only th[data-dash-column="Player"] .dash-cell-value {
    white-space: normal !important;
    height: auto !important;
    line-height: 1.2em;
  }
}

/* ---------------- Games Tabs ---------------- */

#games-subtab,
#games-subtab > .tab-list {
  width: 100% !important;
  display: flex;
  margin: 0;
  padding: 0;
}

#games-subtab .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #333333;
  background-color: #f5f5f5;
  border-right: 1px solid #d0d0d0;
  height: 45px;
  transition: all 0.25s ease-in-out;
  position: relative;
  overflow: hidden;
}

#games-subtab .tab:last-child { border-right: none; }

#games-subtab .tab--selected {
  background-color: #ffffff;
  color: #C8102E;
  box-shadow: inset 0 -4px 0 #C8102E;
}

#games-subtab .tab:not(.tab--selected):hover {
  background: linear-gradient(to bottom, #ffffff, #eaeaea);
  transform: translateY(-1px);
  cursor: pointer;
  color: #C8102E;
}

#games-subtab .tab:not(.tab--selected)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background-color: #C8102E;
  transition: width 0.3s ease-in-out;
}
#games-subtab .tab:not(.tab--selected):hover::after { width: 100%; }

.subtab-content {
  flex: 1 1 auto !important;       /* allow growing */
  min-height: 0 !important;        /* important for flex layout */
  max-height: 100% !important;     /* allow full height */
  overflow-y: auto !important;     /* scroll if content is too tall */
  overflow-x: hidden !important;
  padding-bottom: 30px !important;
  height: 100% !important;
}


/* Force tabs to fill the full horizontal space */
.fullwidth-tabs {
  width: 100% !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Ensure each individual tab flexes evenly */
.fullwidth-tabs .tab {
  flex: 1 1 0 !important;
  text-align: center !important;
  margin: 0 !important;
  padding: 8px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* Remove any built-in padding from the container div */
.dash-spreadsheet-container,
.tab-parent,
#games-subtab {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
.dash-table-container {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  padding-bottom: 20px !important;
}

.dash-table-container .dash-table {
  flex: 1 1 auto !important;
  height: 100% !important;
  max-height: none !important;
}
.dash-spreadsheet-container {
  flex: 1 1 auto;
  min-height: 0;      /* important for flex grow */
  height: 100%;
  overflow-y: auto;
}
.dash-table-container .dash-table {
  height: 100% !important;
  max-height: 100% !important;
}
.mobile-only { display: none; }  /* hide mobile by default */
.desktop-only { display: flex; }

@media (max-width: 768px) {
  .desktop-only { display: none; }
  .mobile-only  { display: block; margin-bottom: 1rem; }
}
/* ---------------- Desktop/Mobile Table Visibility ---------------- */

/* hide mobile table by default on desktop */
.mobile-only-wrapper,
.mobile-only-wrapper * {
  display: none !important;
}

/* show desktop table by default */
.desktop-only-wrapper,
.desktop-only-wrapper * {
  display: flex !important;
}

.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: block !important; margin-bottom: 1rem; }
}
.page-content, .tab-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.data-table-wrapper {
  flex-grow: 1;
  overflow: hidden; /* prevent double scroll */
  display: flex;
  flex-direction: column;
}

.dash-table-container {
  flex-grow: 1;
  overflow-y: auto;
}
.tab-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#method-table-container,
#method-table-container-mobile {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.data-table-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dash-table-container {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.dash-spreadsheet-container {
  height: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.dash-spreadsheet {
  height: 100% !important;
}

.dash-spreadsheet-inner {
  height: 100% !important;
}
/* ---------------- Minimal Dash Table Height Fix ---------------- */

/* Ensure the dash table itself can grow naturally */
.dash-table-container .dash-table {
    height: auto !important;
    max-height: none !important;
}

/* Ensure the internal spreadsheet container can scroll */
.dash-spreadsheet-container {
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
}

/* Make the spreadsheet element grow naturally inside the container */
.dash-spreadsheet {
    height: auto !important;
}
.dash-spreadsheet-inner {
    height: auto !important;
}
/* Limit table height to leave ~5% space at the bottom */
.dash-spreadsheet-container {
    max-height: calc(95vh - 300px) !important; /* adjust 160px for your header/tabs */
    overflow-y: auto !important;
    height: auto !important;     /* let table shrink to fit data */
}
#method-table-fade-wrapper {
  transition: opacity 0.4s ease-in-out;
  opacity: 1;
}
.subtab-content {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.subtab-content.loaded {
    opacity: 1;
}
/* Default H2 styling (desktop) */
h2 {
    margin: 0;
    font-weight: 600;
    text-align: center;
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    color: #1E3A8A;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.08);
}

/* Mobile adjustments: screens narrower than 768px */
@media (max-width: 767px) {
    h2 {
        margin: 0;
        font-weight: 600;
        text-align: center;
        flex: 1;
        font-family: 'Inter', sans-serif;
        font-size: 1rem;
        color: #1E3A8A;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.08);
    }
}
.mobile-only .Select-control {
  background-color: #102A43 !important;
  border: 1px solid #0B1D31 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

.mobile-only .Select-value-label,
.mobile-only .Select-placeholder {
  color: #F9FAFB !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.mobile-only .Select-menu-outer {
  background-color: #102A43 !important;
  border-radius: 8px !important;
  border: 1px solid #0B1D31 !important;
}

.mobile-only .Select-option {
  color: #F9FAFB !important;
}

.mobile-only .Select-option.is-focused {
  background-color: #243B53 !important;
}

.mobile-only .Select-option.is-selected {
  background-color: #C8102E !important;
}
/* ====== Midnight Blue Dropdown Styling ====== */
.Select-control {
  background-color: #1E3A8A !important; /* midnight blue */
  border: 1px solid #0F172A !important; /* dark navy border */
  border-radius: 6px !important;
  color: #FFFFFF !important;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.Select--single > .Select-control .Select-value,
.Select-placeholder {
  color: #FFFFFF !important; /* white text for selected value */
}

/* Dropdown arrow */
.Select-arrow {
  border-top-color: #FFFFFF !important;
}

/* Dropdown menu container */
.VirtualizedSelectOption,
.Select-menu-outer {
  background-color: #1E3A8A !important; /* same midnight blue */
  color: #FFFFFF !important; /* white text */
  font-family: 'Inter', sans-serif;
  border: 1px solid #0F172A !important;
}

/* Hovered menu option */
.VirtualizedSelectFocusedOption {
  background-color: #334B9B !important; /* lighter blue on hover */
  color: #FFFFFF !important;
}
