/* Hux tab hierarchy v91: consistent structure with three readable levels. */

:root {
  --hux-tab-line: #303033;
  --hux-tab-line-soft: #27272a;
  --hux-tab-surface: #101011;
  --hux-tab-surface-active: #171719;
  --hux-tab-text: #8b8b90;
  --hux-tab-text-strong: #f2f2f3;
  --hux-tab-text-disabled: #515156;
}

/* Level 1: page views — light separators and a restrained active underline. */
.view-switch {
  isolation: isolate;
}

.view-switch > .view-tab {
  min-height: 100%;
  padding-inline: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--hux-tab-text);
}

.view-switch > .view-tab + .view-tab {
  border-left: 1px solid var(--hux-tab-line-soft);
}

.view-switch > .view-tab:hover {
  background: rgb(255 255 255 / 2%);
  color: #d8d8da;
}

.view-switch > .view-tab.active {
  background: rgb(255 255 255 / 2.5%);
  color: var(--hux-tab-text-strong);
}

.view-switch > .view-tab:focus-visible {
  outline: 1px solid #6a6a70;
  outline-offset: -4px;
}

/* Level 2: major asset categories — full-height, continuous cell borders. */
.asset-toolbar {
  border-color: var(--hux-tab-line);
  background: var(--hux-tab-surface);
}

.asset-toolbar .search-wrap {
  border-right-color: var(--hux-tab-line);
}

#category-pills > .pill {
  border-right: 1px solid var(--hux-tab-line);
  color: var(--hux-tab-text);
}

#category-pills > .pill:hover {
  background: #151516;
  color: #dedee0;
}

#category-pills > .pill.active {
  border-right: 1px solid var(--hux-tab-line);
  background: var(--hux-tab-surface-active);
  color: var(--hux-tab-text-strong);
}

#category-pills > .pill:disabled,
#category-pills > .pill.empty {
  background: transparent;
  color: var(--hux-tab-text-disabled);
  opacity: 1;
}

#category-pills > .pill:disabled .ui-icon,
#category-pills > .pill.empty .ui-icon,
#category-pills > .pill:disabled .pill-count,
#category-pills > .pill.empty .pill-count {
  color: #48484d;
}

#category-pills > .pill:focus-visible {
  outline: 1px solid #66666b;
  outline-offset: -4px;
}

/* Level 3: secondary filters — shorter row, same structural grammar. */
#subcategory-group {
  min-height: 56px;
  margin: -1px 0 16px;
  padding: 0;
  border-color: var(--hux-tab-line);
  background: #0d0d0e;
}

#subcategory-pills {
  align-items: stretch;
  width: 100%;
  min-height: 56px;
  padding: 0;
  border: 0;
}

#subcategory-pills > .secondary-pill {
  min-height: 56px;
  padding-inline: 20px;
  border-right: 1px solid var(--hux-tab-line-soft);
  background: transparent;
  color: #7d7d82;
  font-size: 13px;
}

#subcategory-pills > .secondary-pill:hover {
  background: #141415;
  color: #d8d8da;
}

#subcategory-pills > .secondary-pill.active {
  border-right: 1px solid var(--hux-tab-line-soft);
  background: #151516;
  color: var(--hux-tab-text-strong);
}

#subcategory-pills > .secondary-pill:disabled,
#subcategory-pills > .secondary-pill.empty {
  background: transparent;
  color: var(--hux-tab-text-disabled);
  opacity: 1;
}

#subcategory-pills > .secondary-pill:disabled .ui-icon,
#subcategory-pills > .secondary-pill.empty .ui-icon,
#subcategory-pills > .secondary-pill:disabled .pill-count,
#subcategory-pills > .secondary-pill.empty .pill-count {
  color: #48484d;
}

#subcategory-pills > .secondary-pill:focus-visible {
  outline: 1px solid #606066;
  outline-offset: -4px;
}

/* Mode tabs on the asset-creation page share the same selected-state language. */
.intake-method-switch {
  border-color: var(--hux-tab-line);
  background: #0d0d0e;
}

.intake-method-switch > button {
  position: relative;
  border-right-color: var(--hux-tab-line);
  background: #101011;
  color: var(--hux-tab-text);
}

.intake-method-switch > button:hover,
.intake-method-switch > button:focus-visible {
  background: #151516;
  color: #dedee0;
}

.intake-method-switch > button.active {
  background: var(--hux-tab-surface-active);
  color: var(--hux-tab-text-strong);
}

.intake-method-switch > button.active::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  background: var(--brand);
  content: "";
}

.intake-method-switch > button:focus-visible {
  outline: 1px solid #66666b;
  outline-offset: -4px;
}

@media (max-width: 760px) {
  .workspace.page-assets .view-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .view-switch > .view-tab {
    min-width: 0;
    padding-inline: 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  #subcategory-group {
    min-height: 52px;
  }

  #subcategory-pills,
  #subcategory-pills > .secondary-pill {
    min-height: 52px;
  }

  #subcategory-pills > .secondary-pill {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-tab,
  .pill,
  .intake-method-switch > button {
    transition: none !important;
  }
}
