/* VietXinChao AI Tutor - Frontend Styling & Robot Interface */
:root {
    --vxc-primary: #0284c7;
    --vxc-primary-hover: #0369a1;
    --vxc-gold: #06b6d4;
    --vxc-bg-chat: #ffffff;
    --vxc-text-main: #1f2937;
    --vxc-text-muted: #6b7280;
    --vxc-border: #bae6fd;
    --vxc-shadow: 0 10px 30px -5px rgba(2, 132, 199, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --vxc-robot-bg: linear-gradient(180deg, #091326 0%, #0f274a 100%);
}

/* Khoá cuộn nền trang web khi AI Tutor mở toàn màn hình */
body.vxc-fullscreen-open {
    overflow: hidden !important;
    touch-action: none !important;
}

.vxc-ai-widget-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Floating Launcher Button */
.vxc-ai-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--vxc-primary), #06b6d4);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    overflow: hidden;
}

.vxc-ai-toggle-btn:hover {
    transform: scale(1.08);
}

/* ================= TOÀN MÀN HÌNH (FULLSCREEN IMMERSIVE CONTAINER) ================= */
.vxc-ai-chatbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999999 !important;
    display: flex;
    flex-direction: column;
    background: #090f1d;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    animation: vxcFullScreenFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vxcFullScreenFadeIn {
    from {
        opacity: 0;
        transform: scale(0.985);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mode 1: Text Chat trong Fullscreen */
.vxc-chat-mode-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .vxc-chat-mode-container {
        max-width: 960px;
        margin: 0 auto;
        background: #ffffff;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
    }
}

.vxc-chat-header {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.vxc-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vxc-btn-avatar-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.vxc-header-avatar-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.vxc-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vxc-tutor-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.vxc-tutor-status {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.vxc-status-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.vxc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Nút chuyển chế độ Robot Call */
.vxc-mode-pill-btn {
    background: #0284c7;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s, background 0.15s;
    animation: vxcGlow 2s infinite ease-in-out;
}

@keyframes vxcGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(2, 132, 199, 0.4); }
    50% { box-shadow: 0 0 12px rgba(6, 182, 212, 0.85); transform: scale(1.02); }
}

.vxc-icon-btn, .vxc-icon-btn-light {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 20px;
    padding: 6px 14px;
    height: auto;
    width: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.vxc-icon-btn:hover, .vxc-icon-btn-light:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Upsell Promo Banner */
.vxc-promo-banner {
    background: #f0f9ff;
    border-bottom: 1px solid #e0f2fe;
    padding: 7px 14px;
    font-size: 11px;
    color: #0369a1;
    text-align: center;
}

.vxc-promo-banner a {
    color: var(--vxc-primary);
    font-weight: 700;
    text-decoration: underline;
}

/* Messages Box */
.vxc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
}

.vxc-msg {
    display: flex;
    flex-direction: column;
    max-width: 84%;
}

.vxc-msg-bot { align-self: flex-start; }
.vxc-msg-user { align-self: flex-end; }

.vxc-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}

.vxc-msg-bot .vxc-msg-bubble {
    background: #ffffff;
    color: var(--vxc-text-main);
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.vxc-msg-translation {
    margin-top: 6px;
    font-size: 12px;
    color: var(--vxc-text-muted);
    font-style: italic;
    border-top: 1px dashed #e5e7eb;
    padding-top: 4px;
}

.vxc-msg-user .vxc-msg-bubble {
    background: var(--vxc-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.vxc-bot-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.vxc-btn-listen {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--vxc-primary);
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    padding: 2px 4px;
}

.vxc-bubble-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    align-self: flex-start;
}

.vxc-bubble-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
}

.vxc-btn-robot-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.45);
    border: 1px solid rgba(110, 231, 183, 0.4);
    animation: vxcPulseCta 2s infinite ease-in-out;
}

