@mixin button {
  border-radius: $primaryBorderRadius;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background-color: $primaryBackground200;
  font-size: 1rem;
  font-weight: 600;
  color: $whiteText;

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  &:active:not(:disabled) {
    opacity: 1;
  }
}

@mixin primary-button {
  @include button;
  padding: 1rem;
  transition: background 0.3s ease;
  background-blend-mode: overlay;
  background: linear-gradient(100.29deg, $green-500 7.82%, $teal 49.79%, $dark-purple 92.28%);

  &:not(:disabled) {
    &:hover {
      background: linear-gradient(100.29deg, $green-500 7.82%, $teal 49.79%, $dark-purple 92.28%),
        linear-gradient(0deg, rgba(244, 244, 247, 0.102), rgba(244, 244, 247, 0.1));
    }
    &:active {
      box-shadow: none;
    }
  }
}
@mixin gray-button {
  @include button;
  padding: 1rem;
  transition: background 0.3s ease;
  background-blend-mode: overlay;
  background: linear-gradient(100.29deg, $green-500 7.82%, $teal 49.79%, $dark-purple 92.28%);
  border-radius: 8px;
  opacity: 0.8;
  background: rgba(141, 147, 172, 0.33);

  &:not(:disabled) {
    &:hover {
      border-radius: 8px;
      background: rgba(244, 244, 247, 0.1);
    }
  }
}

@mixin secondary-button {
  @include button;
  padding: 1rem;
  gap: 0.625rem;
  border-radius: $primaryBorderRadius;
  background-color: transparent;
  border: 0.125rem solid $primaryText;
  color: $primaryText;

  svg {
    font-size: 0.875rem;
  }
}
@mixin container {
  max-width: 62.5rem;
  width: 100%;
  margin: 0 auto;
}

@mixin containerLg {
  max-width: 75rem;
}

@mixin on-mobile {
  @media (max-width: 599px) {
    @content;
  }
}

@mixin breakpoint-from($breakpoint) {
  @if $breakpoint == tablet {
    @media (min-width: 600px) {
      @content;
    }
  } @else if $breakpoint == large-tablet {
    @media (min-width: 900px) {
      @content;
    }
  } @else if $breakpoint == small-desktop {
    @media (min-width: 1200px) {
      @content;
    }
  } @else if $breakpoint == medium-desktop {
    @media (min-width: 1400px) {
      @content;
    }
  } @else if $breakpoint == large-desktop {
    @media (min-width: 1800px) {
      @content;
    }
  }
}

// Reverse of breakpoint-from. Will be more useful because
// legends isn't mobile-first and responsive.
@mixin breakpoint-down-from($breakpoint) {
  @if $breakpoint == tablet {
    @media (max-width: 899px) {
      @content;
    }
  } @else if $breakpoint == large-tablet {
    @media (max-width: 1199px) {
      @content;
    }
  } @else if $breakpoint == small-desktop {
    @media (max-width: 1399px) {
      @content;
    }
  } @else if $breakpoint == medium-desktop {
    @media (max-width: 1799px) {
      @content;
    }
  } @else if $breakpoint == large-desktop {
    @media (min-width: 1800px) {
      @content;
    }
  }
}
