/* Reset & Base */
:root { --primary: #0084ff; --bg: #f0f2f5; --white: #ffffff; --grey: #e4e6eb; --red: #ff3b30; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg); min-height: 100vh; }

/* App Container */
.app-container { width: 100%; max-width: 1200px; margin: 0 auto; background: var(--white); display: flex; flex-direction: column; min-height: 100vh; box-shadow: 0 0 20px rgba(0,0,0,0.05); }

/* Navbar cố định */
.navbar { position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid #ddd; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.navbar-brand h2 { font-size: 20px; font-weight: 700; color: #050505; margin: 0; }
.navbar-menu { display: flex; gap: 24px; align-items: center; }
.nav-link { color: #65676b; text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: all 0.2s; }
.nav-link:hover { background: #f0f2f5; color: var(--primary); }
.nav-link.active { color: var(--primary); background: #e3f2fd; }
.navbar-actions { display: flex; align-items: center; }
.badge { font-size: 10px; padding: 3px 8px; border-radius: 10px; font-weight: bold; vertical-align: middle; display: inline-block; }
.badge-offline { background: #eee; color: #666; }
.badge-online { background: #31a24c; color: white; }
.btn-icon { background: none; border: none; font-size: 20px; color: #65676b; cursor: pointer; padding: 4px; }
.btn-icon:hover { background: #f0f2f5; border-radius: 4px; }

/* Mobile menu button */
.mobile-only { display: none !important; }
@media (max-width: 768px) {
    .navbar-menu { display: none; }
    .navbar { padding: 12px 16px; }
    .navbar-brand h2 { font-size: 18px; }
    .mobile-only { display: block !important; }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container { max-width: 100%; }
    .page-content { padding: 15px; }
    .modal-content { padding: 20px; }
}

/* Footer */
.footer { background: #f8f9fa; border-top: 1px solid #ddd; padding: 20px 24px; text-align: center; margin-top: auto; }
.footer p { margin: 4px 0; color: #65676b; font-size: 13px; }
.footer-note { font-size: 11px; color: #bcc0c4; }

/* Screens */
.screen { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; min-height: calc(100vh - 140px); }

/* Welcome Screen */
.welcome-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.logo { font-size: 64px; margin-bottom: 20px; animation: bounce 2s infinite; }
.desc { color: #65676b; margin-bottom: 40px; line-height: 1.5; font-size: 14px; }
.btn-primary { background: var(--primary); color: white; border: none; padding: 14px 40px; border-radius: 25px; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.2s; width: 100%; max-width: 250px; }
.btn-primary:active { transform: scale(0.96); opacity: 0.9; }
.status-text { margin-bottom: 15px; color: var(--primary); font-weight: 500; min-height: 20px; }
.footer-note { padding: 20px; text-align: center; font-size: 11px; color: #bcc0c4; }

/* Chat Screen */
.messages-area { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 8px; background: #fff; scroll-behavior: smooth; }
.system-msg { text-align: center; font-size: 12px; color: #999; margin: 10px 0; font-style: italic; }

.msg-row { display: flex; width: 100%; }
.msg-bubble { padding: 8px 14px; border-radius: 18px; max-width: 75%; font-size: 15px; line-height: 1.4; word-wrap: break-word; }

/* Thời gian gửi dưới tin nhắn */
.msg-time {
    font-size: 11px;
    color: #bcc0c4;
    margin-top: 3px;
    text-align: right;
}

/* My Message (Right) */
.msg-me { justify-content: flex-end; }
.msg-me .msg-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }

/* Their Message (Left) */
.msg-them { justify-content: flex-start; }
.msg-them .msg-bubble { background: var(--grey); color: #050505; border-bottom-left-radius: 4px; }

/* Input Area */
.input-area { padding: 10px; border-top: 1px solid #ddd; display: flex; gap: 8px; align-items: center; background: white; }
#image-btn, #music-btn { font-size: 20px; color: var(--primary); cursor: pointer; }
#image-btn:hover, #music-btn:hover { opacity: 0.8; }
#msg-input { flex: 1; padding: 10px 15px; border-radius: 20px; border: 1px solid #ddd; outline: none; background: #f0f2f5; font-size: 15px; }
#msg-input:focus { background: white; border-color: var(--primary); }
.btn-send { background: none; border: none; color: var(--primary); font-size: 24px; cursor: pointer; padding: 0 5px; }
.btn-send:disabled { color: #ccc; }

/* Image message */
.msg-image { max-width: 200px; border-radius: 12px; margin: 4px 0; cursor: pointer; }
.msg-image:hover { opacity: 0.9; }

/* Loader */
.loader { width: 30px; height: 30px; border: 3px solid #f3f3f3; border-top: 3px solid var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 15px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Menu Overlay */
.menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.menu-content { background: white; padding: 30px; border-radius: 12px; max-width: 400px; width: 90%; max-height: 80vh; overflow-y: auto; }
.menu-content h3 { margin-bottom: 20px; color: #050505; }
.menu-list { list-style: none; padding: 0; }
.menu-list li { margin-bottom: 15px; }
.menu-list a { color: var(--primary); text-decoration: none; font-size: 16px; display: block; padding: 10px; border-radius: 8px; transition: background 0.2s; }
.menu-list a:hover { background: #f0f2f5; }

/* Page Content */
.page-content { padding: 20px; max-width: 600px; margin: 0 auto; overflow-y: auto; height: 100%; }
.page-content h2 { margin-bottom: 20px; color: #050505; }
.page-content h3 { margin-top: 25px; margin-bottom: 10px; color: #050505; font-size: 18px; }
.page-content p { margin-bottom: 15px; line-height: 1.6; color: #65676b; }
.page-content ul { margin-left: 20px; margin-bottom: 15px; }
.page-content li { margin-bottom: 8px; line-height: 1.6; color: #65676b; }

/* Policy & Contact Pages */
.policy-content, .contact-content { line-height: 1.8; }

/* Report Page */
.report-content { line-height: 1.8; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #050505; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 100px; }
.contact-item { margin-bottom: 15px; padding: 10px; background: #f0f2f5; border-radius: 8px; }
.phone-stats-section { border-top: 1px solid #ddd; padding-top: 20px; }

/* Warning Message */
.warning-msg { background: #fff3cd !important; color: #856404 !important; border: 1px solid #ffc107; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal-content { background: white; padding: 30px; border-radius: 12px; max-width: 400px; width: 90%; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.modal-content h3 { margin-bottom: 15px; color: #050505; }
.modal-content p { margin-bottom: 20px; color: #65676b; }
.modal-actions { display: flex; gap: 12px; }
.btn-secondary { background: #e4e6eb; color: #050505; border: none; padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.2s; flex: 1; width: 100%; max-width: 250px; }
.btn-secondary:hover { background: #d0d2d6; }

/* Rating buttons */
.rating-buttons { display: flex; gap: 12px; margin-top: 15px; }
.rating-btn { flex: 1; padding: 10px; border: 2px solid #ddd; border-radius: 8px; background: white; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.rating-btn.good { border-color: #31a24c; color: #31a24c; }
.rating-btn.good:hover { background: #e8f5e9; }
.rating-btn.bad { border-color: #ff3b30; color: #ff3b30; }
.rating-btn.bad:hover { background: #ffebee; }
.rating-btn:disabled { opacity: 0.5; cursor: not-allowed; }