.vxc-btn-robot-cta:hover {
    transform: scale(1.03);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

@keyframes vxcPulseCta {
    0%, 100% { box-shadow: 0 4px 16px rgba(5, 150, 105, 0.45); }
    50% { box-shadow: 0 4px 24px rgba(16, 185, 129, 0.75); }
}

/* Typing Indicator */
.vxc-typing {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--vxc-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
}

.vxc-dots span {
    width: 4px;
    height: 4px;
    background: var(--vxc-text-muted);
    border-radius: 50%;
    display: inline-block;
    animation: vxcBounce 1.4s infinite ease-in-out both;
}
.vxc-dots span:nth-child(1) { animation-delay: -0.32s; }
.vxc-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes vxcBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Interactive Quick Topic Starters */
.vxc-quick-suggestions {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.vxc-quick-suggestions::-webkit-scrollbar { display: none; }

.vxc-suggestion-chip {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 6px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.vxc-suggestion-chip:hover {
    background: var(--vxc-primary);
    color: #ffffff;
    border-color: var(--vxc-primary);
    transform: translateY(-1px);
}

/* Input Area (Fullscreen Optimized) */
.vxc-chat-input-area {
    padding: 14px 24px;
    background: #ffffff;
    border-top: 1px solid var(--vxc-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.vxc-chat-input-area input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.vxc-chat-input-area input:focus {
    border-color: var(--vxc-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.vxc-input-tool-btn, .vxc-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vxc-input-tool-btn { background: #f3f4f6; color: #4b5563; }
.vxc-send-btn { background: var(--vxc-primary); color: #ffffff; }

/* ================= CHẾ ĐỘ TALKING ROBOT ================= */
.vxc-robot-mode-container {
    background: var(--vxc-robot-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.vxc-robot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vxc-robot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vxc-avatar-toggle-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vxc-avatar-toggle-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
}

.vxc-call-timer {
    font-family: monospace;
    font-size: 13px;
    color: #94a3b8;
}

.vxc-call-badge {
    font-size: 12px;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vxc-pulse-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: vxcPulseDot 1.5s infinite;
}

@keyframes vxcPulseDot {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #10b981; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* Robot Stage */
.vxc-robot-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px 16px;
    min-height: 250px;
}

.vxc-robot-avatar {
    width: 200px;
    height: 200px;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= 3D ANIMATED ROBOT CHARACTER ================= */
.vxc-robot-character {
    width: 170px;
    height: 195px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Bóng mờ lơ lửng bên dưới */
.vxc-robot-shadow {
    position: absolute;
    bottom: -6px;
    width: 100px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 70%);
    animation: vxcRobotShadow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes vxcRobotShadow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(0.75); opacity: 0.25; }
}

/* Khung thân robot lơ lửng */
.vxc-robot-body-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: vxcRobotHover 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes vxcRobotHover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Ăng-ten */
.vxc-robot-antenna {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: -3px;
    position: relative;
    z-index: 1;
}

.vxc-antenna-ball {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.7);
    transition: all 0.3s ease;
}

.vxc-antenna-signal {
    position: absolute;
    top: -4px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 1.5px solid #38bdf8;
    opacity: 0;
    pointer-events: none;
}

.vxc-antenna-pole {
    width: 3.5px;
    height: 14px;
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    border-radius: 2px;
}

/* Tai nghe robot 2 bên */
.vxc-robot-ear {
    position: absolute;
    top: 40px;
    width: 14px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(180deg, #64748b 0%, #334155 100%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 4px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.vxc-ear-left { left: 4px; }
.vxc-ear-right { right: 4px; }

.vxc-ear-core {
    width: 6px;
    height: 16px;
    border-radius: 4px;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    transition: all 0.3s ease;
}

/* Đầu Robot */
.vxc-robot-head {
    width: 146px;
    height: 104px;
    border-radius: 46px 46px 40px 40px;
    background: linear-gradient(145deg, #ffffff 0%, #e2e8f0 35%, #cbd5e1 75%, #94a3b8 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 3px 5px rgba(255, 255, 255, 0.95), inset 0 -4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: transform 0.3s ease;
}

.vxc-head-aura {
    position: absolute;
    inset: -5px;
    border-radius: 50px 50px 45px 45px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Mặt kính màn hình Visor */
.vxc-robot-visor {
    width: 116px;
    height: 68px;
    border-radius: 30px;
    background: linear-gradient(180deg, #070a13 0%, #0d1527 100%);
    border: 2px solid #1e293b;
    box-shadow: inset 0 0 14px rgba(56, 189, 248, 0.3), 0 3px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vxc-visor-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 48%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 30px 30px 0 0;
    pointer-events: none;
}

.vxc-visor-scanline {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 3px;
    pointer-events: none;
    opacity: 0.6;
}

/* Khuôn mặt số (Eyes + Cheeks + Mouth) */
.vxc-robot-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    padding-top: 3px;
}

/* Đôi mắt điện tử */
.vxc-robot-eyes {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.vxc-robot-eye {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 14px #38bdf8, 0 0 22px rgba(56, 189, 248, 0.75);
    position: relative;
    animation: vxcEyeBlink 3.8s infinite ease-in-out;
    transition: all 0.25s ease;
}

.vxc-eye-shine {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffffff;
}

@keyframes vxcEyeBlink {
    0%, 94%, 98%, 100% { transform: scaleY(1); }
    96% { transform: scaleY(0.08); }
}

/* Má hồng công nghệ */
.vxc-robot-cheeks {
    position: absolute;
    top: 33px;
    width: 82px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.vxc-blush {
    width: 8px;
    height: 5px;
    border-radius: 50%;
    background: rgba(244, 114, 182, 0.5);
    box-shadow: 0 0 8px rgba(244, 114, 182, 0.4);
}

/* Mồm Robot */
.vxc-robot-mouth-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 18px;
}

/* Trạng thái miệng cười bình thường */
.vxc-mouth-shape {
    width: 18px;
    height: 5px;
    border-bottom: 2.5px solid #38bdf8;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 6px rgba(56, 189, 248, 0.6);
    transition: all 0.2s ease;
}

/* Sóng âm thanh nhấp nháy trong miệng khi nói */
.vxc-mouth-equalizer {
    display: none;
    align-items: center;
    gap: 2.5px;
    height: 14px;
}

.vxc-mouth-equalizer span {
    width: 2.5px;
    height: 12px;
    border-radius: 2px;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    animation: vxcEqMouthWave 0.35s infinite alternate ease-in-out;
}

.vxc-mouth-equalizer span:nth-child(1) { animation-delay: 0.05s; height: 6px; }
.vxc-mouth-equalizer span:nth-child(2) { animation-delay: 0.15s; height: 14px; }
.vxc-mouth-equalizer span:nth-child(3) { animation-delay: 0.1s; height: 10px; }
.vxc-mouth-equalizer span:nth-child(4) { animation-delay: 0.25s; height: 16px; }
.vxc-mouth-equalizer span:nth-child(5) { animation-delay: 0.12s; height: 8px; }

@keyframes vxcEqMouthWave {
    0% { transform: scaleY(0.3); }
    100% { transform: scaleY(1.4); }
}

/* Cổ & Thân ngực */
.vxc-robot-neck {
    width: 26px;
    height: 7px;
    background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
    border-radius: 3px;
    margin-top: -3px;
    z-index: 2;
}

.vxc-robot-torso {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -1px;
    z-index: 1;
}

.vxc-chest-core {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.vxc-core-glow {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    animation: vxcHeartbeat 1.8s infinite ease-in-out;
}

@keyframes vxcHeartbeat {
    0%, 100% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

.vxc-chest-badge {
    font-size: 8px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    background: rgba(15, 23, 42, 0.85);
    padding: 1px 7px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    margin-top: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ================= TRẠNG THÁI ROBOT NÓI (SPEAKING) ================= */
.vxc-robot-avatar.speaking .vxc-robot-body-wrapper {
    animation: vxcRobotTalkingBody 0.45s infinite alternate ease-in-out;
}

@keyframes vxcRobotTalkingBody {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    100% { transform: translateY(-7px) scale(1.03) rotate(-1deg); }
}

.vxc-robot-avatar.speaking .vxc-robot-head {
    animation: vxcRobotTalkingHead 0.35s infinite alternate ease-in-out;
}

@keyframes vxcRobotTalkingHead {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(1.5deg) translateY(-2px); }
    100% { transform: rotate(-1.5deg) translateY(-1px); }
}

.vxc-robot-avatar.speaking .vxc-head-aura {
    border-color: rgba(56, 189, 248, 0.8);
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.65);
}

.vxc-robot-avatar.speaking .vxc-antenna-ball {
    box-shadow: 0 0 16px #38bdf8, 0 0 30px #38bdf8;
    transform: scale(1.15);
}

.vxc-robot-avatar.speaking .vxc-antenna-signal {
    animation: vxcSignalPulse 1s infinite ease-out;
}

@keyframes vxcSignalPulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* Khi nói: Mắt cười vui tươi (crescent shape) */
.vxc-robot-avatar.speaking .vxc-robot-eye {
    border-radius: 50% 50% 25% 25%;
    height: 12px;
    transform: scale(1.15);
    box-shadow: 0 0 18px #38bdf8, 0 0 30px rgba(56, 189, 248, 0.9);
}

/* Khi nói: Mồm chuyển động và phát sáng sóng âm */
.vxc-robot-avatar.speaking .vxc-mouth-shape {
    display: none;
}

.vxc-robot-avatar.speaking .vxc-mouth-equalizer {
    display: flex;
}

/* ================= TRẠNG THÁI ROBOT LẮNG NGHE (LISTENING) ================= */
.vxc-robot-avatar.listening .vxc-robot-head {
    transform: translateY(3px) scale(1.02);
}

.vxc-robot-avatar.listening .vxc-robot-eye {
    box-shadow: 0 0 20px #10b981, 0 0 32px rgba(16, 185, 129, 0.8);
    background: #10b981;
    animation: vxcEyeRadar 1s infinite alternate ease-in-out;
}

.vxc-robot-avatar.listening .vxc-antenna-ball {
    background: #10b981;
    box-shadow: 0 0 14px #10b981;
}

.vxc-robot-avatar.listening .vxc-ear-core {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

@keyframes vxcEyeRadar {
    0% { transform: scale(0.95); }
    100% { transform: scale(1.15); }
}

/* ================= TRẠNG THÁI ROBOT SUY NGHĨ (THINKING) ================= */
.vxc-robot-avatar.thinking .vxc-robot-eye {
    background: #fbbf24;
    box-shadow: 0 0 16px #fbbf24;
    animation: vxcEyeThink 0.8s infinite alternate ease-in-out;
}

.vxc-robot-avatar.thinking .vxc-antenna-ball {
    background: #fbbf24;
    box-shadow: 0 0 14px #fbbf24;
}

@keyframes vxcEyeThink {
    0% { transform: scaleX(0.7); opacity: 0.6; }
    100% { transform: scaleX(1.15); opacity: 1; }
}

/* Ảnh thật dự phòng (Nếu người dùng muốn xem ảnh thật) */
.vxc-avatar-photo-wrapper {
    width: 170px;
    height: 170px;
    position: relative;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vxc-avatar-photo {
    width: 156px;
    height: 156px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.vxc-avatar-glow-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.vxc-robot-avatar.speaking .vxc-avatar-photo {
    animation: vxcAvatarPulse 1.2s infinite ease-in-out;
}

.vxc-robot-avatar.speaking .vxc-avatar-glow-ring {
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.8);
    animation: vxcGlowSpin 3s linear infinite;
}

@keyframes vxcAvatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes vxcGlowSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vxc-speaking-equalizer {
    position: absolute;
    bottom: 4px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.5);
    padding: 3px 8px;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 3px;
    z-index: 3;
}

.vxc-robot-avatar.speaking .vxc-speaking-equalizer {
    display: flex;
}

.vxc-speaking-equalizer span {
    width: 3px;
    height: 12px;
    background: #38bdf8;
    border-radius: 2px;
    animation: vxcEqWave 0.8s infinite ease-in-out;
}

.vxc-speaking-equalizer span:nth-child(1) { animation-delay: 0.1s; height: 8px; }
.vxc-speaking-equalizer span:nth-child(2) { animation-delay: 0.3s; height: 14px; }
.vxc-speaking-equalizer span:nth-child(3) { animation-delay: 0.2s; height: 10px; }
.vxc-speaking-equalizer span:nth-child(4) { animation-delay: 0.4s; height: 16px; }
.vxc-speaking-equalizer span:nth-child(5) { animation-delay: 0.15s; height: 9px; }

@keyframes vxcEqWave {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1.3); }
}

/* Sóng âm thanh lan tỏa */
.vxc-audio-rings {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 170px;
    height: 170px;
    pointer-events: none;
    z-index: 1;
}

.vxc-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.4);
    opacity: 0;
}

/* Khi Robot đang nghe học viên nói */
.vxc-robot-stage.listening .vxc-ring {
    animation: vxcRipple 2s infinite ease-out;
}
.vxc-robot-stage.listening .vxc-ring-1 { animation-delay: 0s; }
.vxc-robot-stage.listening .vxc-ring-2 { animation-delay: 0.6s; }
.vxc-robot-stage.listening .vxc-ring-3 { animation-delay: 1.2s; }

@keyframes vxcRipple {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Trạng thái text */
.vxc-robot-status-text {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 4px 14px;
    border-radius: 20px;
    z-index: 2;
    text-align: center;
}

/* Phụ đề trực tiếp song ngữ (Fullscreen Responsive) */
.vxc-live-subtitle-box {
    margin: 18px auto 0 auto;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 18px;
    padding: 16px 24px;
    max-width: 820px;
    width: 90%;
    min-height: 56px;
    text-align: center;
    z-index: 2;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

.vxc-sub-vn {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.vxc-sub-en {
    font-size: 15px;
    color: #94a3b8;
    margin-top: 6px;
    font-style: italic;
}

/* Chủ đề thực hành nhanh trong chế độ Voice (Fullscreen Responsive) */
.vxc-robot-quick-topics {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px auto 0 auto;
    flex-wrap: wrap;
    max-width: 820px;
    width: 90%;
    z-index: 2;
}

.vxc-robot-topics-label {
    font-size: 12px;
    color: #94a3b8;
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
    font-weight: 500;
}

.vxc-robot-topic-btn {
    font-size: 13px;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.vxc-robot-topic-btn:hover {
    background: rgba(56, 189, 248, 0.35);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

/* Bảng điều khiển cuộc gọi toàn màn hình */
.vxc-robot-controls {
    padding: 20px 24px;
    background: rgba(10, 16, 31, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    z-index: 5;
    flex-wrap: wrap;
}

.vxc-call-action-btn {
    flex: 0 1 340px;
    padding: 14px 28px;
    border-radius: 35px;
    border: none;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.vxc-btn-start-call {
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.vxc-btn-start-call.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45);
    animation: vxcPulseDot 1.4s infinite;
}

.vxc-call-sub-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: none;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.vxc-call-sub-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vxc-btn-danger {
    color: #f87171;
}
.vxc-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Modal Limit & 1-on-1 Upsell */
.vxc-lead-modal {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 999;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.vxc-lead-content {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px 20px;
    width: 100%;
    max-width: 440px;
    max-height: 94vh;
    overflow-y: auto;
    position: relative;
    color: var(--vxc-text-main);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.vxc-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f1f5f9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.vxc-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.vxc-limit-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 8px;
}

.vxc-lead-header h4 {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.vxc-lead-header p {
    margin: 0 0 14px 0;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
}

/* Tutor VDC Card */
.vxc-tutor-upsell-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bae6fd;
    border-radius: 14px;
    padding: 14px;
    margin: 10px 0 14px 0;
    text-align: left;
}

.vxc-tutor-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.vxc-upsell-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0284c7;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.vxc-tutor-profile strong {
    display: block;
    font-size: 14.5px;
    color: #0369a1;
}

.vxc-tutor-profile span {
    display: block;
    font-size: 11.5px;
    color: #64748b;
}

.vxc-upsell-perks {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #1e293b;
}

.vxc-btn-book-1on1 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 14px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13.5px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    box-sizing: border-box;
    transition: transform 0.15s, box-shadow 0.15s;
    text-align: center;
}

.vxc-btn-book-1on1:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
    color: #ffffff !important;
}

.vxc-modal-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 12px 0 10px 0;
    font-size: 10.5px;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.vxc-modal-divider::before,
.vxc-modal-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.vxc-modal-divider span {
    padding: 0 10px;
}

.vxc-form-subtext {
    font-size: 11.5px;
    color: #64748b;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.vxc-form-error-msg {
    display: none;
    background: #fef2f2;
    border: 1px solid #f87171;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
    animation: vxcShake 0.4s ease;
}

.vxc-form-error-msg a {
    color: #b91c1c;
    text-decoration: underline;
    font-weight: 700;
}

@keyframes vxcShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.vxc-form-group {
    margin-bottom: 8px;
}

.vxc-form-group input,
.vxc-form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12.5px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.vxc-form-group input:focus,
.vxc-form-group select:focus {
    border-color: #0284c7;
    outline: none;
}

.vxc-btn-primary {
    width: 100%;
    padding: 9px 12px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.15s;
}

.vxc-btn-primary:hover {
    background: #1e293b;
}

/* ================= ONBOARDING GATE MODAL ================= */
.vxc-onboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000002;
    padding: 16px;
    box-sizing: border-box;
    animation: vxcFadeIn 0.25s ease-out;
}

.vxc-onboard-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 26px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    position: relative;
    box-sizing: border-box;
}

.vxc-onboard-header {
    text-align: center;
    margin-bottom: 18px;
}

.vxc-onboard-avatar {
    width: 68px;
    height: 68px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
}

.vxc-onboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.vxc-onboard-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.vxc-onboard-header h3 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.vxc-onboard-header p {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.45;
}

.vxc-form-group label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

.vxc-onboard-note {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin: 10px 0 0 0;
}

