AI-Chat-Server / static /css /main.css
NathMen12's picture
Upload 17 files
771ff9e verified
Raw History Blame Contribute Delete
28.5 kB
/* ============================================================
AI Chat V10 — Refonte UI complète
Design : moderne, smooth, intuitif. Thème clair + sombre.
============================================================ */
/* ---------- Reset & variables ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
/* Palette dark par défaut */
--bg: #0f0f1a;
--bg-soft: #181828;
--surface: #1f1f33;
--surface-hover: #282844;
--surface-active: #2f2f50;
--border: #2e2e4a;
--border-soft: #232338;
--text: #e4e4f0;
--text-soft: #a0a0b8;
--text-dim: #6c6c85;
--primary: #7c5cff;
--primary-hover: #6940ff;
--primary-soft: rgba(124, 92, 255, 0.15);
--accent: #00d4ff;
--danger: #ff4d6d;
--danger-soft: rgba(255, 77, 109, 0.15);
--success: #4ade80;
--success-soft: rgba(74, 222, 128, 0.15);
--warning: #fbbf24;
--warning-soft: rgba(251, 191, 36, 0.15);
--gradient-primary: linear-gradient(135deg, #7c5cff 0%, #00d4ff 100%);
--gradient-danger: linear-gradient(135deg, #ff4d6d 0%, #ff8a3d 100%);
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-full: 9999px;
--shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
--shadow-md: 0 4px 12px rgba(0,0,0,0.15);
--shadow-lg: 0 12px 32px rgba(0,0,0,0.25);
--shadow-glow: 0 0 24px rgba(124, 92, 255, 0.3);
--sidebar-w: 280px;
--transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
--font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}
[data-theme="light"] {
--bg: #f5f5fa;
--bg-soft: #ffffff;
--surface: #ffffff;
--surface-hover: #f0f0f7;
--surface-active: #e8e8f0;
--border: #e0e0ec;
--border-soft: #ececf2;
--text: #1a1a2e;
--text-soft: #555570;
--text-dim: #8a8aa0;
--primary-soft: rgba(124, 92, 255, 0.1);
--shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
--shadow-md: 0 4px 12px rgba(0,0,0,0.06);
--shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
}
html, body {
height: 100vh;
height: 100dvh;
font-family: var(--font);
background: var(--bg);
color: var(--text);
overflow: hidden;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
body { display: flex; flex-direction: column; }
/* App shell : row contenant sidebar + main */
.app-shell { display: flex; flex: 1; min-height: 0; }
/* Scrollbar moderne */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
/* ---------- Boutons ---------- */
.btn {
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
padding: 10px 18px; border: none; border-radius: var(--radius-md);
background: var(--primary); color: #fff; font-weight: 600; font-size: 0.9rem;
cursor: pointer; transition: var(--transition);
font-family: inherit;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #e63957; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-icon {
width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md);
background: var(--surface); border: 1px solid var(--border); color: var(--text);
display: flex; align-items: center; justify-content: center; cursor: pointer;
transition: var(--transition); flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface-hover); }
.btn-icon.primary { background: var(--primary); color: #fff; border: none; }
.btn-icon.danger { color: var(--danger); }
/* ---------- Sidebar ---------- */
.sidebar {
width: var(--sidebar-w); background: var(--bg-soft); border-right: 1px solid var(--border);
display: flex; flex-direction: column; flex-shrink: 0; transition: var(--transition); z-index: 100;
}
.sidebar-header { padding: 16px; border-bottom: 1px solid var(--border-soft); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 1.15rem; font-weight: 700; }
.sidebar-brand-icon {
width: 32px; height: 32px; border-radius: var(--radius-sm);
background: var(--gradient-primary); display: flex; align-items: center; justify-content: center;
color: #fff; font-size: 1rem; box-shadow: var(--shadow-glow);
}
.sidebar-actions { display: flex; flex-direction: column; gap: 8px; }
.sidebar-actions .btn { justify-content: flex-start; padding: 10px 14px; }
.sidebar-search { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.sidebar-search input {
width: 100%; padding: 8px 12px 8px 34px;
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
color: var(--text); font-size: 0.85rem; font-family: inherit; outline: none;
transition: var(--transition);
}
.sidebar-search { position: relative; }
.sidebar-search i { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 0.85rem; }
.sidebar-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.chat-list { flex: 1; overflow-y: auto; padding: 8px; }
.chat-item {
display: flex; align-items: center; gap: 10px; padding: 10px 12px;
border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); margin-bottom: 2px;
}
.chat-item:hover { background: var(--surface-hover); }
.chat-item.active { background: var(--primary-soft); color: var(--primary); }
.chat-item .chat-icon { color: var(--text-dim); font-size: 0.9rem; flex-shrink: 0; }
.chat-item.active .chat-icon { color: var(--primary); }
.chat-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.chat-actions { display: none; gap: 4px; }
.chat-item:hover .chat-actions { display: flex; }
.chat-action-btn { background: none; border: none; color: var(--text-dim); padding: 4px 6px; cursor: pointer; border-radius: 4px; transition: var(--transition); }
.chat-action-btn:hover { background: var(--surface-active); color: var(--text); }
.chat-action-btn.danger:hover { color: var(--danger); }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-soft); }
.user-card {
display: flex; align-items: center; gap: 10px; padding: 8px;
border-radius: var(--radius-sm); transition: var(--transition); cursor: pointer;
}
.user-card:hover { background: var(--surface-hover); }
.user-avatar {
width: 32px; height: 32px; border-radius: var(--radius-full);
background: var(--gradient-primary); display: flex; align-items: center; justify-content: center;
color: #fff; font-weight: 600; font-size: 0.85rem; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 0.75rem; color: var(--text-dim); }
.user-role.admin { color: var(--warning); font-weight: 600; }
/* ---------- Main area ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; background: var(--bg); }
.header {
display: flex; align-items: center; gap: 12px; padding: 10px 16px;
border-bottom: 1px solid var(--border); background: var(--bg-soft);
backdrop-filter: blur(10px); flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; padding: 4px; }
.header-models { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 600px; }
.model-search-wrap { position: relative; flex-shrink: 0; }
.model-search-wrap > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 0.78rem; pointer-events: none; }
.model-search-input {
padding: 8px 12px 8px 28px; background: var(--surface); color: var(--text);
border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none;
font-size: 0.82rem; font-family: inherit; transition: var(--transition);
width: 130px;
}
.model-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); width: 180px; }
.provider-select, .model-select {
padding: 8px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
border-radius: var(--radius-sm); outline: none; font-size: 0.85rem; font-family: inherit; cursor: pointer; transition: var(--transition);
max-width: 280px; min-width: 0; flex: 1;
}
.provider-select:hover, .model-select:hover { border-color: var(--primary); }
.provider-select:focus, .model-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.header-right { display: flex; align-items: center; gap: 8px; }
.sync-badge {
display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 500;
background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
}
.sync-badge.online { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.sync-badge.syncing { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.sync-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.lang-select { padding: 6px 10px; font-size: 0.8rem; }
/* ---------- Messages ---------- */
.messages {
flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px;
background: var(--bg);
}
.message-wrapper { display: flex; max-width: 90%; }
.message-wrapper.user { align-self: flex-end; }
.message-wrapper.assistant { align-self: flex-start; width: 100%; max-width: 100%; }
.message {
padding: 14px 18px; border-radius: var(--radius-lg); line-height: 1.6; word-wrap: break-word; font-size: 0.92rem;
animation: messageIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes messageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.message.user {
background: var(--gradient-primary); color: #fff; border-bottom-right-radius: 4px;
box-shadow: var(--shadow-md);
}
.message.assistant { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.message p { margin: 0 0 10px 0; }
.message p:last-child { margin: 0; }
.message ul, .message ol { margin: 6px 0 10px 22px; }
.message li { margin: 4px 0; }
.message code:not(pre code) { background: rgba(0,0,0,0.25); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 0.85em; }
.message.user code { background: rgba(255,255,255,0.2); }
.message a { color: var(--accent); text-decoration: none; }
.message a:hover { text-decoration: underline; }
.message blockquote { border-left: 3px solid var(--primary); padding-left: 12px; margin: 8px 0; color: var(--text-soft); font-style: italic; }
.message h1, .message h2, .message h3 { margin: 14px 0 8px 0; font-weight: 700; }
.message h1 { font-size: 1.3rem; }
.message h2 { font-size: 1.15rem; }
.message h3 { font-size: 1rem; }
.message table { border-collapse: collapse; margin: 10px 0; }
.message th, .message td { border: 1px solid var(--border); padding: 6px 10px; }
/* Code blocks */
.code-block { background: #0d0d18; border-radius: var(--radius-sm); margin: 10px 0; overflow: hidden; border: 1px solid var(--border); }
.code-header { background: #181828; padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--text-soft); }
.code-header .lang { font-family: var(--font-mono); font-weight: 600; }
.code-copy { background: none; border: none; color: var(--text-soft); cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: var(--transition); display: flex; align-items: center; gap: 4px; }
.code-copy:hover { background: var(--surface-hover); color: var(--text); }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5; color: #e4e4f0; }
/* Message footer */
.msg-footer {
display: flex; align-items: center; gap: 12px; padding: 4px 6px; margin-top: 6px;
font-size: 0.78rem; color: var(--text-dim);
}
.msg-action { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; border-radius: 4px; transition: var(--transition); }
.msg-action:hover { color: var(--text); background: var(--surface-hover); }
.tokens-badge { font-family: var(--font-mono); }
/* Tool calls inline (collapsible, dans le message) */
.tool-call-inline {
background: var(--surface-hover); border: 1px solid var(--border);
border-left: 3px solid var(--primary); border-radius: var(--radius-sm);
padding: 0; margin: 10px 0; font-size: 0.82rem; overflow: hidden;
}
.tool-call-header {
display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer;
transition: var(--transition); user-select: none;
}
.tool-call-header:hover { background: rgba(255,255,255,0.03); }
.tool-call-name { font-weight: 600; color: var(--primary); flex: 1; display: flex; align-items: center; gap: 6px; }
.tool-call-status { font-size: 0.75rem; color: var(--text-dim); }
.tool-call-arrow { font-size: 0.72rem; color: var(--text-dim); transition: transform 200ms ease; }
.tool-call-inline.expanded .tool-call-arrow { transform: rotate(180deg); }
.tool-call-body { display: none; padding: 0 14px 12px 14px; }
.tool-call-inline.expanded .tool-call-body { display: block; animation: fadeIn 150ms ease; }
.tool-call-label { font-size: 0.72rem; color: var(--text-dim); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; }
.tool-call-args { background: rgba(0,0,0,0.25); border-radius: 4px; padding: 6px 8px; margin: 4px 0; }
.tool-call-args pre { margin: 0; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-soft); white-space: pre-wrap; word-break: break-all; }
.tool-call-result { background: var(--success-soft); border-radius: 4px; padding: 6px 8px; margin-top: 4px; }
.tool-call-result pre { margin: 0; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-soft); white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto; }
.tool-call-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tool-call-image { max-width: 300px; max-height: 300px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; }
/* Reasoning section (modèles o1/o3) */
.reasoning-section {
background: rgba(124, 92, 255, 0.05); border: 1px solid var(--border-soft);
border-radius: var(--radius-sm); margin: 8px 0; overflow: hidden;
}
.reasoning-header {
display: flex; align-items: center; gap: 6px; padding: 8px 12px; cursor: pointer;
font-size: 0.82rem; color: var(--text-soft); user-select: none; transition: var(--transition);
}
.reasoning-header:hover { background: rgba(255,255,255,0.03); }
.reasoning-header i.fa-brain { color: var(--primary); }
.reasoning-arrow { margin-left: auto; font-size: 0.72rem; transition: transform 200ms ease; }
.reasoning-section.expanded .reasoning-arrow { transform: rotate(180deg); }
.reasoning-content { display: none; padding: 0 12px 10px 12px; font-size: 0.82rem; color: var(--text-dim); border-top: 1px solid var(--border-soft); }
.reasoning-section.expanded .reasoning-content { display: block; animation: fadeIn 150ms ease; }
.reasoning-content p { margin: 6px 0; color: var(--text-dim); }
/* Ancienne classe tool-call-banner (conservée pour compat, plus utilisée) */
.tool-call-banner {
display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
background: var(--warning-soft); color: var(--warning); border-radius: var(--radius-full);
font-size: 0.78rem; margin: 6px 0; border: 1px solid var(--warning);
}
.tool-call-banner i { animation: spin 1.5s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
/* Status inline (DANS le message, pendant l'exécution des tools) */
.status-inline {
display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
background: var(--primary-soft); color: var(--primary); border-radius: var(--radius-sm);
font-size: 0.82rem; margin: 8px 0;
}
.status-inline .spinner {
width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent;
border-radius: 50%; animation: spin 0.8s linear infinite;
}
/* Status banner (ancienne classe, conservée pour compat mais plus utilisée) */
.status-banner {
display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
background: var(--primary-soft); color: var(--primary); border-radius: var(--radius-full);
font-size: 0.82rem; margin: 6px 0;
}
.status-banner .spinner {
width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent;
border-radius: 50%; animation: spin 0.8s linear infinite;
}
/* Typing indicator */
.typing-indicator { display: inline-flex; gap: 4px; padding: 8px 12px; }
.typing-indicator span { width: 8px; height: 8px; background: var(--text-dim); border-radius: 50%; animation: typingBlink 1.4s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink { 0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1.2); } }
/* Images */
.message img.attached-img { max-width: 240px; border-radius: var(--radius-md); margin-top: 10px; border: 1px solid var(--border); }
/* ---------- Input area ---------- */
.input-container { padding: 16px 20px; background: var(--bg-soft); border-top: 1px solid var(--border); }
.attachments-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.attachment-chip {
position: relative; display: flex; align-items: center; gap: 8px;
background: var(--surface); padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.attachment-chip img { max-height: 50px; max-width: 80px; border-radius: 4px; }
.attachment-chip .attachment-remove {
background: var(--danger); color: #fff; border: none; cursor: pointer;
width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.disclaimer-vision { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px; font-style: italic; }
.input-row { display: flex; align-items: flex-end; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 6px 6px 14px; transition: var(--transition); }
.input-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea {
flex: 1; background: transparent; border: none; color: var(--text); padding: 8px 0;
resize: none; max-height: 200px; outline: none; font-family: inherit; font-size: 0.95rem; line-height: 1.5;
}
textarea::placeholder { color: var(--text-dim); }
.input-actions { display: flex; align-items: center; gap: 4px; }
.toggle-btn {
width: 36px; height: 36px; border-radius: var(--radius-sm); background: transparent;
border: none; color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center;
transition: var(--transition);
}
.toggle-btn:hover { background: var(--surface-hover); color: var(--text); }
.toggle-btn.active { background: var(--primary-soft); color: var(--primary); }
.send-btn {
width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--gradient-primary);
color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
transition: var(--transition); font-size: 0.9rem;
}
.send-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-glow); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.send-btn.stop { background: var(--gradient-danger); }
/* ---------- Modals ---------- */
.modal {
display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
align-items: center; justify-content: center; z-index: 1000; padding: 16px;
backdrop-filter: blur(8px); animation: modalIn 200ms ease;
}
.modal.open { display: flex; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
background: var(--bg-soft); padding: 28px; border-radius: var(--radius-lg);
width: 100%; max-width: 480px; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
max-height: 90vh; overflow-y: auto; animation: modalContentIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalContentIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-content.large { max-width: 800px; }
.modal-content.xlarge { max-width: 1100px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-close { background: none; border: none; color: var(--text-soft); cursor: pointer; font-size: 1.2rem; padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text); background: var(--surface-hover); }
/* Form fields */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.88rem; color: var(--text-soft); }
.form-input {
width: 100%; padding: 10px 14px; background: var(--surface); color: var(--text);
border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none;
font-family: inherit; font-size: 0.9rem; transition: var(--transition);
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
/* Toggle switch */
.toggle-row {
display: flex; align-items: center; justify-content: space-between;
background: var(--surface); padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 8px;
}
.toggle-row .label { font-size: 0.9rem; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); transition: var(--transition); border-radius: 22px; }
.slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; transition: var(--transition); border-radius: 50%; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }
/* ---------- Settings tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
padding: 10px 16px; background: none; border: none; color: var(--text-soft);
cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: var(--transition);
border-bottom: 2px solid transparent; font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 200ms ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* API key fields */
.api-key-row { margin-bottom: 14px; }
.api-key-input { display: flex; gap: 8px; }
.api-key-input .form-input { flex: 1; }
.custom-provider-box { background: var(--surface); padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 12px; position: relative; }
.custom-provider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; }
.custom-provider-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.9rem; }
/* MCP servers list */
.mcp-server-row {
display: flex; align-items: center; gap: 12px; padding: 12px;
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.mcp-server-info { flex: 1; min-width: 0; }
.mcp-server-name { font-weight: 600; font-size: 0.9rem; }
.mcp-server-url { font-size: 0.78rem; color: var(--text-dim); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcp-server-actions { display: flex; gap: 4px; align-items: center; }
/* ---------- Auth modal ---------- */
.auth-modal-content { text-align: center; max-width: 420px; }
.auth-logo { font-size: 2.5rem; color: var(--primary); margin-bottom: 16px; }
.auth-subtitle { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 24px; }
.auth-error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 14px; display: none; }
.auth-error.show { display: block; }
.auth-divider { position: relative; margin: 20px 0; border-top: 1px solid var(--border); }
.auth-divider span { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--bg-soft); padding: 0 12px; color: var(--text-dim); font-size: 0.8rem; }
.cgu-checkbox { display: flex; align-items: flex-start; gap: 8px; text-align: left; font-size: 0.85rem; color: var(--text-soft); margin: 12px 0; cursor: pointer; }
.cgu-checkbox input { margin-top: 2px; }
.cgu-link { color: var(--primary); text-decoration: underline; cursor: pointer; }
/* ---------- Legal disclaimer bar (compact, dismissible) ---------- */
.disclaimer-bar {
display: flex; align-items: center; gap: 8px;
background: var(--warning-soft); color: var(--warning);
padding: 6px 14px; font-size: 0.74rem; text-align: left;
border-bottom: 1px solid var(--warning); flex-shrink: 0;
font-style: italic;
}
.disclaimer-bar i.fa-info-circle { font-size: 0.8rem; flex-shrink: 0; }
.disclaimer-bar span { flex: 1; }
.disclaimer-close {
background: none; border: none; color: var(--warning); cursor: pointer;
padding: 2px 6px; border-radius: 4px; font-size: 0.78rem; opacity: 0.7;
transition: var(--transition); flex-shrink: 0;
}
.disclaimer-close:hover { opacity: 1; background: rgba(251, 191, 36, 0.15); }
.disclaimer-bar.hidden { display: none; }
/* ---------- Mobile ---------- */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90; }
.sidebar-overlay.open { display: block; }
@media (max-width: 768px) {
.sidebar { position: absolute; height: 100%; transform: translateX(-100%); transition: transform 250ms ease; z-index: 110; }
.sidebar.open { transform: translateX(0); }
.mobile-toggle { display: block; }
.header-models { flex-wrap: wrap; max-width: 100%; }
.model-search-input { width: 100px; font-size: 0.78rem; }
.model-search-input:focus { width: 130px; }
.model-select { max-width: 150px; font-size: 0.8rem; }
.messages { padding: 12px; }
.message-wrapper { max-width: 100%; }
.modal-content { padding: 20px; }
}
/* ---------- Toast ---------- */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
background: var(--surface); color: var(--text); padding: 12px 16px; border-radius: var(--radius-sm);
border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: 0.85rem; min-width: 200px;
animation: toastIn 200ms ease; border-left: 3px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }