Jatin Mehra
Implement PDF removal functionality and update UI with remove button
6c81e4d
/* Base styles */
:root {
--primary-color: #2563eb;
--primary-light: #3b82f6;
--primary-dark: #1d4ed8;
--secondary-color: #10b981;
--background-color: #f3f4f6;
--sidebar-color: #ffffff;
--text-color: #1f2937;
--text-light: #6b7280;
--border-color: #e5e7eb;
--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--border-radius: 8px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
color: var(--text-color);
background-color: var(--background-color);
line-height: 1.5;
}
.hidden {
display: none !important;
}
/* App container layout */
.app-container {
display: grid;
grid-template-columns: 260px 1fr;
height: 100vh;
overflow: hidden;
}
/* Sidebar styles */
.sidebar {
background-color: var(--sidebar-color);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
overflow-y: auto;
}
.logo-container {
padding: 1.5rem;
border-bottom: 1px solid var(--border-color);
}
.logo-container h1 {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary-color);
}
.beta {
background-color: rgba(37, 99, 235, 0.1);
color: var(--primary-color);
font-size: 0.7rem;
padding: 0.1rem 0.4rem;
border-radius: 4px;
vertical-align: super;
font-weight: 600;
}
.upload-container {
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.upload-box {
border: 2px dashed var(--border-color);
border-radius: var(--border-radius);
padding: 2rem 1rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.upload-box:hover {
border-color: var(--primary-light);
background-color: rgba(59, 130, 246, 0.05);
}
.upload-box .upload-icon {
font-size: 2rem;
color: var(--primary-color);
margin-bottom: 1rem;
}
.upload-box p {
color: var(--text-light);
font-weight: 500;
}
.model-selection {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.model-selection label {
font-weight: 500;
color: var(--text-light);
}
.model-selection select {
padding: 0.75rem;
border-radius: var(--border-radius);
border: 1px solid var(--border-color);
background-color: white;
width: 100%;
font-size: 0.9rem;
outline: none;
}
.session-info {
display: flex;
flex-direction: column;
gap: 1rem;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--border-color);
}
.file-info {
display: flex;
align-items: center;
gap: 0.5rem;
overflow: hidden;
}
.file-info i {
color: var(--primary-color);
}
.file-info span {
font-size: 0.9rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.btn-clear, .btn-new, .btn-remove {
padding: 0.75rem;
border-radius: var(--border-radius);
border: none;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
width: 100%;
}
.btn-clear {
background-color: rgba(239, 68, 68, 0.1);
color: #ef4444;
}
.btn-clear:hover {
background-color: rgba(239, 68, 68, 0.2);
}
.btn-remove {
background-color: rgba(255, 152, 0, 0.1);
color: #ff9800;
}
.btn-remove:hover {
background-color: rgba(255, 152, 0, 0.2);
}
.btn-new {
background-color: rgba(37, 99, 235, 0.1);
color: var(--primary-color);
}
.btn-new:hover {
background-color: rgba(37, 99, 235, 0.2);
}
/* Main content area */
.main-content {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.welcome-screen {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 2rem;
text-align: center;
}
.welcome-header {
margin-bottom: 3rem;
}
.welcome-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
.welcome-header p {
color: var(--text-light);
font-size: 1.2rem;
}
.features {
display: flex;
gap: 2rem;
margin-bottom: 3rem;
}
.feature {
background: white;
border-radius: var(--border-radius);
padding: 2rem;
box-shadow: var(--shadow);
width: 250px;
transition: transform 0.3s ease;
}
.feature:hover {
transform: translateY(-5px);
}
.feature i {
font-size: 2rem;
color: var(--primary-color);
margin-bottom: 1rem;
}
.feature h3 {
margin-bottom: 0.5rem;
}
.feature p {
color: var(--text-light);
font-size: 0.9rem;
}
.get-started {
margin-top: 2rem;
}
.btn-primary {
background-color: var(--primary-color);
color: white;
padding: 1rem 2rem;
border-radius: var(--border-radius);
border: none;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s;
font-size: 1rem;
}
.btn-primary:hover {
background-color: var(--primary-dark);
}
/* Chat container */
.chat-container {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.system-message {
background-color: rgba(37, 99, 235, 0.05);
padding: 1rem;
border-radius: var(--border-radius);
border-left: 4px solid var(--primary-color);
}
.system-message p {
color: var(--text-color);
font-size: 0.9rem;
}
.message {
display: flex;
flex-direction: column;
max-width: 85%;
}
.user-message {
align-self: flex-end;
background-color: var(--primary-color);
color: white;
padding: 1rem;
border-radius: var(--border-radius);
border-bottom-right-radius: 0;
}
.assistant-message {
align-self: flex-start;
background-color: white;
padding: 1rem;
border-radius: var(--border-radius);
border-bottom-left-radius: 0;
box-shadow: var(--shadow);
}
.message-timestamp {
font-size: 0.75rem;
color: var(--text-light);
margin-top: 0.25rem;
}
.user-message .message-timestamp {
align-self: flex-end;
}
.assistant-message .message-timestamp {
align-self: flex-start;
}
.chat-input-container {
padding: 1rem;
border-top: 1px solid var(--border-color);
background-color: white;
}
.search-toggle {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
padding-left: 0.5rem;
}
.search-toggle label {
font-size: 0.9rem;
color: var(--text-light);
cursor: pointer;
}
.chat-input-box {
display: flex;
gap: 0.75rem;
align-items: flex-end;
}
#chat-input {
flex: 1;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
padding: 0.75rem;
resize: none;
min-height: 60px;
max-height: 120px;
outline: none;
font-family: inherit;
font-size: 0.95rem;
line-height: 1.5;
}
#chat-input:focus {
border-color: var(--primary-light);
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}
#send-button {
padding: 0.75rem 1rem;
border-radius: var(--border-radius);
border: none;
background-color: var(--primary-color);
color: white;
cursor: pointer;
transition: background-color 0.2s;
}
#send-button:disabled {
background-color: #d1d5db;
cursor: not-allowed;
}
#send-button:not(:disabled):hover {
background-color: var(--primary-dark);
}
/* Context sidebar */
.context-sidebar {
background-color: white;
border-left: 1px solid var(--border-color);
display: flex;
flex-direction: column;
overflow: hidden;
transition: transform 0.3s ease;
}
.context-sidebar.collapsed {
transform: translateX(290px);
}
.context-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 1px solid var(--border-color);
}
.context-header h3 {
font-size: 1rem;
font-weight: 600;
}
.btn-toggle {
background: none;
border: none;
cursor: pointer;
color: var(--text-light);
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: background-color 0.2s;
}
.btn-toggle:hover {
background-color: var(--border-color);
}
.context-content {
padding: 1rem;
overflow-y: auto;
flex: 1;
}
.context-item {
margin-bottom: 1.5rem;
background-color: #f9fafb;
border-radius: var(--border-radius);
padding: 1rem;
border-left: 3px solid var(--primary-light);
}
.context-item:last-child {
margin-bottom: 0;
}
.context-score {
display: block;
font-size: 0.8rem;
color: var(--text-light);
margin-bottom: 0.5rem;
}
.context-text {
font-size: 0.9rem;
line-height: 1.5;
max-height: 200px;
overflow-y: auto;
}
.no-context {
color: var(--text-light);
font-style: italic;
text-align: center;
padding: 2rem 0;
}
/* Loading overlay */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 1000;
}
.spinner {
width: 50px;
height: 50px;
border-radius: 50%;
border: 5px solid rgba(255, 255, 255, 0.3);
border-top-color: var(--primary-color);
animation: spin 1s linear infinite;
}
#loading-text {
margin-top: 1rem;
color: white;
font-weight: 500;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Message styling with Markdown support */
.message-content {
width: 100%;
word-break: break-word;
}
.message-content pre {
background: #f4f5f7;
border-radius: 5px;
padding: 0.75rem;
overflow-x: auto;
margin: 0.5rem 0;
}
.message-content code {
font-family: 'JetBrains Mono', monospace;
font-size: 0.9rem;
padding: 0.2rem 0.4rem;
background: #f1f1f1;
border-radius: 3px;
}
.message-content pre code {
background: transparent;
padding: 0;
white-space: pre;
color: #333;
line-height: 1.5;
}
.message-content p {
margin-bottom: 0.75rem;
}
.message-content p:last-child {
margin-bottom: 0;
}
.message-content ul, .message-content ol {
margin-left: 1.5rem;
margin-bottom: 0.75rem;
}
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
margin-top: 1rem;
margin-bottom: 0.5rem;
font-weight: 600;
}
.message-content blockquote {
border-left: 4px solid #ddd;
padding-left: 1rem;
margin-left: 0.5rem;
color: #555;
}
.message-content a {
color: var(--primary-color);
text-decoration: underline;
}
.message-content table {
border-collapse: collapse;
width: 100%;
margin: 0.5rem 0;
}
.message-content table th,
.message-content table td {
border: 1px solid #ddd;
padding: 0.5rem;
text-align: left;
}
.message-content table th {
background-color: #f7f7f7;
}
/* Improved Responsive design */
@media (max-width: 1024px) {
.app-container {
grid-template-columns: 260px 1fr 0;
}
.context-sidebar {
position: fixed;
top: 0;
right: 0;
width: 300px;
height: 100vh;
z-index: 100;
transform: translateX(100%);
}
.context-sidebar:not(.collapsed) {
transform: translateX(0);
}
.message {
max-width: 90%;
}
}
@media (max-width: 768px) {
.app-container {
grid-template-columns: 1fr;
}
.sidebar {
position: fixed;
left: 0;
top: 0;
height: 100vh;
width: 260px;
z-index: 100;
transform: translateX(-100%);
}
.sidebar.show {
transform: translateX(0);
}
.menu-toggle {
display: flex;
position: fixed;
top: 1rem;
left: 1rem;
z-index: 101;
}
.main-content {
padding-top: 60px; /* Add spacing for the menu button */
}
.features {
flex-direction: column;
gap: 1rem;
}
.feature {
width: 100%;
}
.message {
max-width: 95%;
}
.welcome-header h1 {
font-size: 2rem;
}
.welcome-header p {
font-size: 1rem;
}
.chat-messages {
padding: 1rem;
}
.chat-input-box {
flex-direction: column;
}
#send-button {
align-self: flex-end;
}
}
@media (max-width: 480px) {
.message {
max-width: 100%;
}
.user-message, .assistant-message {
padding: 0.75rem;
}
.welcome-header h1 {
font-size: 1.5rem;
}
.features {
padding: 0 0.5rem;
}
.feature {
padding: 1.5rem 1rem;
}
}