@use '@angular/material' as mat;
@import "@angular/material/theming";

@mixin sc-toast-theme($theme) {
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $success: map-get($theme, success);
  $warning: map-get($theme, warning);
  $danger: map-get($theme, danger);
  $scBackground: map-get($theme, sc-background);
  $scForeground: map-get($theme, sc-foreground);

  .sc-toast {
    &__container {
      background: map-get($scBackground, card-inverted);
      color: map-get($scForeground, text-inverted);
      @include mat.elevation(6, black, 0.6);

      &.success {
        background: map-get($success, 500);
        color: mat.get-contrast-color-from-palette($success, 500);

        .sc-toast__actions {
          color: mat.get-contrast-color-from-palette($success, 500);
        }
      }

      &.warning {
        background: map-get($warning, 500);
        color: mat.get-contrast-color-from-palette($warning, 500);

        .sc-toast__actions {
          color: mat.get-contrast-color-from-palette($warning, 500);
        }
      }

      &.danger {
        background: map-get($danger, 500);
        color: mat.get-contrast-color-from-palette($danger, 500);

        .sc-toast__actions {
          color: mat.get-contrast-color-from-palette($danger, 500);
        }
      }

      &.primary {
        background: map-get($primary, 500);
        color: mat.get-contrast-color-from-palette($primary, 500);

        .sc-toast__actions {
          color: mat.get-contrast-color-from-palette($primary, 500);
        }
      }

      &.accent {
        background: map-get($accent, 500);
        color: mat.get-contrast-color-from-palette($accent, 500);

        .sc-toast__actions {
          color: mat.get-contrast-color-from-palette($accent, 500);
        }
      }
    }

    &__actions {
      color: mat.get-color-from-palette($primary, 500);
    }
  }
}
