.profile-pic {
    width: 150px;

    .avatar-wrapper {
        position: relative;
        padding-bottom: 100%;
    }

    .avatar-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 50%;
        transition: filter 0.2s ease-in-out;
    }

    .avatar-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .edit {
        cursor: pointer;
        z-index: 1;

        i {
            color: white;
            transition: transform 0.2s ease-in-out;
        }

        &:hover i {
            transform: scale(1.1);
        }
    }

    .spinner-container {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;

        .spinner-border {
            width: 2rem;
            height: 2rem;
        }
    }

    &[data-state="uploading"] {
        .avatar-image {
            filter: blur(2px);
        }

        .edit {
            display: none;
        }

        .spinner-container {
            display: flex !important;
        }
    }

    &[data-state="error"] {
        .upload-error {
            display: flex !important;
            flex-direction: column;
            align-items: center;
            background: rgba(var(--bs-danger-rgb), 0.7);
            padding: 0.5rem;
            border-radius: 4px;
            z-index: 2;

            .error-message {
                color: white;
                font-size: 0.875rem;
                margin-bottom: 0.5rem;
            }
        }

        .edit, .spinner-container {
            display: none;
        }
    }
}
