/* === MODERN UI/UX UPGRADE V4 (STABLE & FIXED) === */

/* --- 1. Biến Toàn Cục & Bảng màu Mới --- */
:root {
    --font-family: 'Be Vietnam Pro', sans-serif;
    
    /* Bảng màu hiện đại */
    --primary-color: #4A00E0; /* Tím đậm */
    --secondary-color: #8E2DE2; /* Tím nhạt hơn */
    --accent-color: #16BFFD; /* Xanh Cyan */
    --success-color: #15B76C;
    --warning-color: #F8B400;

    /* Màu nền & Bề mặt */
    --background-color: #F4F7FC; /* Xám rất nhạt */
    --surface-color: #FFFFFF;
    
    /* Màu chữ */
    --text-color-primary: #121212;
    --text-color-secondary: #5A6474;
    --heading-color: #1A202C;

    /* Bo góc & Bóng đổ */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 20px rgba(142, 45, 226, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);

    /* Hiệu ứng chuyển động */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. Reset & Cài đặt Chung --- */
* { box-sizing: border-box; }
body { 
    font-family: var(--font-family); 
    margin: 0; 
    background-color: var(--background-color); 
    color: var(--text-color-secondary); 
    line-height: 1.65; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}
.container { max-width: 800px; margin: 2rem auto; padding: 0 1.5rem; }
a { color: var(--secondary-color); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-color); }

