@import '../styles/themes/themes.less';

.@{bk-prefix}-message {
  position: fixed;
  top: 20px;
  left: 50%;
  display: flex;
  min-width: 300px;
  padding: 10px 15px;
  font-size: 14px;
  color: @message-color;
  background: @message-primary-bg-color;
  border: 1px solid @message-primary-border-color;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0px 2px 4px 0px @message-primary-shadow-color;
  justify-content: space-between;

  .@{bk-prefix}-message-close {
    padding-left: 20px;
    margin-right: 0;
    font-size: 14px;
    color: @light-gray;
    cursor: pointer;

    &:hover {
      color: @gray-color;
    }
  }
}

.@{bk-prefix}-message-icon {
  display: inline-block;
  height: 18px;
  margin-right: 10px;
  font-size: 18px;
  color: @primary-color;
}

.@{bk-prefix}-message-primary {
  background: @message-primary-bg-color;
  border: 1px solid @message-primary-border-color;
}

.@{bk-prefix}-message-warning {
  background: @message-warning-bg-color;
  border: 1px solid @message-warning-border-color;
  box-shadow: 0px 2px 4px 0px @message-warning-shadow-color;
  .@{bk-prefix}-message-icon {
    color: @warning-color;
  }
}

.@{bk-prefix}-message-success {
  background: @message-success-bg-color;
  border: 1px solid @message-success-border-color;
  box-shadow: 0px 2px 4px 0px @message-success-shadow-color;
  .@{bk-prefix}-message-icon {
    color: @success-color;
  }
}

.@{bk-prefix}-message-error {
  background: @message-danger-bg-color;
  border: 1px solid @message-danger-border-color;
  box-shadow: 0px 2px 4px 0px @message-danger-shadow-color;
  .@{bk-prefix}-message-icon {
    color: @danger-color;
  }
}

.@{bk-prefix}-message-fade-enter-active,
.@{bk-prefix}-message-fade-leave-active {
  transition: margin .2s linear;
}

.@{bk-prefix}-message-fade-enter-from,
.@{bk-prefix}-message-fade-leave-to {
  margin-top: -50px;
  opacity: 0;
}

.@{bk-prefix}-message-content {
  display: flex;
  width: 100%;
  word-break: break-all;

  &.multi {
    flex-direction: column;
    position: relative;

    .overview {
      display: flex;
      justify-content: space-between;
      align-items: self-start;

      .left-content {
        display: flex;

        .describe {
          display: -webkit-box;
          max-width: 560px;
          max-height: 60px;
          overflow: hidden;
          text-overflow: ellipsis;
          -webkit-box-orient: vertical;
          line-clamp: 3;
          -webkit-line-clamp: 3;
        }
      }

      .tools {
        display: flex;
        align-items: center;

        .tool {
          display: flex;
          padding: 0 5px;
          font-size: 14px;
          cursor: pointer;
          align-items: center;

          .@{bk-prefix}-message-close {
            padding-left: 0;
          }

          .message-action-text {
            padding-left: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }

          &:not(.fix) {
            span {
              color: #3a84ff;
            }
          }

          &.fix {
            &.fixed {
              span {
                color: #3a84ff;
              }
            }

            span {
              color: #979ba5;
            }

            &:hover {
              span {
                color: #3a84ff;
              }
            }
          }

          &.close {
            span {
              color: #c4c6cc;

              &:hover {
                color: #979ba5;
              }
            }
          }
        }
      }
    }

    .message-detail {
      position: relative;
      margin-top: 10px;

      .message-tree {
        max-height: 480px;
        padding: 14px 32px;
        overflow: auto;
        background: #fff;
        border-radius: 2px;
        display: flex;
        flex-direction: column;

        .message-row {
          display: inline-flex;
          font-size: 14px;
          line-height: 34px;
          color: #313238;

          label {
            display: inline-block;
            width: 94px;
            min-width: 94px;
            margin-right: 8px;
            overflow: hidden;
            color: #63656e;
            text-align: right;
            text-overflow: ellipsis;
            white-space: nowrap;

            &::after {
              content: ':';
            }
          }

          .copy-value {
            padding-left: 4px;

            &:hover {
              background: rgba(186, 188, 192, 0.2);
              cursor: pointer;
              border-radius: 2px;
            }
          }
        }
      }

      .message-copy {
        position: absolute;
        top: 20px;
        right: 40px;
        font-size: 16px;
        top: 0px;
        right: 0px;
        font-size: 18px;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        border-radius: 0 2px 0 6px;
        cursor: pointer;
        justify-content: center;
        background: #F5F7FA;
        color: #9FA3AE;

        &:hover {
          background: #F0F5FF;
          span {
            color: #3a84ff;
          }
        }
      }

      .copy-status {
        display: none;
        padding-bottom: 4px;

        .inner {
          position: relative;
          display: flex;
          padding: 6px 8px;
          font-size: 12px;
          line-height: 20px;
          color: #63656e;
          background: #fff;
          border: 1px solid #dcdee5;
          box-shadow: 0 2px 6px 0 #0000001a;
          align-items: center;

          span {
            margin-right: 4px;
          }

          &::after {
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 8px;
            height: 8px;
            background: #fff;
            border-color: #dcdee5;
            border-style: solid;
            border-width: 0px 1px 1px 0px;
            content: '';
            transform: translate(0, 4px) rotate(45deg);
            box-shadow: 5px 3px 6px 0 #0000001a;
            box-sizing: border-box;
          }
        }

        &.success {
          .inner {
            span {
              color: #2dcb9d;
            }
          }
        }

        &.error {
          .inner {
            span {
              color: #ea3636;
            }
          }
        }

        &.is-show {
          position: absolute;
          top: 0;
          left: 0;
          display: inline-flex;
          white-space: nowrap;
          transform: translate(-50%, -100%);
        }

        &.is-hidden {
          display: none;
        }
      }
    }
  }
}
