@import '@angular/material';

// Link mixin
// Use theme to manage colors on links
@mixin mic-link-override($theme) {
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $is-dark: map-get($theme, is-dark);
  $textColor: $dark-primary-text;
  $borderColor: map-get($primary, 100);
  $hoverColor: map-get($theme, primary);
  $fontSize: 1rem;

  @if $is-dark {
    $textColor: $light-primary-text;
    $borderColor: map-get($primary, 400);
  }

  a {
    font-size: $fontSize;
    cursor: pointer;
    color: $textColor;
    border-block-end: 2px solid map-get($primary, A400);
    text-decoration: none;

    p {
      font-size: $fontSize;
    }

    &.disabled {
      cursor: not-allowed;
    }

    &:hover,
    &:focus {
      color: map-get($primary, A400);
    }

    mic-sidebar-item &,
    mat-tree-node &,
    mic-logo & {
      border-block-end-color: transparent !important;
    }

    mat-tree-node &:visited {
      color: $textColor;
    }
  }

  a.accent,
  a.accent p {
    color: map-get($accent, A400);
    border-color: map-get($accent, A700);

    &:hover,
    &:focus {
      color: map-get($accent, A100);
      border-color: map-get($accent, A100);
    }

    &:focus {
      outline-color: map-get($accent, A700);
    }
  }

  a.white,
  a.white p {
    color: $mic-text-colors-normal-light;
    border-color: $mic-text-colors-normal-light;

    &:hover,
    &:focus {
      color: map-get($primary, A100);
      border-color: map-get($primary, A100);
    }
  }
}
