VinitT commited on
Commit
e8fa2bc
·
1 Parent(s): 8824a4a

Changed UI

Browse files
Files changed (8) hide show
  1. app.py +27 -8
  2. static/analysis.css +244 -83
  3. static/auth.css +71 -45
  4. static/script.js +55 -29
  5. static/search.js +620 -214
  6. static/styles.css +522 -1907
  7. templates/base.html +2 -0
  8. templates/index.html +4 -14
app.py CHANGED
@@ -275,19 +275,19 @@ def search():
275
  try:
276
  data = request.get_json()
277
  paper_name = data.get('paper_name')
278
- sort_by = data.get('sort_by', 'relevance')
279
- max_results = data.get('max_results', 10)
280
 
281
  if not paper_name:
282
  return jsonify({'error': 'No search query provided'}), 400
283
 
284
- # Map sort_by to arxiv.SortCriterion
285
- sort_mapping = {
286
  'relevance': arxiv.SortCriterion.Relevance,
287
- 'lastUpdated': arxiv.SortCriterion.LastUpdatedDate,
288
- 'submitted': arxiv.SortCriterion.SubmittedDate
289
  }
290
- sort_criterion = sort_mapping.get(sort_by, arxiv.SortCriterion.Relevance)
 
291
 
292
  # Perform the search
293
  search = arxiv.Search(
@@ -298,6 +298,21 @@ def search():
298
 
299
  results = []
300
  for paper in search.results():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  results.append({
302
  'title': paper.title,
303
  'authors': ', '.join(author.name for author in paper.authors),
@@ -307,8 +322,12 @@ def search():
307
  'published': paper.published.strftime('%Y-%m-%d'),
308
  'category': paper.primary_category,
309
  'comment': paper.comment if hasattr(paper, 'comment') else None,
310
- 'doi': paper.doi if hasattr(paper, 'doi') else None
 
311
  })
 
 
 
312
 
313
  return jsonify(results)
314
 
 
275
  try:
276
  data = request.get_json()
277
  paper_name = data.get('paper_name')
278
+ sort_by = data.get('sort_by', 'relevance') # Default to relevance
279
+ max_results = data.get('max_results', 20) # Increase to get more candidates for filtering
280
 
281
  if not paper_name:
282
  return jsonify({'error': 'No search query provided'}), 400
283
 
284
+ # Configure sorting based on user preference
285
+ sort_options = {
286
  'relevance': arxiv.SortCriterion.Relevance,
287
+ 'recent': arxiv.SortCriterion.SubmittedDate
 
288
  }
289
+
290
+ sort_criterion = sort_options.get(sort_by, arxiv.SortCriterion.Relevance)
291
 
292
  # Perform the search
293
  search = arxiv.Search(
 
298
 
299
  results = []
300
  for paper in search.results():
301
+ # Extract citation count if available (not directly provided by arXiv API)
302
+ citation_count = 0
303
+
304
+ # You could integrate with a citation API here (e.g., Semantic Scholar)
305
+ # For now, we'll use proxies for popularity like:
306
+ # - Papers with DOIs (published in journals) tend to be more established
307
+ # - Papers with more authors often have more visibility
308
+ # - More recent papers in the results might indicate ongoing relevance
309
+
310
+ has_doi = hasattr(paper, 'doi') and paper.doi is not None
311
+ author_count = len(paper.authors)
312
+
313
+ # Calculate a simple "popularity score" (this is a heuristic)
314
+ popularity_score = (10 if has_doi else 0) + min(author_count, 5)
315
+
316
  results.append({
317
  'title': paper.title,
318
  'authors': ', '.join(author.name for author in paper.authors),
 
322
  'published': paper.published.strftime('%Y-%m-%d'),
323
  'category': paper.primary_category,
324
  'comment': paper.comment if hasattr(paper, 'comment') else None,
325
+ 'doi': paper.doi if hasattr(paper, 'doi') else None,
326
+ 'popularity_score': popularity_score # Add popularity score
327
  })
328
+
329
+ # Sort results by our popularity score (higher is better)
330
+ results.sort(key=lambda x: x['popularity_score'], reverse=True)
331
 
332
  return jsonify(results)
333
 
static/analysis.css CHANGED
@@ -1,12 +1,20 @@
1
- /* Dark theme variables */
2
  :root {
3
- --bg-primary: #1a1a1a;
4
- --bg-secondary: #2a2a2a;
5
- --text-primary: #ffffff;
6
- --text-secondary: #cccccc;
7
- --accent-color: #6c63ff;
8
- --error-color: #f44336;
9
- --success-color: #4CAF50;
 
 
 
 
 
 
 
 
10
  }
11
 
12
  /* Loading Overlay */
@@ -16,26 +24,30 @@
16
  left: 0;
17
  width: 100%;
18
  height: 100%;
19
- background: rgba(0, 0, 0, 0.9);
20
  display: flex;
21
  justify-content: center;
22
  align-items: center;
23
  z-index: 1000;
 
24
  }
25
 
26
  .loading-content {
27
  text-align: center;
28
  color: var(--text-primary);
 
 
 
 
29
  }
30
 
31
  .loading-spinner {
32
- width: 50px;
33
- height: 50px;
34
- border: 3px solid var(--text-primary);
35
  border-radius: 50%;
36
- border-top-color: transparent;
37
  animation: spin 1s linear infinite;
38
- margin: 0 auto 20px;
39
  }
40
 
41
  /* Analysis Modal */
@@ -45,93 +57,111 @@
45
  left: 0;
46
  width: 100%;
47
  height: 100%;
48
- background: rgba(0, 0, 0, 0.8);
49
  display: flex;
50
  justify-content: center;
51
  align-items: center;
52
  z-index: 1000;
 
53
  }
54
 
55
  .modal-content {
56
- background: var(--bg-primary);
57
  width: 90%;
58
  max-width: 800px;
59
  max-height: 90vh;
60
- border-radius: 8px;
61
  overflow: hidden;
 
 
 
 
 
 
 
 
62
  }
63
 
64
  .modal-header {
65
- padding: 20px;
66
- background: var(--bg-secondary);
67
  display: flex;
68
  justify-content: space-between;
69
  align-items: center;
70
- border-bottom: 1px solid #333;
 
 
71
  }
72
 
73
- .modal-header h2 {
 
 
74
  color: var(--text-primary);
75
- margin: 0;
76
- }
77
-
78
- .modal-body {
79
- padding: 20px;
80
- overflow-y: auto;
81
- max-height: calc(90vh - 80px);
82
- }
83
-
84
- .analysis-section {
85
- background: var(--bg-secondary);
86
- border-radius: 6px;
87
- padding: 15px;
88
- margin-bottom: 15px;
89
- }
90
-
91
- .analysis-section h3 {
92
- color: var(--accent-color);
93
- margin-bottom: 10px;
94
- }
95
-
96
- .analysis-section p {
97
- color: var(--text-secondary);
98
- line-height: 1.6;
99
  }
100
 
101
- /* Buttons */
102
  .close-btn {
103
- background: none;
104
  border: none;
105
- color: var(--text-primary);
106
- font-size: 24px;
107
  cursor: pointer;
108
- padding: 0;
109
- width: 30px;
110
- height: 30px;
111
  display: flex;
112
  align-items: center;
113
  justify-content: center;
 
 
114
  border-radius: 50%;
115
- transition: background 0.3s;
116
  }
117
 
118
  .close-btn:hover {
 
119
  background: rgba(255, 255, 255, 0.1);
120
  }
121
 
122
- .cancel-btn {
123
- background: var(--bg-secondary);
124
- border: none;
125
- color: var(--text-primary);
126
- padding: 8px 16px;
127
- border-radius: 4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  cursor: pointer;
129
- margin-top: 15px;
130
- transition: background 0.3s;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
 
133
  .cancel-btn:hover {
134
- background: #333;
 
135
  }
136
 
137
  /* Error Message */
@@ -141,10 +171,11 @@
141
  right: 20px;
142
  background: var(--error-color);
143
  color: var(--text-primary);
144
- padding: 12px 24px;
145
- border-radius: 6px;
146
  z-index: 1001;
147
  animation: slideIn 0.3s ease-out;
 
148
  }
149
 
150
  /* Animations */
@@ -161,39 +192,43 @@
161
  max-width: 800px;
162
  margin: 2rem auto;
163
  background-color: var(--card-background);
164
- border-radius: 15px;
165
  padding: 2rem;
166
- box-shadow: 0 4px 15px var(--shadow-color);
 
167
  }
168
 
169
  .analysis-header {
170
  text-align: center;
171
  margin-bottom: 2rem;
172
- padding-bottom: 1rem;
173
- border-bottom: 2px solid #eee;
174
  }
175
 
176
  .analysis-header h2 {
177
- color: var(--primary-color);
178
  font-size: 1.8rem;
179
- margin-bottom: 0.5rem;
 
180
  }
181
 
182
  .analysis-section {
183
  margin-bottom: 2rem;
184
  padding: 1.5rem;
185
- background-color: #f8f9fa;
186
- border-radius: 10px;
187
  transition: all 0.3s ease;
 
188
  }
189
 
190
  .analysis-section:hover {
191
  transform: translateY(-2px);
192
  box-shadow: 0 4px 15px var(--shadow-color);
 
193
  }
194
 
195
  .analysis-section h3 {
196
- color: var(--secondary-color);
197
  margin-bottom: 1rem;
198
  font-size: 1.3rem;
199
  display: flex;
@@ -203,23 +238,29 @@
203
 
204
  .analysis-section p {
205
  line-height: 1.8;
206
- color: #4a4a4a;
 
207
  }
208
 
209
  .back-button {
210
  display: inline-block;
211
  padding: 0.8rem 1.5rem;
212
- background-color: var(--secondary-color);
213
  color: white;
214
  text-decoration: none;
215
- border-radius: 25px;
216
  margin-top: 2rem;
217
  transition: all 0.3s ease;
 
 
 
 
 
218
  }
219
 
220
  .back-button:hover {
221
  transform: translateY(-2px);
222
- box-shadow: 0 4px 15px var(--shadow-color);
223
  }
224
 
225
  /* Loading Animation */
@@ -227,20 +268,140 @@
227
  display: flex;
228
  flex-direction: column;
229
  align-items: center;
230
- gap: 1rem;
231
  padding: 3rem;
232
  }
233
 
234
  .analysis-spinner {
235
  width: 60px;
236
  height: 60px;
237
- border: 6px solid #f3f3f3;
238
- border-top: 6px solid var(--secondary-color);
239
  border-radius: 50%;
240
  animation: spin 1s linear infinite;
241
  }
242
 
243
- @keyframes spin {
244
- 0% { transform: rotate(0deg); }
245
- 100% { transform: rotate(360deg); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
 
1
+ /* Modern theme variables */
2
  :root {
3
+ --primary-color: #6366f1;
4
+ --primary-light: #818cf8;
5
+ --primary-dark: #4f46e5;
6
+ --secondary-color: #10b981;
7
+ --accent-color: #f59e0b;
8
+ --background-color: #0f172a;
9
+ --card-background: #1e293b;
10
+ --surface-light: rgba(30, 41, 59, 0.7);
11
+ --surface-dark: rgba(15, 23, 42, 0.7);
12
+ --text-primary: rgba(255, 255, 255, 0.95);
13
+ --text-secondary: rgba(255, 255, 255, 0.7);
14
+ --border-color: rgba(255, 255, 255, 0.08);
15
+ --error-color: #ef4444;
16
+ --success-color: #10b981;
17
+ --shadow-color: rgba(0, 0, 0, 0.25);
18
  }
19
 
20
  /* Loading Overlay */
 
24
  left: 0;
25
  width: 100%;
26
  height: 100%;
27
+ background: rgba(15, 23, 42, 0.9);
28
  display: flex;
29
  justify-content: center;
30
  align-items: center;
31
  z-index: 1000;
32
+ backdrop-filter: blur(8px);
33
  }
34
 
35
  .loading-content {
36
  text-align: center;
37
  color: var(--text-primary);
38
+ display: flex;
39
+ flex-direction: column;
40
+ align-items: center;
41
+ gap: 1.5rem;
42
  }
43
 
44
  .loading-spinner {
45
+ width: 60px;
46
+ height: 60px;
47
+ border: 3px solid rgba(99, 102, 241, 0.3);
48
  border-radius: 50%;
49
+ border-top-color: var(--primary-light);
50
  animation: spin 1s linear infinite;
 
51
  }
52
 
53
  /* Analysis Modal */
 
57
  left: 0;
58
  width: 100%;
59
  height: 100%;
60
+ background: rgba(15, 23, 42, 0.8);
61
  display: flex;
62
  justify-content: center;
63
  align-items: center;
64
  z-index: 1000;
65
+ backdrop-filter: blur(8px);
66
  }
67
 
68
  .modal-content {
69
+ background: var(--card-background);
70
  width: 90%;
71
  max-width: 800px;
72
  max-height: 90vh;
73
+ border-radius: 1rem;
74
  overflow: hidden;
75
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
76
+ border: 1px solid var(--border-color);
77
+ animation: modalFadeIn 0.3s ease-out;
78
+ }
79
+
80
+ @keyframes modalFadeIn {
81
+ from { opacity: 0; transform: translateY(20px); }
82
+ to { opacity: 1; transform: translateY(0); }
83
  }
84
 
85
  .modal-header {
 
 
86
  display: flex;
87
  justify-content: space-between;
88
  align-items: center;
89
+ padding: 1.25rem 1.5rem;
90
+ background: var(--surface-dark);
91
+ border-bottom: 1px solid var(--border-color);
92
  }
93
 
94
+ .modal-title {
95
+ font-size: 1.25rem;
96
+ font-weight: 600;
97
  color: var(--text-primary);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
 
 
100
  .close-btn {
101
+ background: transparent;
102
  border: none;
103
+ color: var(--text-secondary);
104
+ font-size: 1.5rem;
105
  cursor: pointer;
106
+ transition: color 0.2s ease;
 
 
107
  display: flex;
108
  align-items: center;
109
  justify-content: center;
110
+ width: 32px;
111
+ height: 32px;
112
  border-radius: 50%;
 
113
  }
114
 
115
  .close-btn:hover {
116
+ color: var(--text-primary);
117
  background: rgba(255, 255, 255, 0.1);
118
  }
119
 
120
+ .modal-body {
121
+ padding: 1.5rem;
122
+ overflow-y: auto;
123
+ max-height: calc(90vh - 130px);
124
+ }
125
+
126
+ .modal-footer {
127
+ display: flex;
128
+ justify-content: flex-end;
129
+ gap: 1rem;
130
+ padding: 1.25rem 1.5rem;
131
+ background: var(--surface-dark);
132
+ border-top: 1px solid var(--border-color);
133
+ }
134
+
135
+ .action-btn {
136
+ padding: 0.75rem 1.5rem;
137
+ border-radius: 0.5rem;
138
+ font-size: 0.9rem;
139
+ font-weight: 600;
140
  cursor: pointer;
141
+ transition: all 0.2s ease;
142
+ }
143
+
144
+ .primary-btn {
145
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
146
+ color: white;
147
+ border: none;
148
+ box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
149
+ }
150
+
151
+ .primary-btn:hover {
152
+ transform: translateY(-2px);
153
+ box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
154
+ }
155
+
156
+ .cancel-btn {
157
+ background: transparent;
158
+ color: var(--text-secondary);
159
+ border: 1px solid var(--border-color);
160
  }
161
 
162
  .cancel-btn:hover {
163
+ background: rgba(255, 255, 255, 0.05);
164
+ color: var(--text-primary);
165
  }
166
 
167
  /* Error Message */
 
171
  right: 20px;
172
  background: var(--error-color);
173
  color: var(--text-primary);
174
+ padding: 1rem 1.5rem;
175
+ border-radius: 0.75rem;
176
  z-index: 1001;
177
  animation: slideIn 0.3s ease-out;
178
+ box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
179
  }
180
 
181
  /* Animations */
 
192
  max-width: 800px;
193
  margin: 2rem auto;
194
  background-color: var(--card-background);
195
+ border-radius: 1rem;
196
  padding: 2rem;
197
+ box-shadow: 0 4px 20px var(--shadow-color);
198
+ border: 1px solid var(--border-color);
199
  }
200
 
201
  .analysis-header {
202
  text-align: center;
203
  margin-bottom: 2rem;
204
+ padding-bottom: 1.5rem;
205
+ border-bottom: 1px solid var(--border-color);
206
  }
207
 
208
  .analysis-header h2 {
209
+ color: var(--primary-light);
210
  font-size: 1.8rem;
211
+ margin-bottom: 0.75rem;
212
+ line-height: 1.3;
213
  }
214
 
215
  .analysis-section {
216
  margin-bottom: 2rem;
217
  padding: 1.5rem;
218
+ background: rgba(15, 23, 42, 0.3);
219
+ border-radius: 0.75rem;
220
  transition: all 0.3s ease;
221
+ border: 1px solid var(--border-color);
222
  }
223
 
224
  .analysis-section:hover {
225
  transform: translateY(-2px);
226
  box-shadow: 0 4px 15px var(--shadow-color);
227
+ border-color: var(--primary-light);
228
  }
229
 
230
  .analysis-section h3 {
231
+ color: var(--text-primary);
232
  margin-bottom: 1rem;
233
  font-size: 1.3rem;
234
  display: flex;
 
238
 
239
  .analysis-section p {
240
  line-height: 1.8;
241
+ color: var(--text-secondary);
242
+ font-size: 0.95rem;
243
  }
244
 
245
  .back-button {
246
  display: inline-block;
247
  padding: 0.8rem 1.5rem;
248
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
249
  color: white;
250
  text-decoration: none;
251
+ border-radius: 0.75rem;
252
  margin-top: 2rem;
253
  transition: all 0.3s ease;
254
+ font-weight: 600;
255
+ font-size: 0.9rem;
256
+ border: none;
257
+ cursor: pointer;
258
+ box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
259
  }
260
 
261
  .back-button:hover {
262
  transform: translateY(-2px);
263
+ box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
264
  }
265
 
266
  /* Loading Animation */
 
268
  display: flex;
269
  flex-direction: column;
270
  align-items: center;
271
+ gap: 1.5rem;
272
  padding: 3rem;
273
  }
274
 
275
  .analysis-spinner {
276
  width: 60px;
277
  height: 60px;
278
+ border: 4px solid rgba(99, 102, 241, 0.1);
279
+ border-top: 4px solid var(--primary-light);
280
  border-radius: 50%;
281
  animation: spin 1s linear infinite;
282
  }
283
 
284
+ /* Analysis Tabs */
285
+ .analysis-tabs {
286
+ display: flex;
287
+ gap: 0.5rem;
288
+ margin-bottom: 1.5rem;
289
+ border-bottom: 1px solid var(--border-color);
290
+ padding-bottom: 0.5rem;
291
+ overflow-x: auto;
292
+ -webkit-overflow-scrolling: touch;
293
+ justify-content: center;
294
+ }
295
+
296
+ .tab-button {
297
+ padding: 0.75rem 1.5rem;
298
+ background: rgba(30, 41, 59, 0.5);
299
+ border: 1px solid rgba(99, 102, 241, 0.2);
300
+ color: #a3b3cc;
301
+ font-size: 0.95rem;
302
+ font-weight: 500;
303
+ cursor: pointer;
304
+ border-radius: 0.5rem;
305
+ transition: all 0.25s ease;
306
+ white-space: nowrap;
307
+ min-width: max-content;
308
+ position: relative;
309
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
310
+ display: flex;
311
+ align-items: center;
312
+ justify-content: center;
313
+ }
314
+
315
+ .tab-button.active {
316
+ background: rgba(99, 102, 241, 0.15);
317
+ color: #ffffff;
318
+ font-weight: 600;
319
+ border-color: rgba(99, 102, 241, 0.5);
320
+ box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
321
+ transform: translateY(-2px);
322
+ }
323
+
324
+ /* Active tab indicator */
325
+ .tab-button.active::after {
326
+ content: '';
327
+ position: absolute;
328
+ bottom: -0.5rem;
329
+ left: 50%;
330
+ transform: translateX(-50%);
331
+ width: 60%;
332
+ height: 3px;
333
+ background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.8), rgba(99, 102, 241, 0.2));
334
+ border-radius: 3px;
335
+ }
336
+
337
+ .tab-button:hover:not(.active) {
338
+ background: rgba(99, 102, 241, 0.05);
339
+ color: #d1dce8;
340
+ transform: translateY(-1px);
341
+ }
342
+
343
+ .tab-button:focus {
344
+ outline: none;
345
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
346
+ }
347
+
348
+ /* Tab Content */
349
+ .tab-content {
350
+ display: none;
351
+ width: 100%;
352
+ animation: fadeIn 0.3s ease;
353
+ }
354
+
355
+ @keyframes fadeIn {
356
+ from { opacity: 0; transform: translateY(5px); }
357
+ to { opacity: 1; transform: translateY(0); }
358
+ }
359
+
360
+ /* Responsive adjustments */
361
+ @media (max-width: 768px) {
362
+ .analysis-tabs {
363
+ padding-bottom: 0.75rem;
364
+ gap: 0.5rem;
365
+ justify-content: space-between;
366
+ }
367
+
368
+ .tab-button {
369
+ padding: 0.75rem 1rem;
370
+ font-size: 0.9rem;
371
+ flex: 1;
372
+ text-align: center;
373
+ min-height: 45px;
374
+ display: flex;
375
+ align-items: center;
376
+ justify-content: center;
377
+ }
378
+
379
+ /* Ensure tab content is properly sized on mobile */
380
+ .tab-content {
381
+ width: 100%;
382
+ }
383
+
384
+ /* Improve chat container on mobile */
385
+ .chat-container {
386
+ height: 400px;
387
+ max-height: 70vh;
388
+ }
389
+ }
390
+
391
+ /* For very small screens */
392
+ @media (max-width: 380px) {
393
+ .analysis-tabs {
394
+ flex-direction: column;
395
+ width: 100%;
396
+ }
397
+
398
+ .tab-button {
399
+ width: 100%;
400
+ margin-bottom: 0.5rem;
401
+ }
402
+
403
+ .tab-button.active::after {
404
+ width: 30%;
405
+ bottom: -0.25rem;
406
+ }
407
  }
