/* /public/css/components/tabs.css */
/* Horizontal tab navigation — pill (default) and underline variants */

/* ── Base Container ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px;
  background: var(--color-gray-100);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

/* ── Tab Button ───────────────────────────────────────────────────── */
.tabs__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-gray-500);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
  text-decoration: none;
  line-height: 1.4;
}
.tabs__item:hover {
  color: var(--color-gray-700);
  background: rgba(255, 255, 255, 0.6);
}
.tabs__item.active,
.tabs__item[aria-selected="true"] {
  color: var(--color-primary);
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  font-weight: var(--font-weight-semibold);
}

/* ── Tab Count Badge ──────────────────────────────────────────────── */
.tabs__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  background: var(--color-gray-200);
  color: var(--color-gray-600);
}
.tabs__item.active .tabs__count,
.tabs__item[aria-selected="true"] .tabs__count {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}

/* ── Underline Variant ────────────────────────────────────────────── */
.tabs--underline {
  background: transparent;
  padding: 0;
  gap: 0;
  border-bottom: 1px solid var(--color-gray-200);
  border-radius: 0;
}
.tabs--underline .tabs__item {
  padding: 10px 16px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs--underline .tabs__item:hover {
  background: transparent;
  color: var(--color-gray-700);
  border-bottom-color: var(--color-gray-300);
}
.tabs--underline .tabs__item.active,
.tabs--underline .tabs__item[aria-selected="true"] {
  background: transparent;
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  box-shadow: none;
}

/* ── Divided Variant ──────────────────────────────────────────────── */
/* Equal-width tabs with thin vertical separators. Good for modals.   */
.tabs--divided {
  gap: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid var(--color-gray-200);
  overflow: visible;
}
.tabs--divided .tabs__item {
  flex: 1;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  position: relative;
}
.tabs--divided .tabs__item + .tabs__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--color-gray-200);
}
.tabs--divided .tabs__item:hover {
  background: var(--color-gray-50, #f8fafc);
  color: var(--color-gray-700);
}
.tabs--divided .tabs__item.active,
.tabs--divided .tabs__item[aria-selected="true"] {
  background: transparent;
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  box-shadow: none;
}
/* ── Small Variant ────────────────────────────────────────────────── */
.tabs--sm {
  padding: 3px;
}
.tabs--sm .tabs__item {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .tabs__item {
    padding: 8px 14px;
    font-size: var(--font-size-sm);
  }
}
