/* Shared schedule filter bar — v3 design (all UI versions) */

.sch-toolbar {
  display: block;
  width: 100%;
  margin-bottom: 2px;
}

.sch-filter-bar {
  display: flex;
  align-items: stretch;
  flex: 1;
  width: 100%;
  min-width: 0;
  gap: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.sch-filter-bar-icon { display: none; }

.sch-filter-mobile-toggle { display: none; }

.sch-filter-mobile-top {
  display: contents;
}

@media (min-width: 641px) {
  .sch-filter-panel { order: 1; }

  .sch-filter-item--group {
    order: 2;
    flex: 0 0 5.75rem;
    min-width: 5.75rem;
    max-width: 5.75rem;
  }

  .sch-filter-item--venue {
    flex: 2 1 12rem;
    max-width: min(22rem, 34vw);
  }

  .sch-filter-item--team {
    flex: 1.35 1 10rem;
    max-width: min(18rem, 26vw);
  }

  .sch-filter-item--season {
    flex: 0 1 5.5rem;
    max-width: 6.5rem;
  }

  html[data-league="nbl1"] .sch-competition-filter,
  html[data-league="bigv"] .sch-competition-filter {
    flex: 0 1 7rem;
    max-width: 9rem;
  }

  .sch-filter-reset { order: 3; }
}

.sch-filter-panel {
  display: flex;
  flex: 1;
  width: 100%;
  min-width: 0;
  gap: 6px 12px;
  align-items: flex-end;
  justify-content: stretch;
}

.sch-filter-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: default;
}

.sch-filter-item--date .sch-filter-control,
.sch-filter-item--round .sch-filter-control {
  gap: 0;
}

.sch-step-filter {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 2px;
}

.sch-step-nav {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: transparent;
  color: var(--sch-muted);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}

.sch-step-nav:hover:not(:disabled) {
  border-color: rgba(0, 0, 0, 0.22);
  color: var(--sch-text);
  background: rgba(0, 0, 0, 0.03);
}

.sch-step-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.sch-step-dropdown {
  position: relative;
  flex: 1;
  min-width: 0;
}

.sch-step-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--sch-fs-md, .875rem);
  font-family: inherit;
  font-weight: 600;
  color: var(--sch-text);
  padding: 0;
  cursor: pointer;
  line-height: 1.25;
  text-align: center;
}

.sch-step-trigger:hover,
.sch-step-trigger.is-open {
  color: var(--sch-text);
}

.sch-step-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.sch-step-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  width: min(280px, calc(100vw - 32px));
  max-height: min(320px, 50vh);
  overflow: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--sch-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sch-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.sch-step-grid--dates {
  grid-template-columns: 1fr;
}

.sch-step-grid-btn {
  min-height: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sch-text);
  font: 600 var(--sch-fs-sm, .75rem)/1.2 var(--sch-font, inherit);
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.sch-step-grid-btn:hover,
.sch-step-grid-btn.is-active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--sch-text);
}

.sch-step-grid-btn--all {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.sch-step-grid-btn.is-today {
  color: var(--sch-upcoming, #2563eb);
}

.sch-filter-item-label {
  font-size: var(--sch-fs-2xs, .625rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sch-muted);
  line-height: 1;
}

.sch-filter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.sch-filter-control select {
  flex: 1;
  width: auto;
}

.sch-filter-bar select,
.sch-filter-custom-trigger {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--sch-fs-md, .875rem);
  font-family: inherit;
  font-weight: 600;
  color: var(--sch-text);
  padding: 0 18px 0 0;
  cursor: pointer;
  line-height: 1.25;
  appearance: none;
  background-image: var(--sch-filter-chevron);
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 12px 12px;
}

.sch-filter-custom { position: relative; width: 100%; min-width: 0; flex: 1; }

.sch-filter-custom-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: left;
  background-image: var(--sch-filter-chevron);
}

.sch-filter-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: transparent;
  color: var(--sch-muted);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}

