@import '../override-function';

.usa-alert {
  background: none;
  background-color: $color-gray-lightest;
  border-left-style: solid;
  border-left-width: 10px;
  display: table;
  padding: units(4) units(8) units(4) units(3);
  width: 100%;

  &::before {
    display: block;
    width: auto;
    background: none;
    font-family: "Font Awesome 5 Free";
    font-size: scale-rem(2rem);
    margin-right: units(2);
    position: static;
    font-weight: 900;
  }

  // &-body would not have had high enough precedence.
  .usa-alert-body {
    display: table-cell;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    vertical-align: middle;
  }

  &-heading {
    font-size: scale-rem(2rem);
    margin-top: 0;
    padding-top: 0;
  }

  &-text {
    margin-top: units(2.5);

    &:only-child {
      margin: 0;
      padding: 0;
    }

    p:first-child {
      margin-top: 0;
    }

    p:last-child {
       margin-bottom: 0;
    }

    // should override :first-child
    .usa-alert-heading + p:only-of-type {
      margin-top: units(2.5);
    }

    ul {
      padding-left: units(2.5);
    }
  }

  &-info {
    border-left-color: $color-primary-alt-dark;

    &::before {
      content: "\f05a";
    }

    &.background-color-only {
      background-color: $color-primary-alt-lightest;
    }
  }

  &-error {
    border-left-color: $color-secondary-dark;

    &::before {
      color: $color-secondary-dark;
      content: "\f06a"
    }

    &.background-color-only {
      background-color: $color-secondary-lightest;
    }
  }

  &-success {
    border-left-color: $color-green;

    &::before {
      color: $color-green;
      content: "\f00c";
    }

    &.background-color-only {
      background-color: $color-green-lightest;
    }
  }

  &-warning {
    border-left-color: $color-gold;

    &::before {
      content: "\f071";
    }

    &.background-color-only {
      background-color: $color-gold-lightest;
    }
  }

  &-continue {
    border-left-color: $color-green;

    &::before {
      color: $color-green;
      content: "\f023";
    }
  }

  &.background-color-only {
    border-left: none;
    padding: scale-rem(2rem);

    &::before {
      content: none;
    }
  }
}

.va-alert-close {
  @include modal-close-button;
}

// on post-9/11 GI Bill
p.usa-alert-heading {
  margin-top: 0;
}

.claims-list-alert {
  margin-bottom: 1em;
  margin-top: 0;
}

.va-alert-close-icon {
  font-size: 1.1em !important;
}

.claims-alert-status {
  margin-top: 0;
  margin-bottom: 2em;
}

// blue box on individual claim details
.claims-alert-header {
  padding-bottom: 0 !important;
  margin-top: 0;
}

.alerts-list {
  list-style: none;

  li {
    margin-left: -.4em;
  }
}

.claims-alert-checkbox {
  > label {
    margin-top: 0;
    margin-bottom: 0;
    max-width: 100%;
  }
}

.need-files-alert {
  padding-bottom: 4em;
  @include media($medium-large-screen) {
    padding-bottom: 1em;
  }
}

.alert-with-details {
  display: flex;
  justify-content: space-between;
  flex-direction: column;

  @include media($medium-large-screen) {
    flex-direction: row;
  }
}

.usa-alert-full-width {
  background-color: $color-gray-lightest;
  &.dismissable-option-header {
    display: none;
    &.show-alert {
      display: block;
    }
    &.dismissed {
      display: none;
    }
  }
  .usa-alert-dismiss {
    position: absolute;
    right: 0;
    top: 5px;
    cursor: pointer;
  }
  > .usa-alert {
    border-left: none;
    max-width: 1000px;
    margin: 0 auto;
    .paragraph--type--expandable-text {
      .field--name-field-text-expander {
        .field__label {
          display: none;
        }
        .field__item {
          font-size: scale-rem(2rem);
          margin-top: 0;
          padding-top: 0;
          font-weight: 700;
          text-decoration: underline;
          color: #1a4480;
          cursor: pointer;
        }
      }
      .field--type-text-long {
        display: none;
        .field__label {
          display: none;
        }
        &.expander-content-open {
          display: block;
        }
      }
    }
  }
  &-warning {
    border-top: scale-rem(1rem) solid $color-gold;
  }
  &-info,
  &-information {
    border-top: scale-rem(1rem) solid $color-primary-alt-dark;
    .usa-alert:before {
      content: "\F05A";
      background: none;
      font-size: scale-rem(2rem);
      margin-right: scale-rem(1.5rem);
      position: static;
      font-weight: 900;
    }
  }
}