Ruhijiapi / frontend /styles.css
ruhivig85's picture
Upload 3 files
7f4def3 verified
/* ════════════════════════════════════════════════
Chat Arena β€” Styles
Dark theme, glassmorphism, smooth animations
════════════════════════════════════════════════ */
:root {
--bg-primary: #0a0a0f;
--bg-secondary: #111118;
--bg-card: #16161f;
--bg-hover: #1e1e2a;
--bg-input: #1a1a24;
--border: #2a2a3a;
--border-glow: #4f46e5;
--text-primary: #f0f0fa;
--text-secondary: #9090b0;
--text-muted: #606080;
--accent-1: #6366f1; /* indigo */
--accent-2: #8b5cf6; /* violet */
--accent-3: #06b6d4; /* cyan */
--accent-4: #10b981; /* emerald */
/* Provider colors */
--openai: #10a37f;
--anthropic: #d4763b;
--google: #4285f4;
--mistral: #ff7000;
--radius: 12px;
--radius-lg: 20px;
--shadow: 0 4px 24px rgba(0,0,0,0.4);
--shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
--transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
--sidebar-width: 280px;
--header-height: 60px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
height: 100%;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
overflow: hidden;
}
/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-1); }
/* ── Layout ────────────────────────────────────── */
#app {
display: flex;
height: 100vh;
overflow: hidden;
}
/* ── Auth Screen ───────────────────────────────── */
#auth-screen {
position: fixed; inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 65%),
var(--bg-primary);
z-index: 1000;
}
.auth-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 40px;
width: 100%;
max-width: 420px;
box-shadow: var(--shadow), var(--shadow-glow);
}
.auth-logo {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 28px;
justify-content: center;
}
.auth-logo-icon {
width: 44px; height: 44px;
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
border-radius: 12px;
display: flex; align-items: center; justify-content: center;
font-size: 22px;
}
.auth-logo-text { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.auth-tabs {
display: flex;
background: var(--bg-input);
border-radius: 10px;
padding: 4px;
margin-bottom: 24px;
gap: 4px;
}
.auth-tab {
flex: 1;
padding: 8px;
border: none;
background: transparent;
color: var(--text-secondary);
font-size: 14px;
font-weight: 500;
border-radius: 7px;
cursor: pointer;
transition: var(--transition);
}
.auth-tab.active {
background: var(--bg-card);
color: var(--text-primary);
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.form-group { margin-bottom: 16px; }
.form-label {
display: block;
font-size: 13px;
font-weight: 500;
color: var(--text-secondary);
margin-bottom: 6px;
}
.form-input {
width: 100%;
padding: 10px 14px;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text-primary);
font-size: 14px;
transition: var(--transition);
outline: none;
}
.form-input:focus {
border-color: var(--accent-1);
box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.btn-primary {
width: 100%;
padding: 11px;
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
border: none;
border-radius: 9px;
color: white;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
position: relative;
overflow: hidden;
margin-top: 4px;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-error {
color: #f87171;
font-size: 13px;
margin-top: 12px;
text-align: center;
min-height: 18px;
}
/* ── Sidebar ───────────────────────────────────── */
#sidebar {
width: var(--sidebar-width);
background: var(--bg-secondary);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
flex-shrink: 0;
overflow: hidden;
}
.sidebar-header {
padding: 16px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 10px;
height: var(--header-height);
}
.logo-icon {
width: 32px; height: 32px;
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
border-radius: 8px;
display: flex; align-items: center; justify-content: center;
font-size: 16px; flex-shrink: 0;
}
.logo-text { font-size: 16px; font-weight: 700; flex: 1; }
.btn-new-chat {
padding: 6px 12px;
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
border: none;
border-radius: 7px;
color: white;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
white-space: nowrap;
}
.btn-new-chat:hover { opacity: 0.85; }
.sidebar-section-title {
font-size: 11px;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.8px;
padding: 12px 16px 6px;
}
.conversation-list {
flex: 1;
overflow-y: auto;
padding: 4px 8px;
}
.conv-item {
padding: 10px 10px;
border-radius: 9px;
cursor: pointer;
transition: var(--transition);
display: flex;
align-items: center;
gap: 8px;
group: true;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.active { background: rgba(99, 102, 241, 0.12); }
.conv-icon { font-size: 14px; flex-shrink: 0; }
.conv-info { flex: 1; min-width: 0; }
.conv-title {
font-size: 13px;
font-weight: 500;
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.conv-meta {
font-size: 11px;
color: var(--text-muted);
margin-top: 2px;
}
.conv-delete {
opacity: 0;
background: none;
border: none;
color: #f87171;
cursor: pointer;
padding: 3px 6px;
border-radius: 5px;
font-size: 13px;
transition: var(--transition);
flex-shrink: 0;
}
.conv-item:hover .conv-delete { opacity: 1; }
.conv-delete:hover { background: rgba(248, 113, 113, 0.12); }
.sidebar-footer {
padding: 12px 16px;
border-top: 1px solid var(--border);
display: flex;
align-items: center;
gap: 10px;
}
.user-avatar {
width: 30px; height: 30px;
background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 13px; font-weight: 600; flex-shrink: 0;
color: white;
}
.user-name {
flex: 1;
font-size: 13px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.btn-icon {
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 6px;
border-radius: 7px;
transition: var(--transition);
font-size: 16px;
display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
/* ── Main Area ─────────────────────────────────── */
#main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--bg-primary);
}
/* ── Top Bar ───────────────────────────────────── */
#topbar {
height: var(--header-height);
padding: 0 20px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 12px;
background: var(--bg-secondary);
flex-shrink: 0;
}
.topbar-title {
flex: 1;
font-size: 15px;
font-weight: 600;
color: var(--text-secondary);
}
.model-selector-area {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
/* ── Model Pills ───────────────────────────────── */
.model-pill {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 10px;
border-radius: 99px;
font-size: 12px;
font-weight: 500;
border: 1px solid var(--border);
background: var(--bg-card);
cursor: pointer;
transition: var(--transition);
white-space: nowrap;
}
.model-pill:hover { border-color: var(--accent-1); }
.model-pill.selected { border-color: var(--accent-1); background: rgba(99,102,241,0.12); color: #a5b4fc; }
.model-pill .provider-dot { width: 7px; height: 7px; border-radius: 50%; }
.model-pill .remove-btn { font-size: 11px; color: var(--text-muted); }
.btn-add-model {
padding: 5px 10px;
border: 1px dashed var(--border);
border-radius: 99px;
background: transparent;
color: var(--text-muted);
font-size: 12px;
cursor: pointer;
transition: var(--transition);
}
.btn-add-model:hover { border-color: var(--accent-1); color: var(--accent-1); }
/* ── Model Selector Dropdown ───────────────────── */
.model-dropdown {
position: absolute;
top: calc(100% + 8px);
right: 20px;
width: 560px;
max-height: 480px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow-y: auto;
z-index: 500;
padding: 8px;
}
.dropdown-provider-section { margin-bottom: 4px; }
.dropdown-provider-title {
font-size: 11px;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.8px;
padding: 8px 10px 4px;
display: flex;
align-items: center;
gap: 8px;
}
.provider-badge {
font-size: 10px;
padding: 2px 7px;
border-radius: 99px;
font-weight: 600;
}
.provider-badge.no-key {
background: rgba(248, 113, 113, 0.15);
color: #f87171;
}
.provider-badge.has-key {
background: rgba(16, 185, 129, 0.15);
color: #34d399;
}
.model-option {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 10px;
border-radius: 8px;
cursor: pointer;
transition: var(--transition);
}
.model-option:hover { background: var(--bg-hover); }
.model-option.selected { background: rgba(99,102,241,0.1); }
.model-option-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.model-option-info { flex: 1; }
.model-option-name { font-size: 13px; font-weight: 500; }
.model-option-provider { font-size: 11px; color: var(--text-muted); }
.model-option-check { font-size: 14px; color: var(--accent-1); }
/* ── Chat Area ─────────────────────────────────── */
#chat-area {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* ── Welcome Screen ────────────────────────────── */
#welcome-screen {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
gap: 32px;
}
.welcome-hero {
text-align: center;
max-width: 520px;
}
.welcome-hero h1 {
font-size: 36px;
font-weight: 800;
background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: -1px;
margin-bottom: 12px;
}
.welcome-hero p {
font-size: 16px;
color: var(--text-secondary);
line-height: 1.7;
}
.provider-cards {
display: flex;
gap: 12px;
flex-wrap: wrap;
justify-content: center;
}
.provider-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 16px 20px;
text-align: center;
min-width: 120px;
transition: var(--transition);
}
.provider-card:hover {
border-color: var(--accent-1);
transform: translateY(-2px);
box-shadow: var(--shadow-glow);
}
.provider-card-icon { font-size: 26px; margin-bottom: 6px; }
.provider-card-name { font-size: 13px; font-weight: 600; }
.provider-card-count { font-size: 11px; color: var(--text-muted); }
/* ── Messages Grid ─────────────────────────────── */
#messages-wrapper {
flex: 1;
overflow-y: auto;
padding: 20px;
display: flex;
flex-direction: column;
gap: 20px;
}
.message-group { display: flex; flex-direction: column; gap: 12px; }
/* User message */
.user-message-row {
display: flex;
justify-content: flex-end;
}
.user-message-bubble {
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
color: white;
padding: 12px 16px;
border-radius: 16px 16px 4px 16px;
max-width: 600px;
font-size: 14px;
line-height: 1.6;
white-space: pre-wrap;
word-break: break-word;
}
/* AI responses grid */
.ai-responses-grid {
display: grid;
gap: 14px;
}
.ai-responses-grid.cols-1 { grid-template-columns: 1fr; }
.ai-responses-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ai-responses-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ai-responses-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
/* AI Response Card */
.ai-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
transition: var(--transition);
}
.ai-card:hover { border-color: rgba(99, 102, 241, 0.3); }
.ai-card-header {
padding: 10px 14px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 8px;
}
.provider-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-openai { background: var(--openai); }
.dot-anthropic { background: var(--anthropic); }
.dot-google { background: var(--google); }
.dot-mistral { background: var(--mistral); }
.ai-card-model { font-size: 12px; font-weight: 600; flex: 1; }
.ai-card-meta {
display: flex;
gap: 8px;
align-items: center;
}
.meta-badge {
font-size: 10px;
padding: 2px 7px;
border-radius: 99px;
background: var(--bg-input);
color: var(--text-muted);
font-weight: 500;
}
.meta-badge.time { color: var(--accent-3); }
.meta-badge.tokens { color: var(--accent-4); }
.ai-card-body {
padding: 14px;
font-size: 14px;
line-height: 1.7;
color: var(--text-primary);
white-space: pre-wrap;
word-break: break-word;
overflow-wrap: break-word;
max-height: 500px;
overflow-y: auto;
}
.ai-card-body.error { color: #f87171; font-size: 13px; }
/* Code blocks */
.ai-card-body pre {
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px;
overflow-x: auto;
margin: 10px 0;
}
.ai-card-body code { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
/* Loading skeleton */
.skeleton-line {
background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
background-size: 200% 100%;
animation: skeleton-shimmer 1.5s infinite;
border-radius: 4px;
height: 14px;
margin-bottom: 8px;
}
.skeleton-line:last-child { width: 60%; }
.skeleton-line:nth-child(2) { width: 85%; }
@keyframes skeleton-shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
.typing-indicator {
display: flex;
gap: 4px;
align-items: center;
padding: 8px 0;
}
.typing-dot {
width: 6px; height: 6px;
background: var(--accent-1);
border-radius: 50%;
animation: typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
30% { transform: translateY(-6px); opacity: 1; }
}
/* ── Input Area ────────────────────────────────── */
#input-area {
padding: 16px 20px;
border-top: 1px solid var(--border);
background: var(--bg-secondary);
flex-shrink: 0;
}
.input-wrapper {
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius);
display: flex;
align-items: flex-end;
gap: 10px;
padding: 10px 14px;
transition: var(--transition);
max-width: 1200px;
margin: 0 auto;
}
.input-wrapper:focus-within {
border-color: var(--accent-1);
box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
#message-input {
flex: 1;
background: transparent;
border: none;
color: var(--text-primary);
font-size: 14px;
line-height: 1.5;
resize: none;
outline: none;
max-height: 180px;
overflow-y: auto;
font-family: inherit;
}
#message-input::placeholder { color: var(--text-muted); }
.input-actions {
display: flex;
align-items: center;
gap: 6px;
padding-bottom: 2px;
}
.btn-send {
width: 36px; height: 36px;
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
border: none;
border-radius: 9px;
color: white;
cursor: pointer;
font-size: 16px;
display: flex; align-items: center; justify-content: center;
transition: var(--transition);
flex-shrink: 0;
}
.btn-send:hover { opacity: 0.85; transform: scale(1.05); }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.input-hint {
text-align: center;
font-size: 11px;
color: var(--text-muted);
margin-top: 8px;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
/* ── Settings Modal ────────────────────────────── */
.modal-overlay {
position: fixed; inset: 0;
background: rgba(0,0,0,0.7);
backdrop-filter: blur(4px);
z-index: 900;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.modal {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
width: 100%;
max-width: 540px;
max-height: 90vh;
overflow-y: auto;
box-shadow: var(--shadow);
}
.modal-header {
padding: 20px 24px 16px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.modal-footer {
padding: 16px 24px;
border-top: 1px solid var(--border);
display: flex;
justify-content: flex-end;
gap: 10px;
}
.btn-secondary {
padding: 9px 20px;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text-primary);
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: var(--transition);
}
.btn-secondary:hover { background: var(--bg-hover); }
.settings-section-title {
font-size: 13px;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 12px;
padding-bottom: 6px;
border-bottom: 1px solid var(--border);
}
.api-key-row {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 10px;
}
.provider-label {
display: flex;
align-items: center;
gap: 7px;
min-width: 110px;
font-size: 13px;
font-weight: 500;
}
.provider-icon { font-size: 16px; }
.api-key-input-wrap {
flex: 1;
position: relative;
}
.api-key-input-wrap input {
width: 100%;
padding: 8px 36px 8px 12px;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text-primary);
font-size: 13px;
outline: none;
transition: var(--transition);
font-family: monospace;
}
.api-key-input-wrap input:focus { border-color: var(--accent-1); }
.btn-toggle-key {
position: absolute;
right: 8px; top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
font-size: 13px;
}
.key-status {
width: 8px; height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.key-status.saved { background: var(--accent-4); }
.key-status.unsaved { background: var(--text-muted); }
.system-prompt-area {
margin-top: 20px;
}
.system-prompt-area textarea {
width: 100%;
min-height: 100px;
padding: 10px 12px;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text-primary);
font-size: 13px;
resize: vertical;
outline: none;
font-family: inherit;
transition: var(--transition);
}
.system-prompt-area textarea:focus { border-color: var(--accent-1); }
.slider-row {
display: flex;
align-items: center;
gap: 12px;
margin-top: 10px;
}
.slider-label { font-size: 13px; color: var(--text-secondary); min-width: 110px; }
input[type="range"] {
flex: 1;
accent-color: var(--accent-1);
}
.slider-value {
font-size: 13px;
font-weight: 600;
color: var(--accent-1);
min-width: 40px;
text-align: right;
}
/* ── Toast ─────────────────────────────────────── */
#toast-container {
position: fixed;
bottom: 24px;
right: 24px;
z-index: 9999;
display: flex;
flex-direction: column;
gap: 8px;
}
.toast {
padding: 12px 18px;
border-radius: 10px;
font-size: 13px;
font-weight: 500;
color: white;
animation: toast-in 0.3s ease;
box-shadow: var(--shadow);
max-width: 300px;
}
.toast.success { background: var(--accent-4); }
.toast.error { background: #ef4444; }
.toast.info { background: var(--accent-1); }
@keyframes toast-in {
from { opacity: 0; transform: translateY(16px); }
to { opacity: 1; transform: translateY(0); }
}
/* ── Utility ───────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.empty-state {
text-align: center;
padding: 40px 20px;
color: var(--text-muted);
}
.empty-state-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state-text { font-size: 14px; }
/* Provider dot colors inline style helpers */
.dot-color-openai { background-color: var(--openai) !important; }
.dot-color-anthropic { background-color: var(--anthropic) !important; }
.dot-color-google { background-color: var(--google) !important; }
.dot-color-mistral { background-color: var(--mistral) !important; }
/* ── Responsive ────────────────────────────────── */
@media (max-width: 900px) {
#sidebar { width: 240px; }
.ai-responses-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
.ai-responses-grid.cols-4 { grid-template-columns: 1fr; }
.model-dropdown { width: 380px; }
}
@media (max-width: 640px) {
#sidebar { display: none; }
.ai-responses-grid.cols-2,
.ai-responses-grid.cols-3,
.ai-responses-grid.cols-4 { grid-template-columns: 1fr; }
.welcome-hero h1 { font-size: 26px; }
}