@import '../colors';
@import '../variables';
@import '../mixins';

* {
  box-sizing: border-box;
}

.tix-floating-button {
  @include elevation-2;
  opacity: 0;
  overflow: hidden;
  position: fixed;
  z-index: $z-index-popover;
  bottom: 20px;
  pointer-events: none;
  white-space: nowrap;
  background-color: $color-B400;
  border-radius: 50%;
  transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;

  &.show {
    opacity: 1;
    cursor: pointer;
    pointer-events: inherit;
    bottom: 20px;
  }

  &.right {
    right: 20px;
  }

  &.left {
    left: 20px;
  }

  &.center {
    left: 50%;
    transform: translateX(-50%);
  }

  &.shaking {
    animation: shakeButton 1s ease-in-out infinite alternate;
  }

  .content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    margin: auto;
    text-align: center;
  }

  &.regular {
    width: 56px;
    height: 56px;

    .illustration {
      max-width: 32px;
    }
  }

  &.mini {
    width: 48px;
    height: 48px;

    .illustration {
      max-width: 24px;
    }
  }

  &.extended {
    height: 40px;
    width: auto;
    padding: 0;
    background-color: $color-N0;
    border-radius: 20px;

    .extended-content {
      display: flex;
      align-items: center;
      height: 100%;
      padding: 12px 16px;

      &:first-child {
        padding-left: 24px;
      }

      &:last-child {
        padding-right: 24px;
      }

      i,
      p {
        display: inline-block;
        vertical-align: middle;
        margin: 0;
      }

      .tix-divider-vertical {
        position: relative;
        left: -16px;
        vertical-align: middle;
      }

      .tix-icon {
        height: 16px;
        width: 16px;
        margin-right: 8px;
        font-size: 16px;
        line-height: 16px;
      }
    }
  }
}

@keyframes shakeButton {
  0% {
    bottom: 20px;
  }
  100% {
    bottom: 25px;
  }
}
