@import "../../settings/includes/colors";
@import "../../settings/includes/font-sizes";

.c-button {
  padding: 8px;
  cursor: pointer;
  min-width: 96px;
  min-height: 48px;
  text-decoration: none;
  font-family: $base-font-family;

  &:focus {
    outline: none;
  }

  &:disabled,
  &--disabled {
    color: $White;
    cursor: not-allowed;
    border: 2px solid $Mono;
    background-color: $Mono;
  }

  &--icon {
    min-width: 0;
  }

  &__icon {
    display: flex;

    &--right {
      order: 1;
      margin-left: 8px;
    }

    &--left {
      order: -1;
      margin-right: 8px;
    }

    svg {
      left: 0;
    }
  }

  &__text {
    display: flex;
    line-height: 1.29;
  }

  &.c-button--primary,
  &.c-button--secondary,
  &.c-button--tertiary {
    svg {
      width: 16px;
      height: 16px;
    }
  }

  &--pacific {
    &.c-button--primary {
      color: $White;
      border: 2px solid $Pacific;
      background-color: $Pacific;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        background-color: map-get($PacificPalette, 60);
      }

      &:hover,
      &.c-button--hover {
        border: 2px solid map-get($PacificPalette, 60);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Fiord;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      .c-pill {
        background-color: $Fiord;
      }

      .c-spinner__circle {
        stroke: $Fiord;
      }
    }

    &.c-button--secondary {
      color: $Pacific;
      background-color: transparent;

      &:not(:focus) {
        border: 2px solid $Pacific;
      }

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        color: $White;
        background-color: $Pacific;
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Fiord;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $Pacific;
      }

      &:active svg,
      &:hover svg,
      &:focus svg {
        fill: $White;
      }

      .c-pill {
        background-color: $Pacific;
      }

      &:hover .c-pill,
      &:focus .c-pill {
        color: $Pacific;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $Pacific;
      }

      &:hover .c-spinner__circle {
        stroke: $White;
      }
    }

    &.c-button--tertiary {
      color: $Pacific;
      border: 2px solid transparent;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        background-color: $White;
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $Pacific;
      }

      .c-pill {
        background-color: $Pacific;
      }

      .c-spinner__circle {
        stroke: $Pacific;
      }

      &-empty {
        color: $Pacific;
        border: 2px solid transparent;

        &:focus,
        &.c-button--focus {
          border: 2px solid $Pacific;
        }

        svg {
          fill: $Pacific;
        }

        .c-pill {
          background-color: $Pacific;
        }

        .c-spinner__circle {
          stroke: $Pacific;
        }
      }
    }
  }

  &--fiord {
    &.c-button--primary {
      color: $White;
      border: 2px solid $Fiord;
      background-color: $Fiord;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        background-color: map-get($FiordPalette, 100);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      .c-pill {
        color: $White;
        background-color: $Pacific;
      }

      .c-spinner__circle {
        stroke: $Pacific;
      }
    }

    &.c-button--secondary {
      color: $Fiord;
      border: 2px solid $Fiord;
      background-color: transparent;

      &:hover,
      &.c-button--hover {
        color: $White;
        background-color: $Fiord;
      }

      &:focus,
      &.c-button--focus {
        color: $White;
        background-color: $Fiord;
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $Fiord;
      }

      &:active svg,
      &:hover svg,
      &:focus svg {
        fill: $White;
      }

      .c-pill {
        background-color: $Fiord;
      }

      &:hover .c-pill,
      &:focus .c-pill {
        color: $Fiord;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $Fiord;
      }

      &:hover .c-spinner__circle {
        stroke: $White;
      }
    }

    &.c-button--tertiary {
      color: $Fiord;
      border: 2px solid transparent;

      &:hover,
      &.c-button--hover {
        background-color: $White;
      }

      &:focus,
      &.c-button--focus {
        background-color: $White;
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $Fiord;
      }

      .c-pill {
        background-color: $Fiord;
      }

      .c-spinner__circle {
        stroke: $Fiord;
      }
    }
  }

  &--white {
    &.c-button--primary {
      color: $Pacific;
      border: 2px solid $White;
      background-color: $White;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        background-color: map-get($MonoPalette, 30);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $Pacific;
      }

      .c-pill {
        background-color: $Pacific;
      }

      .c-spinner__circle {
        stroke: $Pacific;
      }
    }

    &.c-button--secondary {
      color: $White;
      border: 2px solid $White;
      background-color: transparent;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        color: $Pacific;
        background-color: map-get($MonoPalette, 30);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      &:active svg,
      &:hover svg,
      &:focus svg {
        fill: $Pacific;
      }

      .c-pill {
        color: $Fiord;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $White;
      }

      &:hover .c-spinner__circle {
        stroke: $Pacific;
      }
    }

    &.c-button--tertiary {
      color: $White;
      border: 2px solid transparent;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        background-color: $Fiord;
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      .c-pill {
        color: $Fiord;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $White;
      }
    }
  }

  &--goldenrod {
    &.c-button--primary {
      color: $Fiord;
      border: 2px solid $Goldenrod;
      background-color: $Goldenrod;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        border: 2px solid map-get($GoldenrodPalette, 30);
        background-color: map-get($GoldenrodPalette, 30);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $Fiord;
      }

      .c-pill {
        background-color: $Fiord;
      }

      .c-spinner__circle {
        stroke: $Fiord;
      }
    }
  }

  &--paradiso {
    &.c-button--primary {
      color: $White;
      border: 2px solid $Paradiso;
      background-color: $Paradiso;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        border: 2px solid map-get($ParadisoPalette, 60);
        background-color: map-get($ParadisoPalette, 60);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      .c-pill {
        color: $Fiord;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $White;
      }
    }

    &.c-button--secondary {
      color: $White;
      border: 2px solid $White;
      background-color: transparent;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        color: $Paradiso;
        background-color: map-get($MonoPalette, 30);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $White;
      }

      &:hover .c-pill {
        color: $White;
        background-color: $Paradiso;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      &:active svg,
      &:hover svg,
      &:focus svg {
        fill: $Paradiso;
      }

      .c-pill {
        color: $Paradiso;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $White;
      }

      &:hover .c-spinner__circle {
        stroke: $Paradiso;
      }
    }
  }

  &--demask {
    &.c-button--primary {
      color: $White;
      border: 2px solid $Demask;
      background-color: $Demask;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        border: 2px solid map-get($DemaskPalette, 70);
        background-color: map-get($DemaskPalette, 70);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $Pacific;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      .c-pill {
        color: $Fiord;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $White;
      }
    }

    &.c-button--secondary {
      color: $White;
      border: 2px solid $White;
      background-color: transparent;

      &:hover,
      &.c-button--hover,
      &:focus,
      &.c-button--focus {
        color: $Demask;
        background-color: map-get($MonoPalette, 30);
      }

      &:focus,
      &.c-button--focus {
        border: 2px solid $White;
      }

      &:hover .c-pill {
        color: $White;
        background-color: $Demask;
      }

      &.c-button--disabled {
        color: $White;
        cursor: not-allowed;
        border: 2px solid $Mono;
        background-color: $Mono;
      }

      svg {
        fill: $White;
      }

      &:active svg,
      &:hover svg,
      &:focus svg {
        fill: $Demask;
      }

      .c-pill {
        color: $Demask;
        background-color: $White;
      }

      .c-spinner__circle {
        stroke: $White;
      }

      &:hover .c-spinner__circle {
        stroke: $Demask;
      }
    }
  }
}
