/* Shadow DOM host element */ :host { display: block; /* ── Theming via CSS custom properties ────────────────────────── Override these on the element from the host page: smart-chatbot { --chatbot-btn-bg: rgba(124, 111, 247, 0.3); ... } The Admin Console will generate this snippet per tenant. Defaults below are the light/glassmorphism theme (HF Space). ── */ --chatbot-btn-bg: rgba(255, 255, 255, 0.2); --chatbot-btn-border: rgba(255, 255, 255, 0.35); --chatbot-btn-hover-bg: rgba(255, 255, 255, 0.28); --chatbot-panel-bg: rgba(255, 255, 255, 0.15); --chatbot-panel-border: rgba(255, 255, 255, 0.25); --chatbot-header-bg: rgba(102, 126, 234, 0.5); --chatbot-messages-bg: rgba(255, 255, 255, 0.06); --chatbot-bot-msg-bg: rgba(255, 255, 255, 0.65); --chatbot-bot-msg-border: rgba(255, 255, 255, 0.5); --chatbot-bot-msg-color: #1a1a2e; --chatbot-input-bg: rgba(255, 255, 255, 0.75); --chatbot-input-color: #1a1a2e; --chatbot-input-placeholder: rgba(80, 80, 120, 0.55); --chatbot-thinking-bg: rgba(0, 0, 0, 0.04); --chatbot-thinking-border: rgba(0, 0, 0, 0.12); --chatbot-thinking-color: rgba(0, 0, 0, 0.5); --chatbot-typing-color: rgba(0, 0, 0, 0.45); --chatbot-typing-dot-bg: rgba(0, 0, 0, 0.3); } * { box-sizing: border-box; margin: 0; padding: 0; } /* ============================================================ FLOATING CHAT BUTTON ============================================================ */ .chat-widget-btn { position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px; background: var(--chatbot-btn-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--chatbot-btn-border); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.45); transition: transform 0.2s, box-shadow 0.2s, background 0.2s; z-index: 9999; user-select: none; } .chat-widget-btn:hover { transform: scale(1.08); background: var(--chatbot-btn-hover-bg); box-shadow: 0 6px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5); } /* ============================================================ CHAT PANEL ============================================================ */ .chat-panel { position: fixed; bottom: 96px; right: 24px; width: 370px; height: 520px; background: var(--chatbot-panel-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--chatbot-panel-border); border-radius: 18px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3); display: flex; flex-direction: column; overflow: hidden; z-index: 9998; /* Hidden by default */ opacity: 0; pointer-events: none; transform: scale(0.88) translateY(16px); transform-origin: bottom right; transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .chat-panel.open { opacity: 1; pointer-events: all; transform: scale(1) translateY(0); } /* ============================================================ HEADER ============================================================ */ .chat-header { background: var(--chatbot-header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 16px 20px; border-radius: 18px 18px 0 0; position: relative; flex-shrink: 0; } .chat-header h1 { font-size: 1.1rem; font-weight: 600; margin-bottom: 2px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); } .chat-close-btn { position: absolute; top: 12px; right: 14px; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.25); color: white; font-size: 16px; cursor: pointer; opacity: 0.9; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: opacity 0.15s, background 0.15s; } .chat-close-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.28); } /* ============================================================ MESSAGES ============================================================ */ .chat-messages { flex: 1; padding: 14px; overflow-y: auto; background: var(--chatbot-messages-bg); display: flex; flex-direction: column; gap: 10px; } .messages-spacer { flex: 1; } .chat-messages::-webkit-scrollbar { width: 4px; } .chat-messages::-webkit-scrollbar-track { background: transparent; } .chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 2px; } .message { display: flex; align-items: flex-start; gap: 8px; max-width: 88%; animation: slideIn 0.25s ease-out; } @keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } } .message.user-message { align-self: flex-end; flex-direction: row-reverse; } .message.bot-message { align-self: flex-start; } .message-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.3); } .user-message .message-avatar { background: rgba(102, 126, 234, 0.6); } .bot-message .message-avatar { background: rgba(255, 255, 255, 0.2); } .message-content { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } .user-message .message-content { background: rgba(102, 126, 234, 0.75); border: 1px solid rgba(255, 255, 255, 0.2); color: white; box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3); } .bot-message .message-content { background: var(--chatbot-bot-msg-bg); border: 1px solid var(--chatbot-bot-msg-border); color: var(--chatbot-bot-msg-color); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); } .message-content ul, .message-content ol { padding-left: 18px; } .message-content p { margin-bottom: 6px; } .message-content p:last-child { margin-bottom: 0; } .message-content h1, .message-content h2, .message-content h3 { margin-top: 8px; margin-bottom: 4px; } .debug-info { font-size: 10px; color: #6c757d; margin-top: 6px; padding: 5px 8px; background: rgba(255, 255, 255, 0.4); border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.3); } /* ============================================================ THINKING BLOCK ============================================================ */ .thinking-details { align-self: flex-start; max-width: 88%; font-size: 12px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; color: var(--chatbot-thinking-color); background: var(--chatbot-thinking-bg); border: 1px solid var(--chatbot-thinking-border); border-radius: 10px; padding: 6px 10px; animation: slideIn 0.25s ease-out; } .thinking-details summary { cursor: pointer; font-style: italic; user-select: none; } .thinking-block { margin-top: 6px; font-size: 11px; opacity: 0.85; white-space: pre-wrap; line-height: 1.4; } /* ============================================================ TYPING INDICATOR ============================================================ */ .typing-indicator { display: flex; align-items: center; gap: 5px; padding: 5px 14px; color: var(--chatbot-typing-color); font-style: italic; font-size: 12px; background: var(--chatbot-thinking-bg); flex-shrink: 0; } .typing-content { background: var(--chatbot-thinking-bg) !important; border: 1px solid var(--chatbot-thinking-border) !important; color: var(--chatbot-typing-color) !important; } .typing-dots { display: flex; gap: 3px; } .typing-dots span { width: 5px; height: 5px; background: var(--chatbot-typing-dot-bg); border-radius: 50%; animation: typingBounce 1.4s infinite; } .typing-dots span:nth-child(2) { animation-delay: 0.2s; } .typing-dots span:nth-child(3) { animation-delay: 0.4s; } @keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-6px); opacity: 1; } } /* ============================================================ INPUT ============================================================ */ .chat-input { display: flex; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.1); gap: 8px; align-items: flex-end; flex-shrink: 0; } .input-container { flex: 1; } .chat-input textarea { width: 100%; padding: 9px 13px; line-height: 1.4; height: 38px; max-height: 110px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 18px; font-size: 13.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; outline: none; transition: border-color 0.2s, background 0.2s; overflow-y: auto; resize: none; scrollbar-width: none; -ms-overflow-style: none; background: var(--chatbot-input-bg); color: var(--chatbot-input-color); } .chat-input textarea::-webkit-scrollbar { display: none; } .chat-input textarea:focus { border-color: rgba(255, 255, 255, 0.7); background: var(--chatbot-input-bg); } .chat-input textarea::placeholder { color: var(--chatbot-input-placeholder); } .send-button { width: 38px; height: 38px; background: rgba(102, 126, 234, 0.8); border: 1px solid rgba(255, 255, 255, 0.25); color: white; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.1s; font-size: 15px; flex-shrink: 0; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } .send-button:hover { background: rgba(102, 126, 234, 1); transform: scale(1.06); } .send-button:disabled { background: rgba(180, 180, 200, 0.4); cursor: not-allowed; transform: none; } /* ============================================================ ENVIRONMENT BADGE ============================================================ */ .env-badge { position: fixed; top: 12px; right: 12px; background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 6px 10px; border-radius: 16px; font-size: 11px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: white; border: 1px solid rgba(255, 255, 255, 0.3); z-index: 10000; } .env-badge.development { background: rgba(144, 238, 144, 0.25); border-color: rgba(144, 238, 144, 0.4); } .env-badge.production { background: rgba(255, 100, 100, 0.25); border-color: rgba(255, 100, 100, 0.4); } /* ============================================================ MOBILE ============================================================ */ @media (max-width: 480px) { .chat-panel { width: calc(100vw - 20px); height: 75vh; right: 10px; bottom: 86px; } .chat-widget-btn { bottom: 16px; right: 16px; width: 54px; height: 54px; font-size: 22px; } }