/* Unified Tab Styles - Based on DHCS Design System */

.tabs {
  width: 100%;
}

.tabs-scrollable {
  width: 100%;
}

/* Tab header container */
.tabs-header {
  background-color: transparent;
}

/* Base tab styles */
.tabs-header .mud-tab {
  min-height: 48px;
  padding: 12px var(--dhcs-spacing-md);
  text-transform: none;
  color: var(--dhcs-color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease-in-out;
}

/* Scrollable tabs maintain consistent width and don't shrink */
.tabs-scrollable .tabs-header .mud-tab {
  flex: 0 0 160px;
  min-width: 160px;
  max-width: 160px;
}

/* Tab content wrapper - default variant */
.tabs-default .tab-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tab content wrapper - with icon and scrollable variants */
.tabs-with-icon .tab-content,
.tabs-scrollable .tab-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--dhcs-spacing-sm);
}

/* Tab icon styling */
.tab-icon {
  font-size: 20px;
  color: inherit;
}

/* Tab text styling using Body2 from theme */
.tab-text {
  font-family: var(--dhcs-font-family-default);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

/* Scrollable tabs need nowrap to prevent text wrapping */
.tabs-scrollable .tab-text {
  white-space: nowrap;
}

/* Active tab state */
.tabs-header .mud-tab.mud-tab-active {
  color: var(--dhcs-color-secondary);
  border-bottom-color: var(--dhcs-color-secondary);
}

/* Icon inherits active state color unless overridden */
.tabs-header .mud-tab.mud-tab-active .tab-icon {
  color: inherit;
}

/* Hover state */
.tabs-header .mud-tab:hover:not(.mud-disabled) {
  background-color: var(--dhcs-color-bg-grey-hover);
  color: var(--dhcs-color-text-primary);
}

/* Focus state - keyboard navigation */
.tabs-header .mud-tab:focus-visible {
  outline: 3px solid var(--dhcs-color-secondary);
  outline-offset: -3px;
  background-color: transparent;
  color: var(--dhcs-color-secondary);
}

/* Focus + hover combined */
.tabs-header .mud-tab:focus-visible:hover {
  outline: 3px solid var(--dhcs-color-secondary);
  outline-offset: -3px;
  background-color: var(--dhcs-color-bg-grey-hover);
}

/* Active + hover combined */
.tabs-header .mud-tab.mud-tab-active:hover {
  background-color: var(--dhcs-color-bg-grey-hover);
  color: var(--dhcs-color-secondary);
  border-bottom-color: var(--dhcs-color-secondary);
}

/* Disabled state */
.tabs-header .mud-tab.mud-disabled {
  color: var(--dhcs-color-text-grey);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Disabled icon inherits disabled color */
.tabs-header .mud-tab.mud-disabled .tab-icon {
  color: inherit;
}

/* Scroll button styling (scrollable variant only) */
.mud-tabs-scroll-button {
  min-width: 44px;
  min-height: 44px;
  color: var(--dhcs-color-secondary);
  background-color: transparent;
  transition: background-color 0.2s ease-in-out;
}

.mud-tabs-scroll-button:hover:not(:disabled) {
  background-color: var(--dhcs-color-bg-grey-hover);
}

.mud-tabs-scroll-button:focus-visible {
  outline: 3px solid var(--dhcs-color-secondary);
  outline-offset: -3px;
}

.mud-tabs-scroll-button:disabled {
  color: var(--dhcs-color-text-grey);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tab panel content */
.tab-panel {
  padding: 20px 0;
}

/* Scrollable container */
.mud-tabs-toolbar-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
}

.mud-tabs-toolbar-wrapper::-webkit-scrollbar {
  height: 4px;
}

.mud-tabs-toolbar-wrapper::-webkit-scrollbar-track {
  background-color: var(--dhcs-color-border-default);
}

.mud-tabs-toolbar-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--dhcs-color-secondary);
  border-radius: 2px;
}
