/* MR unified tab slider — ITER 284 (BS-paralel)
   ─────────────────────────────────────────────────────────────────
   CSS-only animated tab navigation. Two visual modes:

   Type 1 — Underline (default)
     <div class="bs-tabs bs-tabs--underline" data-active="0">
       <a class="bs-tab is-active">Tab 1</a>
       <a class="bs-tab">Tab 2</a>
       <a class="bs-tab">Tab 3</a>
       <span class="bs-tab-indicator"></span>
     </div>

   Type 2 — Pill background
     <div class="bs-tabs bs-tabs--pill" data-active="0">
       <a class="bs-tab is-active">Tab 1</a>
       <a class="bs-tab">Tab 2</a>
       <span class="bs-tab-indicator"></span>
     </div>

   Notes:
     - Indicator slides via CSS only (transform translateX with --bs-tab-w/--bs-tab-x)
     - JS gerekirse 1 satır: indicator.style.setProperty('--bs-tab-x', ...)
     - Mobil-first; max-width: 992px viewport BS-paralel
     - Theme tokens kullanır: --bs-tab-active-color, --bs-tab-indicator-bg
*/

:root {
  --bs-tab-active-color: var(--theme-text-primary, #fff);
  --bs-tab-inactive-color: rgba(255, 255, 255, 0.65);
  --bs-tab-indicator-bg: var(--theme-accent, #d4af37);
  --bs-tab-pill-bg: rgba(212, 175, 55, 0.18);
  --bs-tab-transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --bs-tab-h: 40px;
  --bs-tab-pad-x: 14px;
  --bs-tab-fs: 13px;
  --bs-tab-fw: 600;
}

.bs-tabs {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  height: var(--bs-tab-h);
  font-size: var(--bs-tab-fs);
  font-weight: var(--bs-tab-fw);
  line-height: 1;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.bs-tabs::-webkit-scrollbar { display: none; }

.bs-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--bs-tab-pad-x);
  color: var(--bs-tab-inactive-color);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--bs-tab-transition);
  scroll-snap-align: center;
  white-space: nowrap;
  background: transparent;
  border: 0;
  outline: none;
  flex: 0 0 auto;
}
.bs-tab:hover,
.bs-tab:focus-visible {
  color: var(--bs-tab-active-color);
}
.bs-tab.is-active {
  color: var(--bs-tab-active-color);
}
.bs-tab:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.45);
  border-radius: 6px;
}

/* Sliding indicator — common */
.bs-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--bs-tab-w, 0px);
  transform: translate3d(var(--bs-tab-x, 0), 0, 0);
  transition:
    transform var(--bs-tab-transition),
    width var(--bs-tab-transition),
    background-color var(--bs-tab-transition);
  pointer-events: none;
  will-change: transform, width;
}

/* Type 1 — underline */
.bs-tabs--underline {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.bs-tabs--underline .bs-tab-indicator {
  height: 2px;
  background-color: var(--bs-tab-indicator-bg);
  border-radius: 2px 2px 0 0;
}

/* Type 2 — pill bg */
.bs-tabs--pill {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 4px;
  height: calc(var(--bs-tab-h) + 8px);
  gap: 4px;
}
.bs-tabs--pill .bs-tab {
  border-radius: 999px;
  padding: 0 16px;
  z-index: 1;
}
.bs-tabs--pill .bs-tab-indicator {
  top: 4px;
  bottom: 4px;
  height: auto;
  background-color: var(--bs-tab-pill-bg);
  border-radius: 999px;
  z-index: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Compact variant (sub-nav, profile) */
.bs-tabs--compact {
  --bs-tab-h: 32px;
  --bs-tab-fs: 12px;
  --bs-tab-pad-x: 10px;
}

/* Stretch (full-width grid) */
.bs-tabs--stretch {
  display: flex;
  width: 100%;
}
.bs-tabs--stretch .bs-tab {
  flex: 1 1 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bs-tab-indicator,
  .bs-tab {
    transition: none;
  }
}

/* Mobile narrowing */
@media (max-width: 992px) {
  :root {
    --bs-tab-h: 38px;
    --bs-tab-fs: 12.5px;
    --bs-tab-pad-x: 12px;
  }
}
