Files
Autoparts-DB/dashboard/chat-public.css
consultoria-as 5a88d7c7ff feat(pos): add kiosk mode, AI vision, AI part classification, public chatbot (#19 #25 #30 #29)
- Kiosk mode: fullscreen, wake lock, auto-login, context menu block, PWA/Capacitor detection
- AI vision: camera photos analyzed by Gemma 3 27B vision model via OpenRouter
- AI part classification: auto-suggest name/brand/category when entering part number
- Public catalog chatbot: /api/chat endpoint with rate limiting, chat widget on catalog page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 04:18:37 +00:00

238 lines
5.0 KiB
CSS

/* ==========================================================================
NEXUS — Public Catalog Chat Widget
Reuses design tokens from tokens.css
========================================================================== */
.chat-fab {
position: fixed;
bottom: 24px;
right: 24px;
z-index: 8000;
width: 52px;
height: 52px;
border-radius: var(--radius-full, 50%);
border: none;
cursor: pointer;
background: var(--color-accent, #F5A623);
color: #fff;
font-size: 1.5rem;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,0.3));
transition: transform 0.2s ease, background 0.2s ease;
}
.chat-fab:hover {
transform: scale(1.08);
background: var(--color-primary-hover, #e5952f);
}
.chat-panel {
position: fixed;
bottom: 90px;
right: 24px;
z-index: 8001;
width: 400px;
height: 520px;
max-height: calc(100vh - 100px);
display: flex;
flex-direction: column;
background: var(--color-bg-elevated, #1a1a1a);
border: 1px solid var(--color-border, #333);
border-radius: var(--radius-xl, 16px);
box-shadow: var(--shadow-xl, 0 8px 32px rgba(0,0,0,0.4));
overflow: hidden;
transform: translateY(20px) scale(0.95);
opacity: 0;
pointer-events: none;
transition: transform 0.25s ease, opacity 0.25s ease;
}
.chat-panel.open {
transform: translateY(0) scale(1);
opacity: 1;
pointer-events: all;
}
.chat-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: var(--color-accent, #F5A623);
color: #fff;
flex-shrink: 0;
}
.chat-header h3 {
font-family: var(--font-heading, sans-serif);
font-size: 0.95rem;
font-weight: 600;
margin: 0;
}
.chat-header-close {
background: none;
border: none;
color: #fff;
font-size: 1.2rem;
cursor: pointer;
padding: 4px;
line-height: 1;
opacity: 0.8;
}
.chat-header-close:hover { opacity: 1; }
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 12px;
display: flex;
flex-direction: column;
gap: 8px;
}
.chat-msg {
max-width: 85%;
padding: 8px 12px;
border-radius: 12px;
font-size: 0.875rem;
line-height: 1.45;
word-wrap: break-word;
}
.chat-msg.user {
align-self: flex-end;
background: var(--color-accent, #F5A623);
color: #fff;
border-bottom-right-radius: 4px;
}
.chat-msg.ai {
align-self: flex-start;
background: var(--color-surface-2, rgba(255,255,255,0.06));
color: var(--color-text-primary, #fff);
border-bottom-left-radius: 4px;
}
.chat-typing {
align-self: flex-start;
display: none;
gap: 4px;
padding: 8px 12px;
background: var(--color-surface-2, rgba(255,255,255,0.06));
border-radius: 12px;
border-bottom-left-radius: 4px;
}
.chat-typing.visible { display: flex; }
.chat-typing span {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--color-text-muted, #888);
animation: chatBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce {
0%, 60%, 100% { transform: translateY(0); }
30% { transform: translateY(-5px); }
}
.chat-parts {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 8px;
}
.chat-part-card {
background: var(--color-bg-elevated, #1a1a1a);
border: 1px solid var(--color-border, #333);
border-radius: 8px;
padding: 8px 12px;
cursor: pointer;
transition: border-color 0.15s ease, background 0.15s ease;
}
.chat-part-card:hover {
border-color: var(--color-accent, #F5A623);
background: var(--color-bg-base, #111);
}
.chat-part-card .part-number {
font-family: var(--font-mono, monospace);
font-size: 0.75rem;
color: var(--color-accent, #F5A623);
font-weight: 600;
}
.chat-part-card .part-name {
font-size: 0.875rem;
color: var(--color-text-primary, #fff);
margin-top: 2px;
}
.chat-input-area {
display: flex;
gap: 8px;
padding: 12px;
border-top: 1px solid var(--color-border, #333);
flex-shrink: 0;
}
.chat-input {
flex: 1;
padding: 8px 12px;
border: 1px solid var(--color-border, #333);
border-radius: 8px;
background: var(--color-bg-base, #111);
color: var(--color-text-primary, #fff);
font-size: 0.875rem;
font-family: var(--font-body, sans-serif);
resize: none;
outline: none;
min-height: 38px;
max-height: 80px;
}
.chat-input:focus {
border-color: var(--color-accent, #F5A623);
}
.chat-input::placeholder {
color: var(--color-text-muted, #888);
}
.chat-send-btn {
width: 38px;
height: 38px;
border-radius: 8px;
border: none;
background: var(--color-accent, #F5A623);
color: #fff;
font-size: 1.1rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: background 0.15s ease;
}
.chat-send-btn:hover { background: var(--color-primary-hover, #e5952f); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 480px) {
.chat-panel {
width: calc(100vw - 16px);
right: 8px;
height: 60vh;
}
}