@import "../../scss/mnd-bootstrap/variables/variables";

.mnd-c-alert {
  margin-top: 1rem;
  margin-bottom: 0;
}

.alert-dismissable .close,
.alert-dismissible .close {
  color: $color-gray-3000;
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  opacity: 1;

  &:hover {
    color: $color-gray-2000;
  }
}

.mnd-c-alert__content {
  margin-bottom: 0;
}

.mnd-c-alert__content--buttons {
  margin-bottom: 1rem;

  @media only screen and (min-width: 768px) {
    margin: 0;
  }
}

// Bootstrap styles
// =====================

// sass-lint:disable force-pseudo-nesting, force-element-nesting

@import "../../scss/mnd-bootstrap/mnd-mixins";

.alert {
  @include alert-variant($color-white, $color-gray-4000, $color-gray-1000);

  display: flex;
  position: relative;
  align-items: baseline;
  justify-content: space-between;
  flex-direction: column;

  @media only screen and (min-width: 768px) {
    flex-direction: row;
    align-items: center;
  }

  h1,
  h2,
  h3,
  h4,
  h5 {
    margin-top: 0;
  }
}

.alert-success,
.alert-info,
.alert-warning,
.alert-danger,
.alert-error {
  &.alert {
    padding-left: $alert-padding + $alert-icon-width;
  }

  &.alert::before {
    background: transparent;
    color: $color-white;
    content: "";
    font-size: 20px;
    height: 100%;
    left: 0;
    line-height: $alert-icon-width;
    position: absolute;
    text-align: center;
    top: 0;
    width: $alert-icon-width;
  }

  &.alert::after {
    color: $color-white;
    content: "";
    font-family: "Font Awesome 5 Pro";
    font-weight: 900;
    font-size: 12px;
    left: 0;
    line-height: $alert-icon-width;
    position: absolute;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    width: $alert-icon-width;
  }
}

.alert-success.alert::before {
  background: $color-chewing-grass;
}

.alert-error.alert::before,
.alert-danger.alert::before {
  background: $color-copenhagen-red;
}

.alert-info.alert::before {
  background: $color-feel-good-blue;
}

.alert-warning.alert::before {
  background: $color-lemons;
}

.alert-success.alert::after {
  content: "\f058";
}

.alert-error.alert::after,
.alert-danger.alert::after {
  content: "\f057";
}

.alert-info.alert::after {
  content: "\f05a";
}

.alert-warning.alert::after {
  content: "\f071";
}
