Rag-Assistant / frontend /src /index.css
AsrorAsr's picture
Upload folder using huggingface_hub
32c4f08 verified
Raw
History Blame Contribute Delete
14.6 kB
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
/* ===== CSS Custom Properties ===== */
:root {
--bg-primary: #0a0a0f;
--bg-secondary: #12121a;
--bg-tertiary: #1a1a2e;
--bg-glass: rgba(26, 26, 46, 0.7);
--bg-glass-hover: rgba(26, 26, 46, 0.9);
--text-primary: #e8e8f0;
--text-secondary: #9494b8;
--text-muted: #5a5a7a;
--accent-primary: #6c5ce7;
--accent-secondary: #a855f7;
--accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a855f7 50%, #ec4899 100%);
--accent-glow: rgba(108, 92, 231, 0.3);
--border-color: rgba(148, 148, 184, 0.12);
--border-hover: rgba(148, 148, 184, 0.25);
--success: #10b981;
--error: #ef4444;
--warning: #f59e0b;
--sidebar-width: 320px;
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-xl: 20px;
--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
--shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
--shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
--shadow-glow: 0 0 30px var(--accent-glow);
--transition-fast: 0.15s ease;
--transition-normal: 0.25s ease;
--transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
/* ===== Reset & Base ===== */
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body, #root {
height: 100%;
width: 100%;
overflow: hidden;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* ===== App Layout ===== */
.app {
display: flex;
height: 100vh;
width: 100vw;
overflow: hidden;
background: var(--bg-primary);
}
/* ===== Sidebar ===== */
.sidebar {
width: var(--sidebar-width);
min-width: var(--sidebar-width);
height: 100vh;
background: var(--bg-secondary);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
transition: all var(--transition-slow);
position: relative;
z-index: 10;
}
.sidebar.closed {
width: 0;
min-width: 0;
overflow: hidden;
border-right: none;
}
.sidebar-header {
padding: 20px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--border-color);
flex-shrink: 0;
}
.logo {
display: flex;
align-items: center;
gap: 10px;
font-size: 1.1rem;
font-weight: 600;
background: var(--accent-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.logo svg {
stroke: var(--accent-primary);
flex-shrink: 0;
}
.sidebar-toggle {
background: none;
border: 1px solid var(--border-color);
color: var(--text-secondary);
cursor: pointer;
padding: 6px;
border-radius: var(--radius-sm);
transition: all var(--transition-fast);
display: flex;
align-items: center;
justify-content: center;
}
.sidebar-toggle:hover {
background: var(--bg-tertiary);
color: var(--text-primary);
border-color: var(--border-hover);
}
.sidebar-content {
flex: 1;
overflow-y: auto;
padding: 16px;
display: flex;
flex-direction: column;
gap: 20px;
}
.sidebar-content::-webkit-scrollbar {
width: 4px;
}
.sidebar-content::-webkit-scrollbar-track {
background: transparent;
}
.sidebar-content::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 2px;
}
.sidebar-footer {
padding: 16px 20px;
border-top: 1px solid var(--border-color);
text-align: center;
flex-shrink: 0;
}
.sidebar-footer p {
font-size: 0.75rem;
color: var(--text-muted);
letter-spacing: 0.5px;
}
/* ===== Mobile Sidebar Toggle ===== */
.mobile-sidebar-toggle {
position: fixed;
top: 16px;
left: 16px;
z-index: 20;
background: var(--bg-glass);
backdrop-filter: blur(12px);
border: 1px solid var(--border-color);
color: var(--text-primary);
cursor: pointer;
padding: 10px;
border-radius: var(--radius-md);
transition: all var(--transition-fast);
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-md);
}
.mobile-sidebar-toggle:hover {
background: var(--bg-glass-hover);
border-color: var(--accent-primary);
box-shadow: var(--shadow-glow);
}
/* ===== File Upload ===== */
.file-upload-container {
display: flex;
flex-direction: column;
gap: 8px;
}
.drop-zone {
border: 2px dashed var(--border-color);
border-radius: var(--radius-lg);
padding: 24px 16px;
text-align: center;
cursor: pointer;
transition: all var(--transition-normal);
background: var(--bg-primary);
position: relative;
overflow: hidden;
}
.drop-zone::before {
content: '';
position: absolute;
inset: 0;
background: var(--accent-gradient);
opacity: 0;
transition: opacity var(--transition-normal);
border-radius: var(--radius-lg);
}
.drop-zone:hover,
.drop-zone.dragging {
border-color: var(--accent-primary);
box-shadow: var(--shadow-glow);
}
.drop-zone:hover::before,
.drop-zone.dragging::before {
opacity: 0.05;
}
.drop-zone.uploading {
border-color: var(--accent-secondary);
cursor: wait;
}
.drop-zone-content {
position: relative;
z-index: 1;
}
.upload-icon {
color: var(--text-muted);
margin-bottom: 8px;
transition: color var(--transition-normal);
}
.drop-zone:hover .upload-icon {
color: var(--accent-primary);
}
.drop-zone-text {
font-size: 0.9rem;
color: var(--text-secondary);
margin-bottom: 4px;
}
.browse-link {
color: var(--accent-primary);
font-weight: 500;
text-decoration: underline;
text-underline-offset: 2px;
}
.drop-zone-hint {
font-size: 0.75rem;
color: var(--text-muted);
}
/* Upload Spinner */
.upload-spinner {
width: 32px;
height: 32px;
border: 3px solid var(--border-color);
border-top-color: var(--accent-primary);
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin: 0 auto 12px;
}
.upload-status {
font-size: 0.85rem;
color: var(--accent-secondary);
font-weight: 500;
}
.upload-error {
background: rgba(239, 68, 68, 0.1);
border: 1px solid rgba(239, 68, 68, 0.3);
color: var(--error);
padding: 8px 12px;
border-radius: var(--radius-sm);
font-size: 0.8rem;
}
.upload-success {
background: rgba(16, 185, 129, 0.1);
border: 1px solid rgba(16, 185, 129, 0.3);
color: var(--success);
padding: 8px 12px;
border-radius: var(--radius-sm);
font-size: 0.8rem;
}
/* ===== Document List ===== */
.document-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.section-title {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.85rem;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.8px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border-color);
}
.section-title svg {
opacity: 0.6;
}
.doc-count {
background: var(--accent-primary);
color: white;
font-size: 0.65rem;
padding: 2px 7px;
border-radius: 10px;
font-weight: 700;
margin-left: auto;
}
.doc-items {
list-style: none;
display: flex;
flex-direction: column;
gap: 4px;
}
.doc-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
border-radius: var(--radius-sm);
background: var(--bg-primary);
border: 1px solid transparent;
transition: all var(--transition-fast);
}
.doc-item:hover {
border-color: var(--border-hover);
background: var(--bg-tertiary);
}
.doc-info {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
flex: 1;
}
.doc-info svg {
color: var(--accent-secondary);
flex-shrink: 0;
opacity: 0.7;
}
.doc-name {
font-size: 0.82rem;
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.delete-btn {
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 4px;
border-radius: 4px;
transition: all var(--transition-fast);
display: flex;
align-items: center;
opacity: 0;
flex-shrink: 0;
}
.doc-item:hover .delete-btn {
opacity: 1;
}
.delete-btn:hover {
color: var(--error);
background: rgba(239, 68, 68, 0.1);
}
.no-documents {
text-align: center;
padding: 20px 8px;
}
.no-documents p {
font-size: 0.85rem;
color: var(--text-muted);
}
.no-documents .hint {
font-size: 0.75rem;
margin-top: 4px;
}
/* Loading Shimmer */
.loading-shimmer {
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px 0;
}
.shimmer-line {
height: 40px;
border-radius: var(--radius-sm);
background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-glass) 50%, var(--bg-tertiary) 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
.shimmer-line.short {
width: 70%;
}
/* ===== Main Content ===== */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
position: relative;
background: var(--bg-primary);
}
/* ===== Chat Window ===== */
.chat-window {
display: flex;
flex-direction: column;
height: 100%;
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 24px;
display: flex;
flex-direction: column;
gap: 4px;
}
.chat-messages::-webkit-scrollbar {
width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 3px;
}
/* Chat Empty State */
.chat-empty {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 40px;
gap: 12px;
}
.chat-empty-icon {
color: var(--text-muted);
opacity: 0.4;
margin-bottom: 8px;
}
.chat-empty h2 {
font-size: 1.8rem;
font-weight: 700;
background: var(--accent-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.chat-empty p {
font-size: 1rem;
color: var(--text-secondary);
max-width: 400px;
}
.chat-empty .hint {
font-size: 0.85rem;
color: var(--text-muted);
}
/* Messages */
.message {
display: flex;
gap: 12px;
padding: 16px 20px;
border-radius: var(--radius-md);
transition: background var(--transition-fast);
max-width: 85%;
animation: messageIn 0.3s ease;
}
.message.user {
align-self: flex-end;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
}
.message.assistant {
align-self: flex-start;
background: var(--bg-secondary);
border: 1px solid var(--border-color);
}
.message.error .message-text {
color: var(--error);
}
.message-avatar {
width: 36px;
height: 36px;
border-radius: var(--radius-sm);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.message.user .message-avatar {
background: var(--accent-gradient);
color: white;
}
.message.assistant .message-avatar {
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
color: white;
}
.message-content {
flex: 1;
min-width: 0;
}
.message-role {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 4px;
}
.message-text {
font-size: 0.92rem;
line-height: 1.65;
color: var(--text-primary);
white-space: pre-wrap;
word-break: break-word;
}
/* Cursor Blink */
.cursor-blink {
animation: blink 0.7s infinite;
color: var(--accent-primary);
font-weight: 300;
}
/* Sources */
.message-sources {
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid var(--border-color);
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
}
.sources-label {
font-size: 0.72rem;
color: var(--text-muted);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.source-tag {
font-size: 0.75rem;
background: var(--bg-primary);
border: 1px solid var(--border-color);
padding: 3px 8px;
border-radius: 12px;
color: var(--text-secondary);
display: inline-flex;
align-items: center;
gap: 4px;
}
.relevance {
font-size: 0.65rem;
color: var(--accent-secondary);
font-weight: 600;
}
/* ===== Chat Input ===== */
.chat-input-area {
padding: 16px 24px 24px;
border-top: 1px solid var(--border-color);
background: var(--bg-secondary);
flex-shrink: 0;
}
.no-docs-warning {
background: rgba(245, 158, 11, 0.08);
border: 1px solid rgba(245, 158, 11, 0.2);
color: var(--warning);
padding: 8px 14px;
border-radius: var(--radius-sm);
font-size: 0.8rem;
margin-bottom: 12px;
text-align: center;
}
.chat-input-wrapper {
display: flex;
align-items: flex-end;
gap: 10px;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 8px 8px 8px 16px;
transition: all var(--transition-fast);
}
.chat-input-wrapper:focus-within {
border-color: var(--accent-primary);
box-shadow: var(--shadow-glow);
}
.chat-input {
flex: 1;
background: none;
border: none;
color: var(--text-primary);
font-family: inherit;
font-size: 0.92rem;
line-height: 1.5;
resize: none;
outline: none;
padding: 6px 0;
min-height: 20px;
max-height: 120px;
}
.chat-input::placeholder {
color: var(--text-muted);
}
.send-btn {
width: 40px;
height: 40px;
border: none;
border-radius: var(--radius-md);
background: var(--accent-gradient);
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all var(--transition-fast);
flex-shrink: 0;
}
.send-btn:hover:not(:disabled) {
transform: scale(1.05);
box-shadow: var(--shadow-glow);
}
.send-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.send-spinner {
width: 18px;
height: 18px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
/* ===== Animations ===== */
@keyframes spin {
to { transform: rotate(360deg); }
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
@keyframes messageIn {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
.sidebar {
position: fixed;
top: 0;
left: 0;
height: 100vh;
z-index: 100;
box-shadow: var(--shadow-lg);
}
.sidebar.closed {
transform: translateX(-100%);
}
.message {
max-width: 95%;
}
.chat-messages {
padding: 16px;
}
.chat-input-area {
padding: 12px 16px 16px;
}
}