@charset "UTF-8";
@import "common/var";
@import "mixins/button";
@import "mixins/mixins";
@import "mixins/utils";
@import "./icon";

@mixin defalut-button-hover-color(){
  border-color: $--button-default-border-color-hover-ckb;
  color: $--button-default-color-hover-ckb;
  [data-theme="ckb-symbol"] & {
    border-color: $--button-default-border-color-hover-ckb;
    color: $--button-default-color-hover-ckb;
  }
  [data-theme="yjb-symbol"] & {
    border-color: $--button-default-border-color-hover-yjb;
    color: $--button-default-color-hover-yjb;
  }
  [data-theme="sz-symbol"] & {
    border-color: $--button-default-border-color-hover-sz;
    color: $--button-default-color-hover-sz;
  }
}

@mixin defalut-button-active-color(){
  border-color: $--button-default-border-color-active-ckb;
  color: $--button-default-color-active-ckb;
  [data-theme="ckb-symbol"] & {
    border-color: $--button-default-border-color-active-ckb;
    color: $--button-default-color-active-ckb;
  }
  [data-theme="yjb-symbol"] & {
    border-color: $--button-default-border-color-active-yjb;
    color: $--button-default-color-active-yjb;
  }
  [data-theme="sz-symbol"] & {
    border-color: $--button-default-border-color-active-sz;
    color: $--button-default-color-active-sz;
  }
}
@mixin defalut-button-disabled-color(){
  border-color: $--button-default-border-color-disabled-ckb;
  color: $--button-default-color-disabled-ckb;
  [data-theme="ckb-symbol"] & {
    border-color: $--button-default-border-color-disabled-ckb;
    color: $--button-default-color-disabled-ckb;
  }
  [data-theme="yjb-symbol"] & {
    border-color: $--button-default-border-color-disabled-yjb;
    color: $--button-default-color-disabled-yjb;
  }
  [data-theme="sz-symbol"] & {
    border-color: $--button-default-border-color-disabled-sz;
    color: $--button-default-color-disabled-sz;
  }
}