.sch-filter-clear:hover {
  border-color: rgba(0, 0, 0, 0.22);
  color: var(--sch-text);
  background: rgba(0, 0, 0, 0.03);
}

.sch-filter-custom-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sch-filter-custom-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sch-filter-custom-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--sch-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sch-filter-custom-menu [role="option"] {
  padding: 8px 12px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}

.sch-filter-custom-menu [role="option"]:hover,
.sch-filter-custom-menu [role="option"].is-selected {
  background: rgba(0, 0, 0, 0.05);
  color: var(--sch-text);
}

.sch-filter-bar select.is-active,
.sch-filter-item:has(select.is-active) .sch-filter-custom-value {
  color: var(--sch-text);
}

.sch-competition-filter { display: none !important; }
html[data-league="nbl1"] .sch-competition-filter,
html[data-league="bigv"] .sch-competition-filter { display: flex !important; }

.sch-filter-reset {
  align-self: flex-end;
  margin-left: 8px;
  padding: 0 0 8px;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: var(--sch-fs-sm, .75rem);
  font-weight: 600;
  color: var(--sch-muted);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.sch-filter-reset:hover {
  color: var(--sch-text);
}

.sch-header-skel .sch-skel-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sch-skel-filter-item {
  height: 34px;
  border-radius: 4px;
  background: transparent;
}

@media (min-width: 901px) {
  .sch-filter-mobile-toggle {
    display: none !important;
  }

  .sch-filter-panel {
    display: flex !important;
    flex-wrap: nowrap;
  }
}

@media (max-width: 900px) and (min-width: 641px) {
  .sch-filter-panel {
    flex-wrap: nowrap;
    gap: 8px 10px;
  }

  .sch-filter-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .sch-filter-item--venue {
    flex: 2 1 0;
    max-width: none;
  }

  .sch-filter-item--team {
    flex: 1.35 1 0;
    max-width: none;
  }

  .sch-filter-item--season {
    flex: 0 1 5.5rem;
    max-width: 6.5rem;
  }

  .sch-filter-item--group {
    flex: 0 0 5.75rem;
    min-width: 5.75rem;
    max-width: 5.75rem;
  }

  html[data-league="nbl1"] .sch-competition-filter,
  html[data-league="bigv"] .sch-competition-filter {
    flex: 0 1 7rem;
    max-width: 9rem;
  }

  .sch-filter-item-label {
    font-size: .58rem;
  }

  .sch-filter-bar select,
  .sch-filter-custom-trigger {
    font-size: .88rem;
  }
}

@media (max-width: 640px) {
  .sch-filter-bar {
    display: block;
    position: relative;
    --sch-ctrl-fs: 0.6875rem;
    --sch-ctrl-fw: 600;
    --sch-ctrl-radius: 999px;
    --sch-ctrl-pad-y: 7px;
    --sch-ctrl-pad-x: 12px;
    --sch-ctrl-border: 1px solid var(--sch-border, rgba(0, 0, 0, 0.08));
    --sch-ctrl-label-fs: 0.5625rem;
  }

  .sch-filter-mobile-top {
    display: flex;
    gap: 8px;
    align-items: stretch;
  }

  .sch-filter-mobile-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1.1;
    min-width: 0;
    width: auto;
    min-height: 0;
    padding: var(--sch-ctrl-pad-y) var(--sch-ctrl-pad-x);
    border: var(--sch-ctrl-border);
    border-radius: var(--sch-ctrl-radius);
    background: #fff;
    font: inherit;
    font-size: var(--sch-ctrl-fs);
    font-weight: var(--sch-ctrl-fw);
    line-height: 1.25;
    color: var(--sch-text);
    cursor: pointer;
    text-align: left;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
  }

  .sch-filter-mobile-toggle .sch-filter-bar-icon {
    padding: 0;
  }

  .sch-filter-mobile-toggle:focus,
  .sch-filter-mobile-toggle:focus-visible,
  .sch-filter-mobile-toggle:active {
    outline: none;
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.14);
  }

  .sch-filter-bar.is-expanded .sch-filter-mobile-toggle {
    border-color: rgba(0, 0, 0, 0.14);
  }

  .sch-filter-toggle-label {
    flex-shrink: 0;
    font-size: inherit;
    font-weight: inherit;
  }

  .sch-filter-toggle-summary {
    display: none;
  }

  .sch-filter-toggle-chevron {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--sch-muted);
    transition: transform .15s ease;
  }

  .sch-filter-bar.is-expanded .sch-filter-toggle-chevron {
    transform: rotate(180deg);
  }

  .sch-filter-bar.has-active-filters .sch-filter-toggle-label {
    color: var(--sch-upcoming, #2563eb);
  }

  .sch-filter-bar-icon { display: flex; color: var(--sch-muted); }

  .sch-filter-item--group {
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0;
    border-bottom: none;
    justify-content: center;
  }

  .sch-filter-item--group .sch-filter-item-label {
    display: none;
  }

  .sch-filter-item--group .sch-filter-control {
    height: 100%;
  }

  .sch-filter-item--group select {
    height: auto;
    min-height: 0;
    padding: var(--sch-ctrl-pad-y) 28px var(--sch-ctrl-pad-y) var(--sch-ctrl-pad-x);
    border: var(--sch-ctrl-border);
    border-radius: var(--sch-ctrl-radius);
    background-color: #fff;
    font-size: var(--sch-ctrl-fs);
    font-weight: var(--sch-ctrl-fw);
    line-height: 1.25;
    color: var(--sch-text);
  }

  .sch-filter-panel { display: none; }

  .sch-filter-bar.is-expanded .sch-filter-panel {
    display: flex;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 10px;
    gap: 8px;
    background: #fff;
    border: var(--sch-ctrl-border);
    border-radius: var(--sch-radius, 12px);
  }

  .sch-filter-bar.is-expanded .sch-filter-item,
  .sch-filter-bar.is-expanded .sch-filter-item--season,
  .sch-filter-bar.is-expanded .sch-filter-item--date,
  .sch-filter-bar.is-expanded .sch-filter-item--round,
  .sch-filter-bar.is-expanded .sch-filter-item--team,
  .sch-filter-bar.is-expanded .sch-filter-item--venue,
  html[data-league="nbl1"] .sch-filter-bar.is-expanded .sch-competition-filter,
  html[data-league="bigv"] .sch-filter-bar.is-expanded .sch-competition-filter {
    flex: 1 1 calc(50% - 4px);
    max-width: none;
    min-width: calc(50% - 4px);
    padding: 8px 12px;
    border: var(--sch-ctrl-border);
    border-radius: var(--sch-radius, 12px);
    background: var(--sch-bg, #f9f7f6);
    gap: 3px;
    cursor: default;
  }

  .sch-filter-bar.is-expanded .sch-filter-item--venue {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .sch-filter-bar.is-expanded .sch-filter-item-label {
    font-size: var(--sch-ctrl-label-fs);
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  .sch-filter-bar.is-expanded .sch-filter-bar select,
  .sch-filter-bar.is-expanded .sch-filter-custom-trigger {
    font-size: var(--sch-ctrl-fs);
    font-weight: var(--sch-ctrl-fw);
    line-height: 1.25;
    background-color: transparent;
  }

  /* Version CSS may add a ::after chevron — keep one indicator only */
  .sch-filter-custom-trigger::after {
    display: none !important;
  }

  .sch-filter-reset {
    margin: 0;
    width: 100%;
    flex: 1 1 100%;
    padding: var(--sch-ctrl-pad-y) var(--sch-ctrl-pad-x);
    border: var(--sch-ctrl-border);
    border-radius: var(--sch-ctrl-radius);
    background: #fff;
    font-size: var(--sch-ctrl-fs);
    font-weight: var(--sch-ctrl-fw);
    line-height: 1.25;
    color: var(--sch-upcoming, #2563eb);
    text-align: center;
  }

  .sch-header-skel .sch-skel-toolbar { grid-template-columns: 1fr 1fr; }
}
