/* /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);
}
.tabs__count--red {
  background: var(--color-danger);
  color: var(--color-white);
}
.tabs__item.active .tabs__count--red,
.tabs__item[aria-selected="true"] .tabs__count--red {
  background: var(--color-danger);
  color: var(--color-white);
}
.tabs__count--green {
  background: var(--color-success);
  color: var(--color-white);
}
.tabs__item.active .tabs__count--green,
.tabs__item[aria-selected="true"] .tabs__count--green {
  background: var(--color-success);
  color: var(--color-white);
}
.tabs__count--pulse {
  animation: tabsCountPulse 2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes tabsCountPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .tabs__count--pulse { animation: none; }
}

/* ── 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);
}

/* ── Inline Badge (e.g. "Soon", "New", "Beta") ──────────────────── */
.tabs__badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tabs__badge--soon {
  background: var(--color-gray-200);
  color: var(--color-gray-500);
}
.tabs__badge--new {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}
.tabs__item.active .tabs__badge--soon,
.tabs__item[aria-selected="true"] .tabs__badge--soon {
  background: rgba(var(--color-primary-rgb), 0.10);
  color: var(--color-primary);
}

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