/**
 * Lado Competition Core - Public CSS (Phiên bản 1.9.5)
 * Giao diện App Full-screen, Glassmorphism, Đếm ngược, Tra cứu, Giấy chứng nhận, Thống kê 
 * Chatbot AI (Fix cuộn mượt và Nút hiển thị chuẩn) và Banner/Footer hiện đại cao cấp
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ==========================================================================
   1. APP OVERLAY (GIAO DIỆN TOÀN MÀN HÌNH - FULLSCREEN APP)
   ========================================================================== */
#lado-app-overlay.lado-fullscreen-app {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* ==========================================================================
   2. GLOBAL HEADER (GLASSMORPHISM & ĐẾM NGƯỢC) - BẢN SÁNG (LIGHT MODE)
   ========================================================================== */
.lado-global-header.lado-glass-panel {
    width: 100%;
    background: rgba(255, 255, 255, 0.85); /* Đổi sang nền trắng trong suốt */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08); /* Viền mờ màu xám nhạt */
    color: #2d3748; /* Chữ màu tối để nổi bật trên nền sáng */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* Bóng đổ nhẹ nhàng hơn */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.lado-comp-info { display: flex; flex-direction: column; }

.lado-badge {
    background: linear-gradient(90deg, #16a34a, #22c55e);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 30px;
    text-transform: uppercase;
    margin-bottom: 8px;
    align-self: flex-start;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.pulse-anim { animation: pulse 2s infinite; }
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.lado-time-range { margin: 0; font-size: 14px; color: #4a5568; /* Đổi thành xám đậm */ }
.lado-time-range strong { color: #1a202c; font-weight: 700; /* Đổi thành đen */ }

.lado-comp-countdown { text-align: center; display: flex; align-items: center; gap: 15px; }
.countdown-label { font-size: 15px; font-weight: 600; color: #4a5568; text-transform: uppercase; letter-spacing: 0.5px; }

.countdown-clock {
    color: #ce2029; /* Đổi màu chữ đồng hồ sang màu đỏ cờ Đảng */
    font-size: 22px;
    font-weight: 700;
    background: #fff5f5; /* Nền đỏ siêu nhạt */
    padding: 8px 20px;
    border-radius: 8px;
    letter-spacing: 1px;
    border: 1px solid #feb2b2;
    box-shadow: none; /* Bỏ bóng đổ lõm màu đen */
    font-variant-numeric: tabular-nums;
}

.lado-btn-glass {
    background: rgba(0, 0, 0, 0.04); /* Nền nút xám nhạt */
    color: #2d3748; /* Chữ tối màu */
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.lado-btn-glass:hover { 
    background: #fff5f5; 
    color: #ce2029; 
    border-color: #feb2b2; 
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(206, 32, 41, 0.15); 
}

/* ==========================================================================
   3. KHUNG THI CHÍNH (MAIN CARD WRAPPER)
   ========================================================================== */
#lado-exam-wrapper.lado-main-card {
    width: 100%;
    max-width: 1000px;
    flex-grow: 1;
    background: #ffffff;
    margin: 40px auto 60px auto;
    padding: 50px 60px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
    box-sizing: border-box;
}

.lado-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ce2029;
    padding-bottom: 20px;
    margin-bottom: 35px;
}

.lado-exam-title h2 { margin: 0; color: #ce2029; font-size: 28px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.lado-exam-title p { margin: 8px 0 0 0; color: #4a5568; font-size: 16px; font-weight: 500; }

#lado-timer {
    font-size: 32px;
    font-weight: 700;
    color: #ce2029;
    background: #fff5f5;
    padding: 10px 30px;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   4. CỤM NÚT HÀNH ĐỘNG CHÀO MỪNG (THỂ LỆ, THAM GIA, TÀI LIỆU)
   ========================================================================== */
.lado-action-buttons { 
    display: flex; 
    justify-content: center; 
    align-items: center;
    gap: 15px; 
    flex-wrap: wrap; 
    margin-bottom: 40px; 
    margin-top: 10px;
}

.lado-btn-action { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    color: #fff; 
    border: none; 
    padding: 16px 25px; 
    border-radius: 30px; 
    cursor: pointer; 
    font-size: 16px; 
    font-weight: 700; 
    text-transform: uppercase; 
    transition: all 0.3s ease; 
}
.lado-btn-action .icon { font-size: 20px; line-height: 1; }

.lado-btn-action.btn-blue { background: linear-gradient(135deg, #3182ce, #2b6cb0); box-shadow: 0 6px 15px rgba(49,130,206,0.3); }
.lado-btn-action.btn-blue:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(49,130,206,0.4); background: linear-gradient(135deg, #2b6cb0, #2c5282); }

.lado-btn-action.btn-orange { background: linear-gradient(135deg, #dd6b20, #c05621); box-shadow: 0 6px 15px rgba(221,107,32,0.3); }
.lado-btn-action.btn-orange:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(221,107,32,0.4); background: linear-gradient(135deg, #c05621, #9c4221); }

.lado-btn-primary { 
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ce2029, #b81c24); color: #ffffff; 
    padding: 16px 40px; border: none; border-radius: 30px; cursor: pointer; 
    font-size: 18px; font-weight: 800; text-align: center; transition: all 0.3s ease; text-transform: uppercase; 
}
.lado-btn-primary:hover { background: linear-gradient(135deg, #b81c24, #8f151c); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(206, 32, 41, 0.3); }

.lado-btn-primary.btn-dark { background: linear-gradient(135deg, #2d3748, #1a202c); }
.lado-btn-primary.btn-dark:hover { box-shadow: 0 8px 15px rgba(26, 32, 44, 0.2); }
.lado-btn-primary.full-width-btn { width: 100%; border-radius: 8px; }

.btn-glow { animation: glowBtn 2s infinite alternate; }
@keyframes glowBtn { 0% { box-shadow: 0 0 0 rgba(206, 32, 41, 0.2); } 100% { box-shadow: 0 0 18px rgba(206, 32, 41, 0.6); } }

/* ==========================================================================
   5. MÀN HÌNH CHÀO MỪNG & FORM ĐĂNG KÝ
   ========================================================================== */
#lado-welcome-step { padding: 10px 0 30px; text-align: center; }

.lado-welcome-box {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 45px 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.lado-welcome-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ce2029, #ef4444);
}

.lado-welcome-title { 
    color: #1e293b; 
    font-size: 24px; 
    font-weight: 800; 
    margin: 0 0 15px 0; 
    letter-spacing: 0.5px;
}

.lado-divider {
    width: 60px;
    height: 4px;
    background: #ce2029;
    margin: 0 auto 20px auto;
    border-radius: 4px;
}

.lado-welcome-desc { 
    color: #475569; 
    font-size: 16px; 
    margin: 0 0 35px 0; 
    line-height: 1.7; 
}

.lado-welcome-note {
    display: inline-block;
    margin-top: 10px;
    color: #ce2029; 
    font-size: 14px;
    font-weight: 600;
    background: #fff5f5;
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px dashed #feb2b2;
}

.lado-step-notice { background: #f8fafc; border-left: 4px solid #3182ce; padding: 20px; border-radius: 8px; margin-bottom: 30px; text-align: left; }
.step-title { margin: 0 0 8px 0; color: #2d3748; font-size: 20px; font-weight: 700; }
.step-warning { margin: 0; color: #e53e3e; font-size: 15px; font-weight: 500; }

.lado-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-bottom: 35px; }
.lado-form-group.full-width { grid-column: span 2; }
.lado-form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #4a5568; font-size: 15px; }
.lado-form-group input, .lado-form-group select, .lado-textarea-field { width: 100%; padding: 14px 18px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 15px; background: #f8fafc; box-sizing: border-box; transition: all 0.3s ease; color: #2d3748; font-family: inherit; font-weight: 400; }
.lado-form-group input:focus, .lado-form-group select:focus, .lado-textarea-field:focus { border-color: #3182ce; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15); }

.lado-success-icon { font-size: 60px; margin-bottom: 15px; }
.lado-success-title { color: #16a34a; font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.lado-success-desc { font-size: 18px; color: #4a5568; }
.lado-warning-box { background: #fff5f5; border: 1px dashed #feb2b2; padding: 20px; border-radius: 8px; margin: 30px auto; text-align: left; max-width: 600px; }
.warning-title { color: #c53030; margin: 0; font-weight: 700; font-size: 16px; }
.warning-list { color: #c53030; margin-top: 10px; padding-left: 20px; line-height: 1.6; font-size: 15px; font-weight: 400; }

/* ==========================================================================
   6. BÀI THI TRẮC NGHIỆM & TỰ LUẬN
   ========================================================================== */
.lado-step-title-box { background: #fff5f5; border-left: 4px solid #ce2029; padding: 15px 20px; margin-bottom: 30px; border-radius: 6px; font-size: 18px; font-weight: 700; color: #ce2029; display: flex; align-items: center; }
.lado-step-title-box.essay-mode { background: #f0fdf4; border-left-color: #16a34a; color: #16a34a; }
.step-icon { font-size: 20px; margin-right: 12px; }
.lado-questions-wrapper { display: grid; grid-template-columns: 1fr; gap: 25px; }
.lado-question-block { background: #ffffff; border: 1px solid #edf2f7; border-radius: 12px; padding: 25px; transition: all 0.3s ease; }
.lado-question-block:hover { border-color: #cbd5e0; box-shadow: 0 10px 20px rgba(0,0,0,0.04); }
.lado-question-block h4 { margin-top: 0; margin-bottom: 20px; color: #2d3748; font-size: 17px; line-height: 1.6; font-weight: 500; }
.q-num { font-weight: 700; }
.lado-options { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.lado-opt-label { display: flex; align-items: center; padding: 15px 20px; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; cursor: pointer; transition: all 0.2s ease; font-size: 15px; color: #4a5568; }
.lado-opt-label:hover { background: #edf2f7; border-color: #a0aec0; }
.lado-opt-label input[type="radio"] { margin-right: 15px; transform: scale(1.2); cursor: pointer; }
.lado-opt-label input[type="radio"]:checked + span { font-weight: 700; color: #ce2029; }
.lado-opt-label:has(input[type="radio"]:checked) { background: #fff5f5; border-color: #ce2029; }

.lado-essay-prompt { background: #f8fafc; padding: 25px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 30px; line-height: 1.7; color: #2d3748; font-size: 15px; }
.lado-upload-box { margin-top: 30px; padding: 25px; border: 1px dashed #cbd5e0; border-radius: 8px; background: #f8fafc; }
.lado-bold-label { font-size: 16px !important; font-weight: 700 !important; display: block; }
.lado-upload-desc { font-size: 14px; color: #718096; margin-top: 5px; margin-bottom: 20px; }
.lado-btn-outline { background: transparent; color: #3182ce; border: 1px solid #3182ce; padding: 12px 25px; border-radius: 6px; font-weight: 700; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.lado-btn-outline:hover { background: #3182ce; color: #fff; }
.lado-action-bottom { text-align: center; margin-top: 40px; padding-top: 30px; border-top: 1px solid #edf2f7; }

/* ==========================================================================
   7. MODAL TRA CỨU & THỂ LỆ 
   ========================================================================== */
.lado-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,0.75); z-index: 99999; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); padding: 20px; box-sizing: border-box; }
.lado-glass-modal { background: rgba(255, 255, 255, 0.98); width: 100%; max-width: 550px; max-height: 90vh; display: flex; flex-direction: column; border-radius: 16px; padding: 35px; position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3); animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-sizing: border-box; }
@keyframes modalSlideUp { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.lado-lookup-close { position: absolute; top: 15px; right: 25px; font-size: 32px; cursor: pointer; color: #a0aec0; transition: color 0.2s; z-index: 10; line-height: 1; }
.lado-lookup-close:hover { color: #ce2029; }
.lado-modal-header, .lado-glass-modal > .lado-form-group { flex-shrink: 0; }
.lado-modal-header { text-align: center; margin-bottom: 20px; }
.lado-modal-icon { font-size: 45px; margin-bottom: 10px; }
.lado-modal-title { color: #ce2029; margin: 0 0 8px 0; font-size: 24px; font-weight: 800; text-transform: uppercase; }
.lado-modal-desc { font-size: 15px; color: #4a5568; margin: 0; line-height: 1.5; }
.lado-input-field { width: 100%; padding: 14px 18px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 15px; font-size: 15px; box-sizing: border-box; }
.lado-input-field:focus { border-color: #3182ce; outline: none; }
.lado-lookup-results { margin-top: 15px; flex-grow: 1; overflow-y: auto; min-height: 0; text-align: left; padding-right: 8px; }
.lado-lookup-results::-webkit-scrollbar { width: 6px; }
.lado-lookup-results::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }

.lado-editor-content { padding: 10px 15px 20px 5px; font-size: 16px; line-height: 1.8; color: #334155; }
.lado-editor-content h1, .lado-editor-content h2, .lado-editor-content h3, .lado-editor-content h4 { color: #ce2029; margin-top: 25px; margin-bottom: 15px; font-weight: 800; }
.lado-editor-content h2 { font-size: 22px; }
.lado-editor-content h3 { font-size: 18px; }
.lado-editor-content p { margin-bottom: 15px; }
.lado-editor-content a { color: #2563eb; text-decoration: none; font-weight: 600; border-bottom: 1px solid transparent; transition: 0.2s; }
.lado-editor-content a:hover { border-bottom-color: #2563eb; }
.lado-result-card { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 4px solid #3182ce; border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.lado-result-card h4 { margin: 0 0 10px 0; color: #2d3748; font-size: 16px; font-weight: 700; }
.lado-result-card p { margin: 6px 0; font-size: 15px; color: #4a5568; }
.lado-result-essay { background: #fff; padding: 15px; border: 1px solid #e2e8f0; border-radius: 6px; margin-top: 15px; font-size: 14px; line-height: 1.6; }

/* ==========================================================================
   8. GIẤY CHỨNG NHẬN
   ========================================================================== */
#certificate-container { animation: fadeIn 1s ease-in-out; }
.lado-certificate { background: #ffffff; background-image: radial-gradient(#e2e8f0 2px, transparent 2px); background-size: 20px 20px; border: 10px solid #ce2029; padding: 50px 40px; border-radius: 12px; position: relative; color: #2d3748; max-width: 800px; margin: 0 auto; box-shadow: 0 10px 30px rgba(0,0,0,0.1); text-align: center; overflow: hidden; }
.lado-certificate.has-bg { background-image: none; border: none; padding: 60px 40px; border-radius: 0; box-shadow: 0 15px 40px rgba(0,0,0,0.15); }
.cert-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.85); z-index: 1; }
.lado-certificate::before { content: ''; position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px; border: 1px solid #ce2029; border-radius: 6px; pointer-events: none; z-index: 2; }
.lado-certificate.has-bg::before { display: none; }
.cert-content-wrap { position: relative; z-index: 3; }
.cert-header h4 { color: #4a5568; margin-bottom: 5px; font-weight: 700; font-size: 16px; letter-spacing: 1px; }
.cert-header h2 { color: #ce2029; font-size: 36px; font-weight: 800; margin-top: 0; text-transform: uppercase; letter-spacing: 2px; }
.cert-body { margin: 40px 0; }
.cert-body p { font-size: 18px; margin: 10px 0; color: #4a5568; }
.cert-name { font-size: 46px; color: #ce2029; font-family: "Times New Roman", Georgia, serif; font-style: italic; font-weight: bold; margin: 25px 0; text-transform: uppercase; }
.cert-achievement { font-weight: 600; color: #2d3748; font-size: 20px !important; }
.cert-competition-name { font-size: 18px !important; margin-top: 12px; font-weight: 800; color: #ce2029; line-height: 1.5; text-transform: uppercase; }
.cert-footer { text-align: right; margin-top: 50px; font-style: italic; font-size: 16px; padding-right: 25px; }
.cert-footer-sign { margin-top: 10px; font-weight: 800; font-style: normal; color: #2d3748; font-size: 18px; }
.btn-download { margin-top: 35px; background: linear-gradient(135deg, #0969da, #0352b5); box-shadow: 0 8px 20px rgba(9, 105, 218, 0.25); }
.btn-download:hover { background: linear-gradient(135deg, #0352b5, #023b82); box-shadow: 0 10px 25px rgba(9, 105, 218, 0.35); }

/* ==========================================================================
   9. BẢNG THỐNG KÊ CÔNG KHAI
   ========================================================================== */
.lado-public-stats-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 40px; padding-top: 30px; border-top: 1px solid #e2e8f0; }
.lado-stat-panel { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px; display: flex; flex-direction: column; }
.lado-stat-panel.highlight { background: #fff5f5; border-color: #feb2b2; }
.lado-stat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 2px solid #edf2f7; padding-bottom: 15px; }
.lado-stat-panel.highlight .lado-stat-header { border-bottom-color: #fed7d7; }
.lado-stat-header h4 { margin: 0; font-size: 16px; color: #4a5568; font-weight: 800; }
.lado-stat-panel.highlight .lado-stat-header h4 { color: #c53030; }
.lado-stat-big-number { font-size: 30px; font-weight: 800; color: #2b6cb0; background: #ebf8ff; padding: 6px 16px; border-radius: 8px; }
.lado-stat-panel.highlight .lado-stat-big-number { color: #e53e3e; background: #fff0f0; }
.lado-stat-table-wrap { flex-grow: 1; max-height: 280px; overflow-y: auto; padding-right: 8px; }
.lado-stat-table-wrap::-webkit-scrollbar { width: 6px; }
.lado-stat-table-wrap::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }
.lado-stat-table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: left; }
.lado-stat-table td { padding: 12px 5px; border-bottom: 1px dashed #e2e8f0; color: #2d3748; }
.lado-stat-table tr:last-child td { border-bottom: none; }
.lado-stat-table td.stat-count { text-align: right; font-weight: 800; color: #4a5568; }

/* ==========================================================================
   10. WIDGET CHATBOT AI (Bổ sung Fix Tràn chữ + Flexbox Cuộn mượt mà)
   ========================================================================== */
#lado-chatbot-toggle { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    width: auto;            /* FIXED: Tự động co giãn theo chữ */
    height: auto;           /* FIXED: Không dùng height tĩnh 60px */
    padding: 14px 24px;     /* FIXED: Chuyển thành nút viên thuốc (Pill) */
    border-radius: 30px;    /* FIXED: Bo 2 góc tròn đều thay vì 50% */
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #ce2029, #a0181f); 
    color: #fff; 
    border: none; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    box-shadow: 0 5px 20px rgba(206, 32, 41, 0.4); 
    cursor: pointer; 
    z-index: 99998; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
}
#lado-chatbot-toggle:hover { 
    transform: scale(1.05) translateY(-5px); 
    box-shadow: 0 8px 25px rgba(206, 32, 41, 0.5); 
}

#lado-chatbot-widget { 
    position: fixed; 
    bottom: 100px; 
    right: 30px; 
    width: 380px; 
    height: 600px; 
    max-height: calc(100vh - 130px); 
    background: #ffffff; 
    border-radius: 16px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); 
    z-index: 99999; 
    display: none; 
    flex-direction: column; 
    overflow: hidden; 
    border: 1px solid rgba(0,0,0,0.08); 
    transform-origin: bottom right; 
    animation: scaleChatIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
}

/* FIXED QUAN TRỌNG: Ghi đè hiệu ứng fadeToggle của jQuery ép thành flexbox thay vì block để tạo cuộn được */
#lado-chatbot-widget[style*="display: block"] {
    display: flex !important;
}

@keyframes scaleChatIn { from { opacity: 0; transform: scale(0.8) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.lado-chatbot-header { background: linear-gradient(135deg, #ce2029, #a0181f); color: #ffffff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 2; }
.lado-chatbot-close { font-size: 28px; cursor: pointer; opacity: 0.8; transition: 0.2s; line-height: 1; }
.lado-chatbot-close:hover { opacity: 1; transform: scale(1.1); }
.lado-chatbot-body { flex: 1; min-height: 0; padding: 20px; overflow-y: auto; background: #f8fafc; display: flex; flex-direction: column; gap: 15px; scroll-behavior: smooth; }
.lado-chatbot-body::-webkit-scrollbar { width: 6px; }
.lado-chatbot-body::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }
.chat-msg { max-width: 85%; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.6; word-break: break-word; animation: fadeMsgUp 0.3s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
@keyframes fadeMsgUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.user-msg { align-self: flex-end; background: #ce2029; color: #ffffff; border-bottom-right-radius: 4px; }
.ai-msg { align-self: flex-start; background: #ffffff; color: #1e293b; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.ai-msg strong { color: #ce2029; }
.ai-msg.error { color: #e53e3e; font-style: italic; background: #fff5f5; border-color: #feb2b2; }
.typing { color: #94a3b8; font-style: italic; background: transparent; border: none; box-shadow: none; padding: 0; align-self: flex-start; }
.dot { animation: typingDot 1.4s infinite; display: inline-block; font-weight: bold; font-size: 18px; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%, 20% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
.lado-chatbot-input-area { display: flex; padding: 15px; background: #ffffff; border-top: 1px solid #edf2f7; gap: 10px; align-items: center; }
.lado-chatbot-input-area input { flex: 1; padding: 12px 18px; border: 1px solid #e2e8f0; border-radius: 25px; outline: none; font-size: 14px; background: #f1f5f9; transition: 0.3s; }
.lado-chatbot-input-area input:focus { background: #ffffff; border-color: #ce2029; box-shadow: 0 0 0 3px rgba(206,32,41,0.1); }
.lado-chatbot-input-area button { background: #ce2029; color: #ffffff; border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; flex-shrink: 0; }
.lado-chatbot-input-area button:hover { background: #a0181f; transform: scale(1.05); }

div:where(.swal2-container) { z-index: 9999999 !important; }
div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm { background-color: #ce2029 !important; border-radius: 6px !important; padding: 10px 20px !important; font-weight: 700 !important; font-family: 'Inter', sans-serif !important; text-transform: uppercase; }
div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel { border-radius: 6px !important; padding: 10px 20px !important; font-family: 'Inter', sans-serif !important; font-weight: 600 !important; text-transform: uppercase; }

/* ==========================================================================
   11. HEADER BANNER HIỆN ĐẠI (PREMIUM - BRIGHT THEME)
   ========================================================================== */
.lado-brand-header {
    width: 100%;
    /* Đổi sang dải màu đỏ tươi sáng và rực rỡ hơn */
    background-color: #ce2029;
    background-image: linear-gradient(135deg, #ef4444 0%, #ce2029 50%, #b91c1c 100%);
    background-size: cover;
    background-position: center;
    color: #ffffff;
    text-align: center;
    padding: 60px 20px; /* Tăng padding cho thoáng đãng hơn */
    position: relative;
    /* Đổi bóng đổ đen nặng nề thành bóng đổ màu đỏ nhẹ nhàng */
    box-shadow: 0 10px 25px rgba(206, 32, 41, 0.2);
    z-index: 10;
    border-bottom: 4px solid #fbbf24; /* Viền vàng sáng và dày hơn một chút */
}

.lado-brand-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Loại bỏ màng đen thui, thay bằng lớp màng sáng nhẹ từ trên xuống */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.05) 100%);
    z-index: 1;
}

.lado-brand-header-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lado-brand-header-subtitle {
    font-size: 15px;
    font-weight: 700;
    color: #fef08a; /* Vàng nhạt tươi sáng */
    text-transform: uppercase;
    letter-spacing: 3px; /* Tăng khoảng cách chữ cho sang trọng */
    margin-bottom: 8px;
    /* Thêm khung nền mờ (pill) để chữ luôn nổi bật dù Admin thay ảnh nền gì */
    background: rgba(0, 0, 0, 0.15); 
    padding: 6px 20px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
    text-shadow: none; /* Bỏ viền đen của chữ */
}

.lado-brand-header h1 {
    margin: 0;
    font-size: 38px; /* Cho tiêu đề to hơn một chút */
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
    /* Bóng đổ mềm mại hơn, bớt u tối */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); 
}

/* ==========================================================================
   12. FOOTER THƯƠNG HIỆN ĐẠI (PREMIUM)
   ========================================================================== */
.lado-brand-footer {
    width: 100%;
    background: linear-gradient(to bottom, #1a202c, #0f172a);
    color: #cbd5e1;
    padding: 60px 20px 30px;
    margin-top: auto;
    font-size: 15px;
    z-index: 10;
    box-sizing: border-box;
    border-top: 4px solid #ce2029;
}
.lado-brand-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.lado-footer-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lado-footer-org {
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.lado-footer-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lado-footer-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    padding: 12px 20px;
    border-radius: 8px;
    transition: 0.3s;
}
.lado-footer-contact-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}
.lado-footer-contact-icon {
    font-size: 20px;
    background: rgba(206, 32, 41, 0.2);
    color: #ef4444;
    width: 40px; height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}
.lado-footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 25px;
    margin-top: 20px;
    font-size: 14px;
    color: #64748b;
}

/* TỐI ƯU MÀN HÌNH NHỎ (RESPONSIVE) */
@media (max-width: 900px) {
    .lado-global-header.lado-glass-panel { flex-direction: column; gap: 15px; text-align: center; padding: 15px; }
    .lado-comp-info .lado-badge { align-self: center; }
    .lado-comp-countdown { flex-direction: column; gap: 8px; }
    
    #lado-exam-wrapper.lado-main-card { margin: 20px auto; padding: 30px 20px; border-radius: 0; box-shadow: none; }
    .lado-options { grid-template-columns: 1fr; }
    
    .lado-exam-header { flex-direction: column; text-align: center; gap: 15px; }
    .lado-exam-title h2 { font-size: 22px; }
    
    #lado-timer { width: 100%; position: sticky; top: 0; z-index: 100; font-size: 28px; padding: 10px; }
    
    .lado-form-grid { grid-template-columns: 1fr; gap: 15px; }
    .lado-form-group.full-width { grid-column: span 1; }
    
    .lado-certificate { padding: 30px 15px; border-width: 6px; }
    .cert-header h2 { font-size: 24px; }
    .cert-name { font-size: 32px; }
    .cert-body p { font-size: 15px; }
    .cert-achievement, .cert-competition-name { font-size: 15px !important; }
    
    .lado-glass-modal { padding: 25px 20px; }
    .lado-action-buttons { flex-direction: column; align-items: stretch; }
    
    .lado-brand-header h1 { font-size: 24px; }
    .lado-brand-footer-inner { grid-template-columns: 1fr; text-align: center; gap: 30px; }
    .lado-footer-contact-item { justify-content: center; }
    .lado-footer-contact-item:hover { transform: translateY(-3px); }
    
    #lado-chatbot-widget { bottom: 0; right: 0; width: 100%; height: 85vh; border-radius: 20px 20px 0 0; border: none; } 
    #lado-chatbot-toggle { bottom: 20px; right: 20px; width: auto; height: auto; padding: 12px 20px; font-size: 14px; }
}