@include b(button) {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: $--border-base;
  -webkit-appearance: none;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  margin: 0;
  transition: .1s;
  background-color: $--color-white;
  border-radius: $--border-radius-base;
  border-color: $--button-default-border-color-ckb;
  color: $--button-default-color-ckb;
  max-height: $--button-max-height;

  @include utils-user-select(none);
  & + & {
    margin-left: 10px;
  }

  @include button-size($--button-padding-vertical, $--button-padding-horizontal, $--button-font-size, $--button-min-width, $--button-max-height);

  &:hover {
    border-color: $--button-default-border-color-hover-ckb;
    color: $--button-default-color-hover-ckb;
  }
  &:active {
    border-color: $--button-default-border-color-active-ckb;
    color: $--button-default-color-active-ckb;
    outline: none;
  }

  &::-moz-focus-inner {
    border: 0;
  }

  & [class*="xb_icon_"] {
    & + span {
      margin-left: 5px;
    }
  }
  // &.xb-button--default,&.xb-button--table{
  //   [class*="xb_icon_"] {
  //     color: #909399;
  //   }
  // } 

  @include when(disabled) {
    &,
    &:hover,
    &:focus {
      cursor: not-allowed;
      background-image: none;
      border-color: $--button-default-border-color-disabled-ckb;
      color: $--button-default-color-disabled-ckb;
    }

    &.xb-button--text {
      background-color: transparent;
    }
  }

  @include when(jiazai) {
    position: relative;
    pointer-events: none;

    &:before {
      pointer-events: none;
      content: '';
      position: absolute;
      left: -1px;
      top: -1px;
      right: -1px;
      bottom: -1px;
      border-radius: inherit;
      background-color: rgba(255,255,255,.35);
    }
  }
  @include m(default) {
    color: $--button-default-color-ckb;
    border-color: $--button-default-border-color-ckb;
    [data-theme="ckb-symbol"] & {
      border-color: $--button-default-border-color-ckb;
      color: $--button-default-color-ckb;
    }
    [data-theme="yjb-symbol"] & {
      border-color: $--button-default-border-color-yjb;
      color: $--button-default-color-yjb;
    }
    [data-theme="sz-symbol"] & {
      border-color: $--button-default-border-color-sz;
      color: $--button-default-color-sz;
    }
    &:hover {
      @include defalut-button-hover-color;
    }
    &:active {
      @include defalut-button-active-color;
    }
    @include when(disabled){
      &,
      &:hover,
      &:focus {
        cursor: not-allowed;
        background-image: none;
        @include defalut-button-disabled-color;
      }
    }
  }
  @include m(primary) {
    @include button-variant($--color-white, $--button-primary-color-ckb, $--button-primary-color-ckb);
    [data-theme="ckb-symbol"] & {
      @include button-variant($--color-white, $--button-primary-color-ckb, $--button-primary-color-ckb);
    }
    [data-theme="yjb-symbol"] & {
      @include button-variant($--color-white, $--button-primary-color-yjb, $--button-primary-color-yjb);
    }
    [data-theme="sz-symbol"] & {
      @include button-variant($--color-white, $--button-primary-color-sz, $--button-primary-color-sz);
    }
  }
  @include m(success) {
    @include button-variant($--color-white, $--button-success-color-ckb, $--button-success-color-ckb);
    [data-theme="ckb-symbol"] & {
      @include button-variant($--color-white, $--button-success-color-ckb, $--button-success-color-ckb);
    }
    [data-theme="yjb-symbol"] & {
      @include button-variant($--color-white, $--button-success-color-yjb, $--button-success-color-yjb);
    }
    [data-theme="sz-symbol"] & {
      @include button-variant($--color-white, $--button-success-color-sz, $--button-success-color-sz);
    }
  }
  @include m(warning) {
    @include button-variant($--color-white, $--button-warning-color-ckb, $--button-warning-color-ckb);
    [data-theme="ckb-symbol"] & {
      @include button-variant($--color-white, $--button-warning-color-ckb, $--button-warning-color-ckb);
    }
    [data-theme="yjb-symbol"] & {
      @include button-variant($--color-white, $--button-warning-color-yjb, $--button-warning-color-yjb);
    }
    [data-theme="sz-symbol"] & {
      @include button-variant($--color-white, $--button-warning-color-sz, $--button-warning-color-sz);
    }
  }
  @include m(danger) {
    @include button-variant($--color-white, $--button-danger-color-ckb, $--button-danger-color-ckb);
    [data-theme="ckb-symbol"] & {
      @include button-variant($--color-white, $--button-danger-color-ckb, $--button-danger-color-ckb);
    }
    [data-theme="yjb-symbol"] & {
      @include button-variant($--color-white, $--button-danger-color-yjb, $--button-danger-color-yjb);
    }
    [data-theme="sz-symbol"] & {
      @include button-variant($--color-white, $--button-danger-color-sz, $--button-danger-color-sz);
    }
  }
  @include m(text) {
    border-color: $--color-white;
    border:none;
    color: $--button-text-color;
    background-color: $--color-white;
    padding-left: 0;
    padding-right: 0;

    &:hover,
    &:focus,
    &:active {
      color: $--button-text-color;
      border-color: $--color-white;
      background-color: $--color-white;
    }

    &.is-disabled,
    &.is-disabled:hover,
    &.is-disabled:focus {
      border-color: $--color-white;
      color: mix($--button-text-color, $--color-white, 45%);
    }
  }
  @include m(more) {
    border:none;
    color: #F13B3A;
    background-color: $--color-white;
    padding-left: 0;
    padding-right: 0;
    &:hover,
    &:focus,
    &:active {
      color: #F13B3A;
    }
    .xb-icon--right{
      margin-left: 0;
    }
  }
  &.xb-button--table, &.xb-button--table-border{
    & + &{
      margin: 0;
      margin-right: 18px;
    }
    margin-right: 18px;
    
    background: transparent;
    color: $--color-text-content;
    &:nth-of-type(3n){
      margin-right: 0;
    }
    i{
      color: #909399;
      font-size: 12px;
    }

    &:hover, &:hover i{
      color:$--button-table-hover-color;
    }
    &:focus, &:focus i{
      color:$--button-table-focus-color;
    }
  }
  &.xb-button--table-border{
    &:hover{
      border-color:$--button-table-hover-color;
    }
    &:focus{
      border-color:$--button-table-focus-color;
    }
  }
  &.xb-button--table{
    border:none;
  }
  @include m(big) {
    @include button-size($--button-big-padding-vertical, $--button-big-padding-horizontal, $--button-big-font-size, $--button-big-min-width, $--button-big-max-height);
  }
  @include m(medium) {
    @include button-size($--button-padding-vertical, $--button-padding-horizontal, $--button-font-size, $--button-min-width, $--button-max-height);
  }
  @include m(small) {
    @include button-size($--button-small-padding-vertical, $--button-small-padding-horizontal, $--button-small-font-size, $--button-small-min-width, $--button-small-max-height);
  }
}

