@import '../../style/themes/index';
@import '../../style/mixins/index';

@message-prefix-cls: ~'@{ant-prefix}-message';

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

  position: fixed;
  top: 22px;
  left: 0;
  z-index: @zindex-message;
  width: 100%;
  font-size: @font-size-base;
  pointer-events: none;

  &-notice {
    margin-bottom: -2px;
    padding: 8px 0;
    text-align: center;
  }

  &-notice-content {
    display: inline-block;
    overflow: hidden;
    border-radius: @border-radius-base;
    box-shadow: @message-shadow;
    pointer-events: all;
  }

  &-success,
  &-error,
  &-warning,
  &-loading,
  &-info {
    padding: @message-padding;
  }

  &-warning {
    background: @message-warning-content-bg;
    border: 1px solid @message-warning-border-color;
    .@{iconfont-css-prefix} {
      color: @warning-color;
    }
  }

  &-success {
    background: @message-success-content-bg;
    border: 1px solid @message-success-border-color;
    .@{iconfont-css-prefix} {
      color: @success-color;
    }
  }

  &-info {
    background: @message-info-content-bg;
    border: 1px solid @message-info-border-color;
    .@{iconfont-css-prefix} {
      color: @info-color;
    }
  }

  &-error {
    background: @message-error-content-bg;
    border: 1px solid @message-error-border-color;
    .@{iconfont-css-prefix} {
      color: @error-color;
    }
  }

  &-loading {
    background: @message-loading-content-bg;
    border: 1px solid @message-loading-border-color;
    .@{iconfont-css-prefix} {
      color: @info-color;
    }
  }

  .@{iconfont-css-prefix} {
    position: relative;
    top: 1px;
    margin-right: 6px;
    font-size: @font-size-lg;
  }

  &-notice.move-up-leave.move-up-leave-active {
    animation-name: MessageMoveOut;
    animation-duration: 0.3s;
  }
}

@keyframes MessageMoveOut {
  0% {
    max-height: 150px;
    padding: 8px;
    opacity: 1;
  }
  100% {
    max-height: 0;
    padding: 0;
    opacity: 0;
  }
}

@import './rtl';
