@message-cls: ~"@{prefix}-message";

.bp-mask-message {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 999;
}

.bp-message-bottom {
  bottom: 0;

  .@{message-cls}-list {
    bottom: 40px;
  }
}

.bp-message-top {
  top: 0;

  .@{message-cls}-list {
    top: 40px;
  }
}

.@{message-cls}-list {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;

  .@{message-cls} {
    min-width: 80px;
    width: max-content;
    height: 46px;
    border-radius: 6px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    line-height: 1;
    text-align: center;
    list-style: none;
    overflow: hidden;
    .no-select;

    &-icon {
      width: 18px;
      height: 18px;
      margin-right: 6px;
    }
    .icon-loading {
      .bp-icon {
        display: inline-block;
        fill: @primary-6;
        animation: rotating 0.8s linear infinite;
        -webkit-animation: rotating 0.8s linear infinite;
      }
    }
    .icon-success {
      .bp-icon {
        fill: @success-6;
      }
    }
    .icon-error {
      .bp-icon {
        fill: @danger-6;
      }
    }
    .icon-warning {
      .bp-icon {
        fill: @warning-6;
      }
    }

    &-content {
      font-size: 14px;
      font-weight: normal;
      letter-spacing: 0.2px;
      color: @gary-10;
    }

    &-close {
      margin-left: 6px;

      .bp-icon {
        width: 18px;
        height: 18px;
        fill: @gary-7;
        cursor: pointer;
        padding: 2px;
        border-radius: 10px;
        transition: all 0.2s ease;

        &:hover {
          fill: @gary-9;
          background-color: @gary-3;
          transition: all 0.2s ease;
        }
      }
    }
  }

  .@{message-cls}-text,
  .@{message-cls}-loading {
    background: @gary-1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid @gary-4;

    .@{message-cls}-content {
      color: @gary-10;
    }
  }

  .@{message-cls}-success {
    background-color: @success-0;
    border: 1px solid @success-7;
    box-shadow: 0 4px 12px rgba(32, 145, 36, 0.1);

    .@{message-cls}-content {
      color: @success-7;
    }
  }

  .@{message-cls}-warning {
    background-color: @warning-0;
    border: 1px solid @warning-7;
    box-shadow: 0 4px 12px rgba(212, 107, 8, 0.1);

    .@{message-cls}-content {
      color: @warning-7;
    }
  }

  .@{message-cls}-error {
    background-color: @danger-0;
    border: 1px solid @danger-7;
    box-shadow: 0 4px 12px rgba(207, 19, 43, 0.1);

    .@{message-cls}-content {
      color: @danger-7;
    }
  }

  .@{message-cls}-plain {
    background: @gary-1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid @gary-4;

    &-icon {
      .bp-icon {
        width: 18px;
        height: 18px;
      }
    }

    .icon-success {
      .bp-icon {
        fill: @success-6;
      }
    }
    .icon-error {
      .bp-icon {
        fill: @danger-6;
      }
    }
    .icon-warning {
      .bp-icon {
        fill: @warning-6;
      }
    }
    .icon-loading {
      .bp-icon {
        fill: @primary-6;
      }
    }

    &-content {
      color: @gary-10;
    }

    &-close {
      .bp-icon {
        fill: @gary-7;

        &:hover {
          fill: @gary-8;

          &::before {
            background-color: @gary-4;
          }
        }
      }
    }
  }
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
    -webkit-transform: rotate(365deg);
  }
}

.fademsg-move,
.fademsg-enter-active,
.fademsg-leave-active {
  transition: all 0.2s cubic-bezier(0, 0, 1, 1);
}
.fademsg-enter-from,
.fademsg-leave-to {
  opacity: 0;
}
.fademsg-leave-active {
  position: absolute;
}
