/* --- 1. THIẾT LẬP CƠ BẢN --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #333; /* Màu nền dự phòng nếu ảnh lỗi */
}

/* --- [MỚI] CSS CHO 2 LỚP NỀN (Fix lỗi trắng tinh) --- */
.bg-layer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -10; /* Nằm dưới cùng */
}

.bg-original {
    background-image: url('anh/pixa.png'); /* Đổi tên file ảnh nền gốc ở đây */
}

.bg-bocchi {
    background-image: url('anh/anh2.png'); /* Ảnh Bocchi */
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
    z-index: -9;
}

.bg-bocchi.show {
    opacity: 1;
}

/* --- 2. THẺ KÍNH (GLASS CARD) --- */
.glass-card {
    position: relative;
    overflow: visible;
    width: 400px;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    
    background: linear-gradient(
        135deg, 
        rgba(20, 50, 140, 0.5) 0%, 
        rgba(140, 20, 90, 0.4) 100%
    );
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    
    /* BỎ VIỀN CŨ ĐỂ DÙNG VIỀN NEON */
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.5);

    /* Animation Slide-up */
    opacity: 0;
    transform: translateY(100px);
    transition: 
        opacity 1s cubic-bezier(0.22, 1, 0.36, 1), 
        transform 1s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.5s ease, padding 0.5s ease;
        
    z-index: 1; 
    --x: 50%;
    --y: 50%;
}

.glass-card.active {
    opacity: 1;
    transform: translateY(0);
}

/* GLOW NỀN (Bên trong) */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(
        800px circle at var(--x) var(--y), 
        rgba(255, 255, 255, 0.03) 0%, /* GIẢM TỪ 0.1 XUỐNG 0.03 (Rất mờ) */
        transparent 40%
    );
    z-index: -1; 
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;

}
.glass-card:hover::before { opacity: 1; }

/* --- TÌM ĐOẠN NÀY VÀ SỬA LẠI MÀU --- */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0; 
    border-radius: 20px; 
    padding: 2px; 
    
    background: linear-gradient(
        135deg, 
        rgba(40, 70, 180, 1),   /* Xanh dương đậm (Deep Blue) */
        rgba(160, 30, 90, 1)    /* Tím đỏ trầm (Dark Magenta) */
    );
    
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        radial-gradient(150px circle at var(--x) var(--y), #fff 0%, transparent 100%);
    -webkit-mask-composite: xor; 
    mask-composite: exclude;
    
    z-index: -1; 
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;

    clip-path: inset(0 round 20px);
}

/* --- SỬA ĐỘ SÁNG KHI HOVER --- */
.glass-card:hover::after {
    /* Cũ: opacity: 1 (Sáng hết cỡ) */
    /* Mới: opacity: 0.6 (Chỉ sáng nhẹ 60%, trông huyền bí hơn) */
    opacity: 0.6; 
}


/* --- 3. CÁC THÀNH PHẦN KHÁC --- */
.profile-header, .search-wrapper, .button-area, .toggle-btn, #toast, .volume-control {
    position: relative;
    z-index: 10;
}

.profile-header {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 25px; 
    margin-bottom: 35px; 
    text-align: left;
}
.profile-avatar {
    width: 100px; 
    height: 100px; 
    border-radius: 50%; 
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.profile-info { 
    display: flex; 
    flex-direction: column; 
}

.profile-name { 
    color: white; 
    font-size: 26px; font-weight: 800; 
    margin-bottom: 5px; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); 
}

.profile-username { 
    color: rgba(255, 255, 255, 0.7); 
    font-size: 16px; 
    margin-bottom: 12px; 
}

.profile-location { 
    color: rgba(255, 255, 255, 0.9); 
    font-size: 14px; display: flex; 
    align-items: center; 
    font-weight: 600; 
}

.profile-location i { 
    color: #ff4757; 
    margin-right: 8px; 
    font-size: 16px; 
}

/* Nút Bấm */
.btn {
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 100%; 
    padding: 15px; 
    margin-bottom: 15px; 
    border-radius: 50px;
    text-decoration: none; 
    font-weight: bold; 
    font-size: 16px; 
    transition: all 0.3s ease;
    cursor: pointer; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); 
    z-index: 3;
    background-color: rgba(0, 0, 0, 0.3); 
    color: #ffffff; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative; 
    padding-left: 60px;
}

.btn:hover {
    background-color: rgba(0, 0, 0, 0.8); /* Nền đen giữ nguyên */
    
    /* GIẢM ĐỘ SÁNG VIỀN: Từ 0.4 xuống 0.1 */
    border-color: rgba(255, 255, 255, 0.1); 
    
    transform: translateY(-3px);
}

