component Progress {
  props {
    size: string = "default"
    color: string = "primary"
    label: string = "Progress"
    value: number = 50
    max: number = 100
    showValue: boolean = true
    class: string = ""
  }
  view {
    <div class="wire-progress-component {class}" data-color="{color}" data-size="{size}">
      <div class="wire-progress-component__row"><span>{label}</span>{#if showValue}<strong>{value}%</strong>{/if}</div>
      <progress class="wire-progress-component__track" value="{value}" max="{max}" aria-label="{label}"></progress>
    </div>
  }

  style {
    .wire-progress-component {
      --wire-progress-color: var(--wire-color-primary);
      display: grid;
      width: 100%;
      gap: 0.5rem;
      color: var(--wire-color-text);
      font-size: 0.875rem;
    }

    .wire-progress-component[data-color="secondary"] { --wire-progress-color: var(--wire-color-secondary); }
    .wire-progress-component[data-color="success"] { --wire-progress-color: var(--wire-color-success); }
    .wire-progress-component[data-color="warning"] { --wire-progress-color: var(--wire-color-warning); }
    .wire-progress-component[data-color="danger"] { --wire-progress-color: var(--wire-color-danger); }
    .wire-progress-component[data-color="info"] { --wire-progress-color: var(--wire-color-info); }
    .wire-progress-component[data-size="xs"] { font-size: 0.75rem; }
    .wire-progress-component[data-size="lg"],
    .wire-progress-component[data-size="xl"] { font-size: 1rem; }

    .wire-progress-component__row {
      display: flex;
      justify-content: space-between;
      gap: 1rem;
    }

    .wire-progress-component__track {
      width: 100%;
      height: 0.6rem;
      overflow: hidden;
      border: 0;
      border-radius: 999px;
      background: var(--wire-color-surface-2);
      accent-color: var(--wire-progress-color);
    }

    .wire-progress-component__track::-webkit-progress-bar { background: var(--wire-color-surface-2); }
    .wire-progress-component__track::-webkit-progress-value { background: var(--wire-progress-color); }
    .wire-progress-component__track::-moz-progress-bar { background: var(--wire-progress-color); }
  }
}
