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

@message-prefix-cls: ~'@{wd-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;
    padding: @message-notice-content-padding;
    background: @message-notice-content-bg;
    border-radius: @border-radius-base;
    box-shadow: @message-notive-content-shadow;
    pointer-events: all;

    &__box {
      display: flex;
      align-items: flex-start;
      flex-direction: column;
    }

    &__title {
      color: @message-notice-content-color;
      line-height: @message-line-height;
      margin-bottom: @margin-xss;
    }

    &__message {
      color: @message-notice-content-message-color;
      line-height: @message-line-height;
    }

    &__icon {
      position: relative;
      display: flex;
      align-items: center;
      &::before {
        position: absolute;
        content: '';
        display: block;
        width: @message-icon-font-size;
        height: @message-icon-font-size;
        border-radius: @message-icon-font-size;
        width: 15px;
        top: 50%;
        height: 15px;
        background-color: #fff; // 添加白色底色
        border-radius: 15px;
        left: 50%;
        transform: translate(-50%, -50%);
      }
    }
  }

  &-custom-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    color: @message-notice-content-color;

    span {
      line-height: @message-line-height;
    }
  }

  &-notice-title {
    .@{message-prefix-cls}-notice-content {
      padding: @message-notice-content-title-padding;
    }
  }

  &-success .@{iconfont-css-prefix} {
    color: @fluctuation-fall-fall;
  }

  &-error .@{iconfont-css-prefix} {
    color: @fluctuation-rise-rise;
  }

  &-warning .@{iconfont-css-prefix} {
    color: @trade-selling-sellinging;
  }

  &-info .@{iconfont-css-prefix},
  &-loading .@{iconfont-css-prefix} {
    color: @trade-buy-buy;
  }

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

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

  &-close {
    cursor: pointer;
    margin-left: 24px;
    padding: 0;
    overflow: hidden;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;

    .@{iconfont-css-prefix} {
      margin-right: 0;
      // font-size: 12px;
      font-size: @font-size-lg;
      color: @message-close-icon-color;
    }
  }
}

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

  100% {
    max-height: 0;
    padding: 0;
    opacity: 0;
  }
}

@import './rtl';
