brainkb-assistant
Version:
A configurable, standalone BrainKB Assistant that can be integrated into any website
898 lines (804 loc) • 24.8 kB
CSS
/* BrainKB Assistant Global Styles - ULTRA FORCE OVERRIDE v1.0.61 */
.brainkb-assistant-container {
position: fixed ;
z-index: 999999 ;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif ;
bottom: 24px ;
right: 24px ;
}
.brainkb-assistant-button {
position: fixed ;
z-index: 999999 ;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) ;
color: white ;
border: none ;
border-radius: 50% ;
padding: 16px ;
cursor: pointer ;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) ;
transition: all 0.3s ease ;
font-size: 24px ;
line-height: 1 ;
display: flex ;
align-items: center ;
justify-content: center ;
min-width: 60px ;
min-height: 60px ;
width: 64px ;
height: 64px ;
}
.brainkb-assistant-button:hover {
transform: scale(1.1) ;
box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4) ;
}
.brainkb-assistant-chat {
background: white ;
border-radius: 16px ;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) ;
border: 1px solid #e5e7eb ;
overflow: hidden ;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif ;
width: 400px ;
height: 600px ;
display: flex ;
flex-direction: column ;
max-width: 100% ;
box-sizing: border-box ;
}
/* ULTRA FORCE OVERRIDE - Beautiful Header Styling v1.0.61 */
.brainkb-assistant-chat .brainkb-assistant-header,
.brainkb-assistant-header,
div[class*="brainkb-assistant-header"],
div.brainkb-assistant-header,
.brainkb-assistant-chat div[class*="header"],
div[class*="header"] {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) ;
background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) ;
color: white ;
padding: 20px 24px ;
border-radius: 16px 16px 0 0 ;
display: flex ;
align-items: center ;
justify-content: space-between ;
min-height: 70px ;
box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2) ;
border-bottom: 1px solid rgba(255, 255, 255, 0.1) ;
background-color: transparent ;
margin: 0 ;
border: none ;
}
/* Force header content styling */
.brainkb-assistant-chat .header-content,
.header-content,
div[class*="header-content"],
div.header-content {
display: flex ;
align-items: center ;
gap: 16px ;
flex: 1 ;
color: white ;
}
.brainkb-assistant-chat .header-icon,
.header-icon,
div[class*="header-icon"],
div.header-icon {
width: 40px ;
height: 40px ;
background: rgba(255, 255, 255, 0.15) ;
border-radius: 50% ;
display: flex ;
align-items: center ;
justify-content: center ;
backdrop-filter: blur(10px) ;
border: 1px solid rgba(255, 255, 255, 0.2) ;
}
.brainkb-assistant-chat .header-text,
.header-text,
div[class*="header-text"],
div.header-text {
display: flex ;
flex-direction: column ;
gap: 4px ;
color: white ;
}
.brainkb-assistant-chat .header-title,
.header-title,
div[class*="header-title"],
div.header-title {
font-size: 18px ;
font-weight: 600 ;
color: white ;
margin: 0 ;
padding: 0 ;
}
.brainkb-assistant-chat .header-subtitle,
.header-subtitle,
div[class*="header-subtitle"],
div.header-subtitle {
font-size: 14px ;
color: rgba(255, 255, 255, 0.8) ;
margin: 0 ;
padding: 0 ;
}
.brainkb-assistant-chat .close-button,
.close-button,
div[class*="close-button"],
button[class*="close-button"] {
background: rgba(255, 255, 255, 0.1) ;
border: 1px solid rgba(255, 255, 255, 0.2) ;
border-radius: 50% ;
width: 32px ;
height: 32px ;
display: flex ;
align-items: center ;
justify-content: center ;
cursor: pointer ;
color: white ;
transition: all 0.2s ease ;
backdrop-filter: blur(10px) ;
}
.brainkb-assistant-chat .close-button:hover,
.close-button:hover,
div[class*="close-button"]:hover,
button[class*="close-button"]:hover {
background: rgba(255, 255, 255, 0.2) ;
transform: scale(1.1) ;
color: white ;
}
.brainkb-assistant-messages {
background: #f8fafc ;
padding: 20px ;
overflow-y: auto ;
flex: 1 ;
max-height: none ;
box-sizing: border-box ;
word-wrap: break-word ;
overflow-wrap: break-word ;
hyphens: auto ;
}
.brainkb-assistant-input {
background: white ;
padding: 20px ;
border-top: 1px solid #e5e7eb ;
flex-shrink: 0 ;
box-sizing: border-box ;
min-height: 90px ;
}
.brainkb-assistant-input input {
width: 100% ;
padding: 14px 18px ;
border: 2px solid #e2e8f0 ;
border-radius: 12px ;
font-size: 15px ;
outline: none ;
box-sizing: border-box ;
min-width: 0 ;
max-width: 100% ;
transition: all 0.2s ease ;
background: #f8fafc ;
}
.brainkb-assistant-input input:focus {
border-color: #667eea ;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) ;
background: white ;
}
.brainkb-assistant-input input::placeholder {
color: #94a3b8 ;
font-weight: 400 ;
}
/* Position classes */
.brainkb-assistant-bottom-right {
bottom: 24px ;
right: 24px ;
}
.brainkb-assistant-bottom-left {
bottom: 24px ;
left: 24px ;
}
.brainkb-assistant-top-right {
top: 24px ;
right: 24px ;
}
.brainkb-assistant-top-left {
top: 24px ;
left: 24px ;
}
/* High contrast mode for better visibility */
.brainkb-assistant-high-contrast {
background: linear-gradient(135deg, #1f2937 0%, #374151 100%) ;
color: #ffffff ;
border: 2px solid #ffffff ;
}
.brainkb-assistant-high-contrast .brainkb-assistant-chat {
background: #1f2937 ;
color: #ffffff ;
border: 2px solid #ffffff ;
}
/* Responsive design */
@media (max-width: 768px) {
.brainkb-assistant-chat {
width: calc(100vw - 48px) ;
max-width: 400px ;
min-width: 300px ;
}
.brainkb-assistant-button {
min-width: 50px ;
min-height: 50px ;
padding: 12px ;
}
.brainkb-assistant-messages {
padding: 16px ;
font-size: 14px ;
}
.brainkb-assistant-input {
padding: 16px ;
}
.brainkb-assistant-input input {
padding: 12px 16px ;
font-size: 14px ;
}
}
/* Content overflow handling - FIXED */
.brainkb-assistant-chat * {
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
box-sizing: border-box ;
}
.brainkb-assistant-chat pre {
white-space: pre-wrap ;
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
overflow-x: auto ;
font-size: 13px ;
line-height: 1.4 ;
}
.brainkb-assistant-chat code {
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
font-size: 13px ;
}
.brainkb-assistant-chat p {
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
margin: 8px 0 ;
line-height: 1.5 ;
}
.brainkb-assistant-chat div {
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
}
/* Animation for better visibility */
@keyframes brainkb-pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.brainkb-assistant-pulse {
animation: brainkb-pulse 2s infinite ;
}
/* Ensure it's always on top */
.brainkb-assistant-container * {
z-index: inherit ;
}
/* ULTRA FORCE OVERRIDE - Clean Message Styling */
.brainkb-assistant-chat .message-bubble,
.message-bubble,
div[class*="message-bubble"] {
background: #ffffff ;
border-radius: 12px ;
padding: 16px 20px ;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) ;
border: 1px solid #e5e7eb ;
max-width: calc(100% - 32px) ;
word-wrap: break-word ;
overflow-wrap: break-word ;
font-size: 14px ;
line-height: 1.5 ;
position: relative ;
margin: 12px 0 ;
}
.brainkb-assistant-chat .message-user,
.message-user,
div[class*="message-user"] {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) ;
color: #ffffff ;
border: 1px solid rgba(255, 255, 255, 0.2) ;
}
.brainkb-assistant-chat .message-assistant,
.message-assistant,
div[class*="message-assistant"] {
background: #ffffff ;
color: #374151 ;
border: 1px solid #e5e7eb ;
}
.brainkb-assistant-chat .message-timestamp,
.message-timestamp,
div[class*="message-timestamp"] {
font-size: 11px ;
color: #9ca3af ;
font-weight: 400 ;
margin-top: 8px ;
display: flex ;
align-items: center ;
gap: 8px ;
}
.brainkb-assistant-chat .message-avatar,
.message-avatar,
div[class*="message-avatar"] {
width: 32px ;
height: 32px ;
border-radius: 50% ;
display: flex ;
align-items: center ;
justify-content: center ;
flex-shrink: 0 ;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) ;
}
/* ULTRA FORCE OVERRIDE - Clean Quick Actions Styling */
.brainkb-assistant-chat .quick-actions,
.quick-actions,
div[class*="quick-actions"] {
display: grid ;
grid-template-columns: repeat(3, 1fr) ;
gap: 12px ;
padding: 20px 24px ;
background: #f9fafb ;
border-radius: 0 0 16px 16px ;
border-top: 1px solid #e5e7eb ;
min-height: 100px ;
}
.brainkb-assistant-chat .quick-action-button,
.quick-action-button,
button[class*="quick-action-button"] {
background: #ffffff ;
color: #374151 ;
border: 1px solid #e5e7eb ;
border-radius: 8px ;
padding: 12px 16px ;
cursor: pointer ;
transition: all 0.2s ease ;
display: flex ;
flex-direction: column ;
align-items: center ;
gap: 6px ;
min-height: 70px ;
justify-content: center ;
text-align: center ;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) ;
}
.brainkb-assistant-chat .quick-action-button:hover,
.quick-action-button:hover,
button[class*="quick-action-button"]:hover {
background: #f3f4f6 ;
border-color: #d1d5db ;
transform: translateY(-1px) ;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) ;
}
.brainkb-assistant-chat .quick-action-button .icon,
.quick-action-button .icon,
span[class*="icon"] {
font-size: 18px ;
margin-bottom: 4px ;
color: #6b7280 ;
}
.brainkb-assistant-chat .quick-action-button .text,
.quick-action-button .text,
span[class*="text"] {
font-size: 11px ;
font-weight: 600 ;
line-height: 1.2 ;
color: #374151 ;
}
/* ULTRA FORCE OVERRIDE - Clean Input Area */
.brainkb-assistant-chat .input-area,
.input-area,
div[class*="input-area"] {
background: #ffffff ;
border: 1px solid #e5e7eb ;
border-radius: 12px ;
padding: 16px 20px ;
display: flex ;
align-items: center ;
gap: 12px ;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) ;
min-height: 60px ;
margin: 16px ;
}
.brainkb-assistant-chat .input-field,
.input-field,
input[class*="input-field"] {
flex: 1 ;
border: none ;
outline: none ;
background: transparent ;
font-size: 14px ;
color: #374151 ;
line-height: 1.5 ;
min-height: 24px ;
resize: none ;
}
.brainkb-assistant-chat .input-field::placeholder,
.input-field::placeholder,
input[class*="input-field"]::placeholder {
color: #9ca3af ;
font-weight: 400 ;
}
.brainkb-assistant-chat .send-button,
.send-button,
button[class*="send-button"] {
width: 40px ;
height: 40px ;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) ;
border: none ;
border-radius: 8px ;
color: white ;
display: flex ;
align-items: center ;
justify-content: center ;
cursor: pointer ;
transition: all 0.2s ease ;
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) ;
}
.brainkb-assistant-chat .send-button:hover,
.send-button:hover,
button[class*="send-button"]:hover {
transform: translateY(-1px) ;
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) ;
}
/* Download Button */
.download-button {
background: linear-gradient(135deg, #10b981 0%, #059669 100%) ;
color: white ;
border: none ;
border-radius: 8px ;
padding: 12px 20px ;
font-size: 13px ;
font-weight: 600 ;
cursor: pointer ;
min-width: 140px ;
display: flex ;
align-items: center ;
justify-content: center ;
gap: 8px ;
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) ;
transition: all 0.2s ease ;
}
.download-button:hover {
transform: translateY(-1px) ;
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) ;
}
.download-dropdown {
position: absolute ;
top: 100% ;
right: 0 ;
margin-top: 8px ;
background: white ;
border: 1px solid #e5e7eb ;
border-radius: 8px ;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) ;
padding: 16px ;
min-width: 200px ;
z-index: 1000 ;
}
/* Enhanced table styling - FIXED OVERFLOW */
.brainkb-assistant-chat .table-container {
background: white ;
border-radius: 16px ;
border: 1px solid #e2e8f0 ;
overflow: hidden ;
margin: 16px 0 ;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) ;
max-width: 100% ;
box-sizing: border-box ;
}
.brainkb-assistant-chat .table-container table {
width: 100% ;
border-collapse: collapse ;
font-size: 13px ;
line-height: 1.4 ;
table-layout: fixed ;
word-wrap: break-word ;
overflow-wrap: break-word ;
}
.brainkb-assistant-chat .table-container thead {
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) ;
border-bottom: 2px solid #e2e8f0 ;
}
.brainkb-assistant-chat .table-container th {
padding: 12px 16px ;
text-align: left ;
font-weight: 600 ;
color: #1e293b ;
font-size: 13px ;
border-bottom: 1px solid #e2e8f0 ;
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) ;
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 120px ;
min-width: 80px ;
}
.brainkb-assistant-chat .table-container tbody tr {
border-bottom: 1px solid #f1f5f9 ;
transition: background-color 0.2s ease ;
}
.brainkb-assistant-chat .table-container tbody tr:nth-child(even) {
background-color: #fafbfc ;
}
.brainkb-assistant-chat .table-container tbody tr:hover {
background-color: #f1f5f9 ;
}
.brainkb-assistant-chat .table-container td {
padding: 12px 16px ;
color: #374151 ;
font-size: 12px ;
line-height: 1.4 ;
vertical-align: top ;
word-wrap: break-word ;
overflow-wrap: break-word ;
hyphens: auto ;
max-width: 120px ;
min-width: 80px ;
}
/* Index cell styling */
.brainkb-assistant-chat .index-cell {
font-weight: 600 ;
color: #1e293b ;
text-align: center ;
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) ;
border-radius: 8px ;
padding: 6px 10px ;
min-width: 40px ;
display: inline-block ;
border: 1px solid #bae6fd ;
font-size: 12px ;
}
/* URI cell styling - FIXED OVERFLOW */
.brainkb-assistant-chat .uri-cell {
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace ;
font-size: 11px ;
color: #0369a1 ;
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) ;
border-radius: 6px ;
padding: 4px 8px ;
border: 1px solid #bae6fd ;
word-break: break-all ;
overflow-wrap: break-word ;
max-width: 100% ;
}
/* Query summary styling */
.brainkb-assistant-chat .query-summary {
background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) ;
border: 1px solid #f59e0b ;
border-radius: 12px ;
padding: 12px 16px ;
margin: 12px 0 ;
font-size: 13px ;
color: #92400e ;
font-weight: 500 ;
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
}
/* Data highlight styling */
.brainkb-assistant-chat .data-highlight {
background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) ;
border: 1px solid #3b82f6 ;
border-radius: 8px ;
padding: 8px 12px ;
font-size: 12px ;
color: #1e40af ;
font-weight: 500 ;
display: inline-block ;
margin: 4px 0 ;
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
}
@keyframes slideIn {
from {
opacity: 0 ;
transform: translateY(10px) ;
}
to {
opacity: 1 ;
transform: translateY(0) ;
}
}
.brainkb-assistant-chat .download-dropdown::after {
content: '' ;
position: absolute ;
top: 100% ;
right: 20px ;
width: 0 ;
height: 0 ;
border-left: 8px solid transparent ;
border-right: 8px solid transparent ;
border-top: 8px solid white ;
}
.brainkb-assistant-chat .download-dropdown::before {
content: '' ;
position: absolute ;
top: 100% ;
right: 18px ;
width: 0 ;
height: 0 ;
border-left: 10px solid transparent ;
border-right: 10px solid transparent ;
border-top: 10px solid #10b981 ;
z-index: -1 ;
}
.brainkb-assistant-chat .download-option {
display: flex ;
align-items: center ;
gap: 12px ;
padding: 14px 18px ;
border-radius: 10px ;
cursor: pointer ;
transition: all 0.2s ease ;
font-size: 14px ;
color: #374151 ;
font-weight: 500 ;
border: 1px solid transparent ;
background: transparent ;
width: 100% ;
text-align: left ;
}
.brainkb-assistant-chat .download-option:hover {
background-color: #f0fdf4 ;
border-color: #10b981 ;
transform: translateX(4px) ;
}
.brainkb-assistant-chat .download-option .icon {
font-size: 18px ;
width: 20px ;
height: 20px ;
display: flex ;
align-items: center ;
justify-content: center ;
flex-shrink: 0 ;
}
/* Download button container - fixed positioning */
.brainkb-assistant-chat .download-container {
position: relative ;
display: inline-block ;
z-index: 10 ;
}
/* Table header with download button - fixed layout */
.brainkb-assistant-chat .table-header {
display: flex ;
align-items: center ;
justify-content: space-between ;
padding: 24px 28px 20px 28px ;
border-bottom: 2px solid #e2e8f0 ;
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) ;
position: relative ;
min-height: 70px ;
box-sizing: border-box ;
}
.brainkb-assistant-chat .table-title {
font-size: 18px ;
color: #1e293b ;
font-weight: 700 ;
display: flex ;
align-items: center ;
gap: 12px ;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) ;
flex: 1 ;
word-wrap: break-word ;
overflow-wrap: break-word ;
max-width: 100% ;
}
.brainkb-assistant-chat .table-title::before {
content: '📊' ;
font-size: 22px ;
}
/* Add a pulsing animation to draw attention */
@keyframes pulse {
0% {
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) ;
}
50% {
box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5) ;
}
100% {
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) ;
}
}
.brainkb-assistant-chat .download-button {
animation: pulse 2s infinite ;
}
.brainkb-assistant-chat .download-button:hover {
animation: none ;
}
/* Fix layout issues - FIXED */
.brainkb-assistant-chat {
max-height: 100% ;
overflow: hidden ;
display: flex ;
flex-direction: column ;
box-sizing: border-box ;
}
.brainkb-assistant-chat .messages {
flex: 1 ;
overflow-y: auto ;
padding: 20px ;
box-sizing: border-box ;
word-wrap: break-word ;
overflow-wrap: break-word ;
hyphens: auto ;
}
/* Fix floating button positioning */
.brainkb-assistant-container {
position: fixed ;
bottom: 24px ;
right: 24px ;
z-index: 999999 ;
}
.brainkb-assistant-button {
position: fixed ;
bottom: 24px ;
right: 24px ;
z-index: 999999 ;
}
/* Fix input area clipping */
.brainkb-assistant-chat .input-area {
padding: 20px 24px ;
border-top: 1px solid #e2e8f0 ;
background: white ;
flex-shrink: 0 ;
min-height: 90px ;
box-sizing: border-box ;
}
/* Fix quick actions layout */
.brainkb-assistant-chat .quick-actions {
display: grid ;
grid-template-columns: repeat(3, 1fr) ;
gap: 12px ;
padding: 20px 24px ;
background: #f9fafb ;
border-top: 1px solid #e5e7eb ;
flex-shrink: 0 ;
min-height: 100px ;
box-sizing: border-box ;
}
/* Responsive improvements - FIXED */
@media (max-width: 480px) {
.brainkb-assistant-header {
padding: 16px 20px ;
min-height: 60px ;
}
.header-title {
font-size: 18px ;
}
.header-subtitle {
font-size: 13px ;
}
.quick-actions {
padding: 16px 20px ;
gap: 10px ;
grid-template-columns: repeat(2, 1fr) ;
}
.quick-action-button {
padding: 10px 12px ;
min-height: 60px ;
}
.quick-action-button .text {
font-size: 10px ;
}
.message-bubble {
padding: 14px 18px ;
font-size: 13px ;
}
.input-area {
padding: 14px 18px ;
min-height: 56px ;
}
.input-field {
font-size: 13px ;
}
}