/* Tab Components */

/* Tab Container */
.tabs {
  display: flex;
  flex-direction: column;
}

/* Tab List */
.tabs__list {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs__list::-webkit-scrollbar {
  display: none;
}

/* Tab Item */
.tabs__tab {
  position: relative;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tabs__tab:hover {
  color: var(--color-text);
}

.tabs__tab--active {
  color: var(--color-primary);
}

.tabs__tab--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

/* Tab Content */
.tabs__content {
  padding: var(--space-4) 0;
}

.tabs__panel {
  display: none;
}

.tabs__panel--active {
  display: block;
}

/* Pill Tabs Variant */
.tabs--pills .tabs__list {
  border-bottom: none;
  background: var(--color-bg-alt);
  padding: var(--space-1);
  border-radius: var(--radius-lg);
  gap: var(--space-1);
}

.tabs--pills .tabs__tab {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
}

.tabs--pills .tabs__tab--active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.tabs--pills .tabs__tab--active::after {
  display: none;
}

/* Boxed Tabs Variant */
.tabs--boxed .tabs__list {
  border-bottom: none;
  gap: 0;
}

.tabs--boxed .tabs__tab {
  border: 1px solid var(--color-border);
  border-right: none;
  background: var(--color-bg-alt);
}

.tabs--boxed .tabs__tab:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.tabs--boxed .tabs__tab:last-child {
  border-right: 1px solid var(--color-border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.tabs--boxed .tabs__tab--active {
  background: var(--color-surface);
  border-bottom-color: var(--color-surface);
  color: var(--color-primary);
}

.tabs--boxed .tabs__tab--active::after {
  display: none;
}

/* Vertical Tabs */
.tabs--vertical {
  flex-direction: row;
  gap: var(--space-4);
}

.tabs--vertical .tabs__list {
  flex-direction: column;
  border-bottom: none;
  border-right: 1px solid var(--color-border);
  padding-right: 0;
  padding-bottom: 0;
  min-width: 180px;
}

.tabs--vertical .tabs__tab {
  text-align: left;
  padding: var(--space-2) var(--space-4);
}

.tabs--vertical .tabs__tab--active::after {
  bottom: 0;
  top: 0;
  left: auto;
  right: -1px;
  width: 2px;
  height: auto;
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.tabs--vertical .tabs__content {
  flex: 1;
  padding: 0;
}

/* Icon in Tab */
.tabs__tab-icon {
  width: 16px;
  height: 16px;
  margin-right: var(--space-2);
}

/* Badge in Tab */
.tabs__tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-1);
  margin-left: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
}

.tabs__tab--active .tabs__tab-badge {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

/* Responsive */
@media (max-width: 640px) {
  .tabs--vertical {
    flex-direction: column;
  }

  .tabs--vertical .tabs__list {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    min-width: auto;
    overflow-x: auto;
  }

  .tabs--vertical .tabs__tab--active::after {
    bottom: -1px;
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 2px;
    border-radius: var(--radius-full) var(--radius-full) 0 0;
  }
}
