prolog_llm / src /App.css
fraudTech's picture
refactor: Simplify frontend to login + streaming chat only
e5f49d0
Raw History Blame Contribute Delete
11.5 kB
/* Reset */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body, html, #root {
height: 100%;
background: #0a0f1f;
font-family: system-ui, sans-serif;
color: #f0f0f0;
}
/* App container */
.app-root {
display: flex;
flex-direction: column;
height: 100%;
}
/* Header */
.header {
padding: 1rem 2rem;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.8));
border-bottom: 2px solid rgba(99, 102, 241, 0.3);
backdrop-filter: blur(10px);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}
.header-title {
margin: 0;
font-size: 1.75rem;
font-weight: 700;
background: linear-gradient(135deg, #818cf8, #c084fc);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: 0.5px;
}
.header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.strict-toggle-btn {
padding: 0.2rem;
min-width: 28px;
height: 28px;
background: rgba(255,255,255,0.08);
color: white;
border: 1px solid rgba(255,255,255,0.2);
border-radius: 6px;
cursor: pointer;
font-size: 0.9rem;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.strict-toggle-btn:hover {
background: rgba(255,255,255,0.15);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-secondary {
padding: 0.2rem;
min-width: 28px;
height: 28px;
background: rgba(255,255,255,0.08);
color: white;
border: 1px solid rgba(255,255,255,0.2);
border-radius: 6px;
cursor: pointer;
font-size: 0.9rem;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.btn-secondary:hover {
background: rgba(255,255,255,0.15);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.logout-btn {
padding: 0.2rem;
min-width: 28px;
height: 28px;
background: linear-gradient(135deg, rgba(220,38,38,0.7), rgba(185,28,28,0.8));
color: white;
border: 1px solid rgba(220,38,38,0.5);
border-radius: 8px;
cursor: pointer;
font-size: 1rem;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.logout-btn:hover {
background: linear-gradient(135deg, rgba(220,38,38,0.9), rgba(185,28,28,1));
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}
.logout-btn:hover {
background: rgba(220,38,38,1);
}
/* App container with sidebars */
.app-container {
display: flex;
flex: 1;
overflow: hidden;
}
/* Sidebars */
.sidebar {
width: 320px;
padding: 1.5rem;
overflow-y: auto;
border-right: 1px solid rgba(255,255,255,0.1);
background: rgba(255,255,255,0.03);
}
.sidebar h3 {
margin-top: 0;
margin-bottom: 1rem;
font-size: 1.2rem;
}
.sidebar h4 {
margin-top: 1rem;
margin-bottom: 0.5rem;
font-size: 1rem;
}
.right-sidebar {
border-right: none;
border-left: 1px solid rgba(255,255,255,0.1);
}
.status-message {
padding: 0.75rem;
background: rgba(34,197,94,0.2);
border: 1px solid rgba(34,197,94,0.4);
border-radius: 6px;
margin-top: 10px;
font-size: 0.9rem;
}
.metadata-panel pre,
.query-results pre {
background: rgba(0,0,0,0.3);
padding: 10px;
border-radius: 6px;
font-size: 0.85em;
overflow-x: auto;
white-space: pre-wrap;
word-wrap: break-word;
}
/* ---- MAIN CHAT AREA ---- */
.main {
flex: 1;
display: flex;
flex-direction: column;
justify-content: flex-start; /* messages at top */
align-items: center; /* horizontally centered */
padding: 2rem 1rem;
overflow: hidden;
}
/* Messages window */
.messages {
width: 100%;
max-width: 1000px;
height: 50vh;
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
padding: 1rem;
overflow-y: auto;
border-radius: 10px;
margin-bottom: 1.5rem;
}
/* Each message */
.message {
margin-bottom: 1rem;
display: flex;
}
.message.user {
justify-content: flex-end;
}
/* Chat bubbles */
.bubble {
padding: 0.75rem 1rem;
border-radius: 12px; /* nicer, smoother */
max-width: 90%;
line-height: 1.6; /* improved readability */
word-wrap: break-word; /* prevent overflow */
overflow-wrap: break-word;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
width: fit-content;
}
.message.user .bubble {
background: #2563eb;
color: white;
}
.message.assistant .bubble {
background: rgba(255,255,255,0.15);
color: #f0f0f0;
}
/* Ensure all content inside bubbles wraps properly */
.bubble * {
max-width: 100%;
overflow-wrap: break-word;
word-wrap: break-word;
}
.bubble p {
margin: 0.5rem 0;
width: 100%;
}
.bubble ul, .bubble ol {
margin: 0.5rem 0;
padding-left: 1.5rem;
width: 100%;
}
.bubble li {
margin: 0.25rem 0;
}
.bubble blockquote {
margin: 0.5rem 0;
padding-left: 1rem;
border-left: 3px solid rgba(255,255,255,0.3);
font-style: italic;
}
.bubble table {
width: 100%;
max-width: 100%;
overflow-x: auto;
display: block;
}
/* Debug panel styles */
.debug {
margin-top: 0.25rem;
font-size: 0.8rem;
opacity: 0.9;
}
.debug summary {
cursor: pointer;
color: #9ca3af;
}
/* ---- INPUT AREA ---- */
.input-row {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
max-width: 1000px;
gap: 0.75rem;
}
.input-row textarea {
width: 70%;
border-radius: 10px;
border: 1px solid rgba(255,255,255,0.3);
background: rgba(255,255,255,0.1);
color: white;
padding: 0.75rem;
font-size: 1rem;
resize: vertical;
min-height: 60px;
}
.input-row textarea:focus {
outline: 2px solid #2563eb;
}
.input-row button {
padding: 0.75rem 1.25rem;
background: #22c55e;
color: black;
font-weight: 600;
border-radius: 8px;
border: none;
cursor: pointer;
font-size: 1rem;
}
.input-row button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Error box */
.error {
margin-top: 1rem;
padding: 0.75rem;
background: rgba(255,0,0,0.2);
border: 1px solid rgba(255,0,0,0.4);
border-radius: 8px;
text-align: center;
width: 100%;
max-width: 700px;
}
/* ---------------------------------------------------------- */
/* Markdown formatting inside bubbles */
/* ---------------------------------------------------------- */
.message .bubble p {
margin: 0.35rem 0;
line-height: 1.6;
}
.message .bubble h1,
.message .bubble h2,
.message .bubble h3,
.message .bubble h4 {
margin: 0.6rem 0 0.35rem;
font-weight: 600;
}
.message .bubble ul,
.message .bubble ol {
margin: 0.35rem 0 0.35rem 1.25rem;
padding-left: 0.75rem;
}
.message .bubble li {
margin: 0.15rem 0;
}
/* Inline code */
.message .bubble code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", "Courier New", monospace;
font-size: 0.95em;
padding: 0.1rem 0.25rem;
background: rgba(0, 0, 0, 0.35);
border-radius: 4px;
}
/* Code blocks */
.message .bubble pre {
margin: 0.6rem 0;
padding: 0.75rem;
background: rgba(0, 0, 0, 0.55);
border-radius: 6px;
overflow-x: auto;
max-width: 100%;
white-space: pre-wrap;
word-wrap: break-word;
}
.message .bubble pre code {
padding: 0;
background: transparent;
}
.markdown-body .katex {
font-size: 1.05rem;
-webkit-font-smoothing: antialiased;
}
.markdown-body .katex-display {
margin: 0.75rem 0;
padding: 0.75rem 1rem;
background: rgba(0, 0, 0, 0.45);
border-radius: 8px;
overflow-x: auto;
}
.markdown-body .katex-display > .katex {
display: inline-block;
width: 100%;
text-align: center;
}
.markdown-body .katex-inline {
padding: 0 0.15rem;
}
.markdown-body .katex-html {
color: inherit;
}
/* Override KaTeX red error color for dark theme */
.markdown-body .katex-error {
color: #e2e8f0 !important;
}
.markdown-body .katex .mord.text {
color: inherit;
}
/* Blockquotes */
.message .bubble blockquote {
margin: 0.6rem 0;
padding-left: 1rem;
border-left: 3px solid rgba(255,255,255,0.3);
color: #d1d5db;
}
/* Tables */
.message .bubble table {
border-collapse: collapse;
margin: 0.6rem 0;
width: 100%;
}
.message .bubble th,
.message .bubble td {
border: 1px solid rgba(255,255,255,0.2);
padding: 0.4rem;
}
.message .bubble th {
background: rgba(255,255,255,0.15);
font-weight: 600;
}
/* ---------------------------------------------------------- */
/* Login screen */
/* ---------------------------------------------------------- */
.main.login {
justify-content: center;
align-items: center;
}
.login-form {
background: rgba(255,255,255,0.08);
padding: 1.2rem;
border-radius: 8px;
border: 1px solid rgba(255,255,255,0.15);
width: 100%;
max-width: 280px;
}
.login-form h2 {
margin-bottom: 0.8rem;
text-align: center;
color: #f0f0f0;
font-size: 1.3rem;
}
.login-form input {
width: 100%;
padding: 0.5rem;
margin-bottom: 0.6rem;
border-radius: 5px;
border: 1px solid rgba(255,255,255,0.3);
background: rgba(255,255,255,0.1);
color: white;
font-size: 0.85rem;
}
.login-form input:focus {
outline: 2px solid #2563eb;
}
.login-form button {
width: 100%;
padding: 0.5rem;
background: #22c55e;
color: black;
font-weight: 600;
border-radius: 5px;
border: none;
cursor: pointer;
font-size: 0.85rem;
transition: background 0.2s;
}
.login-form button:hover {
background: #16a34a;
}
.login-form .error {
margin-top: 1rem;
padding: 0.75rem;
background: rgba(255,0,0,0.2);
border: 1px solid rgba(255,0,0,0.4);
border-radius: 8px;
text-align: center;
}
/* Thinking spinner */
.thinking-spinner {
display: inline-block;
width: 14px;
height: 14px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
flex-shrink: 0;
align-self: center;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Thinking container */
.thinking-container {
display: flex;
flex-direction: column;
gap: 8px;
}
.thinking-dots {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 6px;
padding: 12px 0;
}
.thinking-dots span {
display: inline-block;
width: 8px;
height: 8px;
background-color: #818cf8;
border-radius: 50%;
animation: thinking-pulse 1.4s ease-in-out infinite;
}
.thinking-dots span:nth-child(1) {
animation-delay: 0s;
}
.thinking-dots span:nth-child(2) {
animation-delay: 0.2s;
}
.thinking-dots span:nth-child(3) {
animation-delay: 0.4s;
}
@keyframes thinking-pulse {
0%, 80%, 100% {
opacity: 0.3;
transform: scale(0.8);
}
40% {
opacity: 1;
transform: scale(1.2);
}
}
/* Thinking status message */
.thinking-status {
font-size: 0.85rem;
color: #a5b4fc;
font-style: italic;
padding: 0 12px;
animation: status-fade 1.5s ease-in-out infinite;
}
@keyframes status-fade {
0%, 100% {
opacity: 0.6;
}
50% {
opacity: 1;
}
}
/* Streaming Preview Sidebar */
.streaming-preview-sidebar {
width: 380px;
background: rgba(99, 102, 241, 0.05);
border-right: 2px solid rgba(99, 102, 241, 0.3);
}
.streaming-preview-sidebar h3 {
color: #818cf8;
font-size: 1.1rem;
margin-bottom: 0.5rem;
}
.preview-content {
background: rgba(0, 0, 0, 0.2);
padding: 1rem;
border-radius: 8px;
max-height: calc(100vh - 250px);
overflow-y: auto;
border: 1px solid rgba(99, 102, 241, 0.2);
}
.preview-content .markdown-body {
font-size: 0.9rem;
line-height: 1.5;
}