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

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

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

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

  &-notice {
    padding: 8px;
    text-align: center;
  }

  &-notice-content {
    display: inline-block;
    box-shadow: @box-shadow-base;
    pointer-events: all;
  }

  &-success,
  &-error,
  &-warning,
  &-info,
  &-loading {
    padding: @message-notice-content-padding;
    border-radius: @message-border-radius;
    color: @message-content-bg;
  }

  // success按钮样式调整
  &-success {
    background-color: @message-success-bg;
  }

  &-error {
    background-color: @message-error-bg;
  }

  &-warning {
    background-color: @message-warning-bg;
  }

  &-info {
    background-color: @message-info-bg;
  }

  &-loading {
    background-color: #45A8E6;
    color: #fff;
  }

  &-success .@{iconfont-css-prefix},
  &-info .@{iconfont-css-prefix},
  &-error .@{iconfont-css-prefix},
  &-warning .@{iconfont-css-prefix} {
    color: @message-content-bg;
  }

  &-loading .@{iconfont-css-prefix} {
    color: #fff;
  }

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

  &-notice.@{ant-prefix}-move-up-leave.@{ant-prefix}-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';
