$prefix: chat;

.#{$prefix} {
  position: fixed;
  right: 18px;
  bottom: 0;
  z-index: 100;
  background-color: var(--ifm-color-primary-light);
  padding: 1em 3em;
  border-top-left-radius: 0.5em;
  border-top-right-radius: 0.5em;
  color: white;
  cursor: pointer;
  transition: all .3s;

  &:hover {
    color: white;
    background-color: var(--ifm-color-primary);
  }

  &.active {
    transform: translateY(120%);
  }

  &Frame {
    position: fixed;
    z-index: 200;
    top: 0;
    left: 60%;
    bottom: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    background-color: white;
    transform: translateX(110%);
    box-shadow: -12px 0 18px 0 rgba(50, 50, 50, .3);
    transition: transform .3s cubic-bezier(.16,.22,.22,1.7);

    iframe {
      flex: 1;
      width: 100%;
      height: 100%;
      border: 0;
    }

    &Menu {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      display: flex;
      justify-content: flex-end;
      padding-bottom: 0.7em;
      background: linear-gradient(180deg, #fff 0, #fff 50%, hsla(0, 0%, 100%, 0));

      &Item {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        padding: 0;
        opacity: .65;
        background-position: 50%;
        background-repeat: no-repeat;
        background-size: 22px 22px;
        cursor: pointer;
        border: 0;
        outline: none;
        transition: all .2s ease;
        background-color: transparent;
      }

      a {
        margin-right: -4px;
        background-image: url(/img/open.svg)
      }

      button {
        background-image: url(/img/close.svg)
      }
    }

    &.active {
      transform: translateX(0);
    }
  }
}

@media screen and (max-width: 996px) {
  .#{$prefix} {
    &Frame {
      left: 0;
    }
  }
}
