:root {
    --fbp-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --fbp-max-width: 800px;
    --fbp-max-height: 600px;
    --fbp-font-size: 15px;
    
    --fbp-header-text: #1f1f1f;
    --fbp-bot-bg: #ffffff;
    --fbp-bot-text: #1f1f1f;
    --fbp-user-bg: #f0f4f9;
    --fbp-user-text: #1f1f1f;
    --fbp-chat-bg: #ffffff;
    --fbp-sug-bg: #ffffff;
    --fbp-sug-text: #444746;
    --fbp-inp-bg: #f0f4f9;
    --fbp-inp-text: #1f1f1f;
}

.fbp-hidden { display: none !important; opacity: 0; }

#fbp-splash-screen {
    position: fixed; inset: 0; z-index: 999990;
    background: rgba(0,0,0,0.65); 
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
}
#fbp-splash-screen.fbp-active { pointer-events: auto; }

#fbp-splash-text {
    color: #ffffff; font-family: var(--fbp-font-family);
    font-size: clamp(24px, 5vw, 42px); 
    font-weight: 700; text-align: center; max-width: 85%; line-height: 1.4;
    transform: translateY(30px); opacity: 0; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
#fbp-splash-text.fbp-show { transform: translateY(0); opacity: 1; }

#fbp-ice-breaker-container { position: fixed; z-index: 999995; display: flex; flex-direction: column; }
.fbp-pc-pos-top_left { top: 30px; left: 30px; align-items: flex-start; }
.fbp-pc-pos-top_center { top: 30px; left: 50%; transform: translateX(-50%); align-items: center; }
.fbp-pc-pos-top_right { top: 30px; right: 30px; align-items: flex-end; }
.fbp-pc-pos-mid_left { top: 50%; left: 30px; transform: translateY(-50%); align-items: flex-start; }
.fbp-pc-pos-mid_right { top: 50%; right: 30px; transform: translateY(-50%); align-items: flex-end; }
.fbp-pc-pos-bottom_left { bottom: 30px; left: 30px; align-items: flex-start; }
.fbp-pc-pos-bottom_center { bottom: 30px; left: 50%; transform: translateX(-50%); align-items: center; }
.fbp-pc-pos-bottom_right { bottom: 30px; right: 30px; align-items: flex-end; }

@media (max-width: 768px) {
    #fbp-ice-breaker-container { top: auto !important; transform: none !important; }
    .fbp-mob-pos-bottom_left { bottom: 20px; left: 20px; right: auto; align-items: flex-start; }
    .fbp-mob-pos-bottom_right { bottom: 20px; right: 20px; left: auto; align-items: flex-end; }
}

.fbp-custom-trigger { position: relative; width: var(--fbp-trigger-w, 150px); height: var(--fbp-trigger-h, 150px); display: flex; align-items: center; justify-content: center; background: transparent !important; border: none !important; box-shadow: none !important; }
.fbp-custom-trigger::after, .fbp-custom-trigger::before { display: none !important; }

/* BONG BÓNG IDLE HOOK */
#fbp-bubbles-container { position: absolute; top: 50%; left: 50%; width: 0; height: 0; z-index: 10; pointer-events: none; }
.fbp-soap-bubble { position: absolute; bottom: 0; left: -42px; width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(24, 119, 242, 0.15)); box-shadow: 0 5px 15px rgba(24, 119, 242, 0.15), inset -5px -5px 15px rgba(255,255,255,0.6), inset 5px 5px 10px rgba(255,255,255,0.9); border: 1px solid rgba(255,255,255,0.7); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; font-weight: 700; color: #0369a1; cursor: pointer; padding: 8px; line-height: 1.3; pointer-events: auto; animation: fbpFloatUp var(--float-duration, 5s) ease-in forwards; transition: filter 0.2s, box-shadow 0.2s; }
.fbp-soap-bubble:hover { filter: brightness(1.15); box-shadow: 0 5px 25px rgba(24, 119, 242, 0.4), inset -5px -5px 15px rgba(255,255,255,0.9), inset 5px 5px 10px rgba(255,255,255,1); animation-play-state: paused !important; z-index: 100; }
.fbp-soap-bubble.pop { animation: fbpBubblePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; pointer-events: none; }
@keyframes fbpFloatUp { 0% { transform: translateY(0) translateX(0) scale(0.5); opacity: 0; } 10% { opacity: 1; transform: translateY(-40px) translateX(calc(var(--drift) * 0.2)) scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-280px) translateX(var(--drift)) scale(1.1); opacity: 0; } }
@keyframes fbpBubblePop { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.4); opacity: 0.5; } 100% { transform: scale(2.2); opacity: 0; filter: blur(2px); } }

