/* ======================================================== */
/* === CSS HOÀN CHỈNH CHO TRANG HỒ SƠ NGƯỜI DÙNG === */
/* ======================================================== */

/* ----- 1. KHUNG HEADER CHUNG ----- */
.profile-header {
    position: relative; /* Làm cơ sở định vị cho các phần tử con */
    display: flex;
    align-items: flex-end; /* Căn các khối con xuống dưới */
    justify-content: space-between; /* Đẩy khối info và khối tiền ra 2 phía */
    flex-wrap: wrap; /* Cho phép các khối xuống dòng khi màn hình hẹp */
    gap: 1.5rem; /* Khoảng cách giữa các khối */
    padding: 2rem;
    min-height: 380px;
    background-size: cover;
    background-position: center;
    border-radius: 0 0 12px 12px;
}

/* ----- 2. KHỐI THÔNG TIN CHÍNH (BÊN TRÁI) ----- */
.profile-main-info {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap; /* Cho phép avatar và text xuống dòng trên màn hình nhỏ hơn */
}

.profile-avatar-container {
    flex-shrink: 0; /* Không cho avatar bị co lại */
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

.profile-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.btn-edit-profile-inline {
    border: 1px solid #555;
    color: #aaa;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}
.btn-edit-profile-inline:hover {
    background-color: #333;
    color: #fff;
}

.author-title.reputation-level {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: bold;
    background-color: #e0a836;
    color: #111;
}

.profile-id {
    color: #a0a0c0;
    margin-bottom: 1rem;
}

.author-stats {
    display: flex;
    flex-wrap: wrap; /* Cho phép các stat xuống dòng */
    gap: 1.5rem;
}
.author-stats .stat {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    color: #fff;
}
.author-stats .stat strong {
    font-size: 1.2rem;
}
.author-stats .stat span {
    font-size: 0.8rem;
    color: #a0a0c0;
}

/* ----- 3. KHỐI TIỀN TỆ (BÊN PHẢI) - ĐÃ TỐI ƯU CHỐNG VỠ LAYOUT ----- */
.profile-currencies {
    display: flex;
    flex-wrap: wrap; /* QUAN TRỌNG: Cho phép các mục tiền tệ xuống dòng nếu không đủ chỗ */
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end; /* Luôn dồn về phía bên phải */
    padding-bottom: 0.5rem; /* Căn chỉnh với baseline của tên */
}

.currency-item {
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    white-space: nowrap; /* Giữ icon và số trên 1 dòng */
}

/* Nổi bật cho số dư tiền thật */
.currency-item.real-money {
    background-color: #ffc107;
    color: #1a1a27;
    border-color: transparent;
    font-weight: 700;
}

.btn-deposit {
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: none;
    flex-shrink: 0;
}

/* ----- 4. PHẦN NỘI DUNG BÊN DƯỚI ----- */
.profile-content-wrapper {
    /* Phần này không có trong HTML bạn gửi, nhưng giữ lại để tương thích */
}

/* ----- 5. CSS CHO DI ĐỘNG (RESPONSIVE) ----- */
@media (max-width: 991px) {
    .profile-header {
        /* Trên mobile, xếp chồng các khối và căn giữa */
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-main-info {
        flex-direction: column;
        align-items: center;
    }
    .profile-currencies {
        justify-content: center; /* Căn giữa các mục tiền tệ */
        margin-top: 1rem;
    }
    .author-stats {
        justify-content: center; /* Căn giữa các thống kê */
    }
}
/* ======================================= */
/* === CSS CHO KHỐI VÍ TIỀN (WALLET) === */
/* ======================================= */

/* Container chính của Wallet Card */
.profile-wallet {
    background-color: #1a1a27;
    border-radius: 12px;
    border: 1px solid #3a3a5a;
    padding: 1.5rem;
    width: 280px; /* Chiều rộng cố định trên desktop */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    align-self: flex-start; /* Giữ cho nó ở trên cùng của flex container */
}

/* Phần hiển thị số dư chính */
.wallet-main-balance {
    text-align: center;
    border-bottom: 1px solid #2a2a3a;
    padding-bottom: 1rem;
}
.wallet-main-balance small {
    color: #a0a0c0;
    font-size: 0.9rem;
    text-transform: uppercase;
}
.wallet-main-balance h3 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffc107;
    margin: 0;
    line-height: 1.2;
    word-break: break-all; /* Chống vỡ layout khi số quá dài */
}
.wallet-main-balance h3 span {
    font-size: 1.5rem;
    margin-left: 0.25rem;
}

/* Phần hiển thị các tiền tệ phụ */
.wallet-secondary-currencies {
    display: flex;
    justify-content: space-around;
    padding: 0.25rem 0;
}
.currency-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}
.currency-item i {
    font-size: 1.2rem;
    color: #a0a0c0;
}
.currency-item i.bi-gem {
    color: #4edfff; /* Màu cho Quân Huy */
}
.currency-item i.bi-coin {
    color: #ffd700; /* Màu cho Vàng */
}

/* Phần nút Nạp tiền */
.wallet-action .btn {
    font-weight: bold;
}

/* === RESPONSIVE CHO DI ĐỘNG === */
@media (max-width: 991px) {
    /* Cho Wallet Card chiếm toàn bộ chiều rộng trên mobile */
    .profile-wallet {
        width: 100%;
        margin-top: 1.5rem;
        order: 3; /* Đưa xuống dưới khối thông tin chính */
    }
}