.btn i {
    position: absolute; 
    left: 0; 
    top: 0; 
    width: 60px; 
    height: 100%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2); 
    font-size: 20px;
}

/* Màu Icon */
.btn-facebook i { 
    color: #1877f2; 
}
.btn-youtube i { 
    color: #ff0000; 
}
.btn-twitch i { 
    color: #9146FF; 
}
.btn-tiktok i { 
    color: #fe2c55; 
}
.btn-github i { 
    color: #f0f6fc; 
}
.btn-speedrun i { 
    color: #F3C944; 
}
.btn-info i { 
    color: #ccc; 
}

/* Info Hover Text */
.btn-info .original-text { 
    display: block; 
}

.btn-info .hover-text { 
    display: none; 
}

.btn-info:hover .original-text { 
    display: none; 
}

.btn-info:hover .hover-text { 
    display: block; 
    animation: fadeIn 0.3s; 
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Chế độ thu nhỏ */
.toggle-btn {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    width: 30px; 
    height: 30px;
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 5px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: white; 
    transition: all 0.2s;
}

.toggle-btn:hover { 
    background: rgba(255, 255, 255, 0.5); 
}

.glass-card.minimized { 
    width: 600px; 
    padding: 30px; 
}

.glass-card.minimized .button-area { 
    display: flex; 
    flex-direction: row; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 15px; 
}

.glass-card.minimized .btn { 
    width: 50px; 
    height: 50px; 
    border-radius: 15px; 
    padding: 0; 
    font-size: 0; 
}

.glass-card.minimized .btn i { 
    position: static; 
    transform: none; 
    width: auto; 
    height: auto; 
    border-right: none; 
    margin: 0; 
    font-size: 24px; 
    display: block; 
}

.glass-card.minimized .btn span { 
    display: none; 
}

@media (max-width: 480px) { .glass-card { width: 90%; padding: 30px 20px; } }

#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 16px;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    
    /* --- NHỮNG DÒNG QUAN TRỌNG CẦN SỬA --- */
    
    /* 1. Đổi từ absolute sang fixed để nó nổi trên toàn màn hình */
    position: fixed; 
    
    /* 2. Set z-index cao hơn Modal (Modal là 99999, cái này phải là 100000 trở lên) */
    z-index: 200000; 
    
    /* 3. Căn giữa màn hình */
    left: 50%;
    transform: translateX(-50%);
    
    /* 4. Vị trí xuất hiện */
    bottom: 30px;
    
    /* Hiệu ứng */
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    /* Khi hiện lên thì bay lên cao hơn một chút */
    bottom: 80px; 
}

/* Volume Control */
.volume-control {
    position: fixed; 
    top: 20px; 
    left: 20px; 
    z-index: 1000; /* Z-index cao để không bị che */
    display: flex; 
    align-items: center; 
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px); 
    border-radius: 50px; 
    padding: 5px; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    transition: all 0.3s ease;
}
.mute-btn { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    color: white; 
    font-size: 18px; 
}

.volume-slider-container {
    width: 0; 
    overflow: hidden; 
    transition: width 0.4s ease; 
    display: flex; 
    align-items: center; 
}

.volume-control:hover .volume-slider-container { 
    width: 100px; 
    padding-right: 15px; 
}

#volumeSlider { 
    -webkit-appearance: none; 
    width: 100%; height: 4px; 
    background: rgba(255, 255, 255, 0.5); 
    border-radius: 2px; 
    outline: none; 
    cursor: pointer; 
}

#volumeSlider::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    width: 12px; 
    height: 12px; 
    border-radius: 50%; 
    background: white; 
    cursor: pointer; 
}

/* Search Bar */
.search-wrapper { position: relative; width: 100%; margin-bottom: 20px; transition: all 0.3s ease; z-index: 50;}

.search-wrapper input { 
    width: 100%; 
    padding: 15px 15px 15px 50px; 
    border-radius: 50px; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    background: rgba(0, 0, 0, 0.3); 
    color: white; font-size: 16px; 
    outline: none; 
    transition: all 0.3s; 
}
.search-wrapper input:focus { 
    background: rgba(0, 0, 0, 0.6); 
    border-color: rgba(255, 255, 255, 0.5); 
}

.search-icon { 
    position: absolute; 
    left: 20px; top: 50%; 
    transform: translateY(-50%); 
    color: rgba(255, 255, 255, 0.6); 
    font-size: 18px; pointer-events: none; 
}

::placeholder { 
    color: rgba(255, 255, 255, 0.5); 
}

