:root {
--ai-chat-primary: #1d4ed8; --ai-chat-primary-hover: #1e40af; --ai-chat-border: #d1d5db; --ai-chat-text: #111827; --ai-chat-text-secondary: #4b5563; --ai-chat-bg: #f9fafb;
--ai-chat-error: #dc2626; --ai-chat-success: #059669; } .sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.ai-chat-widget {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 10000;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ai-chat-widget.position-bottom-left {
left: 20px;
right: auto;
}
.ai-chat-toggle {
width: 60px;
height: 60px;
border-radius: 50%;
background: var(--ai-chat-primary, #3b82f6);
color: white;
border: none;
cursor: pointer;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
transition: all 0.3s ease;
}
.ai-chat-toggle:hover {
background: var(--ai-chat-primary-hover, #1e40af);
transform: scale(1.05);
}
.ai-chat-toggle:focus {
outline: 2px solid var(--ai-chat-primary, #1d4ed8);
outline-offset: 2px;
}
.ai-chat-panel {
position: absolute;
bottom: 80px;
right: 0;
width: 380px;
height: 500px;
background: white;
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
display: none; -webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
overflow: hidden;
border: 1px solid var(--ai-chat-border, #e5e7eb);
}
.ai-chat-widget.position-bottom-left .ai-chat-panel {
left: 0;
right: auto;
}
.ai-chat-panel.open {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
animation: slideUp 0.3s ease;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.ai-chat-header {
background: var(--ai-chat-primary, #3b82f6);
color: white;
padding: 16px; display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.ai-chat-title {
font-weight: 600; display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
gap: 8px;
}
.ai-chat-close {
background: none;
border: none;
color: white;
cursor: pointer;
font-size: 18px;
width: 24px;
height: 24px; display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-radius: 4px;
transition: background 0.2s, transform 0.2s;
}
.ai-chat-close:hover {
background: rgba(255, 255, 255, 0.1);
}
.ai-chat-close:focus {
outline: 2px solid rgba(255, 255, 255, 0.5);
outline-offset: 1px;
}
.ai-chat-messages {
flex: 1;
overflow-y: auto;
padding: 16px;
display: flex;
flex-direction: column;
gap: 12px;
background: #f9fafb;
}
.ai-chat-messages::-webkit-scrollbar {
width: 6px;
}
.ai-chat-messages::-webkit-scrollbar-track {
background: transparent;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
background: #d1d5db;
border-radius: 3px;
}
.ai-chat-messages::-webkit-scrollbar-thumb:hover {
background: #9ca3af;
}
.ai-chat-message {
max-width: 80%;
padding: 12px 16px;
border-radius: 12px;
line-height: 1.4;
font-size: 14px;
word-wrap: break-word;
}
.ai-chat-message.user {
background: var(--ai-chat-primary, #3b82f6);
color: white;
align-self: flex-end;
border-bottom-right-radius: 4px;
}
.ai-chat-message.assistant {
background: white;
color: var(--ai-chat-text, #111827);
align-self: flex-start;
border: 1px solid var(--ai-chat-border, #d1d5db);
border-bottom-left-radius: 4px;
}
.ai-chat-input-area {
padding: 16px;
border-top: 1px solid var(--ai-chat-border, #d1d5db);
background: white;
}
.ai-chat-form {
display: flex;
gap: 8px;
align-items: flex-end;
}
.ai-chat-input {
flex: 1;
padding: 12px;
border: 1px solid #d1d5db;
border-radius: 8px;
font-size: 14px;
outline: none;
resize: none;
min-height: 44px;
max-height: 100px;
font-family: inherit;
transition: border-color 0.2s;
}
.ai-chat-input:focus {
border-color: var(--ai-chat-primary, #1d4ed8);
box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
outline: none;
}
.ai-chat-input::placeholder {
color: var(--contrast-2);
}
.ai-chat-send {
background: var(--ai-chat-primary, #3b82f6);
color: white;
border: none;
border-radius: 8px;
padding: 12px 16px;
cursor: pointer;
transition: background 0.2s;
flex-shrink: 0;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
}
.ai-chat-send:hover:not(:disabled) {
background: var(--ai-chat-primary-hover, #1e40af);
}
.ai-chat-send:focus {
outline: 2px solid var(--ai-chat-primary, #1d4ed8);
outline-offset: 2px;
}
.ai-chat-send:disabled {
background: #9ca3af;
cursor: not-allowed;
}
.ai-chat-typing {
display: none;
padding: 12px 16px;
background: white;
border: 1px solid #e5e7eb;
border-radius: 12px;
border-bottom-left-radius: 4px;
align-self: flex-start;
max-width: 80%;
}
.ai-chat-typing.show {
display: block;
}
.ai-chat-dots {
display: inline-flex;
gap: 4px;
}
.ai-chat-dot {
width: 6px;
height: 6px;
background: #9ca3af;
border-radius: 50%;
animation: bounce 1.4s infinite ease-in-out both;
}
.ai-chat-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
0%, 80%, 100% {
transform: scale(0);
} 40% {
transform: scale(1);
}
}
.ai-chat-error {
background: #fef2f2;
border: 1px solid #fecaca;
color: #dc2626;
}
.ai-chat-status {
text-align: center;
font-size: 12px;
color: var(--ai-chat-text-secondary, #4b5563);
padding: 8px;
background: #f9fafb;
border-top: 1px solid #e5e7eb;
} @media (max-width: 640px) {
.ai-chat-widget {
bottom: 10px;
right: 10px;
}
.ai-chat-widget.position-bottom-left {
left: 10px;
right: auto;
}
.ai-chat-panel {
width: calc(100vw - 20px);
height: 70vh;
right: 0;
left: 0;
margin: 0 auto;
}
.ai-chat-widget.position-bottom-left .ai-chat-panel {
left: 0;
right: 0;
}
.ai-chat-toggle {
width: 50px;
height: 50px;
}
} @media (prefers-color-scheme: dark) {
.ai-chat-panel {
background: #1f2937;
border-color: #374151;
}
.ai-chat-messages {
background: #111827;
}
.ai-chat-message.assistant {
background: #1f2937;
color: #f9fafb;
border-color: #374151;
}
.ai-chat-input-area {
background: #1f2937;
border-color: #374151;
}
.ai-chat-input {
background: #111827;
color: #f9fafb;
border-color: #374151;
}
.ai-chat-input:focus {
border-color: var(--ai-chat-primary, #3b82f6);
}
.ai-chat-status {
background: #111827;
color: #9ca3af;
border-color: #374151;
}
}