// stylelint-disable selector-no-qualifying-type

//
// Base styles
//

.btn {
  display: inline-block;
  font-weight: $btn-font-weight;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  position: relative;
  overflow: hidden;
  border: $btn-border-width solid transparent;
  @include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-line-height, $btn-border-radius);
  @include transition($btn-transition);

  // Share hover and focus styles
  @include hover-focus {
    text-decoration: none;
  }

  &:focus,
  &.focus {
    outline: 0;
  }

  // Disabled comes first so active can properly restyle
  &.disabled,
  &:disabled {
    opacity: $btn-disabled-opacity;
    @include box-shadow(none);
  }

  // Opinionated: add "hand" cursor to non-disabled .btn elements
  &:not(:disabled):not(.disabled) {
    cursor: pointer;
  }

  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled).active {
    @include box-shadow($btn-active-box-shadow);
  }
}

// Future-proof disabling of clicks on `<a>` elements
a.btn.disabled,
fieldset:disabled a.btn {
  pointer-events: none;
}


//
// Alternate buttons
//

@each $color, $value in $theme-colors {
  .btn-#{$color} {
    @include button-variant($value, $value);
  }
}

@each $color, $value in $theme-colors {
  .btn-outline-#{$color} {
    @include button-outline-variant($value);
  }
}


//
// Link buttons
//

// Make a button look and behave like a link
.btn-link {
  font-weight: $font-weight-normal;
  color: $link-color;
  background-color: transparent;

  @include hover {
    color: $link-hover-color;
    text-decoration: $link-hover-decoration;
    background-color: transparent;
    border-color: transparent;
  }

  &:focus,
  &.focus {
    text-decoration: $link-hover-decoration;
    border-color: transparent;
    box-shadow: none;
  }

  &:disabled,
  &.disabled {
    color: $btn-link-disabled-color;
    pointer-events: none;
  }

  // No need for an active state here
}

.btn-transparent, .btn-transparent.disabled {
  border-color: transparent;
  background-color: transparent;
  color: #485b6f;
}


//
// Button Sizes
//

.btn-lg {
  @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
}

.btn-sm {
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
}


//
// Block button
//

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

  // Vertically space out multiple block buttons
  + .btn-block {
    margin-top: $btn-block-spacing-y;
  }
}

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


//
// Rounded buttons
//

.btn-rounded {
    border-radius: 50px !important;
}


//
// Floating buttons
//

.btn-floating {
    height: 40px;
    width: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
    [class*=" la-"] {
        font-size: 1.4rem;
    }
    &.btn-lg, .btn-group-lg & {
        height: 56px;
        width: 56px;
        font-size: 1.7rem;
        [class*="la-"] {
            font-size: 1.9rem;
        }
    }
    &.btn-sm, .btn-group-sm & {
        height: 33px;
        width: 33px;
        font-size: 1.1rem;
        [class*="la-"] {
            font-size: 1.3rem;
        }
    }
}

//
// Icon buttons
//

.btn-icon {
    display: table;
    margin: 0 auto;
    & > i {
        display: table-cell;
        vertical-align: middle;
        line-height: 0;
        padding-right: .6rem;
    }
    &.btn-icon-right > i {
        padding-right: 0;
        padding-left: .6rem;
    }
}
.btn:not(.btn-floating) {
    [class*=" la-"] {
        font-size: 1.35rem;
    }
    [class^="ti-"], [class*=" fa-"] {
        font-size: 1.1rem;
    }
}
.btn-lg:not(.btn-floating), .btn-group-lg .btn:not(.btn-floating) {
    [class^="ti-"], [class*=" fa-"] {
        font-size: 1.35rem;
    }
    [class*=" la-"] {
        font-size: 1.5rem;
    }
}
.btn-sm:not(.btn-floating), .btn-group-sm .btn:not(.btn-floating) {
    [class^="ti-"], [class*=" fa-"] {
        font-size: 1rem;
    }
    [class*=" la-"] {
        font-size: 1.1rem;
    }
}


//
// Social Buttons
//

@each $name, $color in $social-buttons {
  @include social-button-variant($name, $color);
}

