@import "./colors.scss";

@mixin primarycolor($color) {
  background-color: $color;
  border: 1px solid $color;
}

@mixin secondarycolor($color) {
  color: $color;
  border: 1px solid $color;
}

%large-button {
  padding: 14px 0;
  font-size: 1.6rem;
}

%medium-button {
  padding: 11px 0;
  font-size: 1.4rem;
}

%small-button {
  padding: 8px 0;
  font-size: 1.3rem;
}

%extrasmall-button {
  padding: 5px 0;
  font-size: 1.1rem;
}

button {
  width: 100%;
  max-width: 760px;
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  line-height: 115%;
  color: $black;
  padding: 11px 0;
  -webkit-appearance: none;
  outline:none;

  &.rounded {
    border-radius: 30px !important;
  }

  &.primary {
    background-color: $carrot;
    border: 1px solid $carrot;
    border-radius: 6px;
    color: $white;

    &.large {
      @extend %large-button;
      border-radius: 6px;
    }

    &.medium {
      @extend %medium-button;
      border-radius: 5px;
    }

    &.small {
      @extend %small-button;
      border-radius: 4px;
    }

    &.extrasmall {
      @extend %extrasmall-button;
      border-radius: 3px;
    }

    &.carrot {
      @include primarycolor($carrot);
    }

    &.green {
      @include primarycolor($green);
    }

    &.blue {
      @include primarycolor($blue);
    }

    &.indigo {
      @include primarycolor($indigo);
    }

    &.yellow {
      @include primarycolor($yellow);
    }

    &.tomato {
      @include primarycolor($tomato);
    }

    &.gray {
      @include primarycolor($gray);
    }

    &[disabled] {
      cursor: not-allowed;
      background-color: $border-gray;
      border: 1px solid $border-gray;
    }
  }

  &.secondary {
    background-color: $white;
    border: 1px solid $silver;
    border-radius: 5px;
    color: $black;

    &.rounded {
      border-radius: 30px !important;
    }

    &.large {
      @extend %large-button;
      border-radius: 5px;
    }

    &.medium {
      @extend %medium-button;
      border-radius: 5px;
    }

    &.small {
      @extend %small-button;
      border-radius: 4px;
    }

    &.extrasmall {
      @extend %extrasmall-button;
      border-radius: 3px;
    }

    &.carrot {
      @include secondarycolor($carrot);
    }

    &.green {
      @include secondarycolor($green);
    }

    &.blue {
      @include secondarycolor($blue);
    }

    &.indigo {
      @include secondarycolor($indigo);
    }

    &.yellow {
      @include secondarycolor($yellow);
    }

    &.tomato {
      @include secondarycolor($tomato);
    }

    &.gray {
      @include secondarycolor($gray);
    }

    &[disabled] {
      cursor: not-allowed;
      border: 1px solid $silver;
      color: $silver;
    }
  }
}
