@use '../../theme/styles' as theme;

.wr-donut-chart {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  font-family: var(--wr-font-family-base);
  color: var(--wr-color-dark);

  &__surface {
    position: relative;
    display: inline-block;
  }

  svg {
    display: block;
    width: 100%;
    height: auto;
  }

  &__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  &__center-value {
    font-size: var(--wr-text-2xl);
    font-weight: var(--wr-font-weight-semibold);
    line-height: var(--wr-leading-tight);
    font-variant-numeric: tabular-nums;
  }

  &__center-label {
    margin-top: 0.125rem;
    font-size: var(--wr-text-xs);
    color: var(--wr-color-medium);
  }

  &__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.875rem;
    justify-content: center;
  }

  &__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--wr-text-xs);
  }

  &__swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
  }

  &__legend-label {
    font-weight: var(--wr-font-weight-medium);
  }

  &__legend-value {
    color: var(--wr-color-medium);
    font-variant-numeric: tabular-nums;
  }
}
