@import '../core/theming/palette';
@import '../core/theming/theming';
@import '../core/typography/typography-utils';

@mixin mat-radio-color($palette) {
  &.mat-radio-checked .mat-radio-outer-circle {
    border-color: mat-color($palette);
  }

  .mat-radio-inner-circle {
    background-color: mat-color($palette);
  }

  .mat-radio-ripple .mat-ripple-element {
    background-color: mat-color($palette, 0.26);
  }
}

@mixin mat-radio-theme($theme) {
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $warn: map-get($theme, warn);
  $background: map-get($theme, background);
  $foreground: map-get($theme, foreground);

  .mat-radio-outer-circle {
    border-color: mat-color($foreground, secondary-text);
  }

  .mat-radio-disabled .mat-radio-outer-circle {
    border-color: mat-color($foreground, disabled);
  }

  .mat-radio-disabled {
    .mat-radio-ripple .mat-ripple-element, .mat-radio-inner-circle {
      background-color: mat-color($foreground, disabled);
    }

    .mat-radio-label-content {
      color: mat-color($foreground, disabled);
    }
  }

  .mat-radio-button {
    &.mat-primary {
      @include mat-radio-color($primary);
    }

    &.mat-accent {
      @include mat-radio-color($accent);
    }

    &.mat-warn {
      @include mat-radio-color($warn);
    }
  }
}

@mixin mat-radio-typography($config) {
  .mat-radio-button {
    font-family: mat-font-family($config);
  }
}
