//
// Buttons
// --------------------------------------------------


// Base styles
// --------------------------------------------------

.btn {
  display: inline-block;
  margin-bottom: 0; // For input.btn
  font-weight: bold;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  padding: 6px 16px;
  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.428571429;
  border-radius: 3px;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none; // IE10+
          user-select: none;

  &,
  &:active,
  &.active {
    &:focus {
        // Default
        outline: thin dotted;
        // WebKit
        outline: 5px auto -webkit-focus-ring-color;
        outline-offset: -2px;
    }
  }

  &:hover,
  &:focus {
    text-decoration: none;
  }

  &:active,
  &.active {
    outline: 0;
    background-image: none;
  }

  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    cursor: not-allowed;
    pointer-events: none; // Future-proof disabling of clicks
    opacity: .65;
  }
}


// Alternate buttons
// --------------------------------------------------

.btn-default {
  color: #333;
  background-color: #fff;

  &:hover,
  &:focus,
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    color: #333;
    background-color: darken(#fff, 10%);
  }
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    background-image: none;
  }
  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &:active,
    &.active {
      background-color: #fff;
    }
  }

  .badge {
    color: #fff;
    background-color: #333;
  }
}
.btn-primary {
  color: #fff;
  background-color: #2d84b8;

  &:hover,
  &:focus,
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    color: #fff;
    background-color: darken(#2d84b8, 10%);
  }
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    background-image: none;
  }
  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &:active,
    &.active {
      background-color: #2d84b8;
    }
  }

  .badge {
    color: #fff;
    background-color: #2d84b8;
  }
}
// Success appears as green
.btn-success {
  color: #fff;
  background-color: #00a182;

  &:hover,
  &:focus,
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    color: #fff;
    background-color: darken(#00a182, 10%);
  }
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    background-image: none;
  }
  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &:active,
    &.active {
      background-color: #00a182;
    }
  }

  .badge {
    color: #fff;
    background-color: #00a182;
  }
}

// Warning appears as orange
.btn-warning {
  //@include button-variant($btn-warning-color, $btn-warning-bg);
  color: #fff;
  background-color: #f9ae31;

  &:hover,
  &:focus,
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    color: #fff;
    background-color: darken(#f9ae31, 10%);
  }
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    background-image: none;
  }
  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &:active,
    &.active {
      background-color: #f9ae31;
    }
  }

  .badge {
    color: #fff;
    background-color: #f9ae31;
  }
}

// Danger and error appear as red
.btn-danger {
  //@include button-variant($btn-danger-color, $btn-danger-bg);
  color: #fff;
  background-color: #c62760;

  &:hover,
  &:focus,
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    color: #fff;
    background-color: darken(#c62760, 10%);
  }
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    background-image: none;
  }
  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &:active,
    &.active {
      background-color: #c62760;
    }
  }

  .badge {
    color: #fff;
    background-color: #c62760;
  }
}


// Link buttons
// -------------------------

// Make a button look and behave like a link
.btn-link {
  color: #3fa7df;
  font-weight: normal;
  cursor: pointer;
  border-radius: 0;
  padding: 0;

  &,
  &:active,
  &[disabled],
  fieldset[disabled] & {
    background-color: transparent;
  }
  &,
  &:hover,
  &:focus,
  &:active {
    border-color: transparent;
  }
  &:hover,
  &:focus {
    color: darken(#3fa7df, 15%);
    text-decoration: underline;
    background-color: transparent;
  }
  &[disabled],
  fieldset[disabled] & {
    &:hover,
    &:focus {
      color: #777;
      text-decoration: none;
    }
  }
}

// Search buttons
// -------------------------

// Make a button look in search input
.btn-search {
  color: #555;
  font-weight: normal;
  cursor: pointer;
  border-radius: 0;
  padding: 0;

  &,
  &:active,
  &[disabled],
  fieldset[disabled] & {
    background-color: transparent;
  }
  &,
  &:hover,
  &:focus,
  &:active {
    border-color: transparent;
  }
  &:hover,
  &:focus {
    color: darken(#555, 20%);
    text-decoration: underline;
    background-color: transparent;
  }
  &[disabled],
  fieldset[disabled] & {
    &:hover,
    &:focus {
      color: darken(#555, 20%);
      text-decoration: none;
    }
  }
}


// Button Sizes
// --------------------------------------------------

.btn-lg {
  // line-height: ensure even-numbered height of button next to large input
  //@include button-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large);
  padding: 10px 16px;
  font-size: 18px;
  line-height: 1.33;
  border-radius: 6px;
}
.btn-sm {
  // line-height: ensure proper height of button next to small input
  //@include button-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small);
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}
.btn-xs {
  //@include button-size($padding-xs-vertical, $padding-xs-horizontal, $font-size-small, $line-height-small, $border-radius-small);
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}


// Block button
// --------------------------------------------------

.btn-block {
  display: block;
  width: 100%;
}

// Vertically space out multiple block buttons
.btn-block + .btn-block {
  margin-top: 5px;
}

// Specificity overrides
input[type="submit"],
input[type="reset"],
input[type="button"] {
  &.btn-block {
    width: 100%;
  }
}


//
// Close icons
// --------------------------------------------------


.close {
  font-weight: bold;
  line-height: 1;
  color: #727275;

  &:hover,
  &:focus {
    color: #727275;
    text-decoration: none;
    cursor: pointer;
  }

  // [converter] extracted button& to button.close
}

// Additional properties for button version
// iOS requires the button element instead of an anchor tag.
// If you want the anchor version, it requires `href="#"`.
button.close {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  -webkit-appearance: none;
}
