jashdoshi77's picture
Initial commit: AI Consultant Chatbot for HF Spaces
c27eaf1
/* ═══════════════════════════════════════════════════════════════
ConsultAI β€” Premium Dark-Mode Chat UI
═══════════════════════════════════════════════════════════════ */
/* --- CSS Variables / Design Tokens --- */
:root {
--bg-primary: #0a0e1a;
--bg-secondary: #111827;
--bg-tertiary: #1a2038;
--bg-surface: rgba(255, 255, 255, 0.04);
--bg-glass: rgba(255, 255, 255, 0.06);
--bg-glass-hover: rgba(255, 255, 255, 0.10);
--text-primary: #f0f2f5;
--text-secondary: #9ca3af;
--text-muted: #6b7280;
--accent-primary: #6366f1;
--accent-secondary: #818cf8;
--accent-glow: rgba(99, 102, 241, 0.25);
--accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
--phase-discovery: #3b82f6;
--phase-exploration: #8b5cf6;
--phase-constraints: #f59e0b;
--phase-solution: #10b981;
--phase-refinement: #06d6a0;
--border-color: rgba(255, 255, 255, 0.08);
--border-accent: rgba(99, 102, 241, 0.3);
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
--shadow-glow: 0 0 20px var(--accent-glow);
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-xl: 20px;
--sidebar-width: 280px;
--topbar-height: 60px;
--font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
--transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
--transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* --- Reset --- */
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 16px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
font-family: var(--font-family);
background: var(--bg-primary);
color: var(--text-primary);
display: flex;
height: 100vh;
overflow: hidden;
}
/* --- Scrollbar --- */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.12);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.2);
}
/* ═══════════════════════════════════════════════════
SIDEBAR
═══════════════════════════════════════════════════ */
.sidebar {
width: var(--sidebar-width);
min-width: var(--sidebar-width);
background: var(--bg-secondary);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
transition: transform var(--transition-normal), opacity var(--transition-normal);
z-index: 100;
}
.sidebar.hidden {
transform: translateX(-100%);
position: absolute;
height: 100%;
opacity: 0;
pointer-events: none;
}
.sidebar-header {
padding: 16px 20px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--border-color);
}
.logo {
display: flex;
align-items: center;
gap: 10px;
}
.logo-icon {
font-size: 22px;
background: var(--accent-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.logo-text {
font-size: 18px;
font-weight: 700;
letter-spacing: -0.02em;
}
.btn-new-chat {
background: var(--bg-glass);
border: 1px solid var(--border-color);
color: var(--text-primary);
border-radius: var(--radius-sm);
padding: 8px;
cursor: pointer;
transition: all var(--transition-fast);
display: flex;
align-items: center;
justify-content: center;
}
.btn-new-chat:hover {
background: var(--accent-primary);
border-color: var(--accent-primary);
box-shadow: var(--shadow-glow);
}
.session-list {
flex: 1;
overflow-y: auto;
padding: 8px;
}
.session-item {
padding: 10px 14px;
border-radius: var(--radius-sm);
cursor: pointer;
transition: all var(--transition-fast);
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 2px;
font-size: 13px;
color: var(--text-secondary);
}
.session-item:hover {
background: var(--bg-glass-hover);
color: var(--text-primary);
}
.session-item.active {
background: var(--accent-glow);
color: var(--text-primary);
border: 1px solid var(--border-accent);
}
.session-item-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
}
.session-item-delete {
opacity: 0;
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 2px 4px;
font-size: 16px;
line-height: 1;
transition: all var(--transition-fast);
}
.session-item:hover .session-item-delete {
opacity: 1;
}
.session-item-delete:hover {
color: #ef4444;
}
.sidebar-footer {
padding: 12px 20px;
border-top: 1px solid var(--border-color);
}
.sidebar-footer-text {
font-size: 11px;
color: var(--text-muted);
text-align: center;
}
/* ═══════════════════════════════════════════════════
MAIN AREA
═══════════════════════════════════════════════════ */
.main-area {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
position: relative;
}
/* --- Top Bar --- */
.topbar {
height: var(--topbar-height);
padding: 0 20px;
display: flex;
align-items: center;
gap: 16px;
border-bottom: 1px solid var(--border-color);
background: rgba(10, 14, 26, 0.8);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
z-index: 10;
}
.btn-toggle-sidebar {
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 6px;
border-radius: var(--radius-sm);
display: flex;
transition: all var(--transition-fast);
}
.btn-toggle-sidebar:hover {
background: var(--bg-glass);
color: var(--text-primary);
}
.topbar-title {
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
letter-spacing: -0.01em;
}
/* ═══════════════════════════════════════════════════
MESSAGES
═══════════════════════════════════════════════════ */
.messages-container {
flex: 1;
overflow-y: auto;
scroll-behavior: smooth;
}
.messages {
max-width: 820px;
margin: 0 auto;
padding: 24px 20px 100px;
}
/* --- Welcome Screen --- */
.welcome-screen {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 80px 20px 40px;
animation: fadeInUp 0.6s ease-out;
}
.welcome-icon {
font-size: 48px;
background: var(--accent-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 16px;
}
.welcome-screen h1 {
font-size: 28px;
font-weight: 700;
margin-bottom: 12px;
letter-spacing: -0.02em;
}
.welcome-screen p {
color: var(--text-secondary);
font-size: 15px;
max-width: 500px;
line-height: 1.6;
margin-bottom: 32px;
}
.welcome-suggestions {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.suggestion-chip {
background: var(--bg-glass);
border: 1px solid var(--border-color);
color: var(--text-secondary);
padding: 10px 18px;
border-radius: 100px;
font-size: 13px;
cursor: pointer;
transition: all var(--transition-fast);
font-family: var(--font-family);
}
.suggestion-chip:hover {
background: var(--bg-glass-hover);
color: var(--text-primary);
border-color: var(--border-accent);
box-shadow: var(--shadow-glow);
}
/* --- Message Bubbles --- */
.message {
display: flex;
gap: 12px;
margin-bottom: 20px;
animation: fadeInUp 0.35s ease-out;
}
.message.user-message {
justify-content: flex-end;
}
.message.assistant-message {
justify-content: flex-start;
}
.message-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 700;
flex-shrink: 0;
margin-top: 2px;
}
.assistant-message .message-avatar {
background: var(--accent-gradient);
color: white;
box-shadow: var(--shadow-glow);
}
.user-message .message-avatar {
background: var(--bg-glass);
border: 1px solid var(--border-color);
color: var(--text-secondary);
order: 2;
}
.message-bubble {
max-width: 75%;
padding: 14px 18px;
border-radius: var(--radius-lg);
line-height: 1.65;
font-size: 14px;
}
.user-message .message-bubble {
background: var(--accent-primary);
color: white;
border-bottom-right-radius: 4px;
}
.assistant-message .message-bubble {
background: var(--bg-glass);
border: 1px solid var(--border-color);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border-bottom-left-radius: 4px;
}
/* Markdown inside assistant bubbles */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
font-size: 15px;
font-weight: 600;
margin: 12px 0 6px;
color: var(--text-primary);
}
.message-bubble h1:first-child,
.message-bubble h2:first-child,
.message-bubble h3:first-child {
margin-top: 0;
}
.message-bubble p {
margin: 10px 0;
}
.message-bubble ul,
.message-bubble ol {
margin: 6px 0;
padding-left: 20px;
}
.message-bubble li {
margin: 3px 0;
}
/* Question highlighting */
.message-bubble .question-highlight {
background: rgba(99, 102, 241, 0.08);
border: 1px solid rgba(99, 102, 241, 0.25);
border-left: 3px solid var(--accent-primary);
border-radius: var(--radius-sm);
padding: 10px 14px;
margin: 10px 0;
display: flex;
align-items: flex-start;
gap: 10px;
}
.message-bubble .question-highlight p {
margin: 0;
color: var(--text-primary);
font-weight: 500;
}
.message-bubble .question-icon {
font-size: 16px;
flex-shrink: 0;
margin-top: 1px;
}
.message-bubble li.question-item {
background: rgba(99, 102, 241, 0.06);
border-left: 2px solid var(--accent-primary);
padding: 6px 10px;
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
margin: 6px 0;
list-style: none;
font-weight: 500;
}
.message-bubble strong {
color: var(--accent-secondary);
font-weight: 600;
}
.message-bubble code {
background: rgba(0, 0, 0, 0.3);
padding: 2px 6px;
border-radius: 4px;
font-size: 13px;
font-family: 'Fira Code', monospace;
}
.message-bubble pre {
background: rgba(0, 0, 0, 0.3);
padding: 12px;
border-radius: var(--radius-sm);
overflow-x: auto;
margin: 8px 0;
}
.message-bubble pre code {
background: none;
padding: 0;
}
.message-bubble blockquote {
border-left: 3px solid var(--accent-primary);
padding-left: 12px;
color: var(--text-secondary);
margin: 8px 0;
}
/* --- Typing Indicator --- */
.typing-indicator {
display: flex;
gap: 12px;
margin-bottom: 20px;
animation: fadeInUp 0.3s ease-out;
}
.typing-dots {
display: flex;
gap: 5px;
align-items: center;
padding: 14px 18px;
background: var(--bg-glass);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
border-bottom-left-radius: 4px;
backdrop-filter: blur(8px);
}
.typing-dots span {
width: 8px;
height: 8px;
background: var(--text-muted);
border-radius: 50%;
animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) {
animation-delay: 0.15s;
}
.typing-dots span:nth-child(3) {
animation-delay: 0.3s;
}
/* ═══════════════════════════════════════════════════
INPUT AREA
═══════════════════════════════════════════════════ */
.input-area {
padding: 12px 20px 16px;
background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 20%);
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.input-wrapper {
max-width: 820px;
margin: 0 auto;
display: flex;
align-items: flex-end;
gap: 10px;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 8px 8px 8px 18px;
transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input-wrapper:focus-within {
border-color: var(--accent-primary);
box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-wrapper textarea {
flex: 1;
background: none;
border: none;
color: var(--text-primary);
font-family: var(--font-family);
font-size: 14px;
line-height: 1.5;
resize: none;
outline: none;
max-height: 150px;
padding: 6px 0;
}
.input-wrapper textarea::placeholder {
color: var(--text-muted);
}
.btn-send {
background: var(--accent-primary);
border: none;
color: white;
border-radius: var(--radius-sm);
padding: 10px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all var(--transition-fast);
flex-shrink: 0;
}
.btn-send:hover:not(:disabled) {
background: var(--accent-secondary);
box-shadow: var(--shadow-glow);
}
.btn-send:disabled {
opacity: 0.3;
cursor: default;
}
.input-hint {
text-align: center;
font-size: 11px;
color: var(--text-muted);
margin-top: 6px;
}
/* ═══════════════════════════════════════════════════
ANIMATIONS
═══════════════════════════════════════════════════ */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes typingBounce {
0%,
60%,
100% {
transform: translateY(0);
opacity: 0.4;
}
30% {
transform: translateY(-6px);
opacity: 1;
}
}
/* ═══════════════════════════════════════════════════
RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
.sidebar {
position: absolute;
height: 100%;
z-index: 200;
box-shadow: var(--shadow-lg);
}
.sidebar.hidden {
transform: translateX(-100%);
}
.confidence-bar-container {
display: none;
}
.message-bubble {
max-width: 88%;
}
.welcome-screen {
padding: 40px 16px 20px;
}
.welcome-screen h1 {
font-size: 22px;
}
}