/* TOOLTIP HOVER */
.fbp-hover-tooltip { position: absolute; top: -40px; left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(0, 0, 0, 0.75); color: #fff; padding: 6px 14px; border-radius: 20px; font-family: var(--fbp-font-family); font-size: 13px; font-weight: 600; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; z-index: 15; box-shadow: 0 4px 12px rgba(0,0,0,0.15); backdrop-filter: blur(4px); }
.fbp-hover-tooltip::after { content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); border-width: 5px 5px 0; border-style: solid; border-color: rgba(0, 0, 0, 0.75) transparent transparent transparent; }
.fbp-pc-pos-top_left .fbp-hover-tooltip, .fbp-pc-pos-top_center .fbp-hover-tooltip, .fbp-pc-pos-top_right .fbp-hover-tooltip { top: auto; bottom: -40px; transform: translateX(-50%) translateY(-10px); }
.fbp-pc-pos-top_left .fbp-hover-tooltip::after, .fbp-pc-pos-top_center .fbp-hover-tooltip::after, .fbp-pc-pos-top_right .fbp-hover-tooltip::after { bottom: auto; top: -5px; border-width: 0 5px 5px; border-color: transparent transparent rgba(0, 0, 0, 0.75) transparent; }
.fbp-custom-trigger:hover .fbp-hover-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.fbp-custom-trigger.is-dragging .fbp-hover-tooltip { opacity: 0 !important; visibility: hidden !important; transition: none !important; }
@media (max-width: 768px) { .fbp-hover-tooltip { display: none !important; } }

/* ÁNH SÁNG LOGO */
.fbp-icon-wrapper { position: relative; width: 100%; height: 100%; animation: fbpFloatAndGlow 5s ease-in-out infinite alternate; }
@keyframes fbpFloatAndGlow { 0% { transform: translateY(0px) scale(1); filter: drop-shadow(0 0px 10px rgba(24, 119, 242, 0.4)); } 100% { transform: translateY(-15px) scale(1.02); filter: drop-shadow(0 15px 30px rgba(24, 119, 242, 0.9)); } }
.fbp-icon-wrapper img { pointer-events: none !important; -webkit-user-drag: none !important; user-select: none !important; position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }
.fbp-img-base { filter: grayscale(100%) opacity(0.35); z-index: 1; }
.fbp-img-reveal { z-index: 2; filter: brightness(1.15); -webkit-mask-image: linear-gradient(110deg, transparent 35%, black 50%, transparent 65%); mask-image: linear-gradient(110deg, transparent 35%, black 50%, transparent 65%); -webkit-mask-size: 300% 100%; mask-size: 300% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; animation: fbpContinuousScanner 12s linear infinite; }
@keyframes fbpContinuousScanner { 0% { -webkit-mask-position: 130% 0; mask-position: 130% 0; } 100% { -webkit-mask-position: -30% 0; mask-position: -30% 0; } }

