@use '../../../../shared/styles/variables' as *;

.avatar-upload {
  padding: 16px;
  border: 1px solid $color-border-accent;
  border-radius: 22px;
  background: $color-surface-muted;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 180px;
}

.avatar-upload__preview {
  position: relative;

  width: 148px;
  height: 148px;
  border-radius: 50%;

  background:
    radial-gradient(circle at 30% 20%, rgba($white, 0.1), $transparent 28%),
    linear-gradient(135deg, $blue, $color-primary-hover);

  display: flex;
  align-items: center;
  justify-content: center;

  color: $color-text-inverse;
  font-size: $font-size-34;
  font-weight: 750;
  letter-spacing: 0.04em;

  box-shadow:
    $shadow-avatar-preview;

  overflow: visible;

  &.transparent-backdrop{
    background: transparent;
  }

  img {
    width: 100%;
    height: 100%;

    border-radius: 50%;
    object-fit: cover;
  }
}

.avatar-upload__camera {
  position: absolute;
  right: 0px;
  bottom: 0px;

  width: 42px;
  height: 42px;
  border: 2px solid $color-surface-muted;
  border-radius: 50%;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: $blue;
  //backdrop-filter: blur(16px);
  color: $color-text-inverse;

  cursor: pointer;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background-color 0.18s ease;

  //box-shadow: 0 8px 18px rgba($color-shadow-rgb, 0.18);

  &:hover {
    transform: scale(1.05);
    //opacity: 0.92;
  }

  &:disabled {
    cursor: default;
    opacity: 0.6;
    transform: none;
  }
}

.avatar-upload__text {
  text-align: center;

  b {
    display: block;
    color: $color-text-strong;
    font-size: $font-size-16;
    font-weight: 650;
  }

  span {
    display: block;
    margin-top: 4px;
    color: $gray50;
    font-size: $font-size-13;
    font-weight: 500;
  }
}

.avatar-upload__actions {
  width: 100%;

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.avatar-upload__choose,
.avatar-upload__reset {
  height: 40px;
  border: none;
  border-radius: 13px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: $font-size-14;
  font-weight: 650;

  cursor: pointer;
  transition: 0.2s ease;

  &:disabled {
    cursor: default;
    opacity: 0.6;
  }
}

.avatar-upload__choose {
  background: $blue;
  color: $color-text-inverse;

  &:hover {
    box-shadow: inset 0 0 0 1px $blue, 0 8px 20px -8px rgba(var(--color-primary-rgb), 0.8);
  }
}

.avatar-upload__reset {
  width: 40px;
  background: rgba($color-danger-rgb, 0.1);
  color: $red;

  &:hover {
    background: rgba($color-danger-rgb, 0.16);
  }
}

.avatar-upload__hint {
  margin: -2px 0 0;
  color: $gray50;
  font-size: $font-size-12;
  font-weight: 500;
  text-align: center;
  line-height: 1.35;
}
