/* ==========================================================================
   Apple Design System - SegmentedControl Component Styles
   ========================================================================== */

.apple-segmented-control {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  padding: 3px;
  border-radius: 10px;
  gap: 3px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.05);
  user-select: none;
}

.apple-segmented-control--full {
  display: flex;
  width: 100%;
}

.apple-segmented-control--sm {
  height: 32px;
}

.apple-segmented-control--md {
  height: 38px;
}

.apple-segmented-control--lg {
  height: 44px;
}

.apple-segmented-button {
  border: none;
  background: transparent;
  color: var(--apple-text-secondary, #64748b);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0 0.875rem;
  height: 100%;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  outline: none;
  font-family: inherit;
}

.apple-segmented-control--full .apple-segmented-button {
  flex: 1;
  text-align: center;
}

.apple-segmented-button:hover:not(.active) {
  color: var(--apple-text, #1d1d1f);
}

.apple-segmented-button.active {
  background: #ffffff;
  color: var(--apple-primary, #0071e3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04);
}

.apple-segmented-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.apple-segmented-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  line-height: 1;
}

.apple-segmented-button.active .apple-segmented-badge {
  background: rgba(0, 113, 227, 0.1);
}

/* ==========================================================================
   Dark Theme Support
   ========================================================================== */

[data-theme='dark'] .apple-segmented-control {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .apple-segmented-button {
  color: #94a3b8;
}

[data-theme='dark'] .apple-segmented-button:hover:not(.active) {
  color: #ffffff;
}

[data-theme='dark'] .apple-segmented-button.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--apple-primary, #38bdf8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .apple-segmented-badge {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .apple-segmented-button.active .apple-segmented-badge {
  background: rgba(56, 189, 248, 0.2);
}
