$hover: 24;
.btn:focus, .btn:active:focus, .btn.active:focus,
.btn.focus, .btn:active.focus, .btn.active.focus {
  outline: none;
}

.btn {
  border-radius: 2px;
  transition: all 0.1s ease;
  padding: 0rem 1rem;
  min-height: 2.3rem;
  line-height: 2.3rem;
  font-size: 0.9rem;

  &[disabled] {
    cursor: no-drop;
  }
}

@mixin styleButton($color, $borderColor) {
  background: $color;
  border-color: $borderColor;
}

@mixin buttonColor($color, $borderColor) {
  @include styleButton($color, $borderColor);

  &.disabled,
  &[disabled],
  fieldset[disabled] &,
  &.disabled:hover,
  &[disabled]:hover,
  fieldset[disabled] &:hover,
  &.disabled:focus,
  &[disabled]:focus,
  fieldset[disabled] &:focus,
  &.disabled.focus,
  &[disabled].focus,
  fieldset[disabled] &.focus,
  &.disabled:active,
  &[disabled]:active,
  fieldset[disabled] &:active,
  &.disabled.active,
  &[disabled].active,
  fieldset[disabled] &.active {
    @include styleButton($color, $borderColor);
    &:hover {
      transform: none;
    }
  }

  &:focus {
    @include styleButton($color, $borderColor);
  }

  &:hover, &.focus, &:active, &.active {
    @include styleButton(lighten($color, 5%), lighten($borderColor, 5%));
  }
}

@mixin openDropdownButton($color, $dark-color) {
  @include styleButton($color, $hover);
  background-color: $dark-color;
  border-color: $dark-color;
}

@mixin buttonDropdownMenu($color) {
  & + .dropdown-menu {
    > .dropdown-item {
      > a {
        &:hover {
          color: white;
          background-color: $color!important;
        }
      }
    }
  }
}

.open > .btn.dropdown-toggle {
  &.btn.btn-default {
    @include openDropdownButton($sidebar, $sidebar-border);
    @include buttonDropdownMenu($sidebar);
  }
  &.btn.btn-primary {
    @include openDropdownButton($primary, $primary-dark);
    @include buttonDropdownMenu($primary);
  }
  &.btn-success {
    @include openDropdownButton($success, $success-dark);
    @include buttonDropdownMenu($success);
  }
  &.btn-info {
    @include openDropdownButton($info, $info-dark);
    @include buttonDropdownMenu($info);
  }
  &.btn-warning {
    @include openDropdownButton($warning, $warning-dark);
    @include buttonDropdownMenu($warning);
  }
  &.btn-danger {
    @include openDropdownButton($danger, $danger-dark);
    @include buttonDropdownMenu($danger);
  }
}

a.btn.btn-primary,
button.btn.btn-primary {
  @include buttonColor($primary, $primary);
  &:active, &:target {
    background-color: $primary-dark;
  }
}

a.btn.btn-default,
button.btn.btn-default {
  border-width: 1px;
  color: $content-text;
  @include buttonColor($sidebar, $sidebar-border);
  &.active, &:active, &:target {
    background-color: rgba(0, 0, 0, 0.2);
    color: $default-text;
  }
}

a.btn.btn-success,
button.btn.btn-success {
  @include buttonColor($success, $success);
  &:active, &:target {
    background-color: $success-dark;
  }
}

a.btn.btn-info,
button.btn.btn-info {
  @include buttonColor($info, $info);
  &:active, &:target {
    background-color: $info-dark;
  }
}

a.btn.btn-warning,
button.btn.btn-warning {
  @include buttonColor($warning, $warning);
  &:active, &:target {
    background-color: $warning-dark;
  }
}

a.btn.btn-danger,
button.btn.btn-danger {
  @include buttonColor($danger, $danger);
  &:active, &:target {
    background-color: $danger-dark;
  }
}

a.btn.btn-inverse,
button.btn.btn-inverse {
  @include buttonColor($help-text, $help-text);
  color: $label-text;
  &:active, &:target, &:hover {
    background-color: $help-text;
    color: $label-text;
  }
}

.btn-with-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;

  .icon {
    margin-right: 10px;
  }
}

.btn-group, .btn-toolbar {
  :hover {
    transform: none;
  }
}

@mixin buttonGroupColor($color) {
  border-color: $color;
  &:hover {
    border-color: $color;
  }
}

.btn-group {
  button.btn.btn-primary {
    @include buttonGroupColor($primary);
  }
  button.btn.btn-danger {
    @include buttonGroupColor($danger);
  }
  button.btn.btn-info {
    @include buttonGroupColor($info);
  }
  button.btn.btn-success {
    @include buttonGroupColor($success);
  }
  button.btn.btn-warning {
    @include buttonGroupColor($warning);
  }
  .dropdown-menu {
    // margin-top: 0px;
  }
}


.btn-toolbar {
  display: inline-block;
}

.btn .caret {
  margin-left: 2px;
}

@mixin progressButtonColor($btnColor) {
  border-radius: 0;
  .content {
    &:after, &:before {
      color: darken($btnColor, 40);
    }
  }

  &.progress-button-style-move-up, &.progress-button-style-slide-down {
    .content {
      background-color: darken($btnColor, 10);
    }
  }

  &.progress-button-style-lateral-lines .progress-inner {
    border-color: darken($btnColor, 10);
    background: 0 0;
  }

  .progress {
    background-color: darken($btnColor, 10);
    box-shadow: none;
  }

  .progress-inner {
    background-color: darken($btnColor, 20);
  }
  &.progress-button-perspective {
    background: none;
    .content {
      background-color: $btnColor;
    }
  }
}

button.progress-button {

  .progress {
    margin-bottom: 0;
    border-radius: 0;
  }
  &:hover {
    transform: none;
  }

  &.progress-button-style-shrink.btn.disabled.progress-button-dir-horizontal:hover {
    transform: scaleY(.3);
  }
  &.progress-button-style-shrink.btn.disabled.progress-button-dir-vertical:hover {
    transform: scaleX(.1);
  }

  &.btn.btn-primary {
    @include progressButtonColor($primary);
  }

  &.btn.btn-default {
    @include progressButtonColor($default);
  }

  &.btn.btn-success {
    @include progressButtonColor($success);
  }

  &.btn.btn-info {
    @include progressButtonColor($info);
  }

  &.btn.btn-warning {
    @include progressButtonColor($warning);
  }

  &.btn.btn-danger {
    @include progressButtonColor($danger);
  }
}

.btn-raised {
  box-shadow: none;
}

.btn-mm {
  padding: 5px 11px;
  font-size: 13px;
}

.btn-xm {
  padding: 8px 14px;
  font-size: 16px;
}

.btn-group-xs > .btn, .btn-xs {
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  min-height: auto;
}

.btn-group-sm > .btn, .btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
  min-height: auto;
}

.btn-group-lg > .btn, .btn-lg {
  padding: 10px 16px;
  font-size: 18px;
  line-height: 1.3333333;
  border-radius: 3px;
}

.dropdown button.btn.btn-default.dropdown-toggle {
  border-width: 1px;
  color: $content-text;
  @include buttonColor($sidebar, $sidebar-border);
  &.active, &:active, &:target {
    background-color: rgba(0, 0, 0, 0.2);
    color: $default-text;
  }
}

.bootstrap-select {
  .dropdown-toggle:focus {
    outline: none !important;
  }
  button.btn-default:focus {
    color: $default;
  }
  .btn {
    transition: none;
  }
}
