.ak-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: $font-family-serif;
  outline: none;
  border: none;
  font-size: 1rem;
  font-weight: bold;
  height: 50px;
  width: 150px;
  color: white;
  background-color: gray;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.5);
  transition: 0.2s;

  &:active {
    color: lightgray;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1), 0 5px 12px rgba(0, 0, 0, 0.5);
  }

  &__icon {
    display: inline-block;
    width: 48px;
    height: 48px;
  }

  &__label {
    display: inline-block;
    font-family: $font-family-sans-serif;
    line-height: 1;
    top: 0;
  }

  &--block {
    display: block;
    width: 100%;

    + .ak-button-block {
      margin-top: 20px;
    }
  }

  // floating action button
  &--fab {
    width: 64px;
    height: 64px;
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
    padding: 0;

    &:active {
      background-color: rgba(0, 0, 0, 0.6);
      box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
    }

    .ak-button__icon {
      width: 36px;
      height: 36px;
    }
  }

  &--outlined {
    border: 2px solid #fff;
    font-family: $font-family-sans-serif;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5);

    &:active {
      background-color: scale-color($color: gray, $lightness: -10%);
      border-color: lightgray;
    }
  }

  &--action {
    font-family: $font-family-sans-serif;
    text-align: right;
    background-color: map-get($colors, "blue");
    box-shadow: 2px 5px 50px -10px rgba(0, 0, 0, 0.5);

    &:active {
      background-color: map-get($colors, "dark-blue");
    }
  }

  &--glow {
    animation-name: glowing-low;
    animation-duration: 3s;
    animation-iteration-count: infinite;
  }
}

.ak-button--start {
  width: 38px;
  height: 38px;
  background-color: transparent;
  border: 5px solid map-get($colors, "yellow");
  color: map-get($colors, "yellow");
  font-style: italic;
  font-size: xx-small;
  font-weight: bold;
  margin: 10px;
  transform: rotate(-45deg);
  float: left;

  .icon {
    color: map-get($colors, "yellow");
    transform: rotate(45deg) translate(22px, -10px);
  }

  .label {
    transform: rotate(45deg) translateY(5px);
    text-align: center;
  }

  text-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.3);

  &__glow {
    width: 38px;
    height: 38px;
    background-color: transparent;
    border: 5px solid map-get($colors, "yellow");
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-name: bounce;
    animation-duration: 0.7s;
    animation-timing-function: ease-out;
    animation-iteration-count: infinite;
  }
}

@keyframes bounce {
  from {
    width: 38px;
    height: 38px;
    opacity: 1;
  }

  to {
    width: 90px;
    height: 90px;
    opacity: 0;
  }
}

@each $color, $value in $ak-colors {
  .ak-glow-#{$color} {
    animation-name: glowing-#{$color};
  }

  @keyframes glowing-#{$color} {
    from { box-shadow: 0 0 0 rgba($value, 0.3); }
    50% { box-shadow: 0 0 25px rgba($value, 0.8); }
    to { box-shadow: 0 0 0 rgba($value, 0.3); }
  }
}
