@import "variables";
@import "theme-colors";

.btn {
  font-size: inherit;
  line-height: initial;
  color: var(--default-font-color);
  padding: $default-button-padding;
  transition: all $default-transition-duration $action-transition-timing-function;

  &.dropdown-toggle {
    &:after {
      margin-left: 0.85em;
    }

    &.dropdown-toggle-split {
      padding-right: 0.5625rem;
      padding-left: 0.5625rem;
    }
  }

  &.btn-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
  }

  &.btn-lg {
    line-height: 1.5;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
  }

  &:focus {
    box-shadow: none !important;
  }

  &:disabled {
    pointer-events: none;
  }

  &.btn-primary {
    color: $white;
    border-color: $brand-color;
    background-color: $brand-color;

    &:hover {
      background-color: darken($brand-color, 5%);
    }
  }

  &.btn-light {
    border-color: var(--btn-light-color);
    background-color: var(--btn-light-color);

    &:hover {
      color: var(--default-font-color);
      background-color: var(--base-color);
    }
  }

  &.btn-secondary {
    border-color: var(--btn-secondary-bg);
    background-color: var(--btn-secondary-bg);

    &:hover {
      background-color: var(--btn-secondary-hover-bg);
    }
  }

  &.btn-dark {
    color: $white;
    border-color: var(--btn-dark-color);
    background-color: var(--btn-dark-color);

    &:hover {
      background-color: var(--btn-dark-hover-color);
    }
  }

  &.btn-success {
    color: $white;
    border-color: $success-color;
    background-color: $success-color;

    &:hover {
      background-color: darken($success-color, 4%);
    }
  }

  &.btn-danger {
    color: $white;
    border-color: $danger-color;
    background-color: $danger-color;

    &:hover {
      background-color: darken($danger-color, 4%);
    }
  }

  &.btn-secondary {
    color: $white;
  }

  &.btn-info {
    color: $white;
    border-color: $info-color;
    background-color: $info-color;

    &:hover {
      background-color: darken($info-color, 10%);
    }
  }

  &.btn-warning {
    color: $white;
    border-color: $warning-color;
    background-color: $warning-color;

    &:hover {
      background-color: darken($warning-color, 10%);
    }
  }

  &.btn-outline-primary {
    color: $blue;

    &:hover {
      color: $white;
    }
  }

  &.btn-outline-success {
    color: $success-color;

    &:hover {
      color: $white;
    }
  }

  &.btn-outline-danger {
    color: $danger-color;

    &:hover {
      color: $white;
    }
  }

  &.btn-outline-info {
    color: $info-color;
    border-color: $info-color;

    &:hover {
      color: $white;
    }
  }

  &.btn-outline-warning {
    color: $warning-color;
    border-color: $warning-color;

    &:hover {
      color: $white;
      background-color: $warning-color;
    }
  }

  &.btn-social {
    width: 45px;
    height: 45px;
    padding: 0.5rem;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: $white;
    border-radius: 100%;
    border-color: transparent;

    svg {
      &.social-icon {
        width: 17px;
        height: 17px;
      }
    }

    &.btn-sm {
      width: 35px;
      height: 35px;
      padding: 0.25rem;

      svg {
        &.social-icon {
          width: 15px;
          height: 15px;
        }
      }
    }

    &.btn-lg {
      width: 60px;
      height: 60px;
      padding: 0.75rem;

      svg {
        &.social-icon {
          width: 22px;
          height: 22px;
        }
      }
    }
  }
}

// SCSS for RTL Layout
[dir="rtl"] {
  .btn {
    &.dropdown-toggle {
      &:after {
        margin-left: 0;
        margin-right: 0.85em;
      }
    }
  }

  .btn-group > .btn:not(:first-child), .btn-group > .btn-group:not(:first-child) > .btn {
    border-radius: $default-radius 0 0 $default-radius;
  }

  .btn-group > .btn:not(:last-child):not(.dropdown-toggle), .btn-group > .btn-group:not(:last-child) > .btn {
    border-radius: 0 $default-radius $default-radius 0;
  }
}
