%button-basic {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1em;
  white-space: nowrap;
  min-width: 140px;
  font-weight: 700;
}

%outline-button {
  background: none;
  border-width: 2px;
  border-style: solid;
  box-shadow: none;
}

.icon-button {
  border: 0;
  display: flex;
  align-items: center;
  align-content: center;
  justify-content: center;
  cursor: pointer;
  transition: $animate-default;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: none;

  &--round {
    background-color: $primary-button-color;
    box-shadow: $box-shadow-button;
    color: $white;
    width: 32px;
    height: 32px;
    border-radius: 16px;

    &:hover {
      box-shadow: $box-shadow-hover;
      transform: scale(0.9);
    }
  }

  &--search {
    width: 40px;
    background: none;
    border-radius: 20px;
    color: $nearly-black;

    & i {
      font-size: 1.5rem;
    }
  }

  &--action {
    color: $blue-grey-200;

    & i {
      font-size: 24px;
    }

    &:hover {
      color: darken($grey, 30%);
    }
  }

  &--header {
    color: $white;
    opacity: 1;
  }

  &--close {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background-color: rgba($white, 0.8);

    & i {
      font-size: 1rem;
    }

    &:hover {
      opacity: 0.8;
    }
  }

  &--clear {
    width: 18px;
    height: 18px;
    border-radius: 9px;
    background-color: $red;
    color: $white;
    opacity: 0.8;

    & i,
    span {
      font-size: 1rem;
    }

    &:hover {
      opacity: 1;
    }
  }

  &--list {
    background-color: $blue-grey-200;
  }

  &--add {
    background-color: $tertiary-color;
    width: 24px;
    height: 24px;

    & i {
      font-size: 1.125rem;
    }
  }

  &--light {
    color: $white;
  }

  &--swap {
    color: $grey-400;

    &:hover {
      color: $amber;
    }

    &.active {
      color: $amber;
    }
  }

  &__wrapper {
    display: flex;
  }
}

