/* ========== Site Common CSS ========== */
/* Header / Footer / Buttons - extracted from index.html */

/* ===== Header / Navigation ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.2);
}
.header.white {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
}
.header-in {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}
.logo {
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 2px;
    color: #fff;
    background: rgba(255,255,255,0.15);
    padding: 6px 20px;
    border-radius: 40px;
    backdrop-filter: blur(4px);
    transition: 0.2s;
}
.logo:hover { background: rgba(255,255,255,0.25); }
.mheader-nav { display: flex; gap: 40px; list-style: none; }
.mheader-nav li a { text-decoration: none; font-size: 16px; font-weight: 500; color: #fff; transition: opacity 0.2s; }
.mheader-nav li a:hover { opacity: 0.8; }
.brand-dropdown { position: relative; }
.brand-dropdown > a { cursor: pointer; }
.brand-dropdown-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: rgba(17,17,17,0.95); border-radius: 8px; padding: 8px 0; min-width: 160px; list-style: none; gap: 0; box-shadow: 0 8px 30px rgba(0,0,0,0.3); z-index: 9999; }
.brand-dropdown:hover .brand-dropdown-menu { display: block; }
.brand-dropdown.open .brand-dropdown-menu { display: block; }
.brand-dropdown-menu li a { display: block; padding: 8px 20px; font-size: 14px; color: #ddd !important; white-space: nowrap; }
.brand-dropdown-menu li a:hover { color: #0A1F44 !important; background: rgba(255,255,255,0.05); }
.meun-off { display: none; flex-direction: column; gap: 6px; cursor: pointer; }
.meun-off span { width: 28px; height: 2px; background: #fff; transition: 0.3s; }
.nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100%;
    background: #07152E;
    z-index: 1050;
    padding: 80px 40px;
    transition: 0.4s;
}
.nav.open { right: 0; }
.nav ul li { list-style: none; margin-bottom: 30px; }
.nav ul li a { text-decoration: none; color: #fff; font-size: 24px; display: flex; flex-direction: column; }
.nav ul li a .en { font-size: 14px; opacity: 0.6; }
.close { position: absolute; top: 30px; right: 30px; cursor: pointer; color: #fff; font-size: 28px; }
@media (max-width: 1200px) { .mheader-nav { display: none; } .meun-off { display: flex; } }

/* ===== User Actions / Auth ===== */
.user-actions { display: flex; align-items: center; gap: 8px; }
.btn-login, .btn-register { padding: 6px 18px; border-radius: 40px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s; border: none; }
.btn-login { background: rgba(255,255,255,0.2); backdrop-filter: blur(10px); border: 1.5px solid rgba(255,255,255,0.3); color: #fff; }
.btn-login:hover { background: rgba(255,255,255,0.35); border-color: rgba(255,255,255,0.5); }
.btn-register { background: rgba(255,255,255,0.2); backdrop-filter: blur(10px); border: 1.5px solid rgba(255,255,255,0.3); color: #fff; }
.btn-register:hover { background: rgba(255,255,255,0.3); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.4); display: none; align-items: center; justify-content: center; color: #fff; font-size: 14px; cursor: pointer; position: relative; }
.user-avatar.show { display: flex; }
.user-dropdown { display: none; position: absolute; top: 45px; right: 0; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); padding: 8px 0; min-width: 160px; }
.user-dropdown.show { display: block; }
.user-dropdown a { display: block; padding: 10px 20px; color: #333; text-decoration: none; font-size: 14px; }
.user-dropdown a:hover { background: #f5f7fa; color: #0A1F44; }
.user-dropdown .divider { height: 1px; background: #eee; margin: 4px 0; }
.auth-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 3000; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.auth-modal.show { display: flex; }
.auth-box { background: #fff; border-radius: 20px; padding: 40px; width: 400px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; }
.auth-close { position: absolute; top: 15px; right: 28px; font-size: 24px; cursor: pointer; color: #999; }
.auth-close:hover { color: #333; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: #222; }
.auth-subtitle { font-size: 14px; color: #999; margin-bottom: 30px; }
.auth-tabs { display: flex; margin-bottom: 25px; border-bottom: 2px solid #eee; }
.auth-tab { flex: 1; padding: 10px; text-align: center; font-size: 16px; font-weight: 600; cursor: pointer; color: #999; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: #0A1F44; border-bottom-color: #0A1F44; }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-field { margin-bottom: 18px; }
.auth-field label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.auth-field input { width: 100%; padding: 12px 16px; border: 1.5px solid #ddd; border-radius: 10px; font-size: 15px; outline: none; }
.auth-field input:focus { border-color: #0A1F44; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.auth-submit { width: 100%; padding: 14px; background: linear-gradient(135deg, #0A1F44, #66FCF1); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.auth-submit:hover { box-shadow: 0 6px 20px rgba(102,126,234,0.4); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: #999; }
.auth-footer a { color: #0A1F44; text-decoration: none; }
.auth-error { color: #e94c4c; font-size: 13px; margin-top: 4px; display: none; }
.auth-error.show { display: block; }
@media (max-width: 768px) { .user-actions .btn-login, .user-actions .btn-register { padding: 4px 10px; font-size: 12px; } .user-avatar.show { display: flex; } }

/* ===== Footer ===== */
.m-footer { position: relative; z-index: 6; background: #07152E; color: #aaa; padding: 60px 5% 30px; }
.m-footer h4{font-size:16px;margin:0 0 20px;border:none;padding:0;color:#fff}
.footer-main { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.footer-main h4 { color: #fff; margin-bottom: 20px; }
.footer-nav a { display: block; margin-bottom: 10px; color: #ddd; text-decoration: none; }
.footer-nav a:hover { color: #0A1F44; }
.social-links a { display: inline-block; margin-right: 15px; color: #ccc; font-size: 24px; transition: 0.2s; position: relative; }
.social-links a:hover { color: #0A1F44; }
.social-links a .social-qr { display: none; position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 100; background: #fff; border-radius: 8px; padding: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.social-links a .social-qr img { width: 120px; height: 120px; object-fit: contain; display: block; }
.social-links a .social-qr::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid #fff; }
.social-links a:hover .social-qr { display: block; }
.social-links .social-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.social-row:first-child { gap: 5px; }
.privacy-links { text-align: center; margin-top: 40px; }
.privacy-links a {
    color: rgba(255,255,255,0.7);
    margin: 0 15px;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}
.privacy-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}
.copyright { text-align: center; margin-top: 20px; font-size: 14px; }

/* ===== Back to Top ===== */
.back2top {
    position: fixed;
    bottom: 20px;
    right: 28px;
    width: 52px;
    height: 52px;
    background: rgba(0,0,0,0.1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}
.back2top.show { opacity: 1; visibility: visible; }

/* ===== Cross-site Nav Footer ===== */
.footer-main { gap: 40px !important; }
.cross-site-nav-footer { box-sizing: border-box; padding-top: 0; padding-right: 200px; }
.cross-site-nav-footer__title { box-sizing: border-box; font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 10px; padding: 0; line-height: 1.4; }
.cross-site-nav-footer__grid { box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; margin: 0; padding: 0; list-style: none; }
.cross-site-nav-footer__item { box-sizing: border-box; margin: 0; padding: 0; line-height: 1.8; display: flex; align-items: center; gap: 6px; }
.cross-site-nav-footer__brand { box-sizing: border-box; font-size: 14px; color: #fff; text-decoration: none; transition: color .2s; cursor: pointer; padding: 0; white-space: nowrap; }
.cross-site-nav-footer__brand:hover { color: #ccc; text-decoration: underline; }
.cross-site-nav-footer__brand--current { font-weight: 700; color: #fff; text-decoration: underline; cursor: pointer; }
.cross-site-nav-footer__brand--current:hover { color: #fff; }
.cross-site-nav-footer__dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.6); flex-shrink: 0; }
.cross-site-nav-footer__item--current .cross-site-nav-footer__dot { background: #fff; box-shadow: 0 0 4px rgba(255,255,255,0.5); }
.cross-site-nav-footer__suffix { font-size: 12px; color: rgba(255,255,255,0.5); margin-left: 4px; }
@media (max-width: 767px) { .cross-site-nav-footer__grid { grid-template-columns: 1fr; gap: 4px; } }

/* ===== Human CS Floating Button ===== */
#human-cs-btn {
    position: fixed;
    bottom: 150px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A1F44, #66FCF1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(10,31,68,0.4);
    z-index: 2999;
    transition: transform .2s, box-shadow .2s;
    font-size: 24px;
}
#human-cs-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(10,31,68,0.5); }
#human-cs-btn .btn-label { position: absolute; right: 56px; background: #333; color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
#human-cs-btn:hover .btn-label { opacity: 1; }

/* ===== Simplified Floating CS Button (for pages without chat system) ===== */
#float-cs-btn {
    position: fixed;
    bottom: 150px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A1F44, #66FCF1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(10,31,68,0.4);
    z-index: 2999;
    transition: transform .2s, box-shadow .2s;
    font-size: 24px;
    text-decoration: none;
}
#float-cs-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(10,31,68,0.5); }
#float-cs-btn .btn-label { position: absolute; right: 56px; background: #333; color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
#float-cs-btn:hover .btn-label { opacity: 1; }

/* ===== Chat Toggle Button ===== */
#chat-toggle-btn {
    position: fixed;
    bottom: 80px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A1F44 0%, #66FCF1 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(10,31,68,0.4);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
#chat-toggle-btn:hover { transform: scale(1.1); box-shadow: 0 8px 25px rgba(10,31,68,0.5); }
#chat-icon { font-size: 28px; }
#chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ===== Chat Window ===== */
#chat-window {
    position: fixed;
    bottom: 24px;
    right: 28px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-header {
    background: linear-gradient(135deg, #0A1F44 0%, #66FCF1 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.chat-title { display: flex; flex-direction: column; }
.chat-name { font-weight: bold; font-size: 14px; }
.chat-status { font-size: 11px; opacity: 0.9; }
.chat-close-btn { background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; background: #f8f9fa; }
.chat-message { display: flex; margin-bottom: 15px; gap: 10px; }
.bot-message { flex-direction: row; }
.user-message { flex-direction: row-reverse; }
.message-avatar { width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.bot-message .message-avatar { background: linear-gradient(135deg, #0A1F44 0%, #66FCF1 100%); color: white; }
.user-message .message-avatar { background: #28a745; color: white; }
.message-content { max-width: 70%; }
.message-text { padding: 10px 15px; border-radius: 15px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.bot-message .message-text { background: white; border-bottom-left-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.user-message .message-text { background: linear-gradient(135deg, #0A1F44 0%, #66FCF1 100%); color: white; border-bottom-right-radius: 5px; }
.message-time { font-size: 11px; color: #999; margin-top: 5px; }
.bot-message .message-time { text-align: left; }
.user-message .message-time { text-align: right; }
.chat-input-area { border-top: 1px solid #eee; padding: 15px; background: white; }
.quick-replies { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.quick-replies button { padding: 6px 12px; background: #f0f0f0; border: 1px solid #ddd; border-radius: 15px; font-size: 12px; cursor: pointer; transition: all 0.3s; white-space: nowrap; }
.quick-replies button:hover { background: linear-gradient(135deg, #0A1F44 0%, #66FCF1 100%); color: white; border-color: #0A1F44; }
.input-container { display: flex; gap: 10px; }
.input-container input { flex: 1; padding: 10px 15px; border: 1px solid #ddd; border-radius: 20px; font-size: 14px; outline: none; transition: border-color 0.3s; }
.input-container input:focus { border-color: #0A1F44; }
.input-container button { padding: 10px 20px; background: linear-gradient(135deg, #0A1F44 0%, #66FCF1 100%); color: white; border: none; border-radius: 20px; cursor: pointer; font-size: 14px; transition: all 0.3s; }
.input-container button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(10,31,68,0.4); }
@media (max-width: 768px) {
    #chat-window { width: calc(100% - 40px); height: 60vh; bottom: 100px; right: 28px; }
    .message-content { max-width: 80%; }
}

/* ===== Typing Indicator ===== */
.typing-indicator { display: flex; gap: 5px; padding: 10px 15px; }
.typing-indicator span { width: 8px; height: 8px; background: #999; border-radius: 50%; animation: typing 1.4s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* ===== Chat Mode Tabs ===== */
.chat-mode-tabs { display: flex; border-bottom: 1px solid #eee; margin: 0 -16px; padding: 0 16px; background: #f8f9fa; }
.chat-mode-tab { flex: 1; text-align: center; padding: 8px 0; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: #666; transition: all .2s; }
.chat-mode-tab.active { color: #0A1F44; border-bottom-color: #0A1F44; font-weight: 600; }
.chat-mode-tab:hover { color: #0A1F44; }
