@import '../../styles/variables';

.active {
  background-image: var(--button-active) !important;
  background: var(--button-active) !important;
  color: var(--button-active-text) !important;

  &:not([disabled]):hover {
    background: var(--button-active-hover) !important;
    color: var(--button-active-text) !important;
  }
}

.button {
  border: none;
  border-radius: 4px;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  padding: 12px;
  white-space: nowrap;
  transition: opacity 0.2s;
  height: 50px;

  &[disabled] {
    opacity: 1;
  }

  &:not([disabled]) {
    cursor: pointer;
  }

  &.primary {
    &[disabled] {
      background-color: var(--button-primary-disabled-background-color);
      background-image: var(--button-primary-disabled-background-image);
      box-shadow: var(--button-primary-disabled-box-shadow);
      color: var(--button-primary-disabled-text-color);
      path {
        fill: var(--button-primary-disabled-text-color);
      }
    }

    background-image: var(--button-primary-background-image);
    box-shadow: var(--button-primary-box-shadow);
    border-radius: 4px;
    font-size: 14px;
    color: var(--button-primary-text);

    path {
      fill: var(--button-primary-text);
    }

    &:not([disabled]):hover {
      background-image: var(--button-primary-hover-background-image);
    }
  }

  &.secondaryRaised {
    color: var(--secondary-raised-base-text);

    path {
      fill: var(--base-text);
    }

    &[disabled] {
      background-color: var(--button-primary-disabled-background-color);
      background-image: var(--button-primary-disabled-background-image);
      box-shadow: var(--button-primary-disabled-box-shadow);
      color: var(--button-primary-disabled-text-color);
      path {
        fill: var(--button-primary-disabled-text-color);
      }
    }
  }

  &.outline {
    color: var(--secondary-outline-text) !important;
    border: var(--secondary-outline-border) solid 2px !important;

    path {
      fill: var(--button-primary-text) !important;
    }

    &:not([disabled]):hover {
      color: var(--secondary-outline-hover-text) !important;
      background: var(--secondary-outline-background-hover) !important;
      border: var(--secondary-outline-background-hover) solid 2px !important;

      path {
        fill: var(--secondary-outline-hover-text) !important;
      }
    }
  }

  &.secondary {
    border: solid;
    border-width: 2px;
    border-color: transparent;
    background: var(--button-secondary-background);
    color: var(--base-text);

    &:not([disabled]):hover {
      border: double 2px transparent;
      background-origin: border-box;
      background-clip: content-box, border-box;
      border-color: transparent;
      border-color: transparent;
      background: var(--button-secondary-hover);
    }

    path {
      fill: var(--secondary-button-icon-color);
    }
  }

  span {
    width: 100%;
  }

  .centeredLabel {
    position: absolute;
    align-self: center !important;
  }

  .icon {
    svg {
      height: 24.5px;
      width: 24.5px;
    }
    height: 24.5px;
    width: 24.5px;
    align-self: flex-start;
  }
}