/* --- 3. Preloader --- */
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--surface-color); z-index: 10001; display: flex; align-items: center; justify-content: center; transition: opacity 0.5s ease; }
.spinner { width: 48px; height: 48px; border: 4px solid #f0f0f0; border-top: 4px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; }

/* --- 4. Hiệu ứng Chuyển Cảnh & Trạng thái --- */
main > section { display: none; }
main > section.view-active { display: block; animation: fadeInSlideUp 0.6s var(--transition-smooth) forwards; }
main > section.view-fade-out { animation: fadeOutSlideDown 0.4s var(--transition-smooth) forwards; }

/* --- 5. Các Thành Phần Giao Diện --- */
header { text-align: center; padding-bottom: 2rem; margin-bottom: 2rem; }
.logo-link img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 5px solid var(--surface-color); box-shadow: var(--shadow-lg); transition: var(--transition-smooth); }
.logo-link:hover img { transform: scale(1.08) rotate(5deg); box-shadow: var(--shadow-lg); }
footer { text-align: center; margin-top: 4rem; padding-top: 2rem; font-size: 0.9em; color: #9facbf; border-top: 1px solid #e2e8f0; }

.hero { text-align: center; padding: 3rem 2rem; background: var(--surface-color); border-radius: var(--border-radius-md); box-shadow: var(--shadow-md); border: 1px solid #e2e8f0; }
.hero h2 { 
    color: var(--heading-color); font-weight: 800; font-size: 2.25rem; letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1rem;
}
.hero p { margin-top: 0.5rem; font-size: 1.1rem; color: var(--text-color-secondary); }
.search-bar { display: flex; margin: 2rem auto; max-width: 500px; box-shadow: var(--shadow-lg); border-radius: 50px; }
.search-bar input { flex-grow: 1; border: 1px solid transparent; padding: 1rem 1.5rem; font-size: 1rem; border-radius: 50px 0 0 50px; outline-color: var(--secondary-color); font-family: var(--font-family); background: #F9FAFB;}
.search-bar button { background: linear-gradient(to right, var(--secondary-color), var(--primary-color)); color: white; border: none; padding: 1rem 1.75rem; font-size: 1rem; cursor: pointer; border-radius: 0 50px 50px 0; font-weight: 600; transition: var(--transition-fast);}
.search-bar button:hover { opacity: 0.9; }
.choice-buttons { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.choice-btn { 
    padding: 0.8rem 1.75rem; background: transparent; color: var(--secondary-color); border: 2px solid var(--secondary-color);
    border-radius: 50px; font-size: 0.9rem; font-weight: 600; transition: var(--transition-fast); cursor: pointer;
}
.choice-btn:hover { background: var(--secondary-color); color: white; transform: translateY(-3px); }
.choice-btn.btn-housing { border-color: var(--warning-color); color: var(--warning-color); }
.choice-btn.btn-housing:hover { background: var(--warning-color); color: white; }

.ranking-section { margin-top: 4rem; }
.ranking-section h3 { text-align: center; color: var(--heading-color); margin-bottom: 0.5rem; font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.section-subtitle { text-align: center; margin-top: 0; margin-bottom: 2rem; color: var(--text-color-secondary); }

#ranking-list, .applicant-list { display: flex; flex-direction: column; gap: 1rem; }
.ranking-item, .applicant-card, .company-card {
    background: var(--surface-color); padding: 1.5rem; border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md); border: 1px solid #E2E8F0; transition: var(--transition-smooth); cursor: pointer;
}
.ranking-item:hover, .applicant-card:hover, .company-card:hover {
    transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--secondary-color);
}
.rank-number { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: linear-gradient(to bottom, var(--secondary-color), var(--primary-color)); color: white; font-weight: 700; border-radius: 50%; }
.rank-info h4, .company-card h3 { margin: 0 0 4px; color: var(--heading-color); font-weight: 600; }
.rank-info p, .company-card p { margin: 0; font-size: 0.9rem; color: var(--text-color-secondary); display: flex; align-items: center; gap: 8px;}
.rank-arrow { font-size: 1.5rem; color: var(--accent-color); transition: var(--transition-fast); margin-left: auto; }
.ranking-item:hover .rank-arrow { transform: translateX(5px); }
.company-card .icon { color: var(--primary-color); }

#list-title, #list-title-housing { color: var(--heading-color); text-align: center; margin-bottom: 2rem; font-weight: 700; }
.company-details { background: var(--surface-color); padding: 2rem; border-radius: var(--border-radius-md); box-shadow: var(--shadow-md); border: 1px solid #e2e8f0; }
.detail-section h3 { color: var(--heading-color); border-bottom: 1px solid #e2e8f0; padding-bottom: 0.75rem; margin-bottom: 1rem; display: flex; align-items: center; font-weight: 700; }
.detail-section h3 .icon { font-size: 1.5rem; margin-right: 1rem; color: var(--primary-color); }
.detail-section > ul li::before { content: '✓'; color: var(--success-color); }
.back-link { 
    display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 2rem; font-weight: 600; background: #e2e8f0; color: var(--text-color-primary); 
    border: none; padding: 0.75rem 1.5rem; border-radius: 50px; cursor: pointer; transition: var(--transition-fast); 
}
.back-link:hover { background: #cbd5e0; }

/* --- 6. FAB & Modals --- */
/* SỬA LỖI: Trả FAB về lại bên trái, Chat sang phải */
.fab-container { position: fixed; bottom: 25px; left: 25px; z-index: 1000; }
.fab-main-button { width: 60px; height: 60px; background: linear-gradient(45deg, var(--secondary-color), var(--primary-color)); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.2); transition: var(--transition-smooth); }
.fab-main-button:hover { transform: scale(1.1); }
.fab-main-button .icon-close { display: none; }
.fab-options { position: absolute; bottom: 75px; left: 5px; display: flex; flex-direction: column; gap: 15px; }
.fab-option { width: 50px; height: 50px; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); opacity: 0; transform: translateY(20px) scale(0.8); transition: var(--transition-smooth); pointer-events: none; }
.fab-option.fab-zalo { background: #0068FF; }
.fab-option.fab-facebook { background: #1877F2; }
.fab-option.fab-phone { background: var(--success-color); }
.fab-container.active .fab-main-button .icon-main { display: none; }
.fab-container.active .fab-main-button .icon-close { display: block; }
.fab-container.active .fab-options .fab-option { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* MODAL STYLES (FIXED) */
#modal-backdrop, #modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background-color: rgba(18, 18, 18, 0.6); backdrop-filter: blur(5px); z-index: 10000; 
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s;
}
#modal-backdrop.modal-active, #modal-overlay.modal-active { opacity: 1; visibility: visible; pointer-events: auto; }

.modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95);
    background: var(--surface-color); padding: 2rem; border-radius: var(--border-radius-md); 
    box-shadow: var(--shadow-lg); z-index: 10001; text-align: center; max-width: 500px; width: 90%; 
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    max-height: 90vh; overflow-y: auto;
}
.modal.modal-active { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; pointer-events: auto; }

.modal-close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2.5em; color: #cbd5e0; cursor: pointer; transition: var(--transition-fast); }
.modal-close-btn:hover { color: var(--text-color-secondary); }

.modal-icon { margin-bottom: 1.5rem; }
.modal-icon img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface-color); box-shadow: 0 0 20px rgba(142, 45, 226, 0.3); animation: pulse-shadow 2.5s ease-in-out infinite; }
.modal-text h3 { color: var(--heading-color); font-weight: 700; margin: 0 0 0.75rem; font-size: 1.25rem; }
.modal-text p { margin: 0; line-height: 1.6; color: var(--text-color-secondary); }

/* --- 7. Keyframes & Animation --- */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeInSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOutSlideDown { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(20px); } }
@keyframes pulse-shadow { 0% { box-shadow: 0 0 15px rgba(142, 45, 226, 0.3); } 50% { box-shadow: 0 0 30px rgba(142, 45, 226, 0.6); } 100% { box-shadow: 0 0 15px rgba(142, 45, 226, 0.3); } }

/* --- 8. Giao diện Cộng đồng --- */
.applicant-section { background: var(--surface-color); padding: 2rem; border-radius: var(--border-radius-md); border: 1px solid #e2e8f0; }
.filter-buttons { display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 2rem; flex-wrap: wrap; }
.filter-btn { padding: 0.5rem 1.25rem; border: 1px solid #cbd5e0; background-color: transparent; color: var(--text-color-secondary); border-radius: 50px; cursor: pointer; transition: var(--transition-fast); font-weight: 500; }
.filter-btn:hover { background-color: #f4f7fc; border-color: var(--secondary-color); color: var(--secondary-color); }
.filter-btn.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }

.applicant-name { font-size: 1.1rem; font-weight: 600; color: var(--heading-color); }
.applicant-status { font-size: 0.8rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: 50px; flex-shrink: 0; }
.applicant-status.status-pending { background-color: #FFFBEB; color: #B45309; }
.applicant-status.status-confirmed { background-color: #F0FFF4; color: #22543D; }
.btn-connect { background: linear-gradient(to right, var(--accent-color), #23d5ab); color: white !important; padding: 0.6rem 1rem; border-radius: var(--border-radius-sm); font-size: 0.9rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition-fast); box-shadow: var(--shadow-sm); }
.btn-connect:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.action-buttons-container { 
    display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; 
    padding-top: 1.5rem; border-top: 1px solid #e2e8f0; flex-wrap: wrap; 
}
.action-button {
    padding: 0.8rem 1.5rem; border-radius: 50px; font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: var(--transition-smooth); display: inline-flex; align-items: center; gap: 0.5rem;
    border: none; text-decoration: none;
}
.action-button.btn-apply { background: linear-gradient(to right, var(--secondary-color), var(--primary-color)); color: white; }
.action-button.btn-apply:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.action-button.btn-community { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.action-button.btn-community:hover { background: var(--primary-color); color: white; transform: translateY(-3px); }

/* --- 9. Cải tiến Giao diện Form --- */
.form-group { display: flex; flex-direction: column; text-align: left; margin-bottom: 1.25rem; }
.form-group label { font-weight: 600; margin-bottom: 8px; color: var(--heading-color); font-size: 0.95em; }
.form-group input[type="text"], .form-group input[type="tel"], .form-group textarea, .form-group select {
    width: 100%; padding: 12px 16px; border: 1px solid #D1D5DB; border-radius: var(--border-radius-sm);
    background-color: #F9FAFB; font-family: var(--font-family); font-size: 1rem;
    transition: var(--transition-fast); outline: none;
}
.form-group input[type="text"]:focus, .form-group input[type="tel"]:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--secondary-color); box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.15);
}
.form-group select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.7rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 2.8rem;
}
.gender-options, .marital-options { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 5px; }
.gender-options input[type="radio"], .marital-options input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.gender-options label, .marital-options label {
    display: inline-block; padding: 10px 16px; border: 1px solid #D1D5DB; border-radius: 50px;
    cursor: pointer; transition: var(--transition-fast); font-weight: 500;
}
.gender-options input[type="radio"]:checked + label, .marital-options input[type="radio"]:checked + label {
    background-color: var(--primary-color); color: white; border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 0, 224, 0.2);
}
.submit-btn {
    width: 100%; padding: 14px 20px; border: none; border-radius: var(--border-radius-sm);
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    color: white; font-size: 1.1rem; font-weight: 700; cursor: pointer;
    transition: var(--transition-smooth); margin-top: 1rem;
}
.submit-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* --- 10. Tối ưu cho Mobile (Media Queries) --- */
@media (max-width: 600px) {
    .container { margin-top: 1rem; padding: 0 1rem; }
    .hero h2 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .hero, .ranking-item, .applicant-card, .company-card { padding: 1.25rem; }
    .ranking-section h3 { font-size: 1.3rem; }
    .modal { padding: 1.5rem; }
    .search-bar button { padding: 0.9rem 1.25rem; }
}

/* --- 11. Banner Chữ Chạy --- */
.running-banner {
    display: block; width: 100%; background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    color: white; padding: 10px 0; margin-bottom: 2rem; border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md); overflow: hidden; text-decoration: none; cursor: pointer;
    transition: var(--transition-fast);
}
.running-banner:hover { box-shadow: var(--shadow-lg); transform: scale(1.02); }
.running-banner .banner-text {
    display: inline-block; white-space: nowrap; font-weight: 600; font-size: 0.95em;
    animation: marquee-animation 20s linear infinite;
}
@keyframes marquee-animation {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* --- 12. Khung Chat Real-Time --- */
#chat-widget-container { position: fixed; bottom: 25px; right: 25px; z-index: 1001; }
#chat-toggle-btn {
    width: 60px; height: 60px; background: linear-gradient(45deg, var(--accent-color), #23d5ab);
    color: white; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 28px; cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); transition: var(--transition-smooth);
    position: relative;
}
#chat-toggle-btn:hover { transform: scale(1.1); }
#chat-toggle-btn .icon-close { display: none; }
#chat-widget-container.open #chat-toggle-btn .icon-chat { display: none; }
#chat-widget-container.open #chat-toggle-btn .icon-close { display: block; }

#chat-window {
    position: absolute; bottom: 80px; right: 0;
    width: 350px; height: 500px; background: var(--surface-color);
    border-radius: var(--border-radius-md); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateY(20px) scale(0.95); opacity: 0;
    visibility: hidden; transition: var(--transition-smooth);
    transform-origin: bottom right;
}
#chat-widget-container.open #chat-window { transform: translateY(0) scale(1); opacity: 1; visibility: visible; }
.chat-header { padding: 1rem; background: var(--background-color); border-bottom: 1px solid #e2e8f0; }
.chat-header h3 { margin: 0; font-size: 1.1rem; color: var(--heading-color); display: flex; align-items: center; gap: 0.5rem; }
.chat-messages { flex-grow: 1; padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.message-item { max-width: 85%; padding: 0.5rem 0.8rem; border-radius: var(--border-radius-md); background-color: var(--background-color); line-height: 1.5; }
.message-item .user-name { font-weight: 700; font-size: 0.8em; color: var(--primary-color); margin-bottom: 4px; }
.message-item .message-text { word-wrap: break-word; }
.message-item.sent { background: var(--primary-color); color: white; align-self: flex-end; }
.message-item.sent .user-name { color: #f0f0f0; }

.chat-form { display: flex; border-top: 1px solid #e2e8f0; padding: 0.5rem; position: relative; }
.chat-form input { flex-grow: 1; border: none; padding: 0.8rem; font-size: 0.95rem; outline: none; background: transparent; font-family: var(--font-family); }
.chat-form button[type="submit"] {
    background: none; border: none; font-size: 1.5rem; color: var(--primary-color);
    cursor: pointer; padding: 0.5rem 1rem; border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}
.chat-form button[type="submit"]:hover { background: #f0f0f0; }

.notification-dot {
    position: absolute; top: 0; right: 0;
    width: 12px; height: 12px; background-color: #f44336;
    border-radius: 50%; border: 2px solid white;
}
.chat-label-text {
    position: absolute; right: 75px; bottom: 18px;
    background-color: var(--surface-color); padding: 8px 16px;
    border-radius: 50px; font-weight: 600; color: var(--primary-color);
    box-shadow: var(--shadow-md); white-space: nowrap; opacity: 0;
    transition: var(--transition-smooth); pointer-events: none;
}
#chat-widget-container:not(.open):hover .chat-label-text { opacity: 1; }

.message-item { position: relative; padding-right: 35px; }
.reply-btn {
    position: absolute; top: 50%; right: 8px;
    transform: translateY(-50%); font-size: 0.9em;
    color: #999; cursor: pointer; opacity: 0;
    transition: var(--transition-fast);
}
.message-item:hover .reply-btn { opacity: 1; }
.message-item.sent .reply-btn { color: #eee; }

.replying-to-container {
    padding: 8px 12px; background-color: #f0f2f5;
    border-top: 1px solid #e2e8f0; display: flex;
    justify-content: space-between; align-items: center; font-size: 0.85em;
}
.replying-to-content { border-left: 3px solid var(--primary-color); padding-left: 8px; overflow: hidden; }
.replying-to-header { color: var(--text-color-secondary); }
.replying-to-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.cancel-reply-btn { background: none; border: none; font-size: 1.5em; cursor: pointer; color: #999; }

.quoted-message {
    background-color: rgba(0,0,0,0.05); padding: 6px 10px;
    border-radius: var(--border-radius-sm); margin-bottom: 6px;
    font-size: 0.9em; border-left: 3px solid var(--accent-color);
}
.quoted-message strong { color: var(--secondary-color); }
.message-item.sent .quoted-message { background-color: rgba(255,255,255,0.15); }
.message-item.sent .quoted-message strong { color: #fff; }

.admin-chat-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 10px; border-bottom: 1px solid #f0f0f0;
}
.admin-chat-item .message-content { flex-grow: 1; }
.admin-chat-item .message-content strong { color: var(--primary-color); }
.admin-chat-item .delete-chat-btn {
    flex-shrink: 0; margin-left: 1rem; background-color: #dc3545;
    color: white; border: none; padding: 5px 10px;
    border-radius: 5px; cursor: pointer;
}
.emoji-btn {
    background: none; border: none; font-size: 1.5rem; color: var(--text-color-secondary);
    cursor: pointer; padding: 0.5rem; border-radius: 50%;
    transition: var(--transition-fast);
}
.emoji-btn:hover { background: #f0f0f0; }

emoji-picker {
    position: absolute; bottom: 60px; right: 10px; z-index: 1002;
}

@media (max-width: 480px) {
    #chat-window {
        width: calc(100vw - 40px); height: calc(100vh - 120px);
        max-height: 600px; bottom: 90px; right: -15px;
    }
}
#toast-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInUp 0.5s var(--transition-smooth) forwards;
}

.toast-notification.fade-out {
    animation: slideOutDown 0.5s var(--transition-smooth) forwards;
}

.toast-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.toast-body .toast-title {
    font-weight: 700;
    color: var(--heading-color);
    margin: 0 0 4px;
}

.toast-body .toast-message {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-color-secondary);
}

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

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}
/* =========================================== */
/* === CSS CHO HỆ THỐNG TÀI KHOẢN MỚI === */
/* =========================================== */

/* 1. Kiểu cho khu vực trạng thái người dùng trên Header */
#user-status-container {
    text-align: center;
    margin: -1rem 0 2rem 0; /* Điều chỉnh vị trí một chút */
    padding: 0.75rem;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#user-status-container span {
    font-weight: 500;
    color: var(--text-color-primary);
}

/* Thu gọn nút bấm một chút cho hài hòa */
#user-status-container .choice-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
}

/* 2. Kiểu cho Tabs (Đăng nhập / Đăng ký) trong Modal */
.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color-secondary);
    position: relative;
    transition: var(--transition-fast);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.tab-btn:hover {
    background-color: var(--background-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px; /* Dính liền với border-bottom của .auth-tabs */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

/* 3. Kiểu cho thông báo lỗi */
.error-message {
    color: #dc3545; /* Màu đỏ cảnh báo */
    text-align: center;
    margin-top: -5px;
    margin-bottom: 15px;
    font-size: 0.9em;
    font-weight: 500;
}