@import "mixins/mixins";
@import "common/var";
@mixin message_init_content_some($color) {
  .el-message__content {
    color: $color;
    width: 100%;
    font-weight: 400;
    .header {
      display: flex;
      p {
        color: rgba(0, 16, 47, 0.85);
        // margin-left: -5px;
        line-height: 20px;
        font-weight: 400;
      }
      span {
        flex: 1;
        text-align: right;
        cursor: pointer;
      }
      @include e(closeBtn) {
        position: absolute;
        top: 17px;
        right: 10px;
        transform: translateY(-50%);
        cursor: pointer;
        color: $color;
        font-weight: 800;
      }
    }
    .content {
      margin: 0px 24px;
      padding-bottom: 8px;
      p {
        color: rgba(0, 16, 47, 0.65);
        line-height: 20px;
      }
      span {
        display: inline-block;
        padding-top: 8px;
        color: $--color-primary;
        cursor: pointer;
      }
    }
  }
}
@include b(message) {
  min-width: $--message-min-width;
  box-sizing: border-box;
  border-radius: $--border-radius-base;
  border-width: $--border-width-base;
  border-style: $--border-style-base;
  border-color: $--border-color-lighter;
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  background-color: $--message-background-color;
  transition: opacity 0.3s, transform 0.4s, top 0.4s;
  overflow: hidden;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  @include when(center) {
    justify-content: center;
  }

  @include when(closable) {
    .el-message__content {
      padding-right: 16px;
    }
  }

  p {
    margin: 0;
  }

  @include m(info) {
    background-color: $--alert-info-color;
    border: 1px solid $--color-primary;
    @include message_init_content_some($--message-info-font-color);
    .el-message__content {
      color: $--message-info-font-color;
    }
  }
  @include m(success) {
    background-color: $--alert-success-color;
    border-color: $--color-success;
    @include message_init_content_some($--message-success-font-color);
  }

  @include m(warning) {
    background-color: $--alert-warning-color;
    border-color: $--color-warning;
    @include message_init_content_some($--message-warning-font-color);
  }

  @include m(error) {
    background-color: $--alert-danger-color;
    border-color: $--color-danger;
    @include message_init_content_some($--message-danger-font-color);
  }

  @include e(icon) {
    font-size: $--alert-icon-size;
    width: $--alert-icon-size;
    margin-right: 8px;
    margin-top: 2px;
  }

  @include e(content) {
    padding: 0;
    font-size: 12px;
    line-height: 1;
    &:focus {
      outline-width: 0;
    }
  }

  // @include e(closeBtn) {
  //   position: absolute;
  //   top: 15px;
  //   right: 10px;
  //   transform: translateY(-50%);
  //   cursor: pointer;
  //   color: $--message-close-icon-color;
  //   font-size: $--message-close-size;
  //   &:focus {
  //     outline-width: 0;
  //   }
  //   &:hover {
  //     color: $--message-close-hover-color;
  //   }
  // }

  & .el-icon-success {
    color: $--message-success-font-color;
  }

  & .el-icon-error {
    color: $--message-danger-font-color;
  }

  & .el-icon-info {
    color: $--message-info-font-color;
  }

  & .el-icon-warning {
    color: $--message-warning-font-color;
  }
}

.el-message-fade-enter,
.el-message-fade-leave-active {
  opacity: 0;
  transform: translate(-50%, -100%);
}
