@use 'mixins' as mixins;
@use 'variables' as *;

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

[role='button'] {
  cursor: pointer;
}

.sky-btn {
  background-color: transparent;
  @include mixins.sky-border(dark, top, bottom, left, right);
  border-radius: $sky-border-radius;
  color: var(--sky-text-color-default);
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
  padding: 6px 12px;
  line-height: $sky-line-height-base;
  font-size: $sky-font-size-base;

  &:hover {
    @include mixins.sky-border(light, top, bottom, left, right);
    color: var(--sky-text-color-default);
  }

  &.sky-btn-disabled,
  &[disabled] {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.65;
    box-shadow: none;
  }
}

a.sky-btn {
  &:hover {
    text-decoration: none;
  }
}

.sky-btn-default {
  @include mixins.sky-button-variant(
    $sky-text-color-default,
    $sky-color-white,
    $sky-border-color-neutral-medium,
    $sky-background-color-neutral-light
  );
}

.sky-btn-primary {
  @include mixins.sky-button-variant(
    $sky-color-white,
    $sky-background-color-primary-dark,
    $sky-background-color-primary-dark
  );
}

.sky-btn-danger {
  @include mixins.sky-button-variant(
    $sky-color-white,
    $sky-background-color-danger-dark,
    $sky-background-color-danger-dark
  );
}

.sky-btn-link {
  color: var(--sky-text-color-action-primary);
  background-color: transparent;
  border-color: transparent;
}

.sky-btn-link:hover {
  color: var(--sky-text-color-action-primary-hover);
  background-color: transparent;
  border-color: transparent;
  text-decoration: underline;
  outline: none;
}

.sky-btn-link-inline {
  @extend .sky-btn-link;
  font-size: inherit;
  line-height: inherit;
  display: inline;
  padding: 0;
  border: none;
  vertical-align: top;
}

.sky-btn-link-inline:hover {
  border: none;
}

.sky-btn-sm {
  padding: $sky-padding-half $sky-padding;
  font-size: 12px;
  line-height: 1.5;
}

.sky-btn.sky-btn-active {
  outline: 0;
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.sky-btn-tab {
  background-color: transparent;
  border: none;
  border-radius: 4px 4px 0 0;
  color: var(--sky-text-color-deemphasized);
  cursor: pointer;
  display: inline-block;
  font-weight: 600;
  line-height: 1.8;
  padding: 8px 16px;

  &:hover:not(.sky-btn-tab-disabled) {
    background-color: var(--sky-background-color-neutral-light);
    color: var(--sky-text-color-default);
    text-decoration: none;
  }

  &:hover:not(.sky-btn-tab-disabled) {
    background-color: var(--sky-background-color-neutral-light);
  }

  &.sky-btn-tab-disabled {
    background-color: var(--sky-background-color-disabled);
    cursor: not-allowed;
    pointer-events: none;
    outline: none;
    text-decoration: none;

    &:hover {
      color: var(--sky-text-color-deemphasized);
      cursor: default;
      text-decoration: none;
    }
  }
}

.sky-btn-tab-close {
  background-color: transparent;
  border: none;
  color: var(--sky-text-color-deemphasized);
  cursor: pointer;
  line-height: 1.4;
  margin-left: $sky-margin-half;

  &:hover {
    color: var(--sky-text-color-default);
    transition: color $sky-transition-time-short;
  }
}

.sky-tab-header-count {
  font-weight: 400;
  color: var(--sky-text-color-action-primary);
  margin-left: $sky-margin-half;
}

.sky-btn-tab-selected:not(.sky-btn-tab-disabled) {
  background-color: var(--sky-background-color-primary-dark);
  color: var(--sky-text-color-on-dark);

  &:hover:not(.sky-btn-tab-disabled) {
    background-color: var(--sky-background-color-primary-dark);
    color: var(--sky-text-color-on-dark);
  }

  .sky-btn-tab-close,
  .sky-tab-header-count {
    color: #fff;
  }
}

.sky-btn-tab-wizard {
  background-color: $sky-color-white;
  @include mixins.sky-border(light, top, bottom, left, right);
  border-radius: $sky-border-radius;
  font-weight: 400;
  color: var(--sky-text-color-default);
  margin-right: $sky-margin-half;
  padding-bottom: $sky-padding-half;
  padding-top: $sky-padding-half;

  &:hover,
  &:focus {
    text-decoration: none;
    color: var(--sky-text-color-default);
    background-color: var(--sky-background-color-neutral-light);
  }

  &.sky-btn-tab-selected {
    background-color: var(--sky-background-color-info);
    border-color: var(--sky-background-color-info);
    color: var(--sky-text-color-default);
  }

  &.sky-btn-tab-disabled {
    cursor: not-allowed;
    pointer-events: none;
    background-color: var(--sky-background-color-neutral-light);
    color: var(--sky-text-color-deemphasized);
    box-shadow: none;
  }
}

.sky-tabset-tabs .sky-btn-tab-wrapper .sky-btn-tab-wizard {
  line-height: 1.6em;
}

.sky-btn-borderless {
  @include mixins.sky-icon-button-borderless();
  border: none;
}

.sky-btn-borderless:hover {
  border: none;
}

.sky-btn-borderless-inline {
  @extend .sky-btn-borderless;
  font-size: inherit;
  line-height: inherit;
  display: inline;
  padding: 0;
  vertical-align: top;
}

.sky-btn-borderless-inline:hover {
  border: none;
}

.sky-btn-icon-borderless {
  @include mixins.sky-icon-button-borderless();
  height: 26px;
  width: 26px;
  border: none;
  padding: 0;
}