static/auth.css CHANGED
@@ -1,16 +1,21 @@
1
  :root {
2
- --primary-color: #00FFA3;
3
- --background-color: #13111C;
4
- --card-background: #1E1B2E;
5
- --text-color: #ffffff;
6
- --error-color: #ff4444;
 
 
 
 
 
7
  }
8
 
9
  * {
10
  margin: 0;
11
  padding: 0;
12
  box-sizing: border-box;
13
- font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
14
  }
15
 
16
  body {
@@ -19,40 +24,50 @@ body {
19
  display: flex;
20
  align-items: center;
21
  justify-content: center;
 
 
22
  }
23
 
24
  .auth-container {
25
  width: 100%;
26
  max-width: 420px;
27
- padding: 20px;
28
  }
29
 
30
  .auth-card {
31
  background: var(--card-background);
32
- padding: 40px;
33
- border-radius: 20px;
34
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
 
 
 
 
 
 
 
 
35
  }
36
 
37
  .auth-title {
38
- color: var(--primary-color);
39
- font-size: 2.5rem;
40
  text-align: center;
41
- margin-bottom: 10px;
42
  font-weight: 700;
 
43
  }
44
 
45
  .auth-subtitle {
46
- color: var(--text-color);
47
  text-align: center;
48
- opacity: 0.7;
49
- margin-bottom: 30px;
50
  }
51
 
52
  .auth-form {
53
  display: flex;
54
  flex-direction: column;
55
- gap: 20px;
56
  }
57
 
58
  .form-group {
@@ -61,76 +76,83 @@ body {
61
 
62
  .input-icon {
63
  position: absolute;
64
- left: 15px;
65
  top: 50%;
66
  transform: translateY(-50%);
67
- font-size: 1.2rem;
68
- opacity: 0.7;
69
  }
70
 
71
  .auth-input {
72
  width: 100%;
73
- padding: 15px 15px 15px 45px;
74
- border: 1px solid rgba(255, 255, 255, 0.1);
75
- border-radius: 10px;
76
- background: rgba(255, 255, 255, 0.05);
77
- color: var(--text-color);
78
  font-size: 1rem;
79
- transition: all 0.3s ease;
 
80
  }
81
 
82
  .auth-input:focus {
83
  outline: none;
84
- border-color: var(--primary-color);
85
- background: rgba(255, 255, 255, 0.1);
86
  }
87
 
88
  .auth-input::placeholder {
89
- color: rgba(255, 255, 255, 0.5);
 
90
  }
91
 
92
  .auth-button {
93
- background: var(--primary-color);
94
- color: var(--background-color);
95
  border: none;
96
- padding: 15px;
97
- border-radius: 10px;
98
  font-size: 1rem;
99
  font-weight: 600;
100
  cursor: pointer;
101
- transition: all 0.3s ease;
102
- margin-top: 10px;
 
103
  }
104
 
105
  .auth-button:hover {
106
  transform: translateY(-2px);
107
- box-shadow: 0 4px 15px rgba(0, 255, 163, 0.4);
 
 
 
 
108
  }
109
 
110
  .auth-footer {
111
  text-align: center;
112
- color: var(--text-color);
113
- margin-top: 30px;
114
  font-size: 0.9rem;
115
- opacity: 0.7;
116
  }
117
 
118
  .auth-link {
119
- color: var(--primary-color);
120
  text-decoration: none;
121
  font-weight: 600;
122
- transition: all 0.3s ease;
123
  }
124
 
125
  .auth-link:hover {
126
  opacity: 0.8;
 
127
  }
128
 
129
  .error-messages {
130
- background: rgba(255, 68, 68, 0.1);
131
  border: 1px solid var(--error-color);
132
- border-radius: 10px;
133
- padding: 15px;
 
134
  }
135
 
136
  .error-message {
@@ -142,10 +164,14 @@ body {
142
  /* Responsive Design */
143
  @media (max-width: 480px) {
144
  .auth-card {
145
- padding: 30px 20px;
146
  }
147
 
148
  .auth-title {
149
  font-size: 2rem;
150
  }
 
 
 
 
151
  }
 
1
  :root {
2
+ --primary-color: #6366f1;
3
+ --primary-light: #818cf8;
4
+ --primary-dark: #4f46e5;
5
+ --background-color: #0f172a;
6
+ --card-background: #1e293b;
7
+ --text-primary: rgba(255, 255, 255, 0.95);
8
+ --text-secondary: rgba(255, 255, 255, 0.7);
9
+ --error-color: #ef4444;
10
+ --border-color: rgba(255, 255, 255, 0.08);
11
+ --shadow-color: rgba(0, 0, 0, 0.25);
12
  }
13
 
14
  * {
15
  margin: 0;
16
  padding: 0;
17
  box-sizing: border-box;
18
+ font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
19
  }
20
 
21
  body {
 
24
  display: flex;
25
  align-items: center;
26
  justify-content: center;
27
+ padding: 1.5rem;
28
+ background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, rgba(15, 23, 42, 0) 80%);
29
  }
30
 
31
  .auth-container {
32
  width: 100%;
33
  max-width: 420px;
 
34
  }
35
 
36
  .auth-card {
37
  background: var(--card-background);
38
+ padding: 2.5rem;
39
+ border-radius: 1.25rem;
40
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
41
+ border: 1px solid var(--border-color);
42
+ backdrop-filter: blur(10px);
43
+ animation: fadeIn 0.5s ease-out;
44
+ }
45
+
46
+ @keyframes fadeIn {
47
+ from { opacity: 0; transform: translateY(20px); }
48
+ to { opacity: 1; transform: translateY(0); }
49
  }
50
 
51
  .auth-title {
52
+ color: var(--primary-light);
53
+ font-size: 2.25rem;
54
  text-align: center;
55
+ margin-bottom: 0.75rem;
56
  font-weight: 700;
57
+ letter-spacing: -0.5px;
58
  }
59
 
60
  .auth-subtitle {
61
+ color: var(--text-secondary);
62
  text-align: center;
63
+ margin-bottom: 2rem;
64
+ font-size: 1rem;
65
  }
66
 
67
  .auth-form {
68
  display: flex;
69
  flex-direction: column;
70
+ gap: 1.25rem;
71
  }
72
 
73
  .form-group {
 
76
 
77
  .input-icon {
78
  position: absolute;
79
+ left: 1rem;
80
  top: 50%;
81
  transform: translateY(-50%);
82
+ font-size: 1rem;
83
+ color: var(--text-secondary);
84
  }
85
 
86
  .auth-input {
87
  width: 100%;
88
+ background: rgba(15, 23, 42, 0.5);
89
+ border: 1px solid var(--border-color);
90
+ border-radius: 0.75rem;
91
+ padding: 1rem 1rem 1rem 2.75rem;
 
92
  font-size: 1rem;
93
+ color: var(--text-primary);
94
+ transition: all 0.2s ease;
95
  }
96
 
97
  .auth-input:focus {
98
  outline: none;
99
+ border-color: var(--primary-light);
100
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
101
  }
102
 
103
  .auth-input::placeholder {
104
+ color: var(--text-secondary);
105
+ opacity: 0.7;
106
  }
107
 
108
  .auth-button {
109
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
110
+ color: white;
111
  border: none;
112
+ padding: 1rem;
113
+ border-radius: 0.75rem;
114
  font-size: 1rem;
115
  font-weight: 600;
116
  cursor: pointer;
117
+ transition: all 0.2s ease;
118
+ box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
119
+ margin-top: 0.5rem;
120
  }
121
 
122
  .auth-button:hover {
123
  transform: translateY(-2px);
124
+ box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
125
+ }
126
+
127
+ .auth-button:active {
128
+ transform: translateY(0);
129
  }
130
 
131
  .auth-footer {
132
  text-align: center;
133
+ color: var(--text-secondary);
134
+ margin-top: 2rem;
135
  font-size: 0.9rem;
 
136
  }
137
 
138
  .auth-link {
139
+ color: var(--primary-light);
140
  text-decoration: none;
141
  font-weight: 600;
142
+ transition: all 0.2s ease;
143
  }
144
 
145
  .auth-link:hover {
146
  opacity: 0.8;
147
+ text-decoration: underline;
148
  }
149
 
150
  .error-messages {
151
+ background: rgba(239, 68, 68, 0.1);
152
  border: 1px solid var(--error-color);
153
+ border-radius: 0.75rem;
154
+ padding: 1rem;
155
+ margin-bottom: 0.5rem;
156
  }
157
 
158
  .error-message {
 
164
  /* Responsive Design */
165
  @media (max-width: 480px) {
166
  .auth-card {
167
+ padding: 2rem 1.5rem;
168
  }
169
 
170
  .auth-title {
171
  font-size: 2rem;
172
  }
173
+
174
+ .auth-input {
175
+ padding: 0.875rem 0.875rem 0.875rem 2.5rem;
176
+ }
177
  }
static/script.js CHANGED
@@ -44,37 +44,63 @@ document.addEventListener('DOMContentLoaded', function() {
44
  }
45
  });
46
  function createPaperCard(paper) {
47
- return `
48
- <div class="paper-card">
49
- <h2 class="paper-title">${paper.title}</h2>
50
- <div class="paper-authors">
51
- ${paper.authors.split(', ').map(author =>
52
- `<span class="author-name">${author}</span>`
53
- ).join('')}
54
- </div>
55
- <div class="paper-abstract">
56
- ${paper.abstract}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  </div>
58
- <div class="paper-meta">
59
- <div class="meta-info">
60
- <span class="meta-item">
61
- <span class="meta-icon">📅</span>
62
- ${paper.published}
63
- </span>
64
- <span class="meta-item">
65
- <span class="meta-icon">🏷️</span>
66
- ${paper.categories.join(', ')}
67
- </span>
68
- </div>
69
- <div class="paper-actions">
70
- <button onclick="analyzeWithAI('${paper.pdf_link}')" class="action-button analyze-btn">
71
- <span>🔍</span> Analyze with AI
72
- </button>
73
- <button onclick="downloadPaper('${paper.pdf_link}', '${paper.title}')" class="action-button download-btn">
74
- <span>📥</span> Download PDF
75
- </button>
76
- </div>
77
  </div>
78
  </div>
79
  `;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
 
44
  }
45
  });
46
  function createPaperCard(paper) {
47
+ // Create the card element
48
+ const cardElement = document.createElement('div');
49
+ cardElement.className = 'paper-card';
50
+
51
+ // Set the inner HTML with the paper details
52
+ cardElement.innerHTML = `
53
+ <h2 class="paper-title">${escapeHtml(paper.title)}</h2>
54
+ <div class="paper-authors">
55
+ ${paper.authors.split(', ').map(author =>
56
+ `<span class="author-name">${escapeHtml(author)}</span>`
57
+ ).join('')}
58
+ </div>
59
+ <div class="paper-abstract">
60
+ ${escapeHtml(paper.abstract)}
61
+ </div>
62
+ <div class="paper-meta">
63
+ <div class="meta-info">
64
+ <span class="meta-item">
65
+ <span class="meta-icon">📅</span>
66
+ ${paper.published}
67
+ </span>
68
+ <span class="meta-item">
69
+ <span class="meta-icon">🏷️</span>
70
+ ${paper.category || 'N/A'}
71
+ </span>
72
  </div>
73
+ <div class="paper-actions">
74
+ <button class="action-button analyze-btn">
75
+ <span>🔍</span> Analyze with AI
76
+ </button>
77
+ <button class="action-button download-btn">
78
+ <span>📥</span> Download PDF
79
+ </button>
 
 
 
 
 
 
 
 
 
 
 
 
80
  </div>
81
  </div>
82
  `;
83
+
84
+ // Add event listeners directly to the buttons
85
+ const analyzeButton = cardElement.querySelector('.analyze-btn');
86
+ analyzeButton.addEventListener('click', () => {
87
+ analyzeWithAI(paper.pdf_link);
88
+ });
89
+
90
+ const downloadButton = cardElement.querySelector('.download-btn');
91
+ downloadButton.addEventListener('click', () => {
92
+ downloadPaper(paper.pdf_link, paper.title);
93
+ });
94
+
95
+ return cardElement;
96
+ }
97
+
98
+ // Make sure the escapeHtml function is available
99
+ function escapeHtml(unsafe) {
100
+ return unsafe
101
+ .replace(/&/g, "&amp;")
102
+ .replace(/</g, "&lt;")
103
+ .replace(/>/g, "&gt;")
104
+ .replace(/"/g, "&quot;")
105
+ .replace(/'/g, "&#039;");
106
  }
static/search.js CHANGED
@@ -16,6 +16,9 @@ let searchState = {
16
  lastQuery: null
17
  };
18
 
 
 
 
19
  // Utility Functions
20
  function getCsrfToken() {
21
  return document.querySelector('meta[name="csrf-token"]').getAttribute('content');
@@ -36,7 +39,6 @@ function hideLoading() {
36
  // Search Functionality
37
  async function performSearch() {
38
  const searchQuery = document.getElementById('searchInput').value.trim();
39
- const sortBy = document.getElementById('sortBy').value;
40
  const maxResults = parseInt(document.getElementById('maxResults').value);
41
 
42
  if (!searchQuery) {
@@ -90,22 +92,9 @@ async function performSearch() {
90
  const resultsGrid = document.createElement('div');
91
  resultsGrid.className = 'results-grid';
92
 
93
- // Add each paper to the grid
94
  data.forEach(paper => {
95
- const paperCard = document.createElement('div');
96
- paperCard.className = 'paper-card';
97
- paperCard.innerHTML = `
98
- <h3 class="paper-title">${escapeHtml(paper.title)}</h3>
99
- <p class="paper-authors">Authors: ${escapeHtml(paper.authors)}</p>
100
- <p class="paper-category">Category: ${escapeHtml(paper.category)}</p>
101
- <p class="paper-date">Published: ${escapeHtml(paper.published)}</p>
102
- <p class="paper-abstract">${escapeHtml(paper.abstract.substring(0, 200))}...</p>
103
- <div class="paper-actions">
104
- <a href="${paper.pdf_link}" target="_blank" class="action-button pdf-button">PDF</a>
105
- <a href="${paper.arxiv_link}" target="_blank" class="action-button arxiv-button">ARXIV</a>
106
- <button onclick="analyzePaper('${paper.pdf_link}', '${escapeHtml(paper.title)}')" class="action-button analyze">Analyze</button>
107
- </div>
108
- `;
109
  resultsGrid.appendChild(paperCard);
110
  });
111
 
@@ -206,7 +195,7 @@ async function analyzePaper(pdfUrl, paperTitle) {
206
  throw new Error(data.error);
207
  }
208
 
209
- // Show results section
210
  const resultsSection = document.getElementById('resultsSection');
211
  resultsSection.innerHTML = `
212
  <div class="analysis-container">
@@ -217,60 +206,98 @@ async function analyzePaper(pdfUrl, paperTitle) {
217
  <h2 class="current-paper-title">${paperTitle}</h2>
218
  </div>
219
 
220
- <div class="analysis-tabs">
221
  <button id="paperAnalysisTab"
222
- class="tab-button active"
223
- onclick="switchPaperTab('analysis')">
 
 
 
 
 
 
 
 
224
  Paper Analysis
225
  </button>
226
  <button id="chatWithPaperTab"
227
- class="tab-button"
228
- onclick="switchPaperTab('chat')">
 
 
 
 
 
 
 
 
229
  Chat with Paper
230
  </button>
231
  </div>
232
 
233
- <div id="analysisContent" class="tab-content active">
234
  <div class="analysis-section">
235
- <h3>Research Paper Analysis</h3>
236
- <div class="analysis-content">
 
 
 
237
  ${marked.parse(data.analysis.executive_summary)}
238
  </div>
239
  </div>
240
  </div>
241
 
242
- <div id="chatContent" class="tab-content">
243
- <div class="chat-container">
244
- <div class="quick-questions">
245
- <button class="quick-question-btn" onclick="handleQuickQuestion('What are the main findings?')">
 
 
 
246
  What are the main findings?
247
  </button>
248
- <button class="quick-question-btn" onclick="handleQuickQuestion('Explain the methodology')">
 
 
 
249
  Explain the methodology
250
  </button>
251
- <button class="quick-question-btn" onclick="handleQuickQuestion('Key contributions?')">
 
 
 
252
  Key contributions?
253
  </button>
254
- <button class="quick-question-btn" onclick="handleQuickQuestion('Future research directions?')">
 
 
 
255
  Future research directions?
256
  </button>
257
  </div>
258
- <div class="chat-messages" id="chatMessages">
259
- <div class="message-wrapper">
260
- <div class="message-avatar ai-avatar">AI</div>
261
- <div class="message ai-message">
262
  Hello! I'm here to help you understand this research paper better.
263
  Feel free to ask any questions about the paper's content, methodology,
264
  findings, or implications.
265
  </div>
266
  </div>
267
  </div>
268
- <div class="chat-input-area">
269
  <input type="text"
270
  class="chat-input"
271
  placeholder="Ask a question about the paper..."
272
- id="chatInput">
273
- <button class="chat-send-button" onclick="sendMessage()">
 
 
 
 
 
 
 
274
  <span>Send</span>
275
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
276
  <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>
@@ -282,6 +309,26 @@ async function analyzePaper(pdfUrl, paperTitle) {
282
  </div>
283
  `;
284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  } catch (error) {
286
  console.error('Analysis error:', error);
287
  document.getElementById('resultsSection').innerHTML = `
@@ -294,43 +341,28 @@ async function analyzePaper(pdfUrl, paperTitle) {
294
  }
295
  }
296
 
297
- // Function to switch between paper analysis and chat tabs
298
- function switchPaperTab(tab) {
299
- const analysisBtnTab = document.getElementById('paperAnalysisTab');
300
- const chatBtnTab = document.getElementById('chatWithPaperTab');
301
- const analysisContent = document.getElementById('analysisContent');
302
- const chatContent = document.getElementById('chatContent');
303
-
304
- if (tab === 'analysis') {
305
- analysisBtnTab.classList.add('active');
306
- chatBtnTab.classList.remove('active');
307
- analysisContent.classList.add('active');
308
- chatContent.classList.remove('active');
309
- } else {
310
- chatBtnTab.classList.add('active');
311
- analysisBtnTab.classList.remove('active');
312
- chatContent.classList.add('active');
313
- analysisContent.classList.remove('active');
314
- }
315
- }
316
-
317
- // Function to handle chat messages
318
  async function sendMessage() {
319
  const chatInput = document.getElementById('chatInput');
320
- const question = chatInput.value.trim();
321
 
322
- if (!question || !currentPaperState.pdfUrl) return;
323
-
324
- // Add user message
325
- addMessage(question, true);
326
-
327
- // Add AI thinking message with unique ID
328
- const thinkingId = `thinking-${Date.now()}`;
329
- const thinkingDiv = addThinkingMessage(thinkingId);
330
-
331
  chatInput.value = '';
332
 
 
 
 
 
 
 
333
  try {
 
 
 
 
 
334
  const response = await fetch('/chat-with-paper', {
335
  method: 'POST',
336
  headers: {
@@ -338,31 +370,429 @@ async function sendMessage() {
338
  'X-CSRFToken': getCsrfToken()
339
  },
340
  body: JSON.stringify({
341
- pdf_url: currentPaperState.pdfUrl,
342
- question: question
 
343
  })
344
  });
345
-
 
 
 
 
 
 
 
 
 
346
  const data = await response.json();
347
-
348
- // Remove thinking indicator before adding response
349
- removeThinkingMessage(thinkingId);
350
-
351
  if (data.error) {
352
  throw new Error(data.error);
353
  }
354
-
355
- // Add AI response
356
- addMessage(data.response, false);
357
-
 
 
 
 
 
 
358
  } catch (error) {
359
  console.error('Chat error:', error);
360
- // Remove thinking indicator
361
- removeThinkingMessage(thinkingId);
362
- addMessage(`Error: ${error.message}`, false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  }
364
  }
365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  // Navigation Functions
367
  function showHome() {
368
  hideAllSections();
@@ -494,22 +924,9 @@ function backToSearchResults() {
494
  const resultsGrid = document.createElement('div');
495
  resultsGrid.className = 'results-grid';
496
 
497
- // Recreate the results from the saved state
498
  searchState.lastResults.forEach(paper => {
499
- const paperCard = document.createElement('div');
500
- paperCard.className = 'paper-card';
501
- paperCard.innerHTML = `
502
- <h3 class="paper-title">${escapeHtml(paper.title)}</h3>
503
- <p class="paper-authors">Authors: ${escapeHtml(paper.authors)}</p>
504
- <p class="paper-category">Category: ${escapeHtml(paper.category)}</p>
505
- <p class="paper-date">Published: ${escapeHtml(paper.published)}</p>
506
- <p class="paper-abstract">${escapeHtml(paper.abstract.substring(0, 200))}...</p>
507
- <div class="paper-actions">
508
- <a href="${paper.pdf_link}" target="_blank" class="action-button pdf-button">PDF</a>
509
- <a href="${paper.arxiv_link}" target="_blank" class="action-button arxiv-button">ARXIV</a>
510
- <button onclick="analyzePaper('${paper.pdf_link}', '${escapeHtml(paper.title)}')" class="action-button analyze">Analyze</button>
511
- </div>
512
- `;
513
  resultsGrid.appendChild(paperCard);
514
  });
515
 
@@ -591,10 +1008,6 @@ function initializeSearchInterface() {
591
  placeholder="Enter research paper title"
592
  autocomplete="off"
593
  >
594
- <select id="sortBy" class="filter-select">
595
- <option value="relevance">Sort by Relevance</option>
596
- <option value="lastUpdated">Sort by Last Updated</option>
597
- </select>
598
  <select id="maxResults" class="filter-select">
599
  <option value="10">10 results</option>
600
  <option value="25">25 results</option>
@@ -620,117 +1033,6 @@ function initializeSearchInterface() {
620
  }
621
  }
622
 
623
- function createChatInterface() {
624
- return `
625
- <div class="chat-container">
626
- <div class="quick-questions">
627
- <button class="quick-question-btn" onclick="handleQuickQuestion('What are the main findings?')">
628
- What are the main findings?
629
- </button>
630
- <button class="quick-question-btn" onclick="handleQuickQuestion('Explain the methodology')">
631
- Explain the methodology
632
- </button>
633
- <button class="quick-question-btn" onclick="handleQuickQuestion('Key contributions?')">
634
- Key contributions?
635
- </button>
636
- <button class="quick-question-btn" onclick="handleQuickQuestion('Future research directions?')">
637
- Future research directions?
638
- </button>
639
- </div>
640
- <div class="chat-messages" id="chatMessages">
641
- <div class="message-wrapper">
642
- <div class="message-avatar ai-avatar">AI</div>
643
- <div class="message ai-message">
644
- Hello! I'm here to help you understand this research paper better.
645
- Feel free to ask any questions about the paper's content, methodology,
646
- findings, or implications.
647
- </div>
648
- </div>
649
- </div>
650
- <div class="chat-input-area">
651
- <input type="text"
652
- class="chat-input"
653
- placeholder="Ask a question about the paper..."
654
- id="chatInput">
655
- <button class="chat-send-button" onclick="sendMessage()">
656
- <span>Send</span>
657
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
658
- <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>
659
- </svg>
660
- </button>
661
- </div>
662
- </div>
663
- `;
664
- }
665
-
666
- function addMessage(message, isUser = false) {
667
- const chatMessages = document.getElementById('chatMessages');
668
- const messageWrapper = document.createElement('div');
669
- messageWrapper.className = 'message-wrapper';
670
-
671
- const avatar = document.createElement('div');
672
- avatar.className = `message-avatar ${isUser ? 'user-avatar' : 'ai-avatar'}`;
673
- avatar.textContent = isUser ? 'You' : 'AI';
674
-
675
- const messageDiv = document.createElement('div');
676
- messageDiv.className = `message ${isUser ? 'user-message' : 'ai-message'}`;
677
-
678
- // Convert markdown to HTML if it's an AI message
679
- if (!isUser) {
680
- messageDiv.innerHTML = marked.parse(message);
681
- } else {
682
- messageDiv.textContent = message;
683
- }
684
-
685
- messageWrapper.appendChild(avatar);
686
- messageWrapper.appendChild(messageDiv);
687
- chatMessages.appendChild(messageWrapper);
688
-
689
- // Scroll to bottom
690
- chatMessages.scrollTop = chatMessages.scrollHeight;
691
- }
692
-
693
- // Add this new function to handle quick questions
694
- async function handleQuickQuestion(question) {
695
- // Add user's question to chat
696
- addMessage(question, true);
697
-
698
- // Show thinking indicator
699
- const thinkingDiv = addThinkingMessage();
700
-
701
- try {
702
- const response = await fetch('/chat-with-paper', {
703
- method: 'POST',
704
- headers: {
705
- 'Content-Type': 'application/json',
706
- 'X-CSRFToken': getCsrfToken()
707
- },
708
- body: JSON.stringify({
709
- pdf_url: currentPaperState.pdfUrl,
710
- question: question
711
- })
712
- });
713
-
714
- const data = await response.json();
715
-
716
- // Remove thinking indicator
717
- thinkingDiv.remove();
718
-
719
- if (data.error) {
720
- addMessage(`Error: ${data.error}`, false);
721
- return;
722
- }
723
-
724
- // Add AI's response to chat
725
- addMessage(data.response, false);
726
-
727
- } catch (error) {
728
- // Remove thinking indicator
729
- thinkingDiv.remove();
730
- addMessage(`Error: ${error.message}`, false);
731
- }
732
- }
733
-
734
  // Event Listeners
735
  document.addEventListener('DOMContentLoaded', () => {
736
  // Navigation initialization
@@ -778,3 +1080,107 @@ function removeThinkingMessage(id) {
778
  thinkingDiv.remove();
779
  }
780
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  lastQuery: null
17
  };
18
 
19
+ // Add missing sortBy variable
20
+ let sortBy = 'relevance'; // Default sort option
21
+
22
  // Utility Functions
23
  function getCsrfToken() {
24
  return document.querySelector('meta[name="csrf-token"]').getAttribute('content');
 
39
  // Search Functionality
40
  async function performSearch() {
41
  const searchQuery = document.getElementById('searchInput').value.trim();
 
42
  const maxResults = parseInt(document.getElementById('maxResults').value);
43
 
44
  if (!searchQuery) {
 
92
  const resultsGrid = document.createElement('div');
93
  resultsGrid.className = 'results-grid';
94
 
95
+ // Add each paper to the grid using the new function
96
  data.forEach(paper => {
97
+ const paperCard = createPaperCard(paper);
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  resultsGrid.appendChild(paperCard);
99
  });
100
 
 
195
  throw new Error(data.error);
196
  }
197
 
198
+ // Show results section with enhanced tab styling
199
  const resultsSection = document.getElementById('resultsSection');
200
  resultsSection.innerHTML = `
201
  <div class="analysis-container">
 
206
  <h2 class="current-paper-title">${paperTitle}</h2>
207
  </div>
208
 
209
+ <div style="display: flex; gap: 0.75rem; margin-bottom: 2rem; padding: 0.5rem; background: rgba(15, 23, 42, 0.6); border-radius: 0.75rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.07); backdrop-filter: blur(10px); border: 1px solid rgba(99, 102, 241, 0.15); flex-wrap: wrap;">
210
  <button id="paperAnalysisTab"
211
+ style="flex: 1; min-width: 140px; padding: 0.85rem 1rem; background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(79, 70, 229, 0.35) 100%); color: #ffffff; font-size: 0.95rem; font-weight: 600; cursor: pointer; border-radius: 0.6rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap; position: relative; box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1); border: none; outline: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); letter-spacing: 0.3px; display: flex; align-items: center; justify-content: center; gap: 0.5rem;"
212
+ onclick="document.getElementById('analysisContent').style.display='block';
213
+ document.getElementById('chatContent').style.display='none';
214
+ this.style.background='linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(79, 70, 229, 0.35) 100%)';
215
+ this.style.boxShadow='0 2px 10px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1)';
216
+ this.style.color='#ffffff';
217
+ document.getElementById('chatWithPaperTab').style.background='rgba(30, 41, 59, 0.4)';
218
+ document.getElementById('chatWithPaperTab').style.boxShadow='none';
219
+ document.getElementById('chatWithPaperTab').style.color='rgba(255, 255, 255, 0.6)';">
220
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
221
  Paper Analysis
222
  </button>
223
  <button id="chatWithPaperTab"
224
+ style="flex: 1; min-width: 140px; padding: 0.85rem 1rem; background: rgba(30, 41, 59, 0.4); color: rgba(255, 255, 255, 0.6); font-size: 0.95rem; font-weight: 600; cursor: pointer; border-radius: 0.6rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap; position: relative; box-shadow: none; border: none; outline: none; letter-spacing: 0.3px; display: flex; align-items: center; justify-content: center; gap: 0.5rem;"
225
+ onclick="document.getElementById('chatContent').style.display='block';
226
+ document.getElementById('analysisContent').style.display='none';
227
+ this.style.background='linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(79, 70, 229, 0.35) 100%)';
228
+ this.style.boxShadow='0 2px 10px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1)';
229
+ this.style.color='#ffffff';
230
+ document.getElementById('paperAnalysisTab').style.background='rgba(30, 41, 59, 0.4)';
231
+ document.getElementById('paperAnalysisTab').style.boxShadow='none';
232
+ document.getElementById('paperAnalysisTab').style.color='rgba(255, 255, 255, 0.6)';">
233
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path><path d="M13 8l-5 5"></path><path d="M13 13l-5-5"></path></svg>
234
  Chat with Paper
235
  </button>
236
  </div>
237
 
238
+ <div id="analysisContent" style="display: block; width: 100%; animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);">
239
  <div class="analysis-section">
240
+ <h3 style="font-size: 1.5rem; margin-bottom: 1.25rem; color: #f8fafc; font-weight: 600; display: flex; align-items: center; gap: 0.5rem;">
241
+ <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>
242
+ Research Paper Analysis
243
+ </h3>
244
+ <div class="analysis-content" style="background: rgba(15, 23, 42, 0.4); padding: 1.5rem; border-radius: 0.75rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05); border: 1px solid rgba(99, 102, 241, 0.1);">
245
  ${marked.parse(data.analysis.executive_summary)}
246
  </div>
247
  </div>
248
  </div>
249
 
250
+ <div id="chatContent" style="display: none; width: 100%; animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);">
251
+ <div class="chat-container" style="background: rgba(15, 23, 42, 0.4); border-radius: 0.75rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05); border: 1px solid rgba(99, 102, 241, 0.1); overflow: hidden; display: flex; flex-direction: column; height: 500px;">
252
+ <div class="quick-questions" style="padding: 1rem; display: flex; gap: 0.5rem; overflow-x: auto; border-bottom: 1px solid rgba(255, 255, 255, 0.05); background: rgba(15, 23, 42, 0.6);">
253
+ <button class="quick-question-btn" style="padding: 0.6rem 1rem; background: rgba(99, 102, 241, 0.15); color: #d1d5db; border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 2rem; font-size: 0.85rem; white-space: nowrap; transition: all 0.2s ease; cursor: pointer;"
254
+ onclick="handleQuickQuestion('What are the main findings?')"
255
+ onmouseover="this.style.background='rgba(99, 102, 241, 0.25)'; this.style.color='white';"
256
+ onmouseout="this.style.background='rgba(99, 102, 241, 0.15)'; this.style.color='#d1d5db';">
257
  What are the main findings?
258
  </button>
259
+ <button class="quick-question-btn" style="padding: 0.6rem 1rem; background: rgba(99, 102, 241, 0.15); color: #d1d5db; border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 2rem; font-size: 0.85rem; white-space: nowrap; transition: all 0.2s ease; cursor: pointer;"
260
+ onclick="handleQuickQuestion('Explain the methodology')"
261
+ onmouseover="this.style.background='rgba(99, 102, 241, 0.25)'; this.style.color='white';"
262
+ onmouseout="this.style.background='rgba(99, 102, 241, 0.15)'; this.style.color='#d1d5db';">
263
  Explain the methodology
264
  </button>
265
+ <button class="quick-question-btn" style="padding: 0.6rem 1rem; background: rgba(99, 102, 241, 0.15); color: #d1d5db; border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 2rem; font-size: 0.85rem; white-space: nowrap; transition: all 0.2s ease; cursor: pointer;"
266
+ onclick="handleQuickQuestion('Key contributions?')"
267
+ onmouseover="this.style.background='rgba(99, 102, 241, 0.25)'; this.style.color='white';"
268
+ onmouseout="this.style.background='rgba(99, 102, 241, 0.15)'; this.style.color='#d1d5db';">
269
  Key contributions?
270
  </button>
271
+ <button class="quick-question-btn" style="padding: 0.6rem 1rem; background: rgba(99, 102, 241, 0.15); color: #d1d5db; border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 2rem; font-size: 0.85rem; white-space: nowrap; transition: all 0.2s ease; cursor: pointer;"
272
+ onclick="handleQuickQuestion('Future research directions?')"
273
+ onmouseover="this.style.background='rgba(99, 102, 241, 0.25)'; this.style.color='white';"
274
+ onmouseout="this.style.background='rgba(99, 102, 241, 0.15)'; this.style.color='#d1d5db';">
275
  Future research directions?
276
  </button>
277
  </div>
278
+ <div class="chat-messages" id="chatMessages" style="flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem;">
279
+ <div class="message-wrapper" style="display: flex; gap: 0.75rem; max-width: 85%;">
280
+ <div class="message-avatar ai-avatar" style="width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); display: flex; align-items: center; justify-content: center; font-weight: 600; color: white; font-size: 0.85rem; flex-shrink: 0;">AI</div>
281
+ <div class="message ai-message" style="background: rgba(30, 41, 59, 0.6); padding: 1rem; border-radius: 0 1rem 1rem 1rem; color: #e2e8f0; font-size: 0.95rem; line-height: 1.5; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); border: 1px solid rgba(99, 102, 241, 0.1);">
282
  Hello! I'm here to help you understand this research paper better.
283
  Feel free to ask any questions about the paper's content, methodology,
284
  findings, or implications.
285
  </div>
286
  </div>
287
  </div>
288
+ <div class="chat-input-area" style="padding: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.05); background: rgba(15, 23, 42, 0.6); display: flex; gap: 0.75rem;">
289
  <input type="text"
290
  class="chat-input"
291
  placeholder="Ask a question about the paper..."
292
+ id="chatInput"
293
+ style="flex: 1; padding: 0.85rem 1.25rem; background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 0.5rem; color: white; font-size: 0.95rem; outline: none; transition: all 0.2s ease;"
294
+ onfocus="this.style.borderColor='rgba(99, 102, 241, 0.5)'; this.style.boxShadow='0 0 0 2px rgba(99, 102, 241, 0.15)';"
295
+ onblur="this.style.borderColor='rgba(99, 102, 241, 0.2)'; this.style.boxShadow='none';">
296
+ <button class="chat-send-button"
297
+ onclick="sendMessage()"
298
+ style="padding: 0.85rem 1.5rem; background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; border: none; border-radius: 0.5rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3);"
299
+ onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 4px 12px rgba(99, 102, 241, 0.4)';"
300
+ onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 2px 5px rgba(99, 102, 241, 0.3)';">
301
  <span>Send</span>
302
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
303
  <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>
 
309
  </div>
310
  `;
311
 
312
+ // Add event listener for Enter key in chat input
313
+ const chatInput = document.getElementById('chatInput');
314
+ if (chatInput) {
315
+ chatInput.addEventListener('keypress', (e) => {
316
+ if (e.key === 'Enter') {
317
+ sendMessage();
318
+ }
319
+ });
320
+ }
321
+
322
+ // Add animation keyframes
323
+ const style = document.createElement('style');
324
+ style.textContent = `
325
+ @keyframes fadeIn {
326
+ from { opacity: 0; transform: translateY(10px); }
327
+ to { opacity: 1; transform: translateY(0); }
328
+ }
329
+ `;
330
+ document.head.appendChild(style);
331
+
332
  } catch (error) {
333
  console.error('Analysis error:', error);
334
  document.getElementById('resultsSection').innerHTML = `
 
341
  }
342
  }
343
 
344
+ // Chat functionality
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  async function sendMessage() {
346
  const chatInput = document.getElementById('chatInput');
347
+ const userMessage = chatInput.value.trim();
348
 
349
+ if (!userMessage) return;
350
+
351
+ // Clear input
 
 
 
 
 
 
352
  chatInput.value = '';
353
 
354
+ // Add user message to chat
355
+ addMessageToChat('user', userMessage);
356
+
357
+ // Show typing indicator
358
+ addTypingIndicator();
359
+
360
  try {
361
+ console.log('Sending chat request with:', {
362
+ question: userMessage,
363
+ pdf_url: currentPaperState.pdfUrl
364
+ });
365
+
366
  const response = await fetch('/chat-with-paper', {
367
  method: 'POST',
368
  headers: {
 
370
  'X-CSRFToken': getCsrfToken()
371
  },
372
  body: JSON.stringify({
373
+ question: userMessage, // Changed from message to question
374
+ pdf_url: currentPaperState.pdfUrl
375
+ // Removed title parameter as it's not required by the backend
376
  })
377
  });
378
+
379
+ // Remove typing indicator
380
+ removeTypingIndicator();
381
+
382
+ if (!response.ok) {
383
+ const errorText = await response.text();
384
+ console.error('Server error response:', errorText);
385
+ throw new Error(`Server error: ${response.status} - ${errorText}`);
386
+ }
387
+
388
  const data = await response.json();
389
+ console.log('Received chat response:', data);
390
+
 
 
391
  if (data.error) {
392
  throw new Error(data.error);
393
  }
394
+
395
+ // Add AI response to chat
396
+ addMessageToChat('ai', data.response || data.message || data.answer || "I couldn't generate a proper response.");
397
+
398
+ // Scroll to bottom of chat
399
+ const chatMessages = document.getElementById('chatMessages');
400
+ if (chatMessages) {
401
+ chatMessages.scrollTop = chatMessages.scrollHeight;
402
+ }
403
+
404
  } catch (error) {
405
  console.error('Chat error:', error);
406
+ removeTypingIndicator();
407
+ addMessageToChat('ai', `I'm sorry, I encountered an error: ${error.message}. Please try again.`);
408
+ }
409
+ }
410
+
411
+ // Handle quick questions
412
+ function handleQuickQuestion(question) {
413
+ const chatInput = document.getElementById('chatInput');
414
+ if (chatInput) {
415
+ chatInput.value = question;
416
+ sendMessage();
417
+ }
418
+ }
419
+
420
+ // Add message to chat
421
+ function addMessageToChat(sender, message) {
422
+ const chatMessages = document.getElementById('chatMessages');
423
+ if (!chatMessages) return;
424
+
425
+ const messageWrapper = document.createElement('div');
426
+ messageWrapper.className = 'message-wrapper';
427
+
428
+ const avatar = document.createElement('div');
429
+ avatar.className = sender === 'user' ? 'message-avatar user-avatar' : 'message-avatar ai-avatar';
430
+ avatar.textContent = sender === 'user' ? 'You' : 'AI';
431
+
432
+ const messageElement = document.createElement('div');
433
+ messageElement.className = sender === 'user' ? 'message user-message' : 'message ai-message';
434
+
435
+ // Safely handle the message content
436
+ if (typeof message === 'string') {
437
+ // For AI messages, use marked to parse markdown
438
+ if (sender === 'ai') {
439
+ try {
440
+ messageElement.innerHTML = marked.parse(message);
441
+ } catch (e) {
442
+ console.error('Error parsing markdown:', e);
443
+ messageElement.textContent = message;
444
+ }
445
+ } else {
446
+ // For user messages, just use text
447
+ messageElement.textContent = message;
448
+ }
449
+ } else {
450
+ // Handle non-string messages safely
451
+ messageElement.textContent = JSON.stringify(message);
452
+ }
453
+
454
+ messageWrapper.appendChild(avatar);
455
+ messageWrapper.appendChild(messageElement);
456
+ chatMessages.appendChild(messageWrapper);
457
+
458
+ // Scroll to bottom
459
+ chatMessages.scrollTop = chatMessages.scrollHeight;
460
+
461
+ // Add improved message styling if it doesn't exist
462
+ if (!document.getElementById('improved-message-style')) {
463
+ const style = document.createElement('style');
464
+ style.id = 'improved-message-style';
465
+ style.textContent = `
466
+ .message-wrapper {
467
+ display: flex;
468
+ margin-bottom: 16px;
469
+ max-width: 100%;
470
+ animation: fadeIn 0.3s ease;
471
+ }
472
+
473
+ .message-avatar {
474
+ width: 36px;
475
+ height: 36px;
476
+ border-radius: 50%;
477
+ display: flex;
478
+ align-items: center;
479
+ justify-content: center;
480
+ font-weight: 600;
481
+ font-size: 0.85rem;
482
+ flex-shrink: 0;
483
+ margin-right: 12px;
484
+ }
485
+
486
+ .user-avatar {
487
+ background: linear-gradient(135deg, #10b981 0%, #059669 100%);
488
+ color: white;
489
+ }
490
+
491
+ .ai-avatar {
492
+ background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
493
+ color: white;
494
+ }
495
+
496
+ .message {
497
+ padding: 16px;
498
+ border-radius: 12px;
499
+ font-size: 0.95rem;
500
+ line-height: 1.6;
501
+ max-width: calc(100% - 60px);
502
+ overflow-wrap: break-word;
503
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
504
+ }
505
+
506
+ .user-message {
507
+ background: rgba(16, 185, 129, 0.1);
508
+ color: #e2e8f0;
509
+ border: 1px solid rgba(16, 185, 129, 0.2);
510
+ border-radius: 12px 12px 2px 12px;
511
+ align-self: flex-end;
512
+ }
513
+
514
+ .ai-message {
515
+ background: rgba(99, 102, 241, 0.1);
516
+ color: #e2e8f0;
517
+ border: 1px solid rgba(99, 102, 241, 0.2);
518
+ border-radius: 2px 12px 12px 12px;
519
+ }
520
+
521
+ /* Style for markdown content in AI messages */
522
+ .ai-message p {
523
+ margin: 0 0 12px 0;
524
+ }
525
+
526
+ .ai-message p:last-child {
527
+ margin-bottom: 0;
528
+ }
529
+
530
+ .ai-message ul, .ai-message ol {
531
+ margin: 12px 0;
532
+ padding-left: 24px;
533
+ }
534
+
535
+ .ai-message li {
536
+ margin-bottom: 6px;
537
+ }
538
+
539
+ .ai-message h1, .ai-message h2, .ai-message h3, .ai-message h4 {
540
+ margin: 16px 0 12px 0;
541
+ font-weight: 600;
542
+ line-height: 1.3;
543
+ }
544
+
545
+ .ai-message h1 {
546
+ font-size: 1.4rem;
547
+ }
548
+
549
+ .ai-message h2 {
550
+ font-size: 1.3rem;
551
+ }
552
+
553
+ .ai-message h3 {
554
+ font-size: 1.2rem;
555
+ }
556
+
557
+ .ai-message h4 {
558
+ font-size: 1.1rem;
559
+ }
560
+
561
+ .ai-message code {
562
+ background: rgba(30, 41, 59, 0.5);
563
+ padding: 2px 6px;
564
+ border-radius: 4px;
565
+ font-family: monospace;
566
+ font-size: 0.9em;
567
+ }
568
+
569
+ .ai-message pre {
570
+ background: rgba(30, 41, 59, 0.5);
571
+ padding: 12px;
572
+ border-radius: 8px;
573
+ overflow-x: auto;
574
+ margin: 12px 0;
575
+ border: 1px solid rgba(99, 102, 241, 0.2);
576
+ }
577
+
578
+ .ai-message pre code {
579
+ background: transparent;
580
+ padding: 0;
581
+ border-radius: 0;
582
+ display: block;
583
+ line-height: 1.5;
584
+ }
585
+
586
+ .ai-message blockquote {
587
+ border-left: 4px solid rgba(99, 102, 241, 0.4);
588
+ padding-left: 12px;
589
+ margin: 12px 0;
590
+ font-style: italic;
591
+ color: #94a3b8;
592
+ }
593
+
594
+ .ai-message a {
595
+ color: #818cf8;
596
+ text-decoration: underline;
597
+ text-underline-offset: 2px;
598
+ }
599
+
600
+ .ai-message a:hover {
601
+ color: #a5b4fc;
602
+ }
603
+
604
+ .ai-message table {
605
+ border-collapse: collapse;
606
+ width: 100%;
607
+ margin: 16px 0;
608
+ font-size: 0.9em;
609
+ }
610
+
611
+ .ai-message th, .ai-message td {
612
+ border: 1px solid rgba(99, 102, 241, 0.2);
613
+ padding: 8px 12px;
614
+ text-align: left;
615
+ }
616
+
617
+ .ai-message th {
618
+ background: rgba(99, 102, 241, 0.1);
619
+ font-weight: 600;
620
+ }
621
+
622
+ /* Responsive adjustments */
623
+ @media (max-width: 768px) {
624
+ .message {
625
+ padding: 14px;
626
+ font-size: 0.9rem;
627
+ line-height: 1.5;
628
+ }
629
+
630
+ .message-avatar {
631
+ width: 32px;
632
+ height: 32px;
633
+ font-size: 0.75rem;
634
+ margin-right: 10px;
635
+ }
636
+
637
+ .ai-message pre {
638
+ padding: 10px;
639
+ }
640
+ }
641
+ `;
642
+ document.head.appendChild(style);
643
+ }
644
+ }
645
+
646
+ // Add typing indicator
647
+ function addTypingIndicator() {
648
+ const chatMessages = document.getElementById('chatMessages');
649
+ if (!chatMessages) return;
650
+
651
+ const typingIndicator = document.createElement('div');
652
+ typingIndicator.className = 'message-wrapper typing-indicator';
653
+ typingIndicator.innerHTML = `
654
+ <div class="message-avatar ai-avatar">AI</div>
655
+ <div class="message ai-message typing-message">
656
+ <div class="typing-dots">
657
+ <span></span>
658
+ <span></span>
659
+ <span></span>
660
+ </div>
661
+ </div>
662
+ `;
663
+
664
+ chatMessages.appendChild(typingIndicator);
665
+ chatMessages.scrollTop = chatMessages.scrollHeight;
666
+
667
+ // Add the CSS for the typing animation if it doesn't exist
668
+ if (!document.getElementById('typing-animation-style')) {
669
+ const style = document.createElement('style');
670
+ style.id = 'typing-animation-style';
671
+ style.textContent = `
672
+ .typing-message {
673
+ padding: 10px 15px;
674
+ min-height: 20px;
675
+ display: flex;
676
+ align-items: center;
677
+ }
678
+
679
+ .typing-dots {
680
+ display: flex;
681
+ align-items: center;
682
+ height: 20px;
683
+ }
684
+
685
+ .typing-dots span {
686
+ display: inline-block;
687
+ width: 8px;
688
+ height: 8px;
689
+ border-radius: 50%;
690
+ background-color: rgba(255, 255, 255, 0.7);
691
+ margin: 0 3px;
692
+ animation: typingAnimation 1.4s infinite ease-in-out;
693
+ }
694
+
695
+ .typing-dots span:nth-child(1) {
696
+ animation-delay: 0s;
697
+ }
698
+
699
+ .typing-dots span:nth-child(2) {
700
+ animation-delay: 0.2s;
701
+ }
702
+
703
+ .typing-dots span:nth-child(3) {
704
+ animation-delay: 0.4s;
705
+ }
706
+
707
+ @keyframes typingAnimation {
708
+ 0%, 60%, 100% {
709
+ transform: translateY(0);
710
+ opacity: 0.6;
711
+ }
712
+ 30% {
713
+ transform: translateY(-5px);
714
+ opacity: 1;
715
+ }
716
+ }
717
+
718
+ /* Make the typing indicator look better on mobile */
719
+ @media (max-width: 768px) {
720
+ .typing-dots span {
721
+ width: 6px;
722
+ height: 6px;
723
+ margin: 0 2px;
724
+ }
725
+
726
+ .typing-message {
727
+ padding: 8px 12px;
728
+ }
729
+ }
730
+ `;
731
+ document.head.appendChild(style);
732
+ }
733
+ }
734
+
735
+ // Remove typing indicator
736
+ function removeTypingIndicator() {
737
+ const typingIndicator = document.querySelector('.typing-indicator');
738
+ if (typingIndicator) {
739
+ // Add a fade-out effect
740
+ typingIndicator.style.transition = 'opacity 0.3s ease';
741
+ typingIndicator.style.opacity = '0';
742
+
743
+ // Remove after animation completes
744
+ setTimeout(() => {
745
+ if (typingIndicator.parentNode) {
746
+ typingIndicator.parentNode.removeChild(typingIndicator);
747
+ }
748
+ }, 300);
749
  }
750
  }
751
 
752
+ // Create chat interface HTML
753
+ function createChatInterface() {
754
+ return `
755
+ <div class="chat-container">
756
+ <div class="quick-questions">
757
+ <button class="quick-question-btn" onclick="handleQuickQuestion('What are the main findings?')">
758
+ Main findings
759
+ </button>
760
+ <button class="quick-question-btn" onclick="handleQuickQuestion('Explain the methodology')">
761
+ Methodology
762
+ </button>
763
+ <button class="quick-question-btn" onclick="handleQuickQuestion('Key contributions?')">
764
+ Key contributions
765
+ </button>
766
+ <button class="quick-question-btn" onclick="handleQuickQuestion('Future research directions?')">
767
+ Future directions
768
+ </button>
769
+ </div>
770
+ <div class="chat-messages" id="chatMessages">
771
+ <div class="message-wrapper">
772
+ <div class="message-avatar ai-avatar">AI</div>
773
+ <div class="message ai-message">
774
+ Hello! I'm here to help you understand this research paper better.
775
+ Feel free to ask any questions about the paper's content, methodology,
776
+ findings, or implications.
777
+ </div>
778
+ </div>
779
+ </div>
780
+ <div class="chat-input-area">
781
+ <input type="text"
782
+ class="chat-input"
783
+ placeholder="Ask a question about the paper..."
784
+ id="chatInput">
785
+ <button class="chat-send-button" onclick="sendMessage()">
786
+ <span>Send</span>
787
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
788
+ <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>
789
+ </svg>
790
+ </button>
791
+ </div>
792
+ </div>
793
+ `;
794
+ }
795
+
796
  // Navigation Functions
797
  function showHome() {
798
  hideAllSections();
 
924
  const resultsGrid = document.createElement('div');
925
  resultsGrid.className = 'results-grid';
926
 
927
+ // Recreate the results from the saved state using the new function
928
  searchState.lastResults.forEach(paper => {
929
+ const paperCard = createPaperCard(paper);
 
 
 
 
 
 
 
 
 
 
 
 
 
930
  resultsGrid.appendChild(paperCard);
931
  });
932
 
 
1008
  placeholder="Enter research paper title"
1009
  autocomplete="off"
1010
  >
 
 
 
 
1011
  <select id="maxResults" class="filter-select">
1012
  <option value="10">10 results</option>
1013
  <option value="25">25 results</option>
 
1033
  }
1034
  }
1035
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1036
  // Event Listeners
1037
  document.addEventListener('DOMContentLoaded', () => {
1038
  // Navigation initialization
 
1080
  thinkingDiv.remove();
1081
  }
1082
  }
1083
+
1084
+ // Function to create consistent paper cards with properly styled buttons
1085
+ function createPaperCard(paper) {
1086
+ const paperCard = document.createElement('div');
1087
+ paperCard.className = 'paper-card';
1088
+
1089
+ // Format the paper data with proper HTML structure
1090
+ paperCard.innerHTML = `
1091
+ <div class="paper-header">
1092
+ <div class="paper-date">${escapeHtml(paper.published)}</div>
1093
+ <div class="paper-category">Category: ${escapeHtml(paper.category || 'N/A')}</div>
1094
+ </div>
1095
+ <h3 class="paper-title">${escapeHtml(paper.title)}</h3>
1096
+ <div class="paper-authors">Authors: ${escapeHtml(paper.authors)}</div>
1097
+ <p class="paper-abstract">${escapeHtml(paper.abstract.substring(0, 200))}${paper.abstract.length > 200 ? '...' : ''}</p>
1098
+ <div class="paper-actions">
1099
+ <a href="${paper.pdf_link}" target="_blank" class="paper-button pdf-button">PDF</a>
1100
+ <a href="${paper.arxiv_link}" target="_blank" class="paper-button arxiv-button">ARXIV</a>
1101
+ <button onclick="analyzePaper('${paper.pdf_link}', '${escapeHtml(paper.title)}')" class="paper-button analyze-button">Analyze</button>
1102
+ </div>
1103
+ `;
1104
+
1105
+ return paperCard;
1106
+ }
1107
+
1108
+ // Add comprehensive button styling
1109
+ const buttonStyle = document.createElement('style');
1110
+ buttonStyle.id = 'paper-buttons-style';
1111
+ buttonStyle.textContent = `
1112
+ .paper-card {
1113
+ background: rgba(15, 23, 42, 0.6);
1114
+ border-radius: 0.75rem;
1115
+ padding: 1.5rem;
1116
+ margin-bottom: 1.5rem;
1117
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
1118
+ border: 1px solid rgba(99, 102, 241, 0.1);
1119
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
1120
+ }
1121
+
1122
+ .paper-card:hover {
1123
+ transform: translateY(-5px);
1124
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
1125
+ }
1126
+
1127
+ .paper-actions {
1128
+ display: flex;
1129
+ justify-content: center;
1130
+ gap: 0.75rem;
1131
+ margin-top: 1.25rem;
1132
+ }
1133
+
1134
+ .paper-button {
1135
+ display: inline-flex;
1136
+ align-items: center;
1137
+ justify-content: center;
1138
+ padding: 0.75rem 1.5rem;
1139
+ border-radius: 0.5rem;
1140
+ font-weight: 600;
1141
+ font-size: 0.9rem;
1142
+ cursor: pointer;
1143
+ transition: all 0.2s ease;
1144
+ text-decoration: none;
1145
+ border: none;
1146
+ min-width: 100px;
1147
+ letter-spacing: 0.5px;
1148
+ }
1149
+
1150
+ .pdf-button {
1151
+ background: rgba(30, 41, 59, 0.8);
1152
+ color: #e2e8f0;
1153
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
1154
+ }
1155
+
1156
+ .pdf-button:hover {
1157
+ background: rgba(44, 55, 74, 0.9);
1158
+ transform: translateY(-2px);
1159
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
1160
+ }
1161
+
1162
+ .arxiv-button {
1163
+ background: rgba(99, 102, 241, 0.2);
1164
+ color: #e2e8f0;
1165
+ box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15);
1166
+ }
1167
+
1168
+ .arxiv-button:hover {
1169
+ background: rgba(99, 102, 241, 0.3);
1170
+ transform: translateY(-2px);
1171
+ box-shadow: 0 4px 8px rgba(99, 102, 241, 0.25);
1172
+ }
1173
+
1174
+ .analyze-button {
1175
+ background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
1176
+ color: white;
1177
+ box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
1178
+ }
1179
+
1180
+ .analyze-button:hover {
1181
+ transform: translateY(-2px);
1182
+ box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
1183
+ background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
1184
+ }
1185
+ `;
1186
+ document.head.appendChild(buttonStyle);
static/styles.css CHANGED
@@ -1,17 +1,19 @@
1
  :root {
2
- --primary-color: #e91e63;
3
- --primary-light: #f06292;
4
- --primary-dark: #c2185b;
5
- --secondary-color: #9c27b0;
6
- --background-color: #13111C;
7
- --card-background: #1E1B2E;
8
- --surface-light: rgba(30, 27, 46, 0.6);
9
- --surface-dark: rgba(19, 17, 28, 0.6);
 
10
  --text-primary: rgba(255, 255, 255, 0.95);
11
  --text-secondary: rgba(255, 255, 255, 0.7);
12
  --border-color: rgba(255, 255, 255, 0.08);
13
- --error-color: #ff4444;
14
- --success-color: #00C851;
 
15
  }
16
 
17
  /* Base Styles */
@@ -24,9 +26,10 @@
24
  body {
25
  background: var(--background-color);
26
  color: var(--text-primary);
27
- font-family: 'Space Grotesk', sans-serif;
28
  min-height: 100vh;
29
  line-height: 1.6;
 
30
  }
31
 
32
  /* Layout */
@@ -34,6 +37,9 @@ body {
34
  min-height: 100vh;
35
  display: flex;
36
  flex-direction: column;
 
 
 
37
  }
38
 
39
  /* Navigation */
@@ -41,493 +47,432 @@ body {
41
  display: flex;
42
  justify-content: space-between;
43
  align-items: center;
44
- padding: 1.2rem 2.5rem;
45
- background: rgba(30, 27, 46, 0.98);
46
- backdrop-filter: blur(10px);
 
 
 
 
 
47
  }
48
 
49
  .logo {
50
- color: var(--primary-color);
51
  font-size: 1.5rem;
52
- font-weight: 600;
53
- letter-spacing: 0.5px;
 
 
 
 
 
54
  }
55
 
56
  .nav-right {
57
  display: flex;
58
  align-items: center;
59
- gap: 2rem;
60
  }
61
 
62
  .user-info {
63
- color: rgba(255, 255, 255, 0.9);
64
- font-size: 0.95rem;
65
- letter-spacing: 0.3px;
66
  }
67
 
68
  .logout-button {
69
- color: var(--primary-color);
 
70
  text-decoration: none;
71
- font-size: 0.95rem;
 
 
72
  font-weight: 500;
73
- transition: all 0.3s ease;
 
74
  }
75
 
76
  .logout-button:hover {
77
- color: #ff4081;
 
78
  }
79
 
80
- /* Search Container */
81
- .search-container {
82
- width: 90%;
83
- max-width: 800px;
84
- margin: 3rem auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  display: flex;
86
  flex-direction: column;
87
- gap: 1.2rem;
88
  }
89
 
90
- /* Search Input Wrapper */
91
- .search-input-wrapper {
92
- width: 100%;
93
- background: rgba(30, 27, 46, 0.95);
94
- border-radius: 15px;
95
- padding: 1rem 1.5rem;
96
- border: 1px solid rgba(255, 255, 255, 0.08);
97
- transition: all 0.3s ease;
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
 
100
- .search-input-wrapper:focus-within {
101
- border-color: rgba(255, 255, 255, 0.15);
102
- box-shadow: 0 0 20px rgba(233, 30, 99, 0.1);
 
 
 
 
 
 
103
  }
104
 
105
- /* Search Input */
106
  .search-input {
107
- width: 100%;
108
- padding: 16px 24px;
109
- font-size: 1.1rem;
110
- background: rgba(255, 255, 255, 0.08);
111
- border: 2px solid rgba(255, 255, 255, 0.1);
112
- border-radius: 16px;
 
113
  color: var(--text-primary);
114
- transition: all 0.3s ease;
115
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
116
  }
117
 
118
  .search-input:focus {
119
  outline: none;
120
- border-color: var(--primary-color);
121
- background: rgba(255, 255, 255, 0.12);
122
- box-shadow: 0 8px 24px rgba(233, 30, 99, 0.15);
123
- transform: translateY(-1px);
124
  }
125
 
126
  .search-input::placeholder {
127
- color: rgba(255, 255, 255, 0.5);
128
- font-weight: 400;
129
- }
130
-
131
- /* Filters Row */
132
- .filters-row {
133
- display: flex;
134
- align-items: center;
135
- gap: 1rem;
136
- justify-content: space-between;
137
  }
138
 
139
- /* Filter Selects */
140
  .filter-select {
141
- background: rgba(30, 27, 46, 0.95);
142
- border: 1px solid rgba(255, 255, 255, 0.08);
143
- border-radius: 12px;
144
- color: rgba(255, 255, 255, 0.9);
145
- padding: 0.8rem 2.5rem 0.8rem 1.2rem;
146
- font-size: 0.95rem;
147
  cursor: pointer;
148
  outline: none;
149
- flex: 1;
150
  appearance: none;
151
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
152
  background-repeat: no-repeat;
153
  background-position: right 1rem center;
154
  background-size: 1em;
155
- transition: all 0.3s ease;
156
  }
157
 
158
- .filter-select:hover {
159
- border-color: rgba(255, 255, 255, 0.15);
160
- background-color: rgba(40, 37, 56, 0.98);
161
  }
162
 
163
- /* Search Button */
164
  .search-button {
165
- background: linear-gradient(135deg, #e91e63, #f06292);
166
  color: white;
167
  border: none;
168
- padding: 0.8rem 2.5rem;
169
- border-radius: 12px;
170
- font-size: 0.95rem;
171
- font-weight: 500;
172
  cursor: pointer;
173
- transition: all 0.3s ease;
174
  text-transform: uppercase;
175
  letter-spacing: 1px;
176
  min-width: 120px;
177
- box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
178
  }
179
 
180
  .search-button:hover {
181
  transform: translateY(-1px);
182
- box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
183
- background: linear-gradient(135deg, #ec407a, #f48fb1);
184
  }
185
 
186
  .search-button:active {
187
  transform: translateY(0);
188
- box-shadow: 0 2px 10px rgba(233, 30, 99, 0.2);
189
  }
190
 
191
- /* Results Section */
192
- .results-section {
193
- margin-top: 2rem;
194
- padding: 0 2rem;
 
 
195
  }
196
 
197
- /* Loading Overlay */
198
- .loading-overlay {
199
- position: fixed;
200
- top: 0;
201
- left: 0;
202
- right: 0;
203
- bottom: 0;
204
- background: rgba(13, 12, 20, 0.8);
205
- backdrop-filter: blur(5px);
206
  display: flex;
207
- justify-content: center;
208
- align-items: center;
209
- z-index: 1000;
 
 
210
  }
211
 
212
- .loading-overlay.hidden {
213
- display: none;
 
 
214
  }
215
 
216
- /* Responsive Design */
217
- @media (max-width: 768px) {
218
- .top-nav {
219
- padding: 1rem 1.5rem;
220
- }
221
-
222
- .search-container {
223
- margin: 2rem auto;
224
- }
225
-
226
- .filters-row {
227
- flex-direction: column;
228
- gap: 0.8rem;
229
- }
230
-
231
- .filter-select,
232
- .search-button {
233
- width: 100%;
234
- }
235
  }
236
 
237
- /* Main Content */
238
- .main-content {
239
  flex: 1;
240
- max-width: 1200px;
241
- margin: 0 auto;
242
- padding: 2rem;
243
- width: 100%;
244
- }
245
-
246
- /* Search Section */
247
- .search-section {
248
- margin: 2rem auto;
249
- max-width: 700px;
250
  }
251
 
252
- .results-container {
253
- padding: 2rem;
254
- max-width: 1200px;
255
- margin: 0 auto;
 
256
  }
257
 
258
- .results-count {
259
- color: var(--text-primary);
260
- font-size: 1.1rem;
261
- margin-bottom: 1.5rem;
262
- opacity: 0.8;
263
  }
264
 
 
265
  .results-grid {
266
  display: grid;
267
- grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
268
  gap: 1.5rem;
269
- padding: 2rem;
270
- max-width: 1400px;
271
- margin: 0 auto;
272
  }
273
 
274
  .paper-card {
275
  background: var(--card-background);
276
- border-radius: 15px;
277
  padding: 1.5rem;
278
  display: flex;
279
  flex-direction: column;
280
- gap: 1rem;
 
 
281
  height: 100%;
 
282
  }
283
 
284
  .paper-card:hover {
285
- transform: translateY(-2px);
286
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
 
287
  }
288
 
289
- .paper-meta {
290
  display: flex;
291
  justify-content: space-between;
292
  align-items: center;
293
- margin-bottom: 1rem;
294
- }
295
-
296
- .paper-date {
297
- color: var(--primary-color);
298
- font-size: 0.9rem;
299
- opacity: 0.9;
300
  }
301
 
302
  .paper-title {
303
- color: var(--text-primary);
304
- font-size: 1.5rem;
305
- line-height: 1.3;
306
- margin: 0;
307
  font-weight: 600;
 
 
 
308
  }
309
 
310
- .paper-author {
311
- color: var(--text-primary);
312
- font-size: 1rem;
313
- opacity: 0.9;
314
  }
315
 
316
  .paper-abstract {
317
- color: var(--text-primary);
318
- font-size: 0.95rem;
319
- line-height: 1.5;
320
- opacity: 0.7;
321
- margin: 0;
322
- display: -webkit-box;
323
- -webkit-line-clamp: 3;
324
- -webkit-box-orient: vertical;
325
- overflow: hidden;
326
  }
327
 
328
  .paper-actions {
329
  display: flex;
330
- gap: 12px;
331
- justify-content: space-between;
332
- align-items: center;
333
- margin-top: auto;
334
  }
335
 
336
- .action-button {
337
- flex: 1;
338
- padding: 12px 20px;
339
- border-radius: 12px;
340
- font-size: 0.95rem;
341
  font-weight: 600;
342
  cursor: pointer;
343
- transition: all 0.3s ease;
344
- text-transform: uppercase;
345
- letter-spacing: 0.5px;
346
  text-align: center;
347
  text-decoration: none;
 
348
  border: none;
 
349
  }
350
 
351
- .action-button.pdf-button {
352
- background: linear-gradient(135deg, #FF4B2B, #FF416C);
353
- color: white;
354
  }
355
 
356
- .action-button.arxiv-button {
357
- background: linear-gradient(135deg, #4A00E0, #8E2DE2);
358
- color: white;
 
359
  }
360
 
361
- .action-button.analyze {
362
- background: linear-gradient(135deg, #00B4DB, #0083B0);
363
- color: white;
364
  }
365
 
366
- .action-button:hover {
 
367
  transform: translateY(-2px);
368
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
369
- filter: brightness(110%);
370
  }
371
 
372
- .action-button:active {
373
- transform: translateY(0);
374
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
375
  }
376
 
377
- /* Add subtle glow effect on hover */
378
- .action-button.pdf-button:hover {
379
- box-shadow: 0 8px 20px rgba(255, 75, 43, 0.3);
 
380
  }
381
 
382
- .action-button.arxiv-button:hover {
383
- box-shadow: 0 8px 20px rgba(142, 45, 226, 0.3);
 
 
 
 
 
 
 
 
 
 
 
 
384
  }
385
 
386
- .action-button.analyze:hover {
387
- box-shadow: 0 8px 20px rgba(0, 180, 219, 0.3);
388
  }
389
 
390
- @media (max-width: 768px) {
391
- .paper-actions {
392
- flex-direction: column;
393
- gap: 8px;
394
- }
395
-
396
- .action-button {
397
- width: 100%;
398
- }
399
  }
400
 
401
- /* Analysis Section */
402
- .analysis-container {
403
- background: var(--card-background);
404
- border-radius: 10px;
405
- padding: 20px;
406
- margin-top: 20px;
407
  }
408
 
409
- .analysis-section {
410
- margin-bottom: 2rem;
 
411
  }
412
 
413
- .analysis-section h3 {
414
- margin-bottom: 1rem;
415
- color: var(--primary-color);
 
 
 
 
 
 
 
416
  }
417
 
418
- /* Analysis Section Tabs */
419
- .analysis-tabs {
420
  display: flex;
421
- gap: 0;
422
- padding: 1.5rem 2rem;
423
- background: rgba(19, 17, 28, 0.95);
424
- border-bottom: 1px solid rgba(255, 255, 255, 0.08);
425
- position: relative;
426
  }
427
 
428
- .tab-button {
429
- background: transparent;
430
- border: none;
431
- color: rgba(255, 255, 255, 0.6);
432
- padding: 1rem 2.5rem;
433
- font-size: 1rem;
434
- font-weight: 500;
435
  cursor: pointer;
436
- transition: all 0.3s ease;
437
- position: relative;
438
- text-transform: uppercase;
439
- letter-spacing: 1px;
440
- }
441
-
442
- .tab-button:hover {
443
- color: rgba(255, 255, 255, 0.9);
444
- }
445
-
446
- .tab-button.active {
447
- color: #E91E63;
448
- font-weight: 600;
449
- }
450
-
451
- .tab-button.active::after {
452
- content: '';
453
- position: absolute;
454
- bottom: -1px;
455
- left: 0;
456
- width: 100%;
457
- height: 2px;
458
- background: linear-gradient(90deg, #E91E63, #F06292);
459
- animation: slideIn 0.3s ease;
460
- }
461
-
462
- @keyframes slideIn {
463
- from {
464
- transform: scaleX(0);
465
- }
466
- to {
467
- transform: scaleX(1);
468
- }
469
- }
470
-
471
- /* Tab Content Container */
472
- .tab-content {
473
- display: none;
474
- opacity: 0;
475
- padding: 2rem;
476
- transition: all 0.3s ease;
477
- }
478
-
479
- .tab-content.active {
480
- display: block;
481
- opacity: 1;
482
- animation: fadeIn 0.4s ease;
483
- }
484
-
485
- @keyframes fadeIn {
486
- from {
487
- opacity: 0;
488
- transform: translateY(10px);
489
- }
490
- to {
491
- opacity: 1;
492
- transform: translateY(0);
493
- }
494
- }
495
-
496
- /* Paper Analysis Content */
497
- .paper-analysis {
498
- padding: 2rem;
499
- }
500
-
501
- .analysis-section {
502
- margin-bottom: 2.5rem;
503
- }
504
-
505
- .analysis-section h3 {
506
- color: var(--primary-color);
507
- font-size: 1.3rem;
508
- margin-bottom: 1rem;
509
- display: flex;
510
- align-items: center;
511
- gap: 0.8rem;
512
- }
513
-
514
- .analysis-section p {
515
- color: rgba(255, 255, 255, 0.9);
516
- line-height: 1.7;
517
- font-size: 1rem;
518
  }
519
 
520
- /* Chat Interface Styles */
521
- .chat-container {
522
- height: 600px;
523
- display: flex;
524
- flex-direction: column;
525
- background: var(--surface-dark);
526
- border-radius: 20px;
527
- border: 1px solid var(--border-color);
528
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
529
- margin: 2rem auto;
530
- overflow: hidden;
531
  }
532
 
533
  .chat-messages {
@@ -536,197 +481,105 @@ body {
536
  padding: 1.5rem;
537
  display: flex;
538
  flex-direction: column;
539
- gap: 1.5rem;
540
  }
541
 
542
  .message-wrapper {
543
  display: flex;
544
- gap: 1rem;
545
- align-items: flex-start;
546
- opacity: 0;
547
- transform: translateY(10px);
548
- animation: messageAppear 0.3s ease forwards;
549
- }
550
-
551
- @keyframes messageAppear {
552
- to {
553
- opacity: 1;
554
- transform: translateY(0);
555
- }
556
  }
557
 
558
  .message-avatar {
559
- width: 38px;
560
- height: 38px;
561
- border-radius: 12px;
562
  display: flex;
563
  align-items: center;
564
  justify-content: center;
565
- flex-shrink: 0;
566
  font-weight: 600;
567
- font-size: 0.9rem;
568
  }
569
 
570
- .user-avatar {
571
- background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
572
  color: white;
573
  }
574
 
575
- .ai-avatar {
576
- background: var(--surface-light);
577
- border: 1px solid var(--border-color);
578
- color: var(--text-primary);
579
  }
580
 
581
  .message {
582
- max-width: 85%;
583
- padding: 1.2rem 1.5rem;
584
- border-radius: 16px;
585
  line-height: 1.6;
586
- font-size: 0.95rem;
587
- letter-spacing: 0.2px;
588
- }
589
-
590
- .user-message {
591
- background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
592
- color: white;
593
- margin-left: auto;
594
- border-bottom-right-radius: 4px;
595
- box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
596
  }
597
 
598
  .ai-message {
599
- background: var(--surface-light);
600
  color: var(--text-primary);
601
- border: 1px solid var(--border-color);
602
- border-bottom-left-radius: 4px;
603
  }
604
 
605
- /* Markdown Styles in AI Messages */
606
- .ai-message h1,
607
- .ai-message h2,
608
- .ai-message h3 {
609
- margin-top: 1.2rem;
610
- margin-bottom: 0.8rem;
611
  color: var(--text-primary);
612
- font-weight: 600;
613
- }
614
-
615
- .ai-message h1 { font-size: 1.4rem; }
616
- .ai-message h2 { font-size: 1.2rem; }
617
- .ai-message h3 { font-size: 1.1rem; }
618
-
619
- .ai-message p {
620
- margin-bottom: 1rem;
621
- line-height: 1.7;
622
- }
623
-
624
- .ai-message ul,
625
- .ai-message ol {
626
- margin: 1rem 0;
627
- padding-left: 1.5rem;
628
- }
629
-
630
- .ai-message li {
631
- margin-bottom: 0.5rem;
632
- line-height: 1.6;
633
- }
634
-
635
- .ai-message strong {
636
- color: var(--primary-color);
637
- font-weight: 600;
638
- }
639
-
640
- .ai-message em {
641
- color: var(--text-secondary);
642
- font-style: italic;
643
- }
644
-
645
- .ai-message code {
646
- background: var(--surface-dark);
647
- padding: 0.2rem 0.4rem;
648
- border-radius: 4px;
649
- font-family: 'Fira Code', monospace;
650
- font-size: 0.9em;
651
- }
652
-
653
- .ai-message pre {
654
- background: var(--surface-dark);
655
- padding: 1rem;
656
- border-radius: 8px;
657
- overflow-x: auto;
658
- margin: 1rem 0;
659
- }
660
-
661
- .ai-message blockquote {
662
- border-left: 3px solid var(--primary-color);
663
- margin: 1rem 0;
664
- padding-left: 1rem;
665
- color: var(--text-secondary);
666
  }
667
 
668
- /* Chat Input Area */
669
  .chat-input-area {
670
- padding: 1.5rem;
671
- background: var(--surface-light);
672
- border-top: 1px solid var(--border-color);
673
  display: flex;
674
- gap: 1rem;
675
- align-items: center;
 
 
676
  }
677
 
678
  .chat-input {
679
  flex: 1;
680
- background: var(--surface-dark);
681
  border: 1px solid var(--border-color);
682
- border-radius: 12px;
683
- padding: 1rem 1.2rem;
684
  color: var(--text-primary);
685
- font-size: 0.95rem;
686
- font-family: 'Space Grotesk', sans-serif;
687
- transition: all 0.3s ease;
688
  }
689
 
690
  .chat-input:focus {
691
- border-color: var(--primary-color);
692
- box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.1);
693
  outline: none;
 
694
  }
695
 
696
  .chat-send-button {
697
- background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
698
  color: white;
699
  border: none;
700
- padding: 1rem 1.8rem;
701
- border-radius: 12px;
702
- font-weight: 500;
703
- cursor: pointer;
704
- transition: all 0.3s ease;
705
- text-transform: uppercase;
706
- letter-spacing: 1px;
707
  display: flex;
708
  align-items: center;
709
  gap: 0.5rem;
710
- font-family: 'Space Grotesk', sans-serif;
711
- box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
712
  }
713
 
714
  .chat-send-button:hover {
715
- transform: translateY(-2px);
716
- box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
717
- }
718
-
719
- .chat-send-button:active {
720
- transform: translateY(0);
721
  }
722
 
723
- /* AI Thinking Animation */
724
  .ai-thinking {
725
  display: flex;
726
  align-items: center;
727
- padding: 0.8rem 1.2rem;
728
- background: rgba(30, 27, 46, 0.4);
729
- border-radius: 12px;
730
  min-width: 80px;
731
  }
732
 
@@ -741,345 +594,139 @@ body {
741
  .ai-thinking-dot {
742
  width: 6px;
743
  height: 6px;
744
- background: var(--primary-color);
745
  border-radius: 50%;
746
  animation: thinking 1.4s infinite ease-in-out;
747
- opacity: 0.7;
748
  }
749
 
750
- /* Smoother animation for dots */
 
 
 
 
 
 
 
 
 
 
 
751
  @keyframes thinking {
752
- 0%, 80%, 100% {
753
  transform: scale(0.6);
754
  opacity: 0.3;
755
  }
756
- 40% {
757
  transform: scale(1);
758
- opacity: 0.8;
759
  }
760
  }
761
 
762
- /* Scrollbar Styling */
763
- .chat-messages::-webkit-scrollbar {
764
- width: 8px;
765
- }
766
-
767
- .chat-messages::-webkit-scrollbar-track {
768
- background: var(--surface-dark);
 
769
  }
770
 
771
- .chat-messages::-webkit-scrollbar-thumb {
772
- background: var(--surface-light);
773
- border-radius: 4px;
 
 
774
  }
775
 
776
- .chat-messages::-webkit-scrollbar-thumb:hover {
777
- background: rgba(255, 255, 255, 0.2);
 
 
 
778
  }
779
 
780
- /* Responsive Design */
781
- @media (max-width: 768px) {
782
- .chat-container {
783
- height: calc(100vh - 4rem);
784
- margin: 1rem;
785
- }
786
-
787
- .quick-questions {
788
- padding: 1rem;
789
- }
790
-
791
- .quick-question-btn {
792
- padding: 0.6rem 1rem;
793
- font-size: 0.85rem;
794
- }
795
-
796
- .message {
797
- max-width: 90%;
798
- padding: 1rem;
799
- }
800
-
801
- .chat-input-area {
802
- padding: 1rem;
803
- }
804
-
805
- .chat-send-button {
806
- padding: 0.8rem 1.2rem;
807
- }
808
-
809
- .paper-actions {
810
- flex-direction: column;
811
- gap: 8px;
812
- }
813
-
814
- .action-button {
815
- width: 100%;
816
- }
817
  }
818
 
819
- /* Breadcrumb Styles */
820
- .breadcrumb {
821
- padding: 1rem 2rem;
822
- background: var(--background-color);
823
- display: flex;
824
- align-items: center;
825
- gap: 1rem;
826
  }
827
 
828
- .back-button {
829
- background: transparent;
830
- border: none;
831
- color: var(--primary-color);
832
- cursor: pointer;
833
  display: flex;
834
  align-items: center;
835
  gap: 0.5rem;
836
- padding: 0.5rem 1rem;
837
- border-radius: 15px;
838
- transition: all 0.3s ease;
839
- }
840
-
841
- .back-button:hover {
842
- background: rgba(255, 255, 255, 0.05);
843
- }
844
-
845
- /* Content Sections */
846
- .content-section {
847
- display: none;
848
- padding: 2rem;
849
  }
850
 
851
- .content-section.active {
852
- display: block;
 
 
853
  }
854
 
855
- /* History and Saved Papers Grid */
856
  .history-grid, .saved-grid {
857
  display: grid;
858
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
859
- gap: 2rem;
860
- margin-top: 2rem;
861
- }
862
-
863
- /* Tab Styles */
864
- .tabs-container {
865
- background: transparent;
866
- padding: 0;
867
- margin-top: 0;
868
- }
869
-
870
- .tabs {
871
- display: flex;
872
- gap: 10px;
873
- margin-bottom: 20px;
874
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
875
- padding-bottom: 10px;
876
  }
877
 
878
- .tab-button {
879
- background: transparent;
880
- border: none;
881
- color: var(--text-primary);
882
- padding: 10px 20px;
883
- border-radius: 5px;
884
- cursor: pointer;
885
  transition: all 0.3s ease;
886
- opacity: 0.7;
887
  }
888
 
889
- .tab-button:hover {
890
- background: rgba(255, 255, 255, 0.1);
891
- opacity: 1;
 
892
  }
893
 
894
- .tab-button.active {
895
- background: var(--primary-color);
896
- opacity: 1;
 
 
897
  }
898
 
899
- .tab-content {
900
- display: none;
 
 
901
  }
902
 
903
- .tab-content.active {
904
- display: block;
905
- }
906
-
907
- /* Chat Styles */
908
- .chat-container {
909
- height: 500px;
910
- display: flex;
911
- flex-direction: column;
912
- }
913
-
914
- .chat-messages {
915
- flex: 1;
916
- overflow-y: auto;
917
- padding: 20px;
918
- display: flex;
919
- flex-direction: column;
920
- gap: 15px;
921
- }
922
-
923
- .chat-input-area {
924
- display: flex;
925
- gap: 10px;
926
- padding: 20px;
927
- border-top: 1px solid rgba(255, 255, 255, 0.1);
928
- }
929
-
930
- .chat-input-area input {
931
- flex: 1;
932
- background: rgba(255, 255, 255, 0.05);
933
- border: 1px solid rgba(255, 255, 255, 0.1);
934
- padding: 10px 15px;
935
- border-radius: 5px;
936
- color: var(--text-primary);
937
- }
938
-
939
- .chat-send-button {
940
- background: var(--primary-color);
941
- color: white;
942
- border: none;
943
- padding: 10px 20px;
944
- border-radius: 5px;
945
- cursor: pointer;
946
- transition: all 0.3s ease;
947
- }
948
-
949
- .chat-send-button:hover {
950
- transform: translateY(-2px);
951
- box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
952
- }
953
-
954
- /* Message Styles */
955
- .message {
956
- padding: 10px 15px;
957
- border-radius: 10px;
958
- max-width: 80%;
959
- }
960
-
961
- .user-message {
962
- background: var(--primary-color);
963
- align-self: flex-end;
964
- }
965
-
966
- .ai-message {
967
- background: var(--card-background);
968
- align-self: flex-start;
969
- }
970
-
971
- .loading {
972
- opacity: 0.7;
973
- }
974
-
975
- .error {
976
- background: var(--error-color);
977
- }
978
-
979
- /* Add these new styles for navigation */
980
- .analysis-navigation {
981
- display: flex;
982
- align-items: center;
983
- gap: 20px;
984
- margin-bottom: 20px;
985
- padding: 10px 0;
986
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
987
- }
988
-
989
- .back-to-results {
990
- background: transparent;
991
- border: none;
992
- color: var(--primary-color);
993
- padding: 8px 16px;
994
- border-radius: 20px;
995
- cursor: pointer;
996
- display: flex;
997
- align-items: center;
998
- gap: 8px;
999
- transition: all 0.3s ease;
1000
- font-size: 0.9rem;
1001
- }
1002
-
1003
- .back-to-results:hover {
1004
- background: rgba(233, 30, 99, 0.1);
1005
- transform: translateX(-2px);
1006
- }
1007
-
1008
- .current-paper-title {
1009
- font-size: 1.2rem;
1010
- color: var(--text-primary);
1011
- margin: 0;
1012
- flex: 1;
1013
- white-space: nowrap;
1014
- overflow: hidden;
1015
- text-overflow: ellipsis;
1016
- }
1017
-
1018
- /* Responsive adjustments */
1019
- @media (max-width: 768px) {
1020
- .analysis-navigation {
1021
- flex-direction: column;
1022
- align-items: flex-start;
1023
- gap: 10px;
1024
- }
1025
-
1026
- .current-paper-title {
1027
- font-size: 1rem;
1028
- }
1029
-
1030
- .back-to-results {
1031
- width: 100%;
1032
- justify-content: center;
1033
- }
1034
- }
1035
-
1036
- /* Saved Papers Styles */
1037
- .saved-paper-card {
1038
- background: var(--card-background);
1039
- border-radius: 12px;
1040
- padding: 20px;
1041
- margin-bottom: 20px;
1042
- transition: all 0.3s ease;
1043
- border: 1px solid rgba(255, 255, 255, 0.1);
1044
- }
1045
-
1046
- .saved-paper-card:hover {
1047
- transform: translateY(-2px);
1048
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
1049
- }
1050
-
1051
- .saved-date {
1052
- font-size: 0.8rem;
1053
- color: var(--primary-color);
1054
- margin-bottom: 10px;
1055
- opacity: 0.8;
1056
- }
1057
-
1058
- .empty-state {
1059
- text-align: center;
1060
- padding: 40px;
1061
- color: var(--text-primary);
1062
- }
1063
-
1064
- .empty-icon {
1065
- font-size: 3rem;
1066
- margin-bottom: 20px;
1067
- }
1068
-
1069
- /* Notification Styles */
1070
  .notification {
1071
  position: fixed;
1072
- bottom: 20px;
1073
- right: 20px;
1074
- padding: 12px 24px;
1075
- border-radius: 8px;
1076
  background: var(--card-background);
1077
  color: var(--text-primary);
1078
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
 
1079
  transform: translateY(100px);
1080
  opacity: 0;
1081
  transition: all 0.3s ease;
1082
  z-index: 1000;
 
1083
  }
1084
 
1085
  .notification.show {
@@ -1087,1192 +734,160 @@ body {
1087
  opacity: 1;
1088
  }
1089
 
1090
- .notification.success {
1091
- border-left: 4px solid #00C851;
1092
- }
1093
-
1094
- .notification.error {
1095
- border-left: 4px solid var(--error-color);
1096
- }
1097
-
1098
  .notification.info {
1099
- border-left: 4px solid #33b5e5;
1100
- }
1101
-
1102
- /* Action Button Styles */
1103
- .action-button.save {
1104
- background: #00C851;
1105
- color: white;
1106
  }
1107
 
1108
- .action-button.remove {
1109
- background: var(--error-color);
1110
- color: white;
1111
  }
1112
 
1113
- /* Saved Papers Grid */
1114
- .saved-grid {
1115
- display: grid;
1116
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
1117
- gap: 20px;
1118
- padding: 20px;
1119
  }
1120
 
 
1121
  @media (max-width: 768px) {
1122
- .saved-grid {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1123
  grid-template-columns: 1fr;
1124
  }
1125
 
1126
- .notification {
1127
- left: 20px;
1128
- right: 20px;
1129
- text-align: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1130
  }
1131
  }
1132
 
1133
- /* Updated Saved Papers Styles */
1134
- .section-title {
1135
- color: var(--text-primary);
1136
- font-size: 2rem;
1137
- margin: 2rem 0;
1138
- padding: 0 2rem;
1139
- }
1140
-
1141
- .results-grid {
1142
- display: grid;
1143
- grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
1144
- gap: 1.5rem;
1145
- padding: 2rem;
1146
- max-width: 1400px;
1147
- margin: 0 auto;
1148
- }
1149
-
1150
- .paper-card {
1151
- background: var(--card-background);
1152
- border-radius: 15px;
1153
- padding: 1.5rem;
1154
- display: flex;
1155
- flex-direction: column;
1156
- gap: 1rem;
1157
- height: 100%;
1158
- }
1159
-
1160
- .paper-date {
1161
- color: var(--primary-color);
1162
- font-size: 0.9rem;
1163
- opacity: 0.9;
1164
- }
1165
-
1166
- .paper-title {
1167
- color: var(--text-primary);
1168
- font-size: 1.5rem;
1169
- line-height: 1.3;
1170
- margin: 0;
1171
- font-weight: 600;
1172
  }
1173
 
1174
- .paper-author {
1175
- color: var(--text-primary);
1176
- font-size: 1rem;
1177
- opacity: 0.9;
1178
  }
1179
 
1180
- .paper-abstract {
1181
- color: var(--text-primary);
1182
- font-size: 0.95rem;
1183
- line-height: 1.5;
1184
- opacity: 0.7;
1185
- margin: 0;
1186
- display: -webkit-box;
1187
- -webkit-line-clamp: 3;
1188
- -webkit-box-orient: vertical;
1189
- overflow: hidden;
1190
  }
1191
 
1192
- .paper-actions {
1193
- margin-top: auto;
1194
- display: flex;
1195
- flex-direction: row;
1196
- gap: 12px;
1197
- justify-content: space-between;
1198
- align-items: center;
1199
  }
1200
 
1201
- .action-row {
1202
- display: flex;
1203
- gap: 1rem;
1204
- align-items: center;
1205
- justify-content: center;
1206
  }
1207
 
1208
- .save-row {
1209
- width: 100%;
 
1210
  }
1211
 
1212
- .action-button.remove {
1213
- width: 100%;
1214
- background: #ff4444;
1215
- color: white;
1216
- padding: 1rem;
1217
- border-radius: 12px;
1218
- font-weight: 600;
1219
- text-transform: uppercase;
1220
- border: none;
1221
- cursor: pointer;
1222
- transition: all 0.3s ease;
1223
  }
1224
 
1225
- .action-button.remove:hover {
1226
- background: #ff5555;
1227
- transform: translateY(-2px);
1228
- box-shadow: 0 4px 12px rgba(255, 68, 68, 0.2);
1229
  }
1230
 
1231
- .empty-state {
1232
- text-align: center;
1233
- padding: 4rem 2rem;
1234
- color: var(--text-primary);
1235
  }
1236
 
1237
- .empty-state .empty-icon {
1238
- font-size: 3rem;
1239
- margin-bottom: 1rem;
 
1240
  }
1241
 
1242
- .empty-state h3 {
1243
- font-size: 1.5rem;
1244
- margin-bottom: 0.5rem;
1245
  }
1246
 
1247
- .empty-state p {
1248
- color: var(--text-primary);
1249
- opacity: 0.7;
 
1250
  }
1251
 
1252
  /* Responsive adjustments */
1253
  @media (max-width: 768px) {
1254
- .results-grid {
1255
- grid-template-columns: 1fr;
1256
- padding: 1rem;
1257
- }
1258
-
1259
- .section-title {
1260
- font-size: 1.5rem;
1261
- margin: 1.5rem 0;
1262
- padding: 0 1rem;
1263
- }
1264
-
1265
- .paper-card {
1266
- padding: 1rem;
1267
- }
1268
-
1269
- .action-row {
1270
- flex-wrap: wrap;
1271
  }
1272
-
1273
- .action-button, .action-link {
1274
  width: 100%;
1275
- text-align: center;
1276
- }
1277
- }
1278
-
1279
- /* Add styles for back button and header */
1280
- .analysis-header {
1281
- margin: 2rem 0;
1282
- padding: 2rem;
1283
- background: rgba(30, 27, 46, 0.98);
1284
- border-radius: 15px;
1285
- border: 1px solid rgba(255, 255, 255, 0.08);
1286
- }
1287
-
1288
- .back-button {
1289
- display: flex;
1290
- align-items: center;
1291
- gap: 0.5rem;
1292
- background: none;
1293
- border: none;
1294
- color: #E91E63;
1295
- font-size: 1rem;
1296
- font-weight: 500;
1297
- cursor: pointer;
1298
- padding: 0.5rem 1rem;
1299
- border-radius: 6px;
1300
- transition: all 0.3s ease;
1301
- }
1302
-
1303
- .back-button:hover {
1304
- background: rgba(233, 30, 99, 0.1);
1305
- transform: translateX(-2px);
1306
- }
1307
-
1308
- .current-paper-title {
1309
- color: var(--text-primary);
1310
- font-size: 1.25rem;
1311
- margin: 0;
1312
- font-weight: 500;
1313
- flex: 1;
1314
- white-space: nowrap;
1315
- overflow: hidden;
1316
- text-overflow: ellipsis;
1317
- }
1318
-
1319
- /* Update analysis container styles */
1320
- .analysis-container {
1321
- padding: 2rem;
1322
- max-width: 1200px;
1323
- margin: 0 auto;
1324
- }
1325
-
1326
- /* Responsive styles */
1327
- @media (max-width: 768px) {
1328
- .analysis-header {
1329
- flex-direction: column;
1330
- align-items: flex-start;
1331
- gap: 1rem;
1332
- }
1333
-
1334
- .back-button {
1335
- width: 100%;
1336
- justify-content: center;
1337
- }
1338
-
1339
- .current-paper-title {
1340
- font-size: 1.1rem;
1341
- text-align: center;
1342
- width: 100%;
1343
- }
1344
- }
1345
-
1346
- /* Updated button styles */
1347
- .action-link {
1348
- background: none;
1349
- border: none;
1350
- color: #4A7DFF;
1351
- font-size: 0.95rem;
1352
- font-weight: 600;
1353
- padding: 12px 0;
1354
- cursor: pointer;
1355
- transition: all 0.2s ease;
1356
- text-transform: uppercase;
1357
- letter-spacing: 0.5px;
1358
- }
1359
-
1360
- .action-link:hover {
1361
- opacity: 0.8;
1362
- }
1363
-
1364
- .action-button {
1365
- border: none;
1366
- padding: 12px 24px;
1367
- border-radius: 12px;
1368
- font-size: 0.95rem;
1369
- font-weight: 600;
1370
- cursor: pointer;
1371
- transition: all 0.2s ease;
1372
- text-transform: uppercase;
1373
- letter-spacing: 0.5px;
1374
- width: auto;
1375
- text-align: center;
1376
- }
1377
-
1378
- .action-button.analyze {
1379
- background: #E91E63;
1380
- color: white;
1381
- min-width: 120px;
1382
- }
1383
-
1384
- .action-button.save {
1385
- background: #00C851;
1386
- color: white;
1387
- width: 100%;
1388
- padding: 16px;
1389
- font-size: 1rem;
1390
- border-radius: 14px;
1391
- margin-top: 8px;
1392
- }
1393
-
1394
- .paper-actions {
1395
- display: flex;
1396
- flex-direction: row;
1397
- margin-top: auto;
1398
- }
1399
-
1400
- .action-row {
1401
- display: flex;
1402
- align-items: center;
1403
- gap: 24px;
1404
- }
1405
-
1406
- .save-row {
1407
- display: flex;
1408
- width: 100%;
1409
- margin-top: 4px;
1410
- }
1411
-
1412
- /* Hover effects */
1413
- .action-button:hover {
1414
- transform: translateY(-1px);
1415
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1416
- }
1417
-
1418
- .action-button.analyze:hover {
1419
- background: #F0196B;
1420
- }
1421
-
1422
- .action-button.save:hover {
1423
- background: #00D455;
1424
- }
1425
-
1426
- /* Paper card adjustments */
1427
- .paper-card {
1428
- background: var(--card-background);
1429
- border-radius: 16px;
1430
- padding: 24px;
1431
- display: flex;
1432
- flex-direction: column;
1433
- gap: 16px;
1434
- min-height: 320px;
1435
- }
1436
-
1437
- /* Responsive adjustments */
1438
- @media (max-width: 768px) {
1439
- .action-row {
1440
- flex-wrap: wrap;
1441
- gap: 16px;
1442
- }
1443
-
1444
- .action-button {
1445
- width: 100%;
1446
- }
1447
-
1448
- .action-link {
1449
- text-align: center;
1450
- padding: 12px;
1451
- flex: 1;
1452
- }
1453
- }
1454
-
1455
- /* Add these new styles */
1456
- .action-button.remove {
1457
- background: #ff4444;
1458
- color: white;
1459
- width: 100%;
1460
- padding: 16px;
1461
- font-size: 1rem;
1462
- border-radius: 14px;
1463
- margin-top: 8px;
1464
- }
1465
-
1466
- .action-button.remove:hover {
1467
- background: #ff5555;
1468
- }
1469
-
1470
- .action-button.saved {
1471
- background: #666;
1472
- cursor: default;
1473
- }
1474
-
1475
- .action-button.saved:hover {
1476
- transform: none;
1477
- box-shadow: none;
1478
- }
1479
-
1480
- .empty-state {
1481
- text-align: center;
1482
- padding: 60px 20px;
1483
- color: var(--text-primary);
1484
- }
1485
-
1486
- .empty-state .empty-icon {
1487
- font-size: 48px;
1488
- margin-bottom: 20px;
1489
- }
1490
-
1491
- .empty-state h3 {
1492
- font-size: 24px;
1493
- margin-bottom: 10px;
1494
- }
1495
-
1496
- .empty-state p {
1497
- color: var(--text-primary);
1498
- opacity: 0.7;
1499
- }
1500
-
1501
- /* Notification styles */
1502
- .notification {
1503
- position: fixed;
1504
- bottom: 20px;
1505
- right: 20px;
1506
- padding: 12px 24px;
1507
- border-radius: 8px;
1508
- background: var(--card-background);
1509
- color: var(--text-primary);
1510
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
1511
- transform: translateY(100px);
1512
- opacity: 0;
1513
- transition: all 0.3s ease;
1514
- z-index: 1000;
1515
- }
1516
-
1517
- .notification.show {
1518
- transform: translateY(0);
1519
- opacity: 1;
1520
- }
1521
-
1522
- .notification.success {
1523
- border-left: 4px solid #00C851;
1524
- }
1525
-
1526
- .notification.error {
1527
- border-left: 4px solid #ff4444;
1528
- }
1529
-
1530
- .notification.info {
1531
- border-left: 4px solid #33b5e5;
1532
- }
1533
-
1534
- /* Updated saved papers grid styles */
1535
- .saved-papers-grid {
1536
- display: grid;
1537
- grid-template-columns: repeat(2, 1fr);
1538
- gap: 24px;
1539
- padding: 24px;
1540
- max-width: 1400px;
1541
- margin: 0 auto;
1542
- }
1543
-
1544
- .saved-paper-card {
1545
- background: var(--card-background);
1546
- border-radius: 16px;
1547
- padding: 24px;
1548
- display: flex;
1549
- flex-direction: column;
1550
- gap: 16px;
1551
- }
1552
-
1553
- .saved-date {
1554
- color: #E91E63;
1555
- font-size: 14px;
1556
- font-weight: 500;
1557
- }
1558
-
1559
- .paper-title {
1560
- color: var(--text-primary);
1561
- font-size: 24px;
1562
- line-height: 1.3;
1563
- margin: 0;
1564
- font-weight: 600;
1565
- }
1566
-
1567
- .paper-author {
1568
- color: var(--text-primary);
1569
- font-size: 16px;
1570
- opacity: 0.9;
1571
- }
1572
-
1573
- .paper-abstract {
1574
- color: var(--text-primary);
1575
- font-size: 15px;
1576
- line-height: 1.5;
1577
- opacity: 0.7;
1578
- margin: 0;
1579
- display: -webkit-box;
1580
- -webkit-line-clamp: 3;
1581
- -webkit-box-orient: vertical;
1582
- overflow: hidden;
1583
- }
1584
-
1585
- .paper-actions {
1586
- margin-top: auto;
1587
- display: flex;
1588
- flex-direction: row;
1589
- gap: 16px;
1590
- align-items: center;
1591
- }
1592
-
1593
- .action-row {
1594
- display: flex;
1595
- gap: 16px;
1596
- align-items: center;
1597
- }
1598
-
1599
- .action-link {
1600
- background: none;
1601
- border: none;
1602
- color: #4A7DFF;
1603
- font-size: 14px;
1604
- font-weight: 600;
1605
- padding: 0;
1606
- cursor: pointer;
1607
- transition: all 0.2s ease;
1608
- }
1609
-
1610
- .action-button {
1611
- border: none;
1612
- padding: 12px 24px;
1613
- border-radius: 12px;
1614
- font-size: 14px;
1615
- font-weight: 600;
1616
- cursor: pointer;
1617
- transition: all 0.2s ease;
1618
- }
1619
-
1620
- .action-button.analyze {
1621
- background: #E91E63;
1622
- color: white;
1623
- }
1624
-
1625
- .action-button.remove {
1626
- background: #ff4444;
1627
- color: white;
1628
- width: 100%;
1629
- padding: 16px;
1630
- }
1631
-
1632
- .save-row {
1633
- width: 100%;
1634
- }
1635
-
1636
- /* Responsive styles */
1637
- @media (max-width: 1024px) {
1638
- .saved-papers-grid {
1639
- grid-template-columns: 1fr;
1640
- padding: 16px;
1641
- }
1642
-
1643
- .saved-paper-card {
1644
- padding: 20px;
1645
- }
1646
-
1647
- .action-row {
1648
- flex-wrap: wrap;
1649
- gap: 12px;
1650
- }
1651
-
1652
- .action-button,
1653
- .action-link {
1654
- width: 100%;
1655
- text-align: center;
1656
- padding: 12px;
1657
- }
1658
- }
1659
-
1660
- /* Search History Styles */
1661
- .history-title {
1662
- color: var(--text-primary);
1663
- font-size: 32px;
1664
- font-weight: 600;
1665
- margin: 32px 24px 24px;
1666
- }
1667
-
1668
- .search-history-grid {
1669
- display: grid;
1670
- grid-template-columns: repeat(3, 1fr);
1671
- gap: 24px;
1672
- padding: 0 24px 24px;
1673
- max-width: 1400px;
1674
- margin: 0 auto;
1675
- }
1676
-
1677
- .history-item {
1678
- background: var(--card-background);
1679
- border-radius: 16px;
1680
- padding: 24px;
1681
- display: flex;
1682
- flex-direction: column;
1683
- gap: 12px;
1684
- }
1685
-
1686
- .search-term {
1687
- color: var(--text-primary);
1688
- font-size: 24px;
1689
- font-weight: 600;
1690
- margin: 0;
1691
- text-transform: uppercase;
1692
- }
1693
-
1694
- .search-date {
1695
- color: var(--text-primary);
1696
- font-size: 16px;
1697
- opacity: 0.7;
1698
- }
1699
-
1700
- .search-again-btn {
1701
- background: var(--background-color);
1702
- color: var(--text-primary);
1703
- border: none;
1704
- border-radius: 100px;
1705
- padding: 16px 24px;
1706
- font-size: 14px;
1707
- font-weight: 600;
1708
- cursor: pointer;
1709
- transition: all 0.2s ease;
1710
- text-transform: uppercase;
1711
- margin-top: auto;
1712
- }
1713
-
1714
- .search-again-btn:hover {
1715
- background: rgba(255, 255, 255, 0.1);
1716
- transform: translateY(-2px);
1717
- }
1718
-
1719
- /* Empty state */
1720
- .empty-history {
1721
- text-align: center;
1722
- padding: 48px 24px;
1723
- color: var(--text-primary);
1724
- }
1725
-
1726
- .empty-history h3 {
1727
- font-size: 24px;
1728
- margin-bottom: 12px;
1729
- }
1730
-
1731
- .empty-history p {
1732
- opacity: 0.7;
1733
- }
1734
-
1735
- /* Responsive styles */
1736
- @media (max-width: 1200px) {
1737
- .search-history-grid {
1738
- grid-template-columns: repeat(2, 1fr);
1739
- }
1740
- }
1741
-
1742
- @media (max-width: 768px) {
1743
- .search-history-grid {
1744
- grid-template-columns: 1fr;
1745
- padding: 0 16px 16px;
1746
- }
1747
-
1748
- .history-title {
1749
- font-size: 24px;
1750
- margin: 24px 16px 16px;
1751
- }
1752
-
1753
- .history-item {
1754
- padding: 20px;
1755
- }
1756
-
1757
- .search-term {
1758
- font-size: 20px;
1759
- }
1760
- }
1761
-
1762
- /* User Navigation Styles */
1763
- .user-nav {
1764
- display: flex;
1765
- align-items: center;
1766
- gap: 16px;
1767
- padding: 16px 24px;
1768
- position: absolute;
1769
- top: 0;
1770
- right: 0;
1771
- }
1772
-
1773
- .username {
1774
- color: var(--text-primary);
1775
- font-size: 16px;
1776
- font-weight: 400;
1777
- opacity: 0.9;
1778
- }
1779
-
1780
- .logout-button {
1781
- background: rgba(233, 30, 99, 0.1);
1782
- color: #E91E63;
1783
- text-decoration: none;
1784
- padding: 6px 16px;
1785
- border-radius: 8px;
1786
- font-size: 14px;
1787
- font-weight: 500;
1788
- transition: all 0.3s ease;
1789
- border: 1px solid rgba(233, 30, 99, 0.2);
1790
- }
1791
-
1792
- .logout-button:hover {
1793
- background: rgba(233, 30, 99, 0.2);
1794
- transform: translateY(-1px);
1795
- }
1796
-
1797
- /* Responsive adjustments */
1798
- @media (max-width: 768px) {
1799
- .user-nav {
1800
- padding: 12px 16px;
1801
- }
1802
-
1803
- .username {
1804
- font-size: 14px;
1805
- }
1806
-
1807
- .logout-button {
1808
- padding: 4px 12px;
1809
- font-size: 13px;
1810
- }
1811
- }
1812
-
1813
- /* Features Section Styles */
1814
- .features-section {
1815
- display: flex;
1816
- flex-direction: column;
1817
- gap: 24px;
1818
- padding: 32px;
1819
- max-width: 800px;
1820
- margin: 0 auto;
1821
- }
1822
-
1823
- .feature-card {
1824
- background: rgba(20, 22, 36, 0.7);
1825
- border-radius: 24px;
1826
- padding: 32px;
1827
- }
1828
-
1829
- .feature-icon {
1830
- font-size: 32px;
1831
- margin-bottom: 24px;
1832
- width: 48px;
1833
- height: 48px;
1834
- background: rgba(30, 33, 43, 0.8);
1835
- border-radius: 12px;
1836
- display: flex;
1837
- align-items: center;
1838
- justify-content: center;
1839
- }
1840
-
1841
- .feature-title {
1842
- color: #FFFFFF;
1843
- font-size: 32px;
1844
- font-weight: 600;
1845
- margin: 0 0 16px 0;
1846
- line-height: 1.2;
1847
- }
1848
-
1849
- .feature-description {
1850
- color: rgba(255, 255, 255, 0.6);
1851
- font-size: 20px;
1852
- line-height: 1.5;
1853
- margin: 0;
1854
- }
1855
-
1856
- /* Card-specific backgrounds */
1857
- .feature-card:nth-child(1) {
1858
- background: linear-gradient(145deg, rgba(20, 22, 36, 0.7), rgba(74, 125, 255, 0.1));
1859
- }
1860
-
1861
- .feature-card:nth-child(2) {
1862
- background: linear-gradient(145deg, rgba(20, 22, 36, 0.7), rgba(233, 30, 99, 0.1));
1863
- }
1864
-
1865
- .feature-card:nth-child(3) {
1866
- background: linear-gradient(145deg, rgba(20, 22, 36, 0.7), rgba(0, 200, 81, 0.1));
1867
- }
1868
-
1869
- /* Responsive styles */
1870
- @media (max-width: 768px) {
1871
- .features-section {
1872
- padding: 16px;
1873
- }
1874
-
1875
- .feature-card {
1876
- padding: 24px;
1877
- }
1878
-
1879
- .feature-title {
1880
- font-size: 28px;
1881
- }
1882
-
1883
- .feature-description {
1884
- font-size: 18px;
1885
- }
1886
-
1887
- .feature-icon {
1888
- font-size: 28px;
1889
- width: 40px;
1890
- height: 40px;
1891
- }
1892
- }
1893
-
1894
- /* Main Navigation Styles */
1895
- .main-nav {
1896
- background: rgba(30, 33, 43, 0.7);
1897
- backdrop-filter: blur(10px);
1898
- padding: 16px 24px;
1899
- position: sticky;
1900
- top: 0;
1901
- z-index: 100;
1902
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
1903
- }
1904
-
1905
- .nav-links {
1906
- display: flex;
1907
- gap: 32px;
1908
- max-width: 1200px;
1909
- margin: 0 auto;
1910
- }
1911
-
1912
- .nav-link {
1913
- color: rgba(255, 255, 255, 0.7);
1914
- text-decoration: none;
1915
- font-size: 16px;
1916
- font-weight: 500;
1917
- padding: 8px 16px;
1918
- border-radius: 8px;
1919
- transition: all 0.3s ease;
1920
- }
1921
-
1922
- .nav-link:hover {
1923
- color: #FFFFFF;
1924
- background: rgba(255, 255, 255, 0.1);
1925
- }
1926
-
1927
- .nav-link.active {
1928
- color: #FFFFFF;
1929
- background: rgba(233, 30, 99, 0.1);
1930
- position: relative;
1931
- }
1932
-
1933
- .nav-link.active::after {
1934
- content: '';
1935
- position: absolute;
1936
- bottom: -2px;
1937
- left: 50%;
1938
- transform: translateX(-50%);
1939
- width: 24px;
1940
- height: 2px;
1941
- background: #E91E63;
1942
- border-radius: 2px;
1943
- }
1944
-
1945
- /* Responsive styles */
1946
- @media (max-width: 768px) {
1947
- .main-nav {
1948
- padding: 12px 16px;
1949
- }
1950
-
1951
- .nav-links {
1952
- gap: 16px;
1953
  justify-content: center;
1954
  }
1955
-
1956
- .nav-link {
1957
- font-size: 14px;
1958
- padding: 6px 12px;
1959
- }
1960
- }
1961
-
1962
- /* Make sure these styles work with your existing layout */
1963
- .container {
1964
- padding-top: 24px;
1965
- }
1966
-
1967
- /* Update feature cards to work with new navigation */
1968
- .features-section {
1969
- margin-top: 32px;
1970
- }
1971
-
1972
- /* Update other sections to maintain spacing */
1973
- .search-history-grid,
1974
- .saved-papers-grid {
1975
- margin-top: 32px;
1976
- }
1977
-
1978
- /* Back to Search Link */
1979
- .back-to-search {
1980
- display: inline-flex;
1981
- align-items: center;
1982
- gap: 0.5rem;
1983
- color: var(--primary-color);
1984
- text-decoration: none;
1985
- padding: 0.5rem 1rem;
1986
- border-radius: 8px;
1987
- transition: all 0.3s ease;
1988
- margin-bottom: 1.5rem;
1989
- font-size: 0.95rem;
1990
- }
1991
-
1992
- .back-to-search:hover {
1993
- background: rgba(233, 30, 99, 0.1);
1994
- transform: translateX(-2px);
1995
- }
1996
-
1997
- /* Paper Title */
1998
- .paper-title {
1999
- font-size: 1.8rem;
2000
- font-weight: 600;
2001
- color: var(--text-primary);
2002
- margin: 1rem 0 2rem;
2003
- line-height: 1.4;
2004
- }
2005
-
2006
- /* Analysis and Chat Container */
2007
- .analysis-chat-container {
2008
- background: linear-gradient(145deg, rgba(30, 27, 46, 0.95), rgba(19, 17, 28, 0.95));
2009
- border-radius: 24px;
2010
- border: 1px solid rgba(255, 255, 255, 0.08);
2011
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
2012
- margin: 2rem auto;
2013
- max-width: 1200px;
2014
- overflow: hidden;
2015
- }
2016
-
2017
- /* Enhanced Tab Navigation */
2018
- .analysis-tabs {
2019
- display: flex;
2020
- padding: 1.5rem 1.5rem 0;
2021
- gap: 1rem;
2022
- background: transparent;
2023
- }
2024
-
2025
- .tab-button {
2026
- background: rgba(19, 17, 28, 0.6);
2027
- border: 1px solid rgba(255, 255, 255, 0.08);
2028
- color: rgba(255, 255, 255, 0.7);
2029
- padding: 1rem 2rem;
2030
- font-size: 0.95rem;
2031
- font-weight: 500;
2032
- cursor: pointer;
2033
- transition: all 0.3s ease;
2034
- border-radius: 12px 12px 0 0;
2035
- min-width: 160px;
2036
- }
2037
-
2038
- .tab-button:hover {
2039
- background: rgba(30, 27, 46, 0.8);
2040
- color: rgba(255, 255, 255, 0.9);
2041
- }
2042
-
2043
- .tab-button.active {
2044
- background: linear-gradient(135deg, var(--primary-color), #f06292);
2045
- color: white;
2046
- border: none;
2047
- box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
2048
- }
2049
-
2050
- /* Tab Content */
2051
- .tab-content {
2052
- padding: 2rem;
2053
- display: none;
2054
- opacity: 0;
2055
- transform: translateY(10px);
2056
- transition: all 0.3s ease;
2057
- background: rgba(19, 17, 28, 0.6);
2058
- margin: 0 1.5rem 1.5rem;
2059
- border-radius: 0 12px 12px 12px;
2060
- border: 1px solid rgba(255, 255, 255, 0.08);
2061
- }
2062
-
2063
- .tab-content.active {
2064
- display: block;
2065
- opacity: 1;
2066
- transform: translateY(0);
2067
- animation: fadeIn 0.4s ease;
2068
- }
2069
-
2070
- /* Analysis Section Styles */
2071
- .analysis-section {
2072
- margin-bottom: 2rem;
2073
- background: rgba(30, 27, 46, 0.4);
2074
- border-radius: 16px;
2075
- padding: 1.8rem;
2076
- border: 1px solid rgba(255, 255, 255, 0.05);
2077
- transition: all 0.3s ease;
2078
- }
2079
-
2080
- .analysis-section:hover {
2081
- background: rgba(30, 27, 46, 0.6);
2082
- transform: translateY(-2px);
2083
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
2084
- }
2085
-
2086
- .analysis-section:last-child {
2087
- margin-bottom: 0;
2088
- }
2089
-
2090
- .analysis-section h3 {
2091
- color: var(--primary-color);
2092
- font-size: 1.3rem;
2093
- margin-bottom: 1.2rem;
2094
- display: flex;
2095
- align-items: center;
2096
- gap: 0.8rem;
2097
- letter-spacing: 0.5px;
2098
- }
2099
-
2100
- .analysis-section p {
2101
- color: rgba(255, 255, 255, 0.9);
2102
- line-height: 1.8;
2103
- font-size: 1rem;
2104
- margin: 0;
2105
- letter-spacing: 0.2px;
2106
- }
2107
-
2108
- /* Enhanced Chat Interface */
2109
- .chat-container {
2110
- height: 600px;
2111
- display: flex;
2112
- flex-direction: column;
2113
- background: transparent;
2114
- }
2115
-
2116
- .chat-messages {
2117
- flex: 1;
2118
- overflow-y: auto;
2119
- padding: 1.5rem;
2120
- display: flex;
2121
- flex-direction: column;
2122
- gap: 1.2rem;
2123
- }
2124
-
2125
- .message {
2126
- max-width: 85%;
2127
- padding: 1.2rem 1.5rem;
2128
- border-radius: 16px;
2129
- line-height: 1.6;
2130
- font-size: 0.95rem;
2131
- letter-spacing: 0.2px;
2132
- }
2133
-
2134
- .user-message {
2135
- background: linear-gradient(135deg, var(--primary-color), #f06292);
2136
- color: white;
2137
- align-self: flex-end;
2138
- border-bottom-right-radius: 4px;
2139
- box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
2140
- }
2141
-
2142
- .ai-message {
2143
- background: rgba(30, 27, 46, 0.6);
2144
- color: rgba(255, 255, 255, 0.95);
2145
- align-self: flex-start;
2146
- border: 1px solid rgba(255, 255, 255, 0.08);
2147
- border-bottom-left-radius: 4px;
2148
- }
2149
-
2150
- .chat-input-area {
2151
- padding: 1.5rem;
2152
- background: rgba(19, 17, 28, 0.4);
2153
- border-top: 1px solid rgba(255, 255, 255, 0.08);
2154
- display: flex;
2155
- gap: 1rem;
2156
- align-items: center;
2157
- }
2158
-
2159
- .chat-input {
2160
- flex: 1;
2161
- background: rgba(30, 27, 46, 0.95);
2162
- border: 1px solid rgba(255, 255, 255, 0.08);
2163
- border-radius: 12px;
2164
- padding: 1rem 1.2rem;
2165
- color: white;
2166
- font-size: 0.95rem;
2167
- transition: all 0.3s ease;
2168
- }
2169
-
2170
- .chat-input:focus {
2171
- border-color: var(--primary-color);
2172
- box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.1);
2173
- background: rgba(30, 27, 46, 0.8);
2174
- outline: none;
2175
- }
2176
-
2177
- .chat-send-button {
2178
- background: linear-gradient(135deg, #E91E63, #f06292);
2179
- color: white;
2180
- border: none;
2181
- padding: 1rem 1.8rem;
2182
- border-radius: 12px;
2183
- font-weight: 500;
2184
- cursor: pointer;
2185
- transition: all 0.3s ease;
2186
- text-transform: uppercase;
2187
- letter-spacing: 1px;
2188
- display: flex;
2189
- align-items: center;
2190
- gap: 0.5rem;
2191
- font-family: 'Space Grotesk', sans-serif;
2192
- box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
2193
- }
2194
-
2195
- .chat-send-button:hover {
2196
- transform: translateY(-2px);
2197
- box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
2198
- }
2199
-
2200
- .chat-send-button:active {
2201
- transform: translateY(0);
2202
- }
2203
-
2204
- /* Quick Questions Section */
2205
- .quick-questions {
2206
- padding: 1rem 1.5rem;
2207
- border-bottom: 1px solid rgba(255, 255, 255, 0.08);
2208
- display: flex;
2209
- gap: 0.8rem;
2210
- flex-wrap: wrap;
2211
- }
2212
-
2213
- .quick-question-btn {
2214
- background: rgba(30, 27, 46, 0.6);
2215
- border: 1px solid rgba(255, 255, 255, 0.08);
2216
- color: rgba(255, 255, 255, 0.9);
2217
- padding: 0.8rem 1.2rem;
2218
- border-radius: 20px;
2219
- font-size: 0.9rem;
2220
- cursor: pointer;
2221
- transition: all 0.3s ease;
2222
- white-space: nowrap;
2223
- }
2224
-
2225
- .quick-question-btn:hover {
2226
- background: rgba(233, 30, 99, 0.1);
2227
- border-color: rgba(233, 30, 99, 0.3);
2228
- color: #E91E63;
2229
- transform: translateY(-1px);
2230
- }
2231
-
2232
- .quick-question-btn:active {
2233
- transform: translateY(0);
2234
- }
2235
-
2236
- /* AI Thinking Indicator */
2237
- .thinking-indicator {
2238
- opacity: 0.7;
2239
- transition: all 0.3s ease;
2240
- }
2241
-
2242
- .ai-thinking {
2243
- display: flex;
2244
- align-items: center;
2245
- padding: 0.8rem 1.2rem;
2246
- background: rgba(30, 27, 46, 0.4);
2247
- border-radius: 12px;
2248
- min-width: 80px;
2249
- }
2250
-
2251
- .ai-thinking-dots {
2252
- display: flex;
2253
- gap: 4px;
2254
- justify-content: center;
2255
- align-items: center;
2256
- height: 24px;
2257
- }
2258
-
2259
- .ai-thinking-dot {
2260
- width: 6px;
2261
- height: 6px;
2262
- background: var(--primary-color);
2263
- border-radius: 50%;
2264
- animation: thinking 1.4s infinite ease-in-out;
2265
- opacity: 0.7;
2266
- }
2267
-
2268
- /* Smoother animation for dots */
2269
- @keyframes thinking {
2270
- 0%, 80%, 100% {
2271
- transform: scale(0.6);
2272
- opacity: 0.3;
2273
- }
2274
- 40% {
2275
- transform: scale(1);
2276
- opacity: 0.8;
2277
- }
2278
  }
 
1
  :root {
2
+ --primary-color: #6366f1;
3
+ --primary-light: #818cf8;
4
+ --primary-dark: #4f46e5;
5
+ --secondary-color: #10b981;
6
+ --accent-color: #f59e0b;
7
+ --background-color: #0f172a;
8
+ --card-background: #1e293b;
9
+ --surface-light: rgba(30, 41, 59, 0.7);
10
+ --surface-dark: rgba(15, 23, 42, 0.7);
11
  --text-primary: rgba(255, 255, 255, 0.95);
12
  --text-secondary: rgba(255, 255, 255, 0.7);
13
  --border-color: rgba(255, 255, 255, 0.08);
14
+ --error-color: #ef4444;
15
+ --success-color: #10b981;
16
+ --shadow-color: rgba(0, 0, 0, 0.25);
17
  }
18
 
19
  /* Base Styles */
 
26
  body {
27
  background: var(--background-color);
28
  color: var(--text-primary);
29
+ font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
30
  min-height: 100vh;
31
  line-height: 1.6;
32
+ font-size: 16px;
33
  }
34
 
35
  /* Layout */
 
37
  min-height: 100vh;
38
  display: flex;
39
  flex-direction: column;
40
+ max-width: 1440px;
41
+ margin: 0 auto;
42
+ padding: 0 1rem;
43
  }
44
 
45
  /* Navigation */
 
47
  display: flex;
48
  justify-content: space-between;
49
  align-items: center;
50
+ padding: 1.25rem 0;
51
+ border-bottom: 1px solid var(--border-color);
52
+ margin-bottom: 1.5rem;
53
+ }
54
+
55
+ .nav-left {
56
+ display: flex;
57
+ align-items: center;
58
  }
59
 
60
  .logo {
 
61
  font-size: 1.5rem;
62
+ font-weight: 700;
63
+ color: var(--primary-light);
64
+ margin: 0;
65
+ background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
66
+ -webkit-background-clip: text;
67
+ -webkit-text-fill-color: transparent;
68
+ letter-spacing: -0.5px;
69
  }
70
 
71
  .nav-right {
72
  display: flex;
73
  align-items: center;
74
+ gap: 1rem;
75
  }
76
 
77
  .user-info {
78
+ font-size: 0.9rem;
79
+ color: var(--text-secondary);
 
80
  }
81
 
82
  .logout-button {
83
+ background: rgba(99, 102, 241, 0.1);
84
+ color: var(--primary-light);
85
  text-decoration: none;
86
+ padding: 0.5rem 1rem;
87
+ border-radius: 0.5rem;
88
+ font-size: 0.875rem;
89
  font-weight: 500;
90
+ transition: all 0.2s ease;
91
+ border: 1px solid rgba(99, 102, 241, 0.2);
92
  }
93
 
94
  .logout-button:hover {
95
+ background: rgba(99, 102, 241, 0.2);
96
+ transform: translateY(-1px);
97
  }
98
 
99
+ /* Breadcrumb */
100
+ .breadcrumb {
101
+ display: flex;
102
+ align-items: center;
103
+ gap: 1rem;
104
+ margin-bottom: 1.5rem;
105
+ font-size: 0.9rem;
106
+ }
107
+
108
+ #currentSection {
109
+ font-weight: 600;
110
+ color: var(--text-primary);
111
+ }
112
+
113
+ .back-button {
114
+ background: transparent;
115
+ border: none;
116
+ color: var(--primary-light);
117
+ cursor: pointer;
118
+ font-size: 0.9rem;
119
+ display: flex;
120
+ align-items: center;
121
+ gap: 0.25rem;
122
+ padding: 0.25rem 0.5rem;
123
+ border-radius: 0.25rem;
124
+ transition: all 0.2s ease;
125
+ }
126
+
127
+ .back-button:hover {
128
+ background: rgba(99, 102, 241, 0.1);
129
+ }
130
+
131
+ /* Main Content */
132
+ .main-content {
133
+ flex: 1;
134
  display: flex;
135
  flex-direction: column;
 
136
  }
137
 
138
+ .content-section {
139
+ display: none;
140
+ }
141
+
142
+ .content-section.active {
143
+ display: block;
144
+ animation: fadeIn 0.3s ease;
145
+ }
146
+
147
+ @keyframes fadeIn {
148
+ from { opacity: 0; }
149
+ to { opacity: 1; }
150
+ }
151
+
152
+ /* Search Section */
153
+ .search-section {
154
+ display: flex;
155
+ flex-direction: column;
156
+ gap: 2rem;
157
+ margin-bottom: 2rem;
158
  }
159
 
160
+ .search-container {
161
+ display: flex;
162
+ flex-wrap: wrap;
163
+ gap: 1rem;
164
+ align-items: center;
165
+ background: var(--card-background);
166
+ padding: 1.5rem;
167
+ border-radius: 1rem;
168
+ box-shadow: 0 4px 20px var(--shadow-color);
169
  }
170
 
 
171
  .search-input {
172
+ flex: 1;
173
+ min-width: 250px;
174
+ background: rgba(15, 23, 42, 0.5);
175
+ border: 1px solid var(--border-color);
176
+ border-radius: 0.5rem;
177
+ padding: 0.875rem 1.25rem;
178
+ font-size: 1rem;
179
  color: var(--text-primary);
180
+ transition: all 0.2s ease;
 
181
  }
182
 
183
  .search-input:focus {
184
  outline: none;
185
+ border-color: var(--primary-light);
186
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
 
 
187
  }
188
 
189
  .search-input::placeholder {
190
+ color: var(--text-secondary);
191
+ opacity: 0.7;
 
 
 
 
 
 
 
 
192
  }
193
 
 
194
  .filter-select {
195
+ background: rgba(15, 23, 42, 0.5);
196
+ border: 1px solid var(--border-color);
197
+ border-radius: 0.5rem;
198
+ color: var(--text-primary);
199
+ padding: 0.875rem 2.5rem 0.875rem 1.25rem;
200
+ font-size: 0.9rem;
201
  cursor: pointer;
202
  outline: none;
203
+ min-width: 140px;
204
  appearance: none;
205
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
206
  background-repeat: no-repeat;
207
  background-position: right 1rem center;
208
  background-size: 1em;
209
+ transition: all 0.2s ease;
210
  }
211
 
212
+ .filter-select:hover, .filter-select:focus {
213
+ border-color: var(--primary-light);
 
214
  }
215
 
 
216
  .search-button {
217
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
218
  color: white;
219
  border: none;
220
+ padding: 0.875rem 1.5rem;
221
+ border-radius: 0.5rem;
222
+ font-size: 0.9rem;
223
+ font-weight: 600;
224
  cursor: pointer;
225
+ transition: all 0.2s ease;
226
  text-transform: uppercase;
227
  letter-spacing: 1px;
228
  min-width: 120px;
229
+ box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
230
  }
231
 
232
  .search-button:hover {
233
  transform: translateY(-1px);
234
+ box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
 
235
  }
236
 
237
  .search-button:active {
238
  transform: translateY(0);
239
+ box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
240
  }
241
 
242
+ /* Feature Cards */
243
+ .features-grid {
244
+ display: grid;
245
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
246
+ gap: 1.5rem;
247
+ margin-top: 1rem;
248
  }
249
 
250
+ .feature-card {
251
+ background: var(--card-background);
252
+ border-radius: 1rem;
253
+ padding: 1.5rem;
 
 
 
 
 
254
  display: flex;
255
+ align-items: flex-start;
256
+ gap: 1rem;
257
+ transition: all 0.3s ease;
258
+ border: 1px solid var(--border-color);
259
+ margin-bottom: 1rem;
260
  }
261
 
262
+ .feature-card:hover {
263
+ transform: translateY(-5px);
264
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
265
+ border-color: var(--primary-light);
266
  }
267
 
268
+ .feature-icon {
269
+ font-size: 1.75rem;
270
+ background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
271
+ -webkit-background-clip: text;
272
+ -webkit-text-fill-color: transparent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  }
274
 
275
+ .feature-content {
 
276
  flex: 1;
 
 
 
 
 
 
 
 
 
 
277
  }
278
 
279
+ .feature-title {
280
+ font-size: 1.25rem;
281
+ font-weight: 600;
282
+ margin-bottom: 0.5rem;
283
+ color: var(--text-primary);
284
  }
285
 
286
+ .feature-description {
287
+ font-size: 0.9rem;
288
+ color: var(--text-secondary);
289
+ line-height: 1.5;
 
290
  }
291
 
292
+ /* Results Section */
293
  .results-grid {
294
  display: grid;
295
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
296
  gap: 1.5rem;
297
+ margin-top: 1.5rem;
 
 
298
  }
299
 
300
  .paper-card {
301
  background: var(--card-background);
302
+ border-radius: 1rem;
303
  padding: 1.5rem;
304
  display: flex;
305
  flex-direction: column;
306
+ gap: 0.75rem;
307
+ transition: all 0.3s ease;
308
+ border: 1px solid var(--border-color);
309
  height: 100%;
310
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
311
  }
312
 
313
  .paper-card:hover {
314
+ transform: translateY(-5px);
315
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
316
+ border-color: var(--primary-light);
317
  }
318
 
319
+ .paper-header {
320
  display: flex;
321
  justify-content: space-between;
322
  align-items: center;
323
+ margin-bottom: 0.25rem;
 
 
 
 
 
 
324
  }
325
 
326
  .paper-title {
327
+ font-size: 1.25rem;
 
 
 
328
  font-weight: 600;
329
+ line-height: 1.4;
330
+ color: var(--text-primary);
331
+ margin-bottom: 0.5rem;
332
  }
333
 
334
+ .paper-authors {
335
+ font-size: 0.9rem;
336
+ color: var(--text-secondary);
337
+ margin-bottom: 0.5rem;
338
  }
339
 
340
  .paper-abstract {
341
+ font-size: 0.9rem;
342
+ line-height: 1.6;
343
+ color: var(--text-secondary);
344
+ flex-grow: 1;
 
 
 
 
 
345
  }
346
 
347
  .paper-actions {
348
  display: flex;
349
+ gap: 0.75rem;
350
+ margin-top: 1rem;
 
 
351
  }
352
 
353
+ .paper-button {
354
+ padding: 0.75rem 1rem;
355
+ border-radius: 0.5rem;
356
+ font-size: 0.85rem;
 
357
  font-weight: 600;
358
  cursor: pointer;
359
+ transition: all 0.2s ease;
 
 
360
  text-align: center;
361
  text-decoration: none;
362
+ flex: 1;
363
  border: none;
364
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
365
  }
366
 
367
+ .pdf-button {
368
+ background: rgba(30, 41, 59, 0.8);
369
+ color: #e2e8f0;
370
  }
371
 
372
+ .pdf-button:hover {
373
+ background: rgba(44, 55, 74, 0.9);
374
+ transform: translateY(-2px);
375
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
376
  }
377
 
378
+ .arxiv-button {
379
+ background: rgba(99, 102, 241, 0.2);
380
+ color: #e2e8f0;
381
  }
382
 
383
+ .arxiv-button:hover {
384
+ background: rgba(99, 102, 241, 0.3);
385
  transform: translateY(-2px);
386
+ box-shadow: 0 4px 8px rgba(99, 102, 241, 0.25);
 
387
  }
388
 
389
+ .analyze-button {
390
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
391
+ color: white;
392
  }
393
 
394
+ .analyze-button:hover {
395
+ transform: translateY(-2px);
396
+ box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
397
+ background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
398
  }
399
 
400
+ /* Loading Overlay */
401
+ .loading-overlay {
402
+ position: fixed;
403
+ top: 0;
404
+ left: 0;
405
+ width: 100%;
406
+ height: 100%;
407
+ background: rgba(15, 23, 42, 0.9);
408
+ display: flex;
409
+ flex-direction: column;
410
+ justify-content: center;
411
+ align-items: center;
412
+ z-index: 1000;
413
+ backdrop-filter: blur(5px);
414
  }
415
 
416
+ .loading-overlay.hidden {
417
+ display: none;
418
  }
419
 
420
+ .loading-spinner {
421
+ width: 50px;
422
+ height: 50px;
423
+ border: 3px solid rgba(255, 255, 255, 0.1);
424
+ border-radius: 50%;
425
+ border-top-color: var(--primary-light);
426
+ animation: spin 1s linear infinite;
427
+ margin-bottom: 1rem;
 
428
  }
429
 
430
+ .loading-overlay p {
431
+ color: var(--text-primary);
432
+ font-size: 1rem;
433
+ font-weight: 500;
 
 
434
  }
435
 
436
+ @keyframes spin {
437
+ 0% { transform: rotate(0deg); }
438
+ 100% { transform: rotate(360deg); }
439
  }
440
 
441
+ /* Chat Interface */
442
+ .chat-container {
443
+ height: 500px;
444
+ display: flex;
445
+ flex-direction: column;
446
+ background: var(--card-background);
447
+ border-radius: 1rem;
448
+ overflow: hidden;
449
+ border: 1px solid var(--border-color);
450
+ box-shadow: 0 4px 20px var(--shadow-color);
451
  }
452
 
453
+ .quick-questions {
 
454
  display: flex;
455
+ flex-wrap: wrap;
456
+ gap: 0.5rem;
457
+ padding: 1rem;
458
+ background: rgba(15, 23, 42, 0.5);
459
+ border-bottom: 1px solid var(--border-color);
460
  }
461
 
462
+ .quick-question-btn {
463
+ background: rgba(99, 102, 241, 0.1);
464
+ border: 1px solid rgba(99, 102, 241, 0.2);
465
+ color: var(--primary-light);
466
+ padding: 0.5rem 1rem;
467
+ border-radius: 2rem;
468
+ font-size: 0.8rem;
469
  cursor: pointer;
470
+ transition: all 0.2s ease;
471
+ white-space: nowrap;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  }
473
 
474
+ .quick-question-btn:hover {
475
+ background: rgba(99, 102, 241, 0.2);
 
 
 
 
 
 
 
 
 
476
  }
477
 
478
  .chat-messages {
 
481
  padding: 1.5rem;
482
  display: flex;
483
  flex-direction: column;
484
+ gap: 1rem;
485
  }
486
 
487
  .message-wrapper {
488
  display: flex;
489
+ gap: 0.75rem;
490
+ max-width: 85%;
 
 
 
 
 
 
 
 
 
 
491
  }
492
 
493
  .message-avatar {
494
+ width: 2rem;
495
+ height: 2rem;
496
+ border-radius: 50%;
497
  display: flex;
498
  align-items: center;
499
  justify-content: center;
500
+ font-size: 0.8rem;
501
  font-weight: 600;
502
+ flex-shrink: 0;
503
  }
504
 
505
+ .ai-avatar {
506
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
507
  color: white;
508
  }
509
 
510
+ .user-avatar {
511
+ background: linear-gradient(135deg, var(--secondary-color), #059669);
512
+ color: white;
 
513
  }
514
 
515
  .message {
516
+ padding: 1rem;
517
+ border-radius: 0.75rem;
518
+ font-size: 0.9rem;
519
  line-height: 1.6;
 
 
 
 
 
 
 
 
 
 
520
  }
521
 
522
  .ai-message {
523
+ background: rgba(15, 23, 42, 0.5);
524
  color: var(--text-primary);
525
+ border-bottom-left-radius: 0.25rem;
526
+ align-self: flex-start;
527
  }
528
 
529
+ .user-message {
530
+ background: rgba(99, 102, 241, 0.1);
 
 
 
 
531
  color: var(--text-primary);
532
+ border-bottom-right-radius: 0.25rem;
533
+ align-self: flex-end;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
534
  }
535
 
 
536
  .chat-input-area {
 
 
 
537
  display: flex;
538
+ gap: 0.75rem;
539
+ padding: 1rem;
540
+ background: rgba(15, 23, 42, 0.5);
541
+ border-top: 1px solid var(--border-color);
542
  }
543
 
544
  .chat-input {
545
  flex: 1;
546
+ background: rgba(15, 23, 42, 0.5);
547
  border: 1px solid var(--border-color);
548
+ border-radius: 0.5rem;
549
+ padding: 0.75rem 1rem;
550
  color: var(--text-primary);
551
+ font-size: 0.9rem;
 
 
552
  }
553
 
554
  .chat-input:focus {
 
 
555
  outline: none;
556
+ border-color: var(--primary-light);
557
  }
558
 
559
  .chat-send-button {
560
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
561
  color: white;
562
  border: none;
563
+ border-radius: 0.5rem;
564
+ padding: 0.75rem 1rem;
 
 
 
 
 
565
  display: flex;
566
  align-items: center;
567
  gap: 0.5rem;
568
+ cursor: pointer;
569
+ transition: all 0.2s ease;
570
  }
571
 
572
  .chat-send-button:hover {
573
+ transform: translateY(-1px);
574
+ box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
 
 
 
 
575
  }
576
 
 
577
  .ai-thinking {
578
  display: flex;
579
  align-items: center;
580
+ padding: 0.75rem 1rem;
581
+ background: rgba(15, 23, 42, 0.3);
582
+ border-radius: 0.75rem;
583
  min-width: 80px;
584
  }
585
 
 
594
  .ai-thinking-dot {
595
  width: 6px;
596
  height: 6px;
597
+ background: var(--primary-light);
598
  border-radius: 50%;
599
  animation: thinking 1.4s infinite ease-in-out;
 
600
  }
601
 
602
+ .ai-thinking-dot:nth-child(1) {
603
+ animation-delay: 0s;
604
+ }
605
+
606
+ .ai-thinking-dot:nth-child(2) {
607
+ animation-delay: 0.2s;
608
+ }
609
+
610
+ .ai-thinking-dot:nth-child(3) {
611
+ animation-delay: 0.4s;
612
+ }
613
+
614
  @keyframes thinking {
615
+ 0%, 60%, 100% {
616
  transform: scale(0.6);
617
  opacity: 0.3;
618
  }
619
+ 30% {
620
  transform: scale(1);
621
+ opacity: 1;
622
  }
623
  }
624
 
625
+ /* Analysis Styles */
626
+ .analysis-container {
627
+ background: var(--card-background);
628
+ border-radius: 1rem;
629
+ padding: 2rem;
630
+ margin-top: 1.5rem;
631
+ border: 1px solid var(--border-color);
632
+ box-shadow: 0 4px 20px var(--shadow-color);
633
  }
634
 
635
+ .analysis-header {
636
+ margin-bottom: 2rem;
637
+ padding-bottom: 1rem;
638
+ border-bottom: 1px solid var(--border-color);
639
+ text-align: center;
640
  }
641
 
642
+ .analysis-header h2 {
643
+ font-size: 1.5rem;
644
+ font-weight: 700;
645
+ color: var(--primary-light);
646
+ margin-bottom: 0.5rem;
647
  }
648
 
649
+ .analysis-section {
650
+ margin-bottom: 1.5rem;
651
+ padding: 1.5rem;
652
+ background: rgba(15, 23, 42, 0.3);
653
+ border-radius: 0.75rem;
654
+ border: 1px solid var(--border-color);
655
+ transition: all 0.3s ease;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
656
  }
657
 
658
+ .analysis-section:hover {
659
+ transform: translateY(-2px);
660
+ box-shadow: 0 4px 15px var(--shadow-color);
661
+ border-color: var(--primary-light);
 
 
 
662
  }
663
 
664
+ .analysis-section h3 {
665
+ font-size: 1.25rem;
666
+ font-weight: 600;
667
+ margin-bottom: 1rem;
668
+ color: var(--text-primary);
669
  display: flex;
670
  align-items: center;
671
  gap: 0.5rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
672
  }
673
 
674
+ .analysis-section p {
675
+ font-size: 0.95rem;
676
+ line-height: 1.7;
677
+ color: var(--text-secondary);
678
  }
679
 
680
+ /* History Section */
681
  .history-grid, .saved-grid {
682
  display: grid;
683
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
684
+ gap: 1.5rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  }
686
 
687
+ .history-card {
688
+ background: var(--card-background);
689
+ border-radius: 1rem;
690
+ padding: 1.5rem;
691
+ border: 1px solid var(--border-color);
 
 
692
  transition: all 0.3s ease;
 
693
  }
694
 
695
+ .history-card:hover {
696
+ transform: translateY(-5px);
697
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
698
+ border-color: var(--primary-light);
699
  }
700
 
701
+ .history-card h3 {
702
+ font-size: 1.1rem;
703
+ font-weight: 600;
704
+ margin-bottom: 0.5rem;
705
+ color: var(--text-primary);
706
  }
707
 
708
+ .timestamp {
709
+ font-size: 0.8rem;
710
+ color: var(--text-secondary);
711
+ margin-bottom: 1rem;
712
  }
713
 
714
+ /* Notifications */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
715
  .notification {
716
  position: fixed;
717
+ bottom: 2rem;
718
+ right: 2rem;
719
+ padding: 1rem 1.5rem;
720
+ border-radius: 0.5rem;
721
  background: var(--card-background);
722
  color: var(--text-primary);
723
+ font-size: 0.9rem;
724
+ box-shadow: 0 4px 20px var(--shadow-color);
725
  transform: translateY(100px);
726
  opacity: 0;
727
  transition: all 0.3s ease;
728
  z-index: 1000;
729
+ max-width: 300px;
730
  }
731
 
732
  .notification.show {
 
734
  opacity: 1;
735
  }
736
 
 
 
 
 
 
 
 
 
737
  .notification.info {
738
+ border-left: 4px solid var(--primary-color);
 
 
 
 
 
 
739
  }
740
 
741
+ .notification.success {
742
+ border-left: 4px solid var(--success-color);
 
743
  }
744
 
745
+ .notification.error {
746
+ border-left: 4px solid var(--error-color);
 
 
 
 
747
  }
748
 
749
+ /* Responsive Design */
750
  @media (max-width: 768px) {
751
+ .app-container {
752
+ padding: 0 0.75rem;
753
+ }
754
+
755
+ .top-nav {
756
+ padding: 1rem 0;
757
+ }
758
+
759
+ .logo {
760
+ font-size: 1.25rem;
761
+ }
762
+
763
+ .search-container {
764
+ padding: 1rem;
765
+ flex-direction: column;
766
+ align-items: stretch;
767
+ }
768
+
769
+ .search-input, .filter-select, .search-button {
770
+ width: 100%;
771
+ }
772
+
773
+ .results-grid, .history-grid, .saved-grid, .features-grid {
774
  grid-template-columns: 1fr;
775
  }
776
 
777
+ .paper-card, .history-card {
778
+ padding: 1.25rem;
779
+ }
780
+
781
+ .paper-title {
782
+ font-size: 1.1rem;
783
+ }
784
+
785
+ .action-row {
786
+ flex-direction: column;
787
+ }
788
+
789
+ .chat-container {
790
+ height: 400px;
791
+ }
792
+
793
+ .quick-questions {
794
+ overflow-x: auto;
795
+ padding: 0.75rem;
796
+ justify-content: flex-start;
797
+ }
798
+
799
+ .message-wrapper {
800
+ max-width: 95%;
801
+ }
802
+
803
+ .analysis-container {
804
+ padding: 1.25rem;
805
+ }
806
+
807
+ .paper-actions {
808
+ flex-direction: column;
809
+ }
810
+
811
+ .paper-button {
812
+ width: 100%;
813
  }
814
  }
815
 
816
+ @media (min-width: 769px) and (max-width: 1024px) {
817
+ .results-grid, .history-grid, .saved-grid, .features-grid {
818
+ grid-template-columns: repeat(2, 1fr);
819
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
820
  }
821
 
822
+ /* Dark mode scrollbar */
823
+ ::-webkit-scrollbar {
824
+ width: 8px;
825
+ height: 8px;
826
  }
827
 
828
+ ::-webkit-scrollbar-track {
829
+ background: rgba(15, 23, 42, 0.5);
 
 
 
 
 
 
 
 
830
  }
831
 
832
+ ::-webkit-scrollbar-thumb {
833
+ background: rgba(99, 102, 241, 0.5);
834
+ border-radius: 4px;
 
 
 
 
835
  }
836
 
837
+ ::-webkit-scrollbar-thumb:hover {
838
+ background: rgba(99, 102, 241, 0.7);
 
 
 
839
  }
840
 
841
+ /* Direct PDF Input Section */
842
+ .direct-pdf-section {
843
+ margin-top: 1.5rem;
844
  }
845
 
846
+ .direct-pdf-container {
847
+ background: var(--card-background);
848
+ padding: 1.5rem;
849
+ border-radius: 1rem;
850
+ box-shadow: 0 4px 20px var(--shadow-color);
851
+ border: 1px solid var(--border-color);
 
 
 
 
 
852
  }
853
 
854
+ .direct-pdf-container h3 {
855
+ color: var(--primary-light);
856
+ font-size: 1.25rem;
857
+ margin-bottom: 0.5rem;
858
  }
859
 
860
+ .direct-pdf-description {
861
+ color: var(--text-secondary);
862
+ font-size: 0.9rem;
863
+ margin-bottom: 1rem;
864
  }
865
 
866
+ .direct-pdf-input-container {
867
+ display: flex;
868
+ gap: 1rem;
869
+ flex-wrap: wrap;
870
  }
871
 
872
+ .direct-pdf-input-container .search-input {
873
+ flex: 1;
874
+ min-width: 250px;
875
  }
876
 
877
+ .direct-pdf-input-container .search-button {
878
+ display: flex;
879
+ align-items: center;
880
+ gap: 0.5rem;
881
  }
882
 
883
  /* Responsive adjustments */
884
  @media (max-width: 768px) {
885
+ .direct-pdf-input-container {
886
+ flex-direction: column;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
887
  }
888
+
889
+ .direct-pdf-input-container .search-button {
890
  width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
891
  justify-content: center;
892
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
  }
templates/base.html CHANGED
@@ -24,5 +24,7 @@
24
  display: none;
25
  }
26
  </style>
 
 
27
  </body>
28
  </html>
 
24
  display: none;
25
  }
26
  </style>
27
+
28
+ <script src="{{ url_for('static', filename='analysis.js') }}"></script>
29
  </body>
30
  </html>
templates/index.html CHANGED
@@ -36,31 +36,21 @@
36
  <div class="search-container">
37
  <input type="text" id="searchInput" class="search-input" placeholder="Enter research paper title">
38
  <div class="filter-container">
39
- <select id="sortBy" class="filter-select">
40
- <option value="relevance">Sort by Relevance</option>
41
- <option value="lastUpdated">Sort by Last Updated</option>
42
- <option value="submitted">Sort by Submission Date</option>
43
- </select>
44
-
45
  <select id="maxResults" class="filter-select">
46
  <option value="10">10 results</option>
47
  <option value="25">25 results</option>
48
  <option value="50">50 results</option>
49
  </select>
 
 
 
 
50
  </div>
51
  <button id="searchButton" class="search-button">SCAN</button>
52
  </div>
53
  </div>
54
 
55
  <div class="features-section">
56
- <div class="feature-card">
57
- <div class="feature-icon">🔍</div>
58
- <div class="feature-content">
59
- <h2 class="feature-title">Smart Search</h2>
60
- <p class="feature-description">Find relevant papers instantly with our intelligent search system</p>
61
- </div>
62
- </div>
63
-
64
  <div class="feature-card">
65
  <div class="feature-icon">🤖</div>
66
  <div class="feature-content">
 
36
  <div class="search-container">
37
  <input type="text" id="searchInput" class="search-input" placeholder="Enter research paper title">
38
  <div class="filter-container">
 
 
 
 
 
 
39
  <select id="maxResults" class="filter-select">
40
  <option value="10">10 results</option>
41
  <option value="25">25 results</option>
42
  <option value="50">50 results</option>
43
  </select>
44
+ <select id="sortBy" class="filter-select">
45
+ <option value="relevance">Sort by Relevance</option>
46
+ <option value="date">Sort by Date</option>
47
+ </select>
48
  </div>
49
  <button id="searchButton" class="search-button">SCAN</button>
50
  </div>
51
  </div>
52
 
53
  <div class="features-section">
 
 
 
 
 
 
 
 
54
  <div class="feature-card">
55
  <div class="feature-icon">🤖</div>
56
  <div class="feature-content">