.btn-result { 
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    
    /* Màu nền phải trùng khớp với màu input lúc active */
    background: rgba(30, 30, 50, 0.95); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    border: 1px solid rgba(255, 255, 255, 0.2); /* Viền ngoài */
    border-top: none; /* Bỏ viền trên để thông với input */
    
    border-radius: 0 0 20px 20px; /* Chỉ bo tròn 2 góc dưới */
    
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    z-index: 100;
    display: none;
    overflow: hidden;
    
    /* QUAN TRỌNG: Xóa margin để dính chặt vào input */
    margin-top: 0; 
}

.search-result-item { 
    display: flex; 
    align-items: center; 
    padding: 12px 20px; 
    text-decoration: none; 
    color: rgba(255, 255, 255, 0.9); 
    transition: background 0.2s; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
    cursor: pointer; 
}

.search-result-item:last-child { 
    border-bottom: none; 
}

.search-result-item:hover {
    /* ĐỔI TỪ MÀU TRẮNG SANG MÀU ĐEN MỜ */
    background: rgba(0, 0, 0, 0.4); 
}
.search-result-item i { 
    margin-right: 15px; 
    font-size: 18px; 
    width: 25px; 
    text-align: center; 
}

.search-result-item span { 
    font-weight: 600; 
}

/* Overlay Màn hình chờ */
#overlay {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: #000000;
    z-index: 9999; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    transition: opacity 0.5s ease;
}
.overlay-content p { 
    color: white; 
    font-size: 20px; 
    letter-spacing: 2px; 
    font-weight: 300; 
    animation: pulse 1.5s infinite; 
}

@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

.fade-out { 
    opacity: 0; 
    pointer-events: none; }

#type-dots { 
    display: inline-block; 
    min-width: 20px; 
    text-align: left; 
    font-weight: 300; 
}

/* --- CSS CHO KHU VỰC TÌM KIẾM MỚI (XẾP HÀNG NGANG) --- */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Khoảng cách giữa thanh tìm kiếm và nút tiền */
    margin-bottom: 20px;
    position: relative;
    z-index: 50;
}

/* Chỉnh lại search-wrapper cũ để nó co giãn linh hoạt */
.search-wrapper {
    flex: 1; /* Chiếm hết khoảng trống còn lại */
    margin-bottom: 0; /* Bỏ margin cũ đi vì đã có margin ở container cha */
}

/* Thiết kế nút Donate (Nút tiền) */
.donate-btn-trigger {
    width: 50px;
    height: 50px; /* Vuông vắn bằng chiều cao thanh tìm kiếm */
    display: flex;
    justify-content: center;
    align-items: center;
    
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px; /* Bo góc nhẹ */
    color: #ffd700; /* Màu vàng kim loại (Gold) */
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.donate-btn-trigger:hover {
    background: rgba(255, 215, 0, 0.2); /* Sáng vàng nhẹ khi hover */
    border-color: #ffd700;
    transform: scale(1.05);
}

/* --- CSS CHO MODAL (CỬA SỔ QR) --- */

/* 1. Lớp nền đen mờ phủ toàn màn hình */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Đen đậm */
    z-index: 99999; /* Cao nhất */
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Mặc định ẩn */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Khi có class 'open' thì hiện lên */
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* 2. Hộp nội dung (thừa hưởng class glass-card để đẹp) */
.modal-box {
    width: 350px; /* Nhỏ gọn hơn thẻ chính */
    padding: 30px;
    position: relative;
    transform: scale(0.8); /* Mặc định thu nhỏ */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Reset lại các thuộc tính animation của glass-card gốc để tránh xung đột */
    opacity: 1 !important; 
    transform: translateY(0) scale(0.8);
}

/* Khi mở thì phóng to ra kích thước thật */
.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

/* Nút đóng X */
.close-modal {
    position: absolute;
    top: 15px; right: 15px;
    width: 30px; height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    transition: 0.2s;
}
.close-modal:hover { background: rgba(255, 0, 0, 0.5); }

/* Nội dung bên trong Modal */
.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    border: 5px solid white;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.qr-title {
    color: white;
    font-size: 24px;
    margin-bottom: 5px;
}

.qr-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Số tài khoản (Click để copy) */
.bank-info {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ffd700;
    font-weight: bold;
    font-size: 14px;
}
.bank-info:hover { background: rgba(255,255,255,0.2); }

.search-wrapper.active input {
    /* Biến 2 góc dưới thành vuông để nối với dropdown */
    border-radius: 20px 20px 0 0; 
    
    /* Xóa viền dưới để tạo cảm giác liền mạch */
    border-bottom: 1px solid transparent; 
    
    /* Đổi màu nền cho giống hệt dropdown (quan trọng) */
    background: rgba(30, 30, 50, 0.95); 
}