.btn {
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.714;
  border: 2px solid transparent;
  padding: 2px 12px;
  border-radius: 4px;
  box-shadow: 0 1px 3px 0 rgba($black, 0.12), 0 1px 2px 0 rgba($black, 0.24);
  color: $white;

  &:hover, &:focus {
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);

    &.btn-flat {
      box-shadow: none;
    }
  }

  &:focus {
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }

  &:active, &.active:not(.btn-flat) {
    box-shadow: none;
  }

  &:disabled, &.disabled {
    cursor: default;
    color: $gray-50;
    opacity: 0.75;
    box-shadow: none;
    background-color: $gray-700;
    border: 2px solid transparent;

    .svg {
      color: $gray-300;
    }
  }

  &.with-icon {
    height: 32px; // otherwise would something set the height to 33px
    display: flex;
    flex-direction: row;
    align-items: center;
  }
}

.btn-front {
  border: none !important;
  font-size: 16px;
  padding: 2px 17px;

  &:hover {
    border: none !important;
  }
}

.btn-primary {
  background: $purple-200;
  border: 2px solid transparent;
  line-height: 1.714;
  --icon-color: #{$purple-500};

  &:focus {
    background: $purple-200;
    border: 2px solid $purple-400;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
    --icon-color: #{$white};
  }

  &:not(:disabled):not(.disabled) {
    &:hover {
      background: $purple-200;
      border: 2px solid transparent;

      --icon-color: #{$white};
    }

    &:active, &.active {
      background: $purple-200;
      border: 2px solid transparent;
      box-shadow: none;

      --icon-color: #{$white};
    }

    &:active:focus, &.active:focus {
      box-shadow: none;
      border: 2px solid $purple-400;
    }
  }

  &.with-icon {
    .svg-icon.color {
      color: var(--icon-color);
    }
  }
}

.btn-secondary,
.dropdown > .btn-secondary.dropdown-toggle:not(.btn-success),
.show > .btn-secondary.dropdown-toggle:not(.btn-success) {
  background: $white;
  border: 2px solid transparent;
  color: $gray-50;

  --icon-color: #{$gray-200};

  &:focus, &:active {
    background: $white;
    border: 2px solid $purple-400;
    color: $gray-50;

    --icon-color: #{$purple-300};
  }

  &:not(:disabled):not(.disabled) {
    &:active, &.active {
      background: $white;
      border: 2px solid $purple-400;
      color: $purple-300;
      --icon-color: #{$purple-300};

      &:focus {
        color: $purple-300;
        border: 2px solid $purple-400;
        box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
      }

      &:active {
        box-shadow: none;
      }

    }

    &:hover {
      color: $purple-300;

      background: $white !important;
      border: 2px solid transparent;

      --icon-color: #{$purple-300};
      .svg {
        color: $purple-300;
      }
    }
  }

  &.with-icon {
    .svg-icon.color {
      color: var(--icon-color);
    }
  }
}

.show > .btn-secondary.dropdown-toggle:not(.btn-success):not(:disabled):not(.disabled) {
  --icon-color: #{$purple-300};
}

.btn-danger {
  background: $maroon-100;
  border: 2px solid transparent;
  box-shadow: 0 1px 3px 0 rgba($black, 0.16), 0 1px 3px 0 rgba($black, 0.24);


  &:hover:not(:disabled):not(.disabled) {
    background: $maroon-100;
    border: 2px solid transparent;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }

  &:focus {
    background: $maroon-100;
    border: 2px solid $purple-400;
  }

  &:not(:disabled):not(.disabled):active:focus, &:not(:disabled):not(.disabled).active:focus {
    box-shadow: none;
    border: 2px solid $purple-400;
  }

  &:not(:disabled):not(.disabled):active, &:not(:disabled):not(.disabled).active {
    background: $maroon-100;
    border: 2px solid $purple-400;
  }
}

.btn-warning {
  background: $orange-10;
  box-shadow: 0 1px 3px 0 rgba($black, 0.16), 0 1px 3px 0 rgba($black, 0.24);
  color: $white !important;

  &:hover:not(:disabled):not(.disabled) {
    background: $orange-10;
    color: $white;
  }

  &:focus {
    background: $orange-10;
    border: 2px solid $purple-400;
  }

  &:not(:disabled):not(.disabled):active:focus, &:not(:disabled):not(.disabled).active:focus {
    border: 2px solid $purple-400;
    box-shadow: none;
  }

  &:not(:disabled):not(.disabled):active, &:not(:disabled):not(.disabled).active {
    background: $orange-10;
    box-shadow: none;
  }
}

.btn-success {
  background: $green-50;
  border: 2px solid transparent;

  &:hover:not(:disabled):not(.disabled) {
    background: $green-50;
    border: 2px solid transparent;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }

  &:focus {
    background: $green-50;
    border: 2px solid $purple-400;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }

  &:not(:disabled):not(.disabled):active:focus, &:not(:disabled):not(.disabled).active:focus {
    border: 2px solid $purple-400;
    box-shadow: none;
  }

  &:not(:disabled):not(.disabled):active, &:not(:disabled):not(.disabled).active {
    background: $green-50;
    border: 2px solid $purple-400;
    box-shadow: none;
  }
}

.btn-info {
  background: $blue-50;
  border: 2px solid transparent;
  box-shadow: 0 1px 3px 0 rgba($black, 0.16), 0 1px 3px 0 rgba($black, 0.24);

  &:disabled {
    background: $blue-50;
    box-shadow: none;
  }

  &:hover {
    border: 2px solid transparent;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }

  &:focus {
    background: $blue-100;
    border: 2px solid $purple-400;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }

  &:hover:not(:disabled):not(.disabled) {
    background-color: $blue-100;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }

  &:active:not(:disabled):not(.disabled), &.active:not(:disabled):not(.disabled) {
    background: $blue-100;
    border: 2px solid $purple-400;
    box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
  }
}

.btn-show-more {
  display: block;
  width: 100%;
  padding: 8px;
  font-size: 14px;
  line-height: 1.714;
  font-weight: bold;
  text-align: center;
  background: $gray-500;
  color: $gray-200 !important; // Otherwise it gets ignored when used on an A element
  box-shadow: none;

  &:hover {
    box-shadow: none;
    color: inherit !important;
  }
}

.btn-flat {
  border: 0;
  box-shadow: none;
}

.btn-flat,
.dropdown > .btn-flat.dropdown-toggle:not(.btn-success),
.show > .btn-flat.dropdown-toggle:not(.btn-success) {
  &.with-icon {
    .svg-icon.color {
      color: var(--icon-color);
    }
  }
}

.btn-cancel {
  color: $blue-10;
}

.btn-small {
  font-size: 12px;
  line-height: 2;
  padding: 2px 2px;
}

.btn-lg {
  font-size: 1.25rem;
  line-height: 1.5;
  padding: .5rem 1rem;
}
