.tab-container {

  &.hidden,
  &.subgrid.hidden {
    display: none;
  }
}

.tab-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 24px 0;
  padding: 0;
  list-style: none;
  gap: var(--semiquaver);
}

@media only screen and (min-width: 900px) {
  .tab-bar {
    flex-direction: row;
    gap: 32px;
  }
}

/* Mobile tab bar improvements */
@media (max-width: 899px) {
  .tab-bar {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px;
  }

  .tab-bar::-webkit-scrollbar {
    display: none;
  }

  .tab-bar li {
    flex: 0 0 auto;
  }

  .tab-link {
    font-size: 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .tab-indicator {
    bottom: 0;
    height: 2px;
  }

  /* Hide "Report a problem" on mobile */
  .tab-bar-container .report-problem-trigger {
    display: none;
  }

  /* Show mobile report flag in header */
  .report-problem-trigger--mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .tab-bar-container {
    margin: 0 0 16px 0 !important;
  }
}

/* Tab Bar Container - for spacing tabs and report flag */
.tab-bar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0;
}

.tab-bar-container .tab-bar {
  margin: 0;
}

/* Report a Problem Trigger */
.report-problem-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--mb-inactive);
  transition: color 0.6s ease;
  text-decoration: none;
}

.report-problem-trigger:hover {
  color: var(--mb, #3B3933);
}

.report-problem-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  border-radius: 0;
}

.report-problem-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 1rem;
  letter-spacing: 0.015rem;
  text-transform: capitalize;
  color: inherit;

  /* Hidden state (initial) */
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: visible;
  margin-right: 0;
}

.report-problem-trigger:hover .report-problem-text {
  max-width: 200px;
  opacity: 1;
  margin-right: 8px;
}

@media only screen and (min-width: 900px) {
  .report-problem-trigger--mobile {
    display: none;
  }
}

.tab-link {
  color: var(--mb-inactive);
  text-decoration: none;
  display: inline-block;
  border-radius: var(--quaver);
  padding: 6px 0px;
  font-size: 12px;
  font-style: normal;
  font-weight: 540;
  line-height: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  &:hover {
    background-color: transparent;
    color: var(--mb);
  }

  &[aria-selected="true"] {
    color: var(--mb);
  }
}

/* Sliding underline indicator for tabs */
.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1.5px;
  background: var(--mb);
  pointer-events: none;
  transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1),
    width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

section.tab-section {
  scroll-margin-top: 200px;
}

/* Make tab-section fill available height when it has an empty state */
section.tab-section:has(.empty-state) {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height) - 150px);
}

section.tab-section:not(:target) {
  display: none;
}

section.tab-section.default {
  display: block;

  &:has(~ .tab-section:target) {
    display: none;
  }
}