/* ==========================================================================
   Tabs — redesign component
   Three variants: --underline (default), --pills, --segmented.
   Items can be <a>, <button>, or any element. Mark active with .is-active.
   Mobile: container collapses to a horizontal scroll strip.
   ========================================================================== */

body.wb-shell-redesign .wb-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  position: relative;
}

/* ---------- Item base ---------- */
body.wb-shell-redesign .wb-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  border-radius: 0;
}
body.wb-shell-redesign .wb-tabs__item:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}
body.wb-shell-redesign .wb-tabs__item:disabled,
body.wb-shell-redesign .wb-tabs__item[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
body.wb-shell-redesign .wb-tabs__item svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  flex: none;
}
body.wb-shell-redesign .wb-tabs__item i {
  font-size: 16px;
  line-height: 1;
}

/* Badge inside a tab item */
body.wb-shell-redesign .wb-tabs__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Variant: Underline (default) ---------- */
body.wb-shell-redesign .wb-tabs--underline {
  border-bottom: 1px solid var(--border);
  gap: 2px;
}
body.wb-shell-redesign .wb-tabs--underline .wb-tabs__item {
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
body.wb-shell-redesign .wb-tabs--underline .wb-tabs__item:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--text);
}
body.wb-shell-redesign .wb-tabs--underline .wb-tabs__item.is-active {
  color: var(--text);
  border-bottom-color: var(--amber);
}

/* ---------- Variant: Pills ---------- */
body.wb-shell-redesign .wb-tabs--pills {
  gap: 4px;
}
body.wb-shell-redesign .wb-tabs--pills .wb-tabs__item {
  padding: 8px 14px;
  border-radius: 999px;
}
body.wb-shell-redesign .wb-tabs--pills .wb-tabs__item:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--surface-2);
  color: var(--text);
}
body.wb-shell-redesign .wb-tabs--pills .wb-tabs__item.is-active {
  background: var(--text);
  color: var(--bg-elev);
}
body.wb-shell-redesign .wb-tabs--pills .wb-tabs__item.is-active .wb-tabs__badge {
  background: color-mix(in oklab, var(--bg-elev) 22%, transparent);
  color: var(--bg-elev);
}

/* ---------- Variant: Segmented (toggle group) ---------- */
body.wb-shell-redesign .wb-tabs--segmented {
  display: inline-flex;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 12px;
  gap: 2px;
  border: 1px solid var(--border);
}
body.wb-shell-redesign .wb-tabs--segmented .wb-tabs__item {
  padding: 7px 14px;
  border-radius: 9px;
}
body.wb-shell-redesign .wb-tabs--segmented .wb-tabs__item:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--text);
}
body.wb-shell-redesign .wb-tabs--segmented .wb-tabs__item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ---------- Tab panel container ---------- */
body.wb-shell-redesign .wb-tabs__panels {
  margin-top: 14px;
}
body.wb-shell-redesign .wb-tabs__panel {
  display: none;
}
body.wb-shell-redesign .wb-tabs__panel.is-active {
  display: block;
}

/* ---------- Mobile: horizontal scroll ---------- */
@media (max-width: 640px) {
  body.wb-shell-redesign .wb-tabs--underline,
  body.wb-shell-redesign .wb-tabs--pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Soft fade on the right edge to hint at scrollability */
    -webkit-mask-image: linear-gradient(to right, black 92%, transparent 100%);
            mask-image: linear-gradient(to right, black 92%, transparent 100%);
  }
  body.wb-shell-redesign .wb-tabs--underline::-webkit-scrollbar,
  body.wb-shell-redesign .wb-tabs--pills::-webkit-scrollbar {
    display: none;
  }
  body.wb-shell-redesign .wb-tabs--underline .wb-tabs__item,
  body.wb-shell-redesign .wb-tabs--pills .wb-tabs__item {
    flex: none;
  }

  /* Segmented stretches to fill width and items become equal */
  body.wb-shell-redesign .wb-tabs--segmented {
    display: flex;
    width: 100%;
  }
  body.wb-shell-redesign .wb-tabs--segmented .wb-tabs__item {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
  }

  /* Optional: hide labels and keep icons only on very narrow screens */
  body.wb-shell-redesign .wb-tabs--icons-only-sm .wb-tabs__item .wb-tabs__label {
    display: none;
  }
}