.button {
  @extend %button-basic;
  background-color: $primary-button-color;
  color: $white;
  font-size: $button-font-size;
  text-transform: $button-text-style;
  letter-spacing: $small-space;
  height: $button-height;
  padding: $button-padding;
  box-shadow: $box-shadow-button;
  transition: $animate-default;
  border-radius: 3px;
  @include mq($from: phablet) {
    max-width: $button-max-width;
  }

  &:hover {
    background-color: lighten($primary-button-color, 5%);
    box-shadow: none;
    text-decoration: none;
  }

  &.button--outline {
    @extend %outline-button;
    border-color: rgba($primary-button-color, 0.5);
    color: $primary-button-color;

    &:hover {
      background: $primary-button-color;
      color: $white;
    }
  }

  &--rounded {
    border-radius: $button-border-rounded;
  }

  &--cta {
    background-color: $cta-button-color;

    &:hover {
      background-color: saturate($cta-button-color, 10%);
    }

    &.button--outline {
      @extend %outline-button;
      border-color: rgba($cta-button-color, 0.5);
      color: $cta-button-color;

      &:hover {
        background: $cta-button-color;
        color: $white;
      }
    }
  }

  &--alert {
    background-color: $alert-button-color;

    &:hover {
      background-color: saturate($alert-button-color, 50%);
    }

    &.button--outline {
      @extend %outline-button;
      border-color: rgba($alert-button-color, 0.5);
      color: $alert-button-color;

      &:hover {
        background: $alert-button-color;
        color: $white;
      }
    }
  }

  &--light {
    background-color: $light-button-color;

    &:hover {
      background-color: darken($light-button-color, 10%);
    }

    &.button--outline {
      @extend %outline-button;
      border-color: rgba($light-button-color, 0.5);
      color: $light-button-color;

      &:hover {
        background: $light-button-color;
        color: $white;
      }
    }
  }

  &--dark {
    background-color: $dark-button-color;

    &:hover {
      background-color: lighten($dark-button-color, 10%);
    }

    &.button--outline {
      @extend %outline-button;
      border-color: $dark-button-color;
      color: $dark-button-color;
      background: rgba($white, 0.8);

      &:hover {
        background: $dark-button-color;
        color: $white;
      }
    }
  }

  &--disabled {
    opacity: 0.4;
    cursor: auto;
    box-shadow: none;
    background-color: $light-button-color;
    color: $black;

    &:hover {
      background-color: darken($light-button-color, 0);
    }
  }

  &--icon {
    padding: 5px 40px;
    width: auto;
    max-width: 100%;
    position: relative;

    & i {
      position: absolute;
      left: 8px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 1rem;
      width: 24px;
      height: 24px;
      border-radius: 12px;
      background-color: rgba($white, 0);
      display: flex;
      justify-content: center;
      align-items: center;
      transition: $animate-default;
    }

    &:hover {
      & i {
        background-color: rgba($white, 0.4);
      }
    }
  }

  &--small {
    height: $button-height-small;
    font-size: $button-font-size-small;
    padding: $button-padding-small;
    width: auto;
    min-width: 5px;
    box-shadow: none;

    &.button--icon {
      padding-left: 22px;

      & i {
        left: 0;
        border-radius: 0;
        background: none;

        &:hover {
          background: none;
        }
      }
    }
  }

  &--full-width {
    width: 100%;
    max-width: 100%;
  }

  &--back {
    background: none;
    border-radius: 0;
    height: auto;
    padding: 0;
    box-shadow: none;
    text-transform: none;
    color: $nearly-black;
    font-size: 0.875rem;
    justify-content: flex-start;
    letter-spacing: normal;

    & i {
      opacity: 0.6;
      font-size: 1rem;
    }

    &:hover {
      background: none;

      & i {
        opacity: 0.7;
        font-size: 1rem;
      }
    }
  }

  &--link {
    background: none;
    border-radius: 0;
    height: auto;
    padding: 2px 0;
    box-shadow: none;
    color: $primary-color;
    width: auto;
    max-width: auto;
    min-width: 1px;
    border-bottom: 1px solid transparent;
    display: inline-block;
    font-weight: $font-semi-bold;
    position: relative;

    &:hover {
      background: none;
      border-color: $primary-color;
    }
  }

  &--cancel {
    background: none;
    border-radius: 0;
    height: auto;
    padding: 2px 0;
    box-shadow: none;
    color: $grey-dark;
    width: auto;
    max-width: auto;
    min-width: 1px;
    border-bottom: 1px solid transparent;

    &:hover {
      background: none;
      color: $black;
    }
  }

  &--plain {
    padding: 5px;
    min-width: 70px;
    background-color: $blue-grey-50;
    border: 1px solid $blue-grey-100;
    font-size: $size-x-small;
    height: 30px;
    color: $grey-darkest;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;

    &:hover {
      background-color: $blue-grey-100;
    }
  }

  &--header {
    height: 32px;
    padding: 0 15px;
  }

  &--login {
    height: 60px;
    width: 100%;
    max-width: 100%;
    border-radius: 30px;
  }
}
/*on hover for icons animation*/
.bubble {
  font-size: 32px;
  line-height: 40px;
  height: 40px;
  width: 40px;
  color: $grey;
  border-radius: 100%;
  position: relative;
  z-index: 1;

  &::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 100%;
    background: rgba(255, 255, 255, 0);
    z-index: -1;
  }

  &::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    vertical-align: middle;
    width: 100%;
    height: 100%;
    transform: scale(0);
    background: rgba(0, 188, 212, 0.8);
    color: $white;
    border-radius: 100%;
    z-index: -1;
  }

  &:hover {
    animation-name: bubble2;
    animation-duration: 0.5s;
    animation-delay: 0.1s;
    animation-fill-mode: forwards;

    & i {
      color: $white;
    }

    &::after {
      animation-name: bubble;
      animation-duration: 0.5s;
      animation-fill-mode: forwards;
    }
  }

  &:active {
    background: rgba(0, 188, 212, 1);
  }

  &--light {
    color: $white;

    &::after {
      background: rgba(255, 255, 255, 0.6);
      color: $primary-color;
    }

    &:hover {
      & i {
        color: $primary-color;
      }
    }

    &:active {
      background: rgba(255, 255, 255, 0.7);
    }
  }
}
@-moz-keyframes bubble {
  100% {
    transform: scale(1);
  }
}
@-webkit-keyframes bubble {
  100% {
    transform: scale(1);
  }
}
@-o-keyframes bubble {
  100% {
    transform: scale(1);
  }
}
@keyframes bubble {
  100% {
    transform: scale(1);
  }
}
@-moz-keyframes bubble2 {
  100% {
    color: $white;
  }
}
@-webkit-keyframes bubble2 {
  100% {
    color: $white;
  }
}
@-o-keyframes bubble2 {
  100% {
    color: $white;
  }
}
@keyframes bubble2 {
  100% {
    color: $white;
  }
}

.page-header {
  & .button--small {
    height: 30px;
    min-width: 80px;
    padding: 0 20px;
    font-size: $button-font-size;
  }
}