.fbp-action-drag { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.fbp-action-drag:active { cursor: grabbing; }
.fbp-action-click { cursor: pointer; }

/* % DRAG TOOLTIP */
.fbp-drag-tooltip { position: absolute; top: -45px; left: 50%; transform: translateX(-50%) scale(0); background: #1f1f1f; color: #fff; padding: 6px 12px; border-radius: 20px; font-family: var(--fbp-font-family); font-size: 13px; font-weight: 700; opacity: 0; transition: opacity 0.2s, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 10; }
.fbp-drag-tooltip::after { content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); border-width: 5px 5px 0; border-style: solid; border-color: #1f1f1f transparent transparent transparent; transition: border-color 0.2s; }
.fbp-drag-tooltip.fbp-show { opacity: 1; transform: translateX(-50%) scale(1); }
.fbp-drag-tooltip.fbp-success { background: #10a37f; }
.fbp-drag-tooltip.fbp-success::after { border-color: #10a37f transparent transparent transparent; }

/* CỬA SỔ CHAT */
#fbp-chat-window { position: fixed; width: calc(100vw - 40px); max-width: var(--fbp-max-width); max-height: var(--fbp-max-height); background: var(--fbp-chat-bg); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,0.1); z-index: 999999; display: flex; flex-direction: column; overflow: hidden; font-family: var(--fbp-font-family) !important; text-rendering: optimizeLegibility !important; }
#fbp-chat-window.fbp-pos-bottom_right { bottom: 20px; right: 20px; animation: fbpSlideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#fbp-chat-window.fbp-pos-bottom_left { bottom: 20px; left: 20px; animation: fbpSlideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#fbp-chat-window.fbp-pos-center_wide { inset: 0; margin: auto; max-height: 85vh; animation: fbpFadeInCenter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fbpSlideUpFade { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes fbpSlideDownFade { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(30px); } }
@keyframes fbpFadeInCenter { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fbpFadeOutCenter { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.95); } }

.fbp-close-btn { position: absolute; top: 12px; right: 12px; background: var(--fbp-user-bg); border: none; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fbp-header-text); z-index: 100; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.fbp-close-btn:hover { background: #e0e0e0; transform: scale(1.05); }

.fbp-chat-header { padding: 15px 55px 15px 15px; background: var(--fbp-bot-bg); color: var(--fbp-header-text); display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #e3e3e3; position: relative; z-index: 2; }
.fbp-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #e3e3e3; }
.fbp-header-info { font-weight: 600; color: var(--fbp-header-text); }

.fbp-chat-body-wrapper { position: relative; flex-grow: 1; height: 350px; display: flex; overflow: hidden; }
.fbp-chat-body { padding: 20px; flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; position: relative; z-index: 1; padding-right: 40px; }

.fbp-chat-sidebar { position: absolute; right: 0; top: 0; height: 100%; width: 35px; background: #f8fafc; border-left: 1px solid #e2e8f0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 0; z-index: 5; }
.fbp-sidebar-item { position: relative; width: 100%; height: 60px; writing-mode: vertical-rl; text-orientation: mixed; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #475569; cursor: crosshair; overflow: hidden; }
.fbp-sidebar-item .fbp-text { position: relative; z-index: 2; padding: 5px 0; }
.fbp-sidebar-item .fbp-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background: #bfdbfe; z-index: 1; transition: height 2s linear; }
.fbp-sidebar-item:hover .fbp-progress { height: 100%; background: #3b82f6; }
.fbp-sidebar-item:hover .fbp-text { color: #fff; }

#fbp-dynamic-qna-container { position: absolute; bottom: 85px; right: 20px; z-index: 10; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; opacity: 1; transition: opacity 0.8s ease; pointer-events: auto; }
#fbp-dynamic-qna-container.fbp-fade-out { opacity: 0; pointer-events: none; }
.fbp-dyn-qna-item { background: rgba(255, 255, 255, 0.9); border: 1px solid #e2e8f0; color: #0ea5e9; padding: 6px 12px; border-radius: 15px; font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.05); backdrop-filter: blur(4px); transition: all 0.2s; }
.fbp-dyn-qna-item:hover { background: #f0f9ff; color: #0284c7; border-color: #7dd3fc; transform: translateY(-2px); }

/* 🌟 CẬP NHẬT LẠI KHỐI LIKE THÀNH CĂN GIỮA DƯỚI ĐÁY THEO NHƯ YÊU CẦU */
.fbp-simulated-q-likes { font-size: 11px; color: #64748b; margin-top: 5px; text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.fbp-feedback-actions { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 15px; opacity: 0; transition: opacity 0.4s ease; width: 100%; }
.fbp-ans-likes { font-size: 13px; color: #64748b; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.fbp-thumbs { display: flex; gap: 4px; }
.fbp-thumb-btn { background: transparent; border: none; cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; color: #94a3b8; transition: all 0.2s; }
.fbp-thumb-btn:hover { background: #eff6ff; color: #1877F2; }
.fbp-thumb-btn.active { color: #1877F2; background: #e0f2fe; }
.fbp-thumb-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: all 0.2s; }
.fbp-thumb-btn.active svg { fill: currentColor; }

.fbp-msg-customer { align-self: flex-end; max-width: 85%; z-index: 2; position: relative;}
.fbp-msg-customer .fbp-bubble { background: var(--fbp-user-bg); padding: 12px 18px; border-radius: 18px 18px 4px 18px; color: var(--fbp-user-text); line-height: 1.6; font-weight: 400; }
.fbp-msg-brand { align-self: flex-start; max-width: 90%; z-index: 2; position: relative;}
.fbp-msg-brand .fbp-bubble { background: var(--fbp-bot-bg); color: var(--fbp-bot-text); padding: 12px 18px; border-radius: 18px 18px 18px 4px; line-height: 1.6; font-weight: 400; }

/* 🌟 ÉP KIỂU 2 NẰM GIỮA MÀN HÌNH */
.fbp-msg-type-2 {
    width: 100% !important;
    max-width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.fbp-msg-type-2 .fbp-media-card-wrapper {
    margin-left: auto !important;
    margin-right: auto !important;
}

.fbp-typing-indicator { display: flex; align-items: center; gap: 4px; padding: 12px 18px; background: var(--fbp-bot-bg); border-radius: 18px 18px 18px 4px; width: fit-content; }
.fbp-typing-dot { width: 6px; height: 6px; background: var(--fbp-bot-text); border-radius: 50%; opacity: 0.6; animation: fbpTyping 1.4s infinite ease-in-out both; }
.fbp-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.fbp-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes fbpTyping { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); opacity: 1; } }

.fbp-cards-container { padding: 5px 20px 10px; background: var(--fbp-chat-bg); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 2; position: relative;}
.fbp-suggest-item { color: var(--fbp-sug-text); background: transparent; border: 1px solid #e2e8f0; border-radius:20px; padding: 8px 15px; cursor: pointer; transition: all 0.2s; font-weight: 500; font-size:13px;}
.fbp-suggest-item:hover { background: #f1f5f9; color: #1877F2; border-color:#1877F2; }

.fbp-chat-footer-wrapper { background: var(--fbp-chat-bg); border-top: 1px solid #e3e3e3; position: relative; z-index: 20;}
.fbp-chat-input-area { padding: 15px 20px; }
.fbp-input-wrapper { display: flex; align-items: center; background: var(--fbp-inp-bg); border: 1px solid #e3e3e3; border-radius: 30px; padding: 5px 5px 5px 18px; }
#fbp-chat-input { flex-grow: 1; border: none; background: transparent; outline: none; color: var(--fbp-inp-text); padding: 8px 0; font-family: inherit; }
#fbp-chat-input::placeholder { color: #747775; font-weight: 400; }

.fbp-icon-btn { background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 8px; color: #747775; transition: all 0.2s; }
.fbp-icon-btn:hover { color: #1f1f1f; }
.fbp-send-btn { background: #1f1f1f; border-radius: 50%; width: 38px; height: 38px; margin-left: 5px; }
.fbp-send-btn:hover { background: #000; }
.fbp-send-btn svg { margin-left: -2px; }

.fbp-chat-bottom-bar { display: flex; justify-content: space-between; align-items: center; padding: 0 20px 15px; }
.fbp-bottom-menu { font-size: 12px; color: #444746; font-weight: 500; }
.fbp-copyright { font-size: 11px; color: #8e918f; user-select: none; }
.fbp-copyright a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
.fbp-copyright a:hover { opacity: 0.7; }

/* 🌟 HOOK CTA BADGE (NÚT KÍCH THÍCH CHỐT SALE) */
.fbp-cta-hook-badge {
    background: linear-gradient(90deg, #ff007f, #ff5e62);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    overflow: hidden;
    animation: fbpHookPulse 2s infinite;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.fbp-cta-hook-badge::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: fbpShine 3s infinite;
}
.fbp-cta-hook-icon { font-size: 14px; line-height: 1; animation: fbpBounce 1s infinite; }

@keyframes fbpHookPulse {
    0% { background: linear-gradient(90deg, #ff007f, #ff5e62); }
    50% { background: linear-gradient(90deg, #e60073, #e55357); }
    100% { background: linear-gradient(90deg, #ff007f, #ff5e62); }
}
@keyframes fbpShine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}
@keyframes fbpBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* 🌟 VIDEO CTA HOVER */
.fbp-video-cta:hover {
    background: #1e293b !important;
}
.fbp-video-cta:hover .fbp-video-icon-wrap {
    transform: scale(1.1);
}

/* 🌟 CSS CHO CÁC CLASS NỀN GRADIENT Ở PHÍA CLIENT */
.bg-gradient-blue { background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important; }
.bg-gradient-purple { background: linear-gradient(135deg, #4c1d95, #a855f7) !important; }
.bg-gradient-rose { background: linear-gradient(135deg, #881337, #f43f5e) !important; }
.bg-gradient-emerald { background: linear-gradient(135deg, #064e3b, #10b981) !important; }
.bg-gradient-dark { background: linear-gradient(135deg, #0f172a, #334155) !important; }
.bg-gradient-sunset { background: linear-gradient(135deg, #ea580c, #f59e0b) !important; }

/* 🌟 HIỆU ỨNG GIỰT GIỰT GỢI Ý (TUGGING ANIMATION) */
.fbp-tug-hint {
    animation: fbpPeekAnimation 1.2s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
@keyframes fbpPeekAnimation {
    0% { transform: translateX(0); }
    30% { transform: translateX(-40px); }
    50% { transform: translateX(-30px); }
    70% { transform: translateX(-40px); }
    100% { transform: translateX(0); }
}