$dark-blue: #222;
$green: #2CD892;
$action-color: $green;

.svg-filters {
  position: absolute;
  visibility: hidden;
  width: 1px;
  height: 1px;
}

%button {
  -webkit-font-smoothing: antialiased;
  background-color: $dark-blue;
  border: none;
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85em;
  font-weight: 700;
  text-decoration: none;
  user-select: none;
  letter-spacing: 0.1em;
  color: white;
  padding: 20px 40px;
  text-transform: uppercase;
  @include transition(background-color 0.1s ease-out);

  &:hover {
    background-color: $action-color;
    color: #fff;
  }

  &:focus {
    outline: none;
    color: #fff;
  }
}

.button,
.button__bg {
  .safari & {
    -webkit-filter: none!important;
    filter: none!important;
  }
}

.button--1 {
  position: relative;
  @extend %button;
  background: none;
  z-index: 0;

  &:hover {
    background: none;
  }

  &:hover .circle {
    background: $action-color;
  }

  &:hover .button__bg {
    background: $action-color;
  }

  .button__container {
    position: absolute;
    display: block;
    width: 200%;
    height: 400%;
    top: -150%;
    left: -50%;
    pointer-events: none;
    z-index: -1;
    @include transform(translateZ(0));
    @include transition(all 0.1s ease-out);
  }

  .button__bg, .circle {
    @include animation(hue-rotate 10s linear infinite);
  }

  .button__bg {
    position: absolute;
    @extend %button;
    width: 50%;
    height: 25%;
    top: 50%;
    left: 25%;
    @include transform(translateY(-50%));
  }

  .circle {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 15px;
    background: $dark-blue;
    @include transition(background-color 0.1s ease-out);

    &.top-left {
      top: 40%;
      left: 27%;
    }

    &.bottom-right {
      bottom: 40%;
      right: 27%;
    }
  }
}

.button--2 {
  @extend %button;
  outline: 90px solid transparent!important; // this makes the area of effect of the filter bigger. This doesn't change anything on Firefox.
  position: relative;
  z-index: 0;
  background-color: transparent;
  
  .left, .right {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 15px;
    background: $dark-blue;
    @include transition(background 0.1s ease-out);
    top: 50%;
    margin-top: -12px;
    z-index: -2;

    &.left {
      left: 0;
    }

    &.right {
      right: 0;
    }
  }

  .button__bg {
    content: "";
    background: $dark-blue;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    @include transition(background 0.1s ease-out);
  }

  &:hover {
    background-color: transparent;

    &:before, span {
      background-color: $action-color;
    }
  }
}

.button--4 {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  line-height: 80px;
  padding: 0;
  @extend %button;
  background: none;

  &:hover {
    background: none;
  }

  &:focus {
    outline: none;
  }

  &:active .button__bg {
    transform: scale(0.8);
  }

  .button__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: 90px solid transparent!important; // this makes the area of effect of the filter bigger. This doesn't change anything on Firefox.
    @extend %button;
    padding: 0;
    border-radius: 100px;
    @include transform(translateZ(0));
    background: none;
    font-weight: bold;
    z-index: -2;
    @include transition(all 0.1s ease-out);

    &:hover {
      background: none;
    }
  }

  .blob {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    border-radius: 70px;
    opacity: 0.3;
    background: $dark-blue;
    @include transition(background 0.1s ease-out);
    z-index: -1;
    pointer-events: none;

    &:first-child {
      opacity: 1;
    }

    &:nth-child(n+2) {
      width: 100%;
      height: 100%;
    }
  }
}

.button--5 {
  @extend %button;
  transform: translateZ(0);
  outline: 90px solid transparent!important; // this makes the area of effect of the filter bigger. This doesn't change anything on Firefox.
}

.button--6 {
  @extend %button;
  transform: translateZ(0);
  outline: 90px solid transparent!important; // this makes the area of effect of the filter bigger. This doesn't change anything on Firefox.
}

.button--7 {
  @extend %button;
  transform: translateZ(0);
  outline: 90px solid transparent!important; // this makes the area of effect of the filter bigger. This doesn't change anything on Firefox.
}

.button--8 {
  position: relative;
  z-index: 1;
  @extend %button;
  outline: 10px solid #F6F6F6!important; // background-color of parent
  background: #F6F6F6;
  border: 2px solid #000;
  color: #000;

  &:focus {
    color: $dark-blue;
  }
  
  &:hover {
    background: #F6F6F6;
    border-color: $action-color;
    color: $action-color;
  }
}

.button--9 {
  @include transition(all 0.45s ease-out);
  @extend %button;
  @include radial-gradient(circle at 60% 20%, #FF6023 0%, #DA305D);
  box-shadow: 0 0 0 20px #f6f6f6;
  border-radius: 80px;
  color: #FFF;
  width: 80px;
  height: 80px;
  line-height: 80px;
  padding: 0;

  &:focus {
    color: #FFF;
  }
  
  &:hover {
    @include radial-gradient(circle at 60% 20%, #FF6023 0%, #DA305D);
    color: #FFF;
  }
}

.button--10 {
  @extend %button;
  position: relative;
  background: none;
  z-index: 0;
  width: 135px;

  &:hover {
    background: none;
  }

  &:hover .button__bg {
    background: $action-color;
  }

  .button__bg {
    transform: translateZ(0);
    outline: 90px solid transparent!important; // this makes the area of effect of the filter bigger. This doesn't change anything on Firefox.
    background: $dark-blue;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    @include transition(background 0.1s ease-out);
    border-radius: 40px;
  }
}


@keyframes hue-rotate {
  from {
    -webkit-filter: hue-rotate(0);
    -moz-filter: hue-rotate(0);
    -ms-filter: hue-rotate(0);
    filter: hue-rotate(0);
  }
  to {
    -webkit-filter: hue-rotate(360deg);
    -moz-filter: hue-rotate(360deg);
    -ms-filter: hue-rotate(360deg);
    filter: hue-rotate(360deg);
  }
}