@notification-prefix-cls: ~'@{css-prefix}notification';

@notification-padding-vertical: @padding-md;
@notification-padding-horizontal: @padding-md;
@notification-padding: @notification-padding-vertical @notification-padding-horizontal;



.@{notification-prefix-cls} {
  .reset-component;

  position: fixed;
  width: @notification-width;
  max-width: @notification-max-width;
  margin-right: @notification-margin;

  &-topLeft,
  &-bottomLeft {
    margin-left: @notification-margin;
    margin-right: 0;

    .@{notification-prefix-cls}-fade-enter-to.@{notification-prefix-cls}-fade-enter-active,
    .@{notification-prefix-cls}-fade-appear.@{notification-prefix-cls}-fade-appear-active {
      animation-name: NotificationLeftFadeIn;
    }
  }

  &-close-icon {
    font-size: @font-size-sm;
    cursor: pointer;
  }

  &-notice {
    padding: @notification-padding;
    border-radius: @border-radius-base;
    box-shadow: @shadow-md;
    background: @notification-component-background;
    line-height: @line-height-md;
    position: relative;
    margin-bottom: @notification-margin-bottom;
    overflow: hidden;

    &-message {
      font-size: @font-size-md;
      font-weight: @font-weight-bold;
      color: @notification-heading-color;
      margin-bottom: @notification-message-margin;
      line-height: @line-height-md;
      display: inline-block;
    }

    &-description {
      font-size: @font-size-sm;
      line-height: @line-height-sm;
      color: @notification-description-color;
    }

    &-closable &-message {
      padding-right: @notification-margin;
    }

    &-with-icon &-message {
      margin-left: @notification-margin;
      margin-bottom: @notification-message-with-icon-margin;
    }

    &-with-icon &-description {
      margin-left: @notification-margin;
      font-size: @font-size-sm;
    }

    &-icon {
      position: absolute;
      font-size: @font-size-lg;
      height: @line-height-md;
      display: flex;
      align-items: center;

      &-success {
        fill: @success-color;
      }
      &-info {
        fill: @info-color;
      }
      &-warning {
        fill: @warning-color;
      }
      &-error {
        fill: @danger-color;
      }
    }

    &-close {
      position: absolute;
      height: @line-height-md;
      display: flex;
      align-items: center;
      right: @notification-padding-horizontal;
      top: @notification-padding-vertical;
      color: @notification-close-icon-color;
      outline: none;

      a&:focus {
        text-decoration: none;
      }

      &:hover {
        color: shade(@notification-close-icon-color, 40%);
      }
    }

    &-btn {
      float: right;
      margin-top: @notification-btn-margin;
    }
  }

  .notification-fade-effect {
    animation-duration: 0.24s;
    animation-fill-mode: both;
    animation-timing-function: @notification-ease-in-out;
  }

  &-fade-enter,
  &-fade-appear {
    opacity: 0;
  }
  
  &-fade-enter-to&-fade-enter-active,
  &-fade-appear&-fade-appear-active {
    .notification-fade-effect();
    animation-name: NotificationFadeIn;
  }

  &-fade-leave-to&-fade-leave-active {
    .notification-fade-effect();
    animation-name: NotificationFadeOut;
    animation-duration: 0.2s;
  }
}

@keyframes NotificationFadeIn {
  0% {
    opacity: 0;
    left: @notification-width;
  }
  100% {
    left: 0;
    opacity: 1;
  }
}

@keyframes NotificationLeftFadeIn {
  0% {
    opacity: 0;
    right: @notification-width;
  }
  100% {
    right: 0;
    opacity: 1;
  }
}

@keyframes NotificationFadeOut {
  0% {
    opacity: 1;
    margin-bottom: @notification-margin-bottom;
    padding-top: @notification-padding;
    padding-bottom: @notification-padding;
    max-height: 150px;
  }
  100% {
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
  }
}
