.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Adjust 100px for desired size */
    gap: 10px;
    max-height: 400px; /* Or desired max height */
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.avatar-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    padding: 5px; /* Add some padding around the image */
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-item img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

.avatar-item.selected {
    border-color: #007bff; /* Bootstrap primary color */
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.avatar-item:hover {
    border-color: #0056b3; /* Darker shade for hover */
}

/* Preview styles for register/settings page */
.avatar-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    min-height: 140px; /* Ensures container is always visible and clickable */
    height: 140px;    /* Explicit height for consistent layout */
}

.avatar-preview {
    width: 128px;
    height: 128px;
    border: 1px solid #ccc;
    /* border-radius: 50%; */ /* Remove circular mask */
    background-color: #f8f9fa;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

#avatarPreview.has-image::before {
    content: ""; /* Remove placeholder text if image is set */
}

#avatarPreview:not(.has-image)::before {
    content: "";
    text-align: center;
}

#avatarPreview:hover {
    border-color: #007bff;
}

.avatar-prompt {
    display: none; /* Hide the 'Click to Select' text */
}
