@use '@/styles/variables' as *;
@use '@/styles/mixins' as *;

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: $background-color;
  overflow: hidden;
  flex-shrink: 0;

  &--xs {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  &--sm {
    width: 32px;
    height: 32px;
    font-size: $font-size-xs;
  }

  &--md {
    width: 40px;
    height: 40px;
    font-size: $font-size-sm;
  }

  &--lg {
    width: 48px;
    height: 48px;
    font-size: $font-size-base;
  }

  &--xl {
    width: 64px;
    height: 64px;
    font-size: $font-size-lg;
  }

  &--circle {
    border-radius: $border-radius-round;
  }

  &--square {
    border-radius: $border-radius-base;
  }

  &__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  &__initials {
    font-weight: $font-weight-medium;
    color: $text-secondary;
    text-transform: uppercase;
  }

  &__placeholder {
    @include flex-center;
    width: 60%;
    height: 60%;
    color: $text-disabled;

    svg {
      width: 100%;
      height: 100%;
    }
  }

  &__status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 25%;
    height: 25%;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    border: 2px solid $card-background;

    &--online {
      background-color: $success-color;
    }

    &--offline {
      background-color: $text-disabled;
    }
  }
}
