// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

.AvatarPreview {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;

  &__avatar {
    @include button-reset;

    align-items: center;
    border-radius: 100%;
    cursor: auto;
    display: flex;
    font-size: 32px;
    height: 80px;
    justify-content: center;
    margin-bottom: 16px;
    margin-top: 4px;
    position: relative;
    transition: background-color 100ms ease-out;
    user-select: none;
    width: 80px;

    &--loading {
      background: $color-black;
    }

    &--has-image {
      background-size: cover;
      background-position: center center;
    }

    @include keyboard-mode {
      &:focus {
        box-shadow: 0 0 0 3px $color-ultramarine;
      }
    }
  }

  &__group {
    -webkit-mask: url('../images/icons/v2/group-outline-24.svg') no-repeat
      center;
    -webkit-mask-size: 70%;
    height: 100%;
    width: 100%;
  }

  &__upload {
    align-items: center;
    background: $color-gray-02;
    border-radius: 100%;
    bottom: 4px;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    height: 28px;
    justify-content: center;
    position: absolute;
    right: -7px;
    width: 28px;

    &::after {
      @include color-svg(
        '../images/icons/v2/camera-outline-24.svg',
        $color-black
      );
      content: '';
      display: block;
      height: 16px;
      width: 16px;
    }
  }

  &__clear {
    @include button-reset;
    align-items: center;
    background-color: $color-white;
    border-radius: 100%;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    height: 24px;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 0;
    width: 24px;

    &:after {
      @include color-svg('../images/icons/v2/x-24.svg', $color-gray-75);
      content: '';
      height: 14px;
      width: 14px;
    }
  }
}
