.qr-scanner {
  width: 288px;
  height: 288px;

  .modal-content {
    overflow: hidden;
    transform: translateZ(0);

    // Flash effect element
    &:before {
      content: '';
      width: 100%;
      height: 100%;
      background-color: $white;
      position: absolute;
      left: 0;
      top: 0;
      z-index: 1;
      opacity: 0;
    }
  }

  &.flashed .modal-content {
    &:before {
      animation: flashed 0.6s;
    }
  }

  .modal-body {
    padding: 0;
  }
}

@keyframes flashed {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 100;
  }
  100% {
    opacity: 0;
  }
}

.qr-scanner-preview {
  transform: scaleX(-1);

  &:before,
  &:after {
    position: absolute;
    z-index: 1;
    content: '';
    width: 32px;
    height: 32px;
    top: 24px;
    border-color: $white;
    border-style: solid;
    border-top-width: 4px;
    border-bottom-width: 0;
  }

  &:before {
    left: 24px;
    border-top-left-radius: $border-radius;
    border-left-width: 4px;
    border-right-width: 0;
  }

  &:after {
    right: 24px;
    border-top-right-radius: $border-radius;
    border-left-width: 0;
    border-right-width: 4px;
  }

  > section {
    &:before,
    &:after {
      position: absolute;
      z-index: 1;
      content: '';
      width: 32px;
      height: 32px;
      bottom: 24px;
      border-color: $white;
      border-style: solid;
      border-top-width: 0;
      border-bottom-width: 4px;
    }

    &:before {
      left: 24px;
      border-bottom-left-radius: $border-radius;
      border-left-width: 4px;
      border-right-width: 0;
    }

    &:after {
      right: 24px;
      border-bottom-right-radius: $border-radius;
      border-left-width: 0;
      border-right-width: 4px;
    }
  }
}
