// mixins for button
// ------------------------
.button-color(@border; @background) {
  border-color: @border;
  background: @background;
}

.button-variant-other(@hover-color; @active-color) {
  &:hover,
  &:focus {
    color: @hover-color;
  }

  &:active {
    color: @active-color;
  }
}

.button-variant-primary-override(@hover-color; @hover-background: @hover-color; @active-color; @active-background: @active-color) {
  &:hover,
  &:focus {
    .button-color(@hover-color; @hover-background);
  }

  &:active {
    .button-color(@active-color; @active-background);
  }
}

// Base styles of buttons
// --------------------------------------------------
// primary button style
.btn-primary() {
  .button-variant-primary-override(@btn-primary-hover-bg; @btn-primary-hover-bg; @btn-primary-active-bg; @btn-primary-active-bg);
  .button-variant-other(@btn-primary-color; @btn-primary-color);
}

// default button style
.btn-default() {
  .button-variant-primary-override(@btn-primary-hover-bg; transparent; @btn-primary-active-bg; transparent);
  .button-variant-other(@btn-primary-hover-bg, @btn-primary-active-bg);
}

// ghost button style
.btn-ghost() {
  .button-variant-primary-override(@btn-ghost-hover-bg; transparent; @btn-ghost-active-bg; transparent);
}

// dashed button style
.btn-dashed() {
  .button-variant-primary-override(@btn-primary-hover-bg; transparent; @btn-primary-active-bg; transparent);
}

// danger button style
.btn-danger() {
  .button-variant-primary-override(@btn-danger-hover-bg; @btn-danger-hover-bg; @btn-danger-active-bg; @btn-danger-active-bg);
  .button-variant-other(@btn-danger-color; @btn-danger-color);
}

// danger default button style
.btn-danger-default() {
  .button-variant-primary-override(@btn-danger-hover-bg; transparent; @btn-danger-active-bg; transparent);
  .button-variant-other(@btn-danger-hover-bg; @btn-danger-active-bg);
}

// link button style
.btn-link() {
  .button-variant-primary-override(transparent; transparent; transparent; transparent);
}

// text button style
.btn-text() {
  color: @btn-text-color;
  .button-variant-primary-override(transparent; transparent; transparent; transparent);
}

// danger link button style
.btn-danger-link() {
  .button-variant-primary-override(transparent; transparent; transparent; transparent);
  .button-variant-other(@btn-danger-hover-bg; @btn-danger-active-bg);
  &:hover,
  &:focus {
    .button-color(transparent; transparent);
  }
  &:active {
    .button-color(transparent; transparent);
  }
}

.btn-danger-text() {
  .button-variant-other(@btn-danger-hover-bg; @btn-danger-active-bg);
}

.btn-background-ghost-primary {
  .button-variant-primary-override(@btn-primary-hover-bg; @btn-primary-hover-bg; @btn-primary-active-bg; @btn-primary-active-bg);
  .button-variant-other(@btn-primary-hover-bg; @btn-primary-active-bg);
}

.btn-background-ghost-danger {
  .button-variant-primary-override(@btn-danger-hover-bg; @btn-danger-hover-bg; @btn-danger-active-bg; @btn-danger-active-bg);
  .button-variant-other(@btn-danger-hover-bg; @btn-danger-active-bg);
}
