/**
 * Tabs - Tab Bar Navigation
 *
 * Horizontal tab bar with underline active state
 * Based on POC: poc-indstillinger.html
 */

/* ===========================================
   TAB BAR
   =========================================== */
swp-tab-bar {
  display: flex;
  gap: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--spacing-12);
  position: sticky;
  top: var(--topbar-height);
  z-index: var(--z-sticky);
}

/* Account for demo banner if present */
body.has-demo-banner swp-tab-bar {
  top: calc(var(--topbar-height) + 40px);
}

/* ===========================================
   TAB ITEM
   =========================================== */
swp-tab {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
  padding: var(--spacing-7) var(--spacing-12);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
}

swp-tab i {
  font-size: var(--font-size-xl);
}

swp-tab:hover {
  color: var(--color-text);
  background: var(--color-background-alt);
}

swp-tab.active {
  color: var(--color-teal);
  border-bottom-color: var(--color-teal);
}

swp-tab.active:hover {
  background: transparent;
}

/* ===========================================
   TAB CONTENT
   =========================================== */
swp-tab-content {
  display: none;
}

swp-tab-content.active {
  display: block;
}

/* ===========================================
   TAB WITH BADGE
   =========================================== */
swp-tab swp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--spacing-2);
  margin-left: var(--spacing-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  background: var(--color-background-alt);
  color: var(--color-text-secondary);
}

swp-tab.active swp-badge {
  background: color-mix(in srgb, var(--color-teal) 15%, transparent);
  color: var(--color-teal);
}
