/**
 * Apple Design System - Reusable ProgressBar Component
 * Refined progress tracks, dynamic status thresholds, dark/light theme aware.
 */

.apple-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.apple-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
}

.apple-progress__counts {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.apple-progress__current {
  font-weight: 700;
  color: var(--apple-text-primary, #1d1d1f);
}

.apple-progress__max {
  font-weight: 500;
  color: var(--apple-text-secondary, #86868b);
  font-size: 11px;
}

.apple-progress__percentage {
  font-weight: 600;
  color: var(--apple-text-secondary, #86868b);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Track container */
.apple-progress__track {
  position: relative;
  width: 100%;
  background-color: var(--apple-surface-secondary, rgba(0, 0, 0, 0.06));
  border-radius: var(--apple-radius-pill, 9999px);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Sizes */
.apple-progress--sm .apple-progress__track {
  height: 4px;
}

.apple-progress--md .apple-progress__track {
  height: 6px;
}

.apple-progress--lg .apple-progress__track {
  height: 8px;
}

/* Fill bar with smooth transition */
.apple-progress__fill {
  height: 100%;
  width: var(--progress-val, 0%);
  border-radius: var(--apple-radius-pill, 9999px);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  background-color: var(--apple-accent-blue, #0071e3);
}

/* Variants */
.apple-progress--primary .apple-progress__fill {
  background-color: var(--apple-accent-blue, #0071e3);
}

.apple-progress--success .apple-progress__fill {
  background-color: var(--apple-success-green, #34c759);
}

.apple-progress--warning .apple-progress__fill {
  background-color: var(--apple-warning-orange, #ff9500);
}

.apple-progress--danger .apple-progress__fill {
  background-color: var(--apple-danger-red, #ff3b30);
}

.apple-progress--purple .apple-progress__fill {
  background-color: var(--apple-accent-purple, #af52de);
}

.apple-progress--neutral .apple-progress__fill {
  background-color: var(--apple-text-secondary, #86868b);
}

/* Dark Mode support */
[data-theme="dark"] .apple-progress__track {
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .apple-progress__current {
  color: var(--apple-text-primary, #f5f5f7);
}

[data-theme="dark"] .apple-progress__max {
  color: var(--apple-text-secondary, #a1a1a6);
}

[data-theme="dark"] .apple-progress__percentage {
  color: var(--apple-text-secondary, #a1a1a6);
}
