/**
 * DC Tab Switcher — Shared CSS
 *
 * Identical look to the React TabNavigation component.
 * Uses var(--base-*) design tokens (same as React version).
 * Works for both vanilla JS and React tab bars.
 *
 * This file is enqueued by PHP for non-React tab usage (shortcodes, BB module).
 * The React build imports its own copy from TabNavigation.css.
 */

/* ------------------------------------------------------------------ */
/*  Tab Navigation Container                                           */
/* ------------------------------------------------------------------ */

.dc-tab-nav {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background-color: var(--base-100);
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--base-300) transparent;
}

.dc-tab-nav::-webkit-scrollbar {
  height: 6px;
}

.dc-tab-nav::-webkit-scrollbar-track {
  background: transparent;
}

.dc-tab-nav::-webkit-scrollbar-thumb {
  background-color: var(--base-300);
  border-radius: 3px;
}

/* Full-width variant */
.dc-tab-nav--full {
  display: flex;
}

.dc-tab-nav--full .dc-tab-nav__tab {
  flex: 1;
  justify-content: center;
}

/* ------------------------------------------------------------------ */
/*  Sliding Indicator                                                  */
/* ------------------------------------------------------------------ */

.dc-tab-nav__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: left 300ms ease-out, width 300ms ease-out;
  pointer-events: none;
  z-index: 0;
}

/* ------------------------------------------------------------------ */
/*  Tab Button                                                         */
/* ------------------------------------------------------------------ */

.dc-tab-nav .dc-tab-nav__tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--base-600);
  background: transparent;
  border: none;
  border-radius: 6px;
  box-shadow: none;
  cursor: pointer;
  transition: color 150ms ease-out;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-decoration: none;
}

/* Override Kadence / theme global button styles */
.dc-tab-nav .dc-tab-nav__tab:hover,
.dc-tab-nav .dc-tab-nav__tab:focus,
.dc-tab-nav .dc-tab-nav__tab:active {
  color: var(--base-900);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}

.dc-tab-nav .dc-tab-nav__tab:focus-visible {
  outline: 2px solid var(--base-400);
  outline-offset: 2px;
}

.dc-tab-nav .dc-tab-nav__tab--active {
  color: var(--base-900);
}

/* ------------------------------------------------------------------ */
/*  Tab Label                                                          */
/* ------------------------------------------------------------------ */

.dc-tab-nav__label {
  font-size: 14px;
  line-height: 1.25;
}

/* ------------------------------------------------------------------ */
/*  Count Badge                                                        */
/* ------------------------------------------------------------------ */

.dc-tab-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--base-600);
  background-color: var(--base-200);
  border-radius: 9999px;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.dc-tab-nav__badge--active {
  color: var(--base-700);
  background-color: var(--base-100);
}

/* ------------------------------------------------------------------ */
/*  Panel transitions                                                  */
/* ------------------------------------------------------------------ */

[data-dc-tab-panel] {
  /* Hidden by default; JS sets display:'' on active */
}

/* Optional fade-in for panels */
[data-dc-tab-panel][aria-hidden="false"],
[data-dc-tab-panel]:not([aria-hidden="true"]):not([style*="display: none"]) {
  animation: dc-tab-fade-in 200ms ease-out;
}

@keyframes dc-tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                         */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .dc-tab-nav {
    padding: 3px;
    gap: 2px;
  }

  .dc-tab-nav .dc-tab-nav__tab {
    padding: 6px 12px;
    font-size: 13px;
  }

  .dc-tab-nav__label {
    font-size: 13px;
  }

  .dc-tab-nav__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
  }

  .dc-tab-nav__indicator {
    top: 3px;
    bottom: 3px;
  }
}

/* ------------------------------------------------------------------ */
/*  Accessibility                                                      */
/* ------------------------------------------------------------------ */

@media (prefers-contrast: high) {
  .dc-tab-nav {
    border: 2px solid var(--base-700);
  }

  .dc-tab-nav .dc-tab-nav__tab:focus-visible {
    outline-width: 3px;
  }

  .dc-tab-nav__indicator {
    border: 2px solid var(--base-700);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dc-tab-nav__indicator {
    transition: none;
  }

  .dc-tab-nav .dc-tab-nav__tab {
    transition: none;
  }

  .dc-tab-nav__badge {
    transition: none;
  }

  [data-dc-tab-panel] {
    animation: none !important;
  }
}

@media print {
  .dc-tab-nav {
    display: none;
  }

  /* Show all panels when printing */
  [data-dc-tab-panel] {
    display: block !important;
  }
}