@include b(button-group) {
  @include utils-clearfix;
  display: inline-block;
  vertical-align: middle;

  & > .xb-button {
    float: left;
    position: relative;
    & + .xb-button {
      margin-left: 0;
    }
    &.is-disabled {
      z-index: 1;
    }
    &:first-child {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
    &:last-child {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
    &:first-child:last-child {
      border-radius: $--border-radius-base;

      &.is-round {
        border-radius: 20px;
      }

      &.is-circle {
        border-radius: 50%;
      }
    }
    &:not(:first-child):not(:last-child) {
      border-radius: 0;
    }
    &:not(:last-child) {
      margin-right: -1px;
    }

    &:hover,
    &:focus,
    &:active {
      z-index: 1;
    }

    @include when(active) {
      z-index: 1;
    }
  }
  
  & > .xb-dropdown {
    & > .xb-button {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
      border-left-color: rgba($--color-white, 0.5);
    }
  }

  @each $type in (primary, success, warning, danger, info) {
    .xb-button--#{$type} {
      &:first-child {
        border-right-color: rgba($--color-white, 0.5);
      }
      &:last-child {
        border-left-color: rgba($--color-white, 0.5);
      }
      &:not(:first-child):not(:last-child) {
        border-left-color: rgba($--color-white, 0.5);
        border-right-color: rgba($--color-white, 0.5);
      }
    }
  }
  @include m(search-button){
    .xb-button{
      border: 1px solid #F59A99;
      padding:8px 12px;
      box-sizing: border-box;
      min-width: 70px;
      color:#FF3B12;
      background:#FEEBEC;
      [class*="xb_icon_"] + span{
        margin-left: 2px;
      }
    }
    .xb-button + .xb-button{
      border: 1px solid #DCDFE6;
      border-left: none;
      color:#666666;
      margin-left: 1px;
      background: #ffffff;
    }
  }
}

.xb-icon-spinner {
  width: 28px;
  height: 28px;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  zoom:0.45;
  margin-right:20px;
  .container1 > div, .container2 > div, .container3 > div {
    width: 4px;
    height: 4px;
    background-color: #fff;

    border-radius: 100px;
    position: absolute;
    animation: bouncedelay 1.2s infinite ease-in-out;
    animation-fill-mode: both;
  }
  .spinner-container {
    position: absolute;
    width: 100%;
    height: 100%;
  }

  .container2 {
    transform: rotateZ(45deg);
  }

  .container3 {
    transform: rotateZ(90deg);
  }

  .circle1 {
    top: 0;
    left: 0;
  }
  .circle2 {
    top: 0;
    right: 0;
  }
  .circle3 {
    right: 0;
    bottom: 0;
  }
  .circle4 {
    left: 0;
    bottom: 0;
  }

  .container2 .circle1 {
    animation-delay: -1.1s;
  }
  .container3 .circle1 {
    animation-delay: -1s;
  }
  .container1 .circle2 {
    animation-delay: -0.9s;
  }
  .container2 .circle2 {
    animation-delay: -0.8s;
  }
  .container3 .circle2 {
    animation-delay: -0.7s;
  }
  .container1 .circle3 {
    animation-delay: -0.6s;
  }
  .container2 .circle3 {
    animation-delay: -0.5s;
  }
  .container3 .circle3 {
    animation-delay: -0.4s;
  }
  .container1 .circle4 {
    animation-delay: -0.3s;
  }
  .container2 .circle4 {
    animation-delay: -0.2s;
  }
  .container3 .circle4 {
    animation-delay: -0.1s;
  }
}


@keyframes bouncedelay {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}