/* Dashboard horizontal tab filter */
html { scroll-behavior: smooth; }

:root {
  --dash-tab-blue: #1d4ed8;
  --dash-tab-blue-hover: #1e40af;
  --dash-tab-radius: 1rem;
}

.dashboard-tabs-wrap {
  width: 100%;
  max-width: min(80rem, 100%);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

.dashboard-tabs-scroller {
  position: relative;
  display: flex;
  align-items: stretch;
  max-width: 100%;
  min-width: 0;
}

.dashboard-tabs-arrow {
  flex: 0 0 auto;
  align-self: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(255, 255, 255, 0.95);
  color: #1e3a8a;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.dashboard-tabs-arrow[hidden],
.dashboard-tabs-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

html.dark .dashboard-tabs-arrow {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(71, 85, 105, 0.9);
  color: #bfdbfe;
}

.dashboard-tabs-edge {
  position: absolute;
  top: 0;
  bottom: 6px;
  width: 1.75rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dashboard-tabs-edge.is-visible {
  opacity: 1;
}

.dashboard-tabs-edge--start {
  left: 2.25rem;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

.dashboard-tabs-edge--end {
  right: 2.25rem;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

html.dark .dashboard-tabs-edge--start {
  background: linear-gradient(to right, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0));
}

html.dark .dashboard-tabs-edge--end {
  background: linear-gradient(to left, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0));
}

#dashboard-filter-tabs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #64748b #e2e8f0;
  padding: 0.15rem 0.65rem 0.7rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

#dashboard-filter-tabs::-webkit-scrollbar {
  height: 5px;
}

#dashboard-filter-tabs::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

#dashboard-filter-tabs::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 999px;
}

html.dark #dashboard-filter-tabs {
  border-bottom-color: rgba(30, 41, 59, 0.6);
  scrollbar-color: #93c5fd #1e293b;
}

html.dark #dashboard-filter-tabs::-webkit-scrollbar-track {
  background: #1e293b;
}

html.dark #dashboard-filter-tabs::-webkit-scrollbar-thumb {
  background: #93c5fd;
}

@media (max-width: 640px) {
  .dashboard-tabs-arrow {
    display: none;
  }
  .dashboard-tabs-edge--start {
    left: 0;
  }
  .dashboard-tabs-edge--end {
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dashboard-filter-tabs {
    scroll-behavior: auto;
  }
  .dashboard-tabs-edge {
    transition: none;
  }
}

.tab-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  border-radius: var(--dash-tab-radius);
  border: 1px solid var(--dash-tab-blue);
  background-color: rgba(255, 255, 255, 0.72);
  color: var(--dash-tab-blue-hover);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html.dark .tab-trigger:not(.is-active) {
  background-color: rgba(15, 23, 42, 0.45);
  color: #bfdbfe;
  border-color: #3b82f6;
}

.tab-trigger:not(.is-active):hover {
  background-color: rgba(239, 246, 255, 0.95);
  color: var(--dash-tab-blue);
  border-color: var(--dash-tab-blue);
}

html.dark .tab-trigger:not(.is-active):hover {
  background-color: rgba(30, 58, 138, 0.35);
  color: #ffffff;
  border-color: #60a5fa;
}

.tab-trigger.is-active {
  background-color: var(--dash-tab-blue);
  border-color: var(--dash-tab-blue);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 8px 18px -6px rgba(29, 78, 216, 0.45);
}

.tab-trigger.is-active:hover {
  background-color: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
}

#hoeren-modules-section {
  scroll-margin-top: 88px;
}

[data-exercise-group].dash-filter-hidden {
  display: none !important;
}

/* Default view: Lesen Teil 1 only (pre-JS, prevents scroll flash) */
main.main [data-exercise-group] {
  display: none !important;
}
main.main [data-exercise-group="teil1"] {
  display: block !important;
}
