@import "bootstrap-sass/assets/stylesheets/bootstrap/alerts";
@import "variables";

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  align-content: center;
  align-items: center;
  background-color: $white;
  border: 0;
  border-radius: 4px;
  bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  color: rgba($primary, .8);
  display: inline-flex;
  flex-flow: row nowrap;
  justify-content: flex-start;
  left: 12px;
  margin: 0;
  max-width: calc(100% - 24px);
  min-height: 60px;
  padding: 6px 12px;
  position: fixed;
  z-index: 1051;

  @media (min-width: $screen-sm-min) {
    bottom: 48px;
    left: 48px;
    max-width: calc(100% - 96px);
    padding: 12px 24px;
  }
}

.alert-danger {
  background-color: $white;
}

.alert-success {
  background-color: $white;
}

.alert-body {
  align-content: center;
  align-items: center;
  display: inline-flex;
  flex: 0 1 auto;
  flex-direction: row;
  font-family: $font-primary;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  margin: 0;
  min-height: 24px;
  text-align: left;
}

.alert .close {
  color: rgba($primary, .4);
  font-size: 24px;
  height: 24px;
  line-height: 24px;
  margin: 0 0 0 12px;
  min-width: 13px;
  opacity: 1;
  outline: none;
  padding: 0;
  text-shadow: none;

  @include anim(color);

  @media (min-width: $screen-sm-min) {
    margin: 0 0 0 24px;
  }

  > span:not([class]) {
    font-family: $font-primary;
    font-size: 22px;
    font-weight: 600;
    position: relative;
    top: -3px;
  }

  &:hover {
    color: rgba($primary, .6);
  }
}

.alert .spinner {
  flex: 0 0 auto;
  margin: 0 12px 0 0;

  @media (min-width: $screen-sm-min) {
    margin: 0 24px 0 0;
  }
}

.alert-undo-link {
  background: transparent;
  border-width: 0;
  color: $accent;
  font-family: $font-primary;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  margin: 0 0 0 12px;
  outline: none;
  padding: 0;
  text-transform: uppercase;

  @include anim(color);

  @media (min-width: $screen-sm-min) {
    margin: 0 0 0 24px;
  }

  &:hover {
    color: rgba($accent, .8);
  }
}

.slideInBottom {
  animation-name: slideInBottom;
}

.slideOutBottom {
  animation-name: slideOutBottom;
}

.slideInLeft {
  animation-name: slideInLeft;
}

.slideOutLeft {
  animation-name: slideOutLeft;
}

.animated {
  animation-duration: .2s;
  animation-fill-mode: both;
}

/* Page Alert
   ========================================================================== */

.alert.alert-inline {
  align-content: center;
  align-items: center;
  bottom: auto;
  box-shadow: none;
  display: flex;
  flex-flow: row nowrap;
  height: auto;
  justify-content: flex-start;
  left: auto;
  margin-bottom: 12px;
  max-width: 100%;
  padding: 12px;
  position: static;
  text-align: left;
  width: 100%;

  &.alert-inline--vcenter {
    > .close {
      align-self: flex-start;
      margin-top: 6px;
    }
  }

  > * {
    display: inline-block;
    flex: 0 1 auto;
    line-height: 24px;
    margin: 0 12px 0 0;
    min-height: 24px;

    &:last-child {
      margin: 0;
    }
  }

  > .alert-body {
    color: rgba($primary, .8);
    flex-grow: 1;
    flex-shrink: 1;
    font-family: $font-secondary;
    font-weight: 400;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;

    > .alert-link {
      border-bottom: 1px dashed rgba($primary, .4);
      color: rgba($primary, .8);
      font-weight: 700;

      @include anim(all);

      &:hover {
        border-bottom: 1px dashed rgba($accent, .4);
        color: $accent;
      }
    }
  }

  > .close {
    height: 24px;
  }
}

.alert.alert-inline.alert-warning {
  background: rgba($color-yellow, .1);

  > span[class*="icon-16"] {
    color: $color-yellow;
  }
}

.alert.alert-inline.alert-danger {
  background: rgba($color-red, .1);

  > span[class*="icon-16"] {
    color: $color-red;
  }
}

/* Dark Toast
   ========================================================================== */

.alert.alert-dark {
  background-color: rgba($primary, .9);
  color: $white;
  height: auto;
  line-height: 24px;
  min-height: 60px;

  .close {
    color: $white;

    &:hover {
      color: rgba($white, .6);
    }
  }
}

