@use "../../styles/mixins";

.AvatarEditable {
  label {
    cursor: var(--custom-cursor, pointer);

    position: relative;

    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 7.5rem;
    height: 7.5rem;
    margin-right: auto;
    margin-bottom: 2rem;
    margin-left: auto;
    border-radius: 50%;

    font-size: 3rem;
    color: white;

    background-color: var(--color-primary);
    outline: none !important;

    transition: border-radius 200ms;

    input {
      display: none;
    }

    img {
      position: absolute;
      top: 0;
      left: 0;

      width: 100%;
      height: 100%;
    }

    .icon {
      z-index: var(--z-register-add-avatar);
      transform: scale(1);
      transition: transform 0.15s linear;
    }

    // @optimization The weirdest workaround for screen animation lag
    @include mixins.while-transition() {
      input,
      .icon,
      &::after {
        display: none !important;
      }

      img {
        position: static !important;
      }
    }

    &:hover {
      .icon {
        transform: scale(1.2);
      }
    }

    &.filled {
      background-color: var(--color-background);

      &::after {
        content: "";

        position: absolute;
        top: 0;
        left: 0;

        display: block;

        width: 100%;
        height: 100%;

        background-color: rgba(black, 0.4);
      }
    }

    &.disabled {
      pointer-events: none;

      &::after {
        display: none;
      }

      .icon {
        display: none;
      }
    }

    &.rounded-square {
      border-radius: var(--border-radius-forum-avatar);
    }
  }
}
