/* Trình tạo avatar - giao diện LayoutV2 (Sneat/Bootstrap 5).
   Tách riêng khỏi css/avatar.css cũ vì file đó viết cho Bootstrap 3. */

.avatar-stage {
    width: 100%;
    position: relative;
    max-width: 520px;
    margin: 0 auto;
}

/* Ép khung xem trước luôn vuông 1:1 dù màn hình rộng hẹp thế nào. */
.avatar-stage:before {
    content: "";
    display: block;
    padding-top: 100%;
}

.avatar-crop {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid var(--bs-border-color, #d9dee3);
    border-radius: .375rem;
    background-color: #fff;
}

.avatar-crop .cropper-move {
    z-index: 2;
}

/* Ảnh khung nằm đè lên ảnh sinh viên, không nhận chuột để còn kéo ảnh bên dưới. */
.avatar-frame-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: none no-repeat center center;
    background-size: contain;
    pointer-events: none;
    z-index: 3;
}

.avatar-frame-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: .75rem;
}

.avatar-frame-tile {
    border: 2px solid transparent;
    border-radius: .5rem;
    padding: .25rem;
    background-color: var(--bs-body-bg, #fff);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease-in-out;
}

.avatar-frame-tile:hover {
    border-color: rgba(105, 108, 255, .4);
}

.avatar-frame-tile.active {
    border-color: #696cff;
}

.avatar-frame-tile img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.avatar-frame-tile .frame-title {
    display: block;
    font-size: .75rem;
    line-height: 1.1rem;
    margin-top: .25rem;
    word-break: break-word;
}

.avatar-loading {
    display: none;
}

.avatar-loading.show {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, .35);
}
