/*
 * Copyright 2019 dialog LLC <info@dlg.im>
 */

@import '../../styles/variables.css';

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.container {
  display: inline-block;
  flex: 0 0 auto;
  line-height: 1px;
  position: relative;
}

.avatar {
  position: relative;
  z-index: calc(var(--z-index-call) + 5);
}

.animation {
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(1);
  transition: transform 250ms ease-in-out;
  line-height: 1px;

  & > div {
    display: block;
    position: absolute;
    line-height: 1px;
    top: 50%;
    left: 50%;
    z-index: calc(var(--z-index-call) + 4);
    border-radius: 50%;
    transform-origin: 50% 50%;
    transform: translateZ(0);
    background-color: color-mod(var(--color-primary) alpha(5%));
    box-shadow: inset 0 0 0 1px color-mod(var(--color-primary) alpha(3%));
    animation: pulse 1.5s infinite ease;
  }
}

.animationEnded {
  transform: scale(0);
  transform-origin: 50% 50%;

  & > div {
    animation-play-state: paused;
  }
}
