/* ĐỊNH NGHĨA BIẾN MÀU SẮC (SÁNG VÀ TỐI) */
:root {
    --bg-color: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --primary-color: #b91c1c; /* Đỏ mận thanh lịch */
    --primary-hover: #991b1b;
    --sidebar-bg: #ffffff;
    --btn-hover: #f3f4f6;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Chế độ tối (Dark Mode) sẽ thay đổi các biến này */
body.dark-theme {
    --bg-color: #111827;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --card-bg: #1f2937;
    --border-color: #374151;
    --primary-color: #ef4444; /* Đỏ tươi hơn một chút cho nền tối */
    --primary-hover: #dc2626;
    --sidebar-bg: #1f2937;
    --btn-hover: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* RESET & CƠ BẢN */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* KHUNG CHÍNH */
.container {
    display: flex;
    width: 100%;
    max-width: 900px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

/* THANH MENU */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.nav-brand { text-align: center; margin-bottom: 30px; }
.mini-avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--primary-color); margin-bottom: 10px;}
.nav-brand h3 { font-size: 1.1em; font-weight: 600; }
.tag { font-size: 0.8em; color: var(--text-muted); }

/* Chỉ định dạng cho nút Menu */
.nav-btn {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}
.nav-btn:hover { background-color: var(--btn-hover); color: var(--text-main); }
.nav-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* --- ĐƯA NÚT SÁNG/TỐI RA GÓC MÀN HÌNH --- */
.nav-bottom {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

/* Định dạng riêng cho nút Sáng/Tối dạng Floating Button */
.theme-btn {
    width: auto;
    background-color: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 30px; /* Bo tròn nút */
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow);
}
.theme-btn:hover {
    background-color: var(--btn-hover);
    color: var(--text-main);
    transform: translateY(-2px); /* Hiệu ứng nảy nhẹ khi hover */
}

/* NỘI DUNG */
.content-area {
    flex: 1;
    padding: 40px;
}
.tab-content { display: none; animation: fadeIn 0.4s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* PROFILE */
.profile-header { text-align: center; margin-bottom: 25px; }
.main-avatar { width: 120px; height: 120px; border-radius: 50%; margin-bottom: 15px;}
.name { font-size: 2em; font-weight: 700; margin-bottom: 5px;}
.title { color: var(--primary-color); font-weight: 500; margin-bottom: 20px; }
.profile-bio p { color: var(--text-muted); margin-bottom: 10px; line-height: 1.6; text-align: center; }

.social-links { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.social-links a { color: var(--text-muted); font-size: 1.5em; transition: 0.2s; }
.social-links a:hover { color: var(--primary-color); }

/* SKILLS */
h2 { margin-bottom: 20px; font-weight: 600; border-bottom: 2px solid var(--border-color); padding-bottom: 10px;}
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.skill-item {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}
.skill-item strong { display: block; margin-bottom: 8px; font-weight: 600; }
.skill-item p { font-size: 0.9em; color: var(--text-muted); line-height: 1.5; }

/* QR CODE */
.subtitle { color: var(--text-muted); margin-bottom: 20px; }
.qr-container { display: flex; flex-direction: column; gap: 15px; max-width: 400px; }

/* Định dạng Input */
input {
    padding: 12px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    font-family: inherit;
}
input:focus { border-color: var(--primary-color); }

.action-btn {
    padding: 12px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 15px;
}
.action-btn:hover { background-color: var(--primary-hover); }
#qr-result { display: none; margin-top: 20px; border-radius: 8px; max-width: 250px; border: 1px solid var(--border-color); }

/* --- CUSTOM SELECT BANK CÓ ICON --- */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 15px;
    transition: 0.2s;
}

.custom-select:hover {
    border-color: var(--primary-color);
}

.custom-select .selected-option {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.bank-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    background-color: #fff; /* Nền trắng cho icon nổi bật */
    padding: 2px;
}

/* Danh sách thả xuống */
.custom-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow);
    z-index: 10;
    display: none; /* Ẩn mặc định */
    flex-direction: column;
    max-height: 200px;
    overflow-y: auto;
}

.custom-options.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    color: var(--text-main);
    transition: background 0.2s;
    font-weight: 500;
}

.custom-option:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* MOBILE */
@media (max-width: 768px) {
    .container { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
    .nav-top { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
    .nav-brand { width: 100%; margin-bottom: 15px; }
    .nav-btn { width: auto; }
    .skills-grid { grid-template-columns: 1fr; }
}