Files
cv-site/static/css/04-interactive/_chat.css
T

462 lines
10 KiB
CSS
Raw Normal View History

/* ============================================================================
CHAT WIDGET — CV Assistant Mascot
Floating AI chat panel for CV questions
============================================================================ */
/* ==========================================================================
Toggle Button — left side, in the fixed button column
========================================================================== */
.chat-toggle-btn {
position: fixed;
bottom: 14rem;
left: 2rem;
z-index: 1000;
width: 50px;
height: 50px;
border-radius: 50%;
background: var(--accent-color, #2563eb);
color: #fff;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.4rem;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
transition: all 0.3s ease;
opacity: 0.6;
}
.chat-toggle-btn:hover {
opacity: 1;
transform: translateY(-3px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
background: var(--accent-color-hover, #1d4ed8);
}
/* Icon swap: show mascot by default, close when active */
.chat-toggle-btn .chat-icon-close {
display: none;
}
.chat-toggle-btn.mascot-active {
opacity: 1;
background: var(--accent-color, #2563eb);
}
.chat-toggle-btn.mascot-active .chat-icon-open {
display: none;
}
.chat-toggle-btn.mascot-active .chat-icon-close {
display: inline-block;
}
/* ==========================================================================
Panel — anchored from the left, above the button
========================================================================== */
.chat-panel {
position: fixed;
bottom: 18.5rem;
left: 2rem;
width: 380px;
max-height: 520px;
background: var(--bg-primary, #fff);
border: 1px solid var(--border-color, #e2e8f0);
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
display: none;
flex-direction: column;
z-index: 999;
overflow: hidden;
}
.chat-panel.chat-open {
display: flex;
}
/* ==========================================================================
Header
========================================================================== */
.chat-header {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 16px;
background: var(--accent-color, #2563eb);
color: #fff;
font-size: 0.9rem;
font-weight: 600;
}
.chat-header iconify-icon {
font-size: 1.2rem;
}
.chat-help-btn {
margin-left: auto;
background: none;
border: none;
color: #fff;
cursor: pointer;
font-size: 1.1rem;
opacity: 0.7;
transition: opacity 0.2s;
display: flex;
align-items: center;
padding: 0;
}
.chat-help-btn:hover {
opacity: 1;
}
.chat-close-btn {
background: none;
border: none;
color: #fff;
cursor: pointer;
font-size: 1.1rem;
opacity: 0.8;
transition: opacity 0.2s;
display: flex;
align-items: center;
padding: 0;
}
.chat-close-btn:hover {
opacity: 1;
}
/* ==========================================================================
Help / Onboarding Card
========================================================================== */
.chat-help-card {
display: none;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 16px 20px;
margin: 12px;
background: var(--bg-secondary, #f1f5f9);
border: 1px solid var(--border-color, #e2e8f0);
border-radius: 10px;
text-align: center;
animation: helpFadeIn 0.25s ease;
}
.chat-help-card.visible {
display: flex;
}
@keyframes helpFadeIn {
from { opacity: 0; transform: translateY(-6px); }
to { opacity: 1; transform: translateY(0); }
}
.chat-help-icon {
font-size: 2rem;
color: var(--accent-color, #2563eb);
line-height: 1;
}
.chat-help-text {
font-size: 0.8rem;
line-height: 1.5;
color: var(--text-secondary, #475569);
margin: 0;
}
.chat-help-dismiss {
background: var(--accent-color, #2563eb);
color: #fff;
border: none;
border-radius: 6px;
padding: 5px 16px;
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
transition: background 0.2s;
}
.chat-help-dismiss:hover {
background: var(--accent-color-hover, #1d4ed8);
}
/* ==========================================================================
Messages Area
========================================================================== */
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 16px;
display: flex;
flex-direction: column;
gap: 12px;
max-height: 260px;
min-height: 80px;
}
/* Message Bubbles */
.chat-message {
padding: 10px 14px;
border-radius: 12px;
font-size: 0.85rem;
line-height: 1.5;
max-width: 90%;
word-wrap: break-word;
}
.chat-message p {
margin: 0 0 4px 0;
}
.chat-message p:last-child {
margin-bottom: 0;
}
.chat-message ul {
margin: 4px 0;
padding-left: 18px;
}
.chat-message li {
margin-bottom: 2px;
}
.chat-agent {
background: var(--bg-secondary, #f1f5f9);
color: var(--text-primary, #1e293b);
align-self: flex-start;
border-bottom-left-radius: 4px;
}
.chat-user {
background: var(--accent-color, #2563eb);
color: #fff;
align-self: flex-end;
border-bottom-right-radius: 4px;
}
.chat-error {
background: #fef2f2;
color: #991b1b;
align-self: center;
font-style: italic;
border: 1px solid #fecaca;
}
/* ==========================================================================
Typing Indicator
========================================================================== */
.chat-typing {
display: none;
align-items: center;
gap: 4px;
padding: 8px 16px;
}
/* Show when HTMX request is in-flight */
.chat-typing.htmx-request {
display: flex;
}
.chat-typing-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-secondary, #94a3b8);
animation: typingBounce 1.4s infinite ease-in-out both;
}
.chat-typing-dot:nth-child(1) { animation-delay: 0s; }
.chat-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes typingBounce {
0%, 80%, 100% {
transform: scale(0.6);
opacity: 0.4;
}
40% {
transform: scale(1);
opacity: 1;
}
}
/* ==========================================================================
Suggested Question Chips
========================================================================== */
.chat-suggestions {
display: flex;
gap: 6px;
padding: 8px 12px;
overflow-x: auto;
border-top: 1px solid var(--border-color, #e2e8f0);
scrollbar-width: none; /* Firefox */
}
.chat-suggestions::-webkit-scrollbar {
display: none; /* Chrome/Safari */
}
.chat-chip {
flex-shrink: 0;
background: var(--bg-secondary, #f1f5f9);
color: var(--text-primary, #1e293b);
border: 1px solid var(--border-color, #e2e8f0);
border-radius: 16px;
padding: 4px 12px;
font-size: 0.72rem;
cursor: pointer;
transition: all 0.2s ease;
white-space: nowrap;
line-height: 1.4;
}
.chat-chip:hover {
background: var(--accent-color, #2563eb);
color: #fff;
border-color: var(--accent-color, #2563eb);
}
/* ==========================================================================
Input Area
========================================================================== */
.chat-input-area {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 12px;
border-top: 1px solid var(--border-color, #e2e8f0);
background: var(--bg-primary, #fff);
}
.chat-input {
flex: 1;
padding: 8px 12px;
border: 1px solid var(--border-color, #e2e8f0);
border-radius: 20px;
font-size: 0.85rem;
outline: none;
background: var(--bg-primary, #fff);
color: var(--text-primary, #1e293b);
transition: border-color 0.2s;
}
.chat-input:focus {
border-color: var(--accent-color, #2563eb);
}
.chat-send-btn {
background: var(--accent-color, #2563eb);
color: #fff;
border: none;
border-radius: 50%;
width: 36px;
height: 36px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.1rem;
transition: background 0.2s;
flex-shrink: 0;
}
.chat-send-btn:hover {
background: var(--accent-color-hover, #1d4ed8);
}
/* ==========================================================================
Responsive
========================================================================== */
@media (max-width: 480px) {
.chat-panel {
bottom: 0;
left: 0;
right: 0;
width: 100%;
max-height: 70vh;
border-radius: 12px 12px 0 0;
}
.chat-toggle-btn {
bottom: 12rem;
left: 1rem;
}
.chat-messages {
max-height: 200px;
}
}
/* ==========================================================================
Dark Theme Support (theme-clean)
========================================================================== */
.theme-clean .chat-panel {
background: #1e293b;
border-color: #334155;
}
.theme-clean .chat-agent {
background: #334155;
color: #e2e8f0;
}
.theme-clean .chat-error {
background: #450a0a;
color: #fca5a5;
border-color: #7f1d1d;
}
.theme-clean .chat-input-area {
border-top-color: #334155;
background: #1e293b;
}
.theme-clean .chat-input {
background: #0f172a;
border-color: #334155;
color: #e2e8f0;
}
.theme-clean .chat-help-card {
background: #334155;
border-color: #475569;
}
.theme-clean .chat-help-text {
color: #cbd5e1;
}
.theme-clean .chat-suggestions {
border-top-color: #334155;
}
.theme-clean .chat-chip {
background: #334155;
color: #e2e8f0;
border-color: #475569;
}
.theme-clean .chat-chip:hover {
background: var(--accent-color, #2563eb);
color: #fff;
border-color: var(--accent-color, #2563eb);
}
.theme-clean .chat-typing-dot {
background: #64748b;
}