@import (reference) './variable.less';

@buttonPrefix: ant-button;

.@{buttonPrefix} {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: auto;
  line-height: normal;
  padding: @button-padding;
  border-radius: 50vh;
  border: 0 none;
  box-sizing: border-box;
  font-size: @button-font-size;
  z-index: 2;

  &-large {
    font-size: @button-large-font-size;
    padding: @button-padding;
  }

  &-medium {
    font-size: @button-medium-font-size;
    padding: @button-medium-padding;
  }

  &-small {
    font-size: @button-small-font-size;
    padding: @button-small-padding;
  }

  &-primary {
    color: @button-primary-color;
    background-color: @button-primary-background-color;
    box-shadow: inset 0 0 0 @button-border-size @button-primary-background-color;
  }

  &-default {
    color: @button-color;
    background-color: @button-background-color;
    box-shadow: inset 0 0 0 @button-border-size @button-border-color;
  }

  &-capsule {
    color: @button-primary-color;
    background-color: @button-default-aide-border-color;
    box-shadow: none;
  }
  &-primary-aide {
    background-color: @button-primary-aide-background-color;
    box-shadow: inset 0 0 0 @button-border-size
      @button-primary-aide-border-color;
    color: @button-color;
  }

  &-default-aide {
    color: @button-default-aide-color;
    background-color: @button-default-aide-background-color;
    box-shadow: inset 0 0 0 @button-border-size
      @button-default-aide-border-color;
  }

  &-text {
    color: @button-color;
    background-color: transparent;
    box-shadow: none;
  }

  &-primary-danger {
    color: @button-primary-danger-color;
    background-color: @button-primary-danger-background-color;
    box-shadow: inset 0 0 0 @button-border-size
      @button-primary-danger-border-color;
  }

  &-default-danger {
    color: @button-default-danger-color;
    background-color: @button-default-danger-background-color;
    box-shadow: inset 0 0 0 @button-border-size
      @button-default-danger-border-color;
  }

  &-text-danger {
    color: @button-text-danger-color;
    background-color: transparent;
    box-shadow: none;
  }

  &-text-active {
    background-color: @button-active-bg;
  }

  &-active {
    filter: brightness(0.92);
  }

  &-disabled {
    opacity: @button-disabled-opacity;
  }

  &-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  &-content-text-margin {
    margin-left: @h-spacing-standard;
  }
  &-content-text {
    /// #if ALIPAY
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /// #endif
    &:empty {
      margin-left: 0;
      width: 0;
      opacity: 0;
      &::after {
        content: '\00a0';
      }
    }
  }

  &-content-subtext {
    font-size: @button-subtext-size;
    opacity: 0.6;
  }

  &-content-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 33px;
    height: 16px;
    margin-left: 8px;
  }

  &-content-loading {
    position: relative;
  }

  &-inline {
    /// #if ALIPAY
    display: inline-block;
    /// #endif
    /// #if WECHAT
    display: inline-flex;
    /// #endif
    border-radius: @button-corner-radius;

    .@{buttonPrefix}-content-loading-container {
      width: @button-icon-size;
      height: @button-icon-size;
    }

    .@{buttonPrefix}-content-loading {
      transform: scale(0.5);
    }
  }

  /// #if WECHAT
  &::after {
    border-width: 0;
  }
  /// #endif
}
