prernajeet14 commited on
Commit
c287bd1
Β·
verified Β·
1 Parent(s): 473b6b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +212 -204
app.py CHANGED
@@ -251,7 +251,7 @@ Provide a thorough and helpful response. If suggesting code changes, provide com
251
  # Initialize the copilot
252
  copilot = CodingCopilot()
253
 
254
- # Professional Black & Red CSS Theme
255
  professional_css = """
256
  /* Global Styles */
257
  * {
@@ -259,21 +259,23 @@ professional_css = """
259
  }
260
 
261
  .gradio-container {
262
- max-width: 1400px !important;
263
  margin: 0 auto !important;
264
  background: #0a0a0a !important;
265
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
266
  color: #ffffff !important;
 
267
  }
268
 
269
  /* Header Styles */
270
  .header-container {
271
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1b1b 50%, #1a1a1a 100%) !important;
272
  border: 1px solid #dc2626 !important;
273
- border-radius: 12px !important;
274
  padding: 2rem !important;
275
- margin-bottom: 2rem !important;
276
- box-shadow: 0 8px 32px rgba(220, 38, 38, 0.1) !important;
 
277
  }
278
 
279
  .header-title {
@@ -281,7 +283,6 @@ professional_css = """
281
  font-size: 2.5rem !important;
282
  font-weight: 700 !important;
283
  margin: 0 !important;
284
- text-align: center !important;
285
  background: linear-gradient(135deg, #ffffff 0%, #dc2626 100%) !important;
286
  -webkit-background-clip: text !important;
287
  -webkit-text-fill-color: transparent !important;
@@ -291,86 +292,162 @@ professional_css = """
291
  .header-subtitle {
292
  color: #a1a1aa !important;
293
  font-size: 1.1rem !important;
294
- text-align: center !important;
295
  margin: 0.5rem 0 0 0 !important;
296
  font-weight: 400 !important;
297
  }
298
 
299
- /* Main Layout */
300
- .main-container {
301
- background: #111111 !important;
302
- border-radius: 16px !important;
303
- border: 1px solid #262626 !important;
304
- overflow: hidden !important;
305
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
306
  }
307
 
308
  /* Sidebar */
309
  .sidebar {
310
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%) !important;
311
- border-right: 1px solid #dc2626 !important;
 
312
  padding: 2rem !important;
313
- height: 100% !important;
314
- min-height: 700px !important;
 
 
 
 
 
315
  }
316
 
317
  .sidebar-title {
318
  color: #dc2626 !important;
319
  font-weight: 700 !important;
320
  font-size: 1.2rem !important;
321
- margin-bottom: 1.5rem !important;
322
  text-transform: uppercase !important;
323
  letter-spacing: 0.5px !important;
 
 
 
324
  }
325
 
326
- .sidebar-content {
327
  color: #d1d5db !important;
328
  font-size: 0.9rem !important;
329
  line-height: 1.6 !important;
 
330
  }
331
 
332
- .sidebar-content strong {
333
  color: #ffffff !important;
 
 
334
  }
335
 
336
- /* Chat Interface */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  .chat-container {
338
- background: #0f0f0f !important;
339
- border-radius: 0 !important;
 
 
 
 
 
 
 
 
 
 
 
340
  border: none !important;
341
- min-height: 600px !important;
342
- max-height: 600px !important;
 
343
  overflow-y: auto !important;
 
344
  }
345
 
346
  .chatbot {
347
  background: transparent !important;
348
  border: none !important;
 
349
  }
350
 
351
- /* Input Area */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  .input-section {
353
  background: #1a1a1a !important;
354
  border-top: 1px solid #262626 !important;
355
- padding: 1.5rem !important;
356
  }
357
 
358
  .input-row {
359
  display: flex !important;
360
- gap: 1rem !important;
361
  align-items: flex-end !important;
362
  }
363
 
364
  .message-input {
365
  background: #262626 !important;
366
  border: 1px solid #404040 !important;
367
- border-radius: 12px !important;
368
  color: #ffffff !important;
369
- padding: 1rem !important;
370
- font-size: 1rem !important;
371
- line-height: 1.5 !important;
372
  resize: vertical !important;
373
  transition: all 0.3s ease !important;
 
374
  }
375
 
376
  .message-input:focus {
@@ -388,15 +465,16 @@ professional_css = """
388
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
389
  color: white !important;
390
  border: none !important;
391
- border-radius: 12px !important;
392
- padding: 1rem 2rem !important;
393
  font-weight: 600 !important;
394
- font-size: 1rem !important;
395
  cursor: pointer !important;
396
  transition: all 0.3s ease !important;
397
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.2) !important;
398
  text-transform: uppercase !important;
399
  letter-spacing: 0.5px !important;
 
400
  }
401
 
402
  .primary-button:hover {
@@ -409,7 +487,7 @@ professional_css = """
409
  background: #262626 !important;
410
  color: #ffffff !important;
411
  border: 1px solid #404040 !important;
412
- border-radius: 12px !important;
413
  padding: 0.75rem 1.5rem !important;
414
  font-weight: 500 !important;
415
  cursor: pointer !important;
@@ -417,6 +495,7 @@ professional_css = """
417
  text-transform: uppercase !important;
418
  letter-spacing: 0.5px !important;
419
  font-size: 0.9rem !important;
 
420
  }
421
 
422
  .secondary-button:hover {
@@ -425,55 +504,13 @@ professional_css = """
425
  transform: translateY(-1px) !important;
426
  }
427
 
428
- .quick-action-button {
429
- background: #1a1a1a !important;
430
- color: #dc2626 !important;
431
- border: 1px solid #dc2626 !important;
432
- border-radius: 8px !important;
433
- padding: 0.75rem 1rem !important;
434
- font-weight: 500 !important;
435
- cursor: pointer !important;
436
- transition: all 0.3s ease !important;
437
- margin-bottom: 0.5rem !important;
438
- width: 100% !important;
439
- text-align: left !important;
440
- font-size: 0.9rem !important;
441
- }
442
-
443
- .quick-action-button:hover {
444
- background: #dc2626 !important;
445
- color: #ffffff !important;
446
- transform: translateX(4px) !important;
447
- }
448
-
449
- /* File Upload */
450
- .file-upload {
451
- background: #1a1a1a !important;
452
- border: 2px dashed #404040 !important;
453
- border-radius: 12px !important;
454
- padding: 1.5rem !important;
455
- text-align: center !important;
456
- transition: all 0.3s ease !important;
457
- color: #d1d5db !important;
458
- }
459
-
460
- .file-upload:hover {
461
- border-color: #dc2626 !important;
462
- background: #262626 !important;
463
- }
464
-
465
- .file-upload-text {
466
- color: #9ca3af !important;
467
- font-size: 0.9rem !important;
468
- }
469
-
470
  /* Download Section */
471
  .download-section {
472
  background: #1a1a1a !important;
473
- border: 1px solid #262626 !important;
474
- border-radius: 12px !important;
475
  padding: 1rem !important;
476
- margin-top: 1rem !important;
477
  }
478
 
479
  .download-title {
@@ -483,53 +520,16 @@ professional_css = """
483
  font-size: 1rem !important;
484
  }
485
 
486
- /* Status Messages */
487
- .status-success {
488
- background: linear-gradient(135deg, #065f46 0%, #047857 100%) !important;
489
- border: 1px solid #10b981 !important;
490
- border-radius: 8px !important;
491
- padding: 1rem !important;
492
- color: #ffffff !important;
493
- font-size: 0.9rem !important;
494
- margin: 0.5rem 0 !important;
495
- }
496
-
497
- .status-error {
498
- background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%) !important;
499
- border: 1px solid #dc2626 !important;
500
- border-radius: 8px !important;
501
- padding: 1rem !important;
502
- color: #ffffff !important;
503
- font-size: 0.9rem !important;
504
- margin: 0.5rem 0 !important;
505
- }
506
-
507
- /* Code Blocks */
508
- pre {
509
- background: #0a0a0a !important;
510
- border: 1px solid #262626 !important;
511
- border-radius: 8px !important;
512
- padding: 1rem !important;
513
- color: #ffffff !important;
514
- font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
515
- font-size: 0.9rem !important;
516
- line-height: 1.4 !important;
517
- overflow-x: auto !important;
518
- }
519
-
520
- code {
521
- background: #1a1a1a !important;
522
- color: #dc2626 !important;
523
- padding: 0.2rem 0.4rem !important;
524
- border-radius: 4px !important;
525
- font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
526
- font-size: 0.9rem !important;
527
  }
528
 
529
  /* Scrollbar */
530
  ::-webkit-scrollbar {
531
- width: 8px !important;
532
- height: 8px !important;
533
  }
534
 
535
  ::-webkit-scrollbar-track {
@@ -538,7 +538,7 @@ code {
538
 
539
  ::-webkit-scrollbar-thumb {
540
  background: #404040 !important;
541
- border-radius: 4px !important;
542
  }
543
 
544
  ::-webkit-scrollbar-thumb:hover {
@@ -546,9 +546,25 @@ code {
546
  }
547
 
548
  /* Mobile Responsiveness */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  @media (max-width: 768px) {
550
  .gradio-container {
551
- padding: 1rem !important;
552
  }
553
 
554
  .header-title {
@@ -556,16 +572,15 @@ code {
556
  }
557
 
558
  .sidebar {
559
- min-height: auto !important;
560
  padding: 1rem !important;
561
  }
562
 
563
  .input-row {
564
  flex-direction: column !important;
565
- gap: 1rem !important;
566
  }
567
 
568
- .primary-button {
569
  width: 100% !important;
570
  }
571
  }
@@ -588,6 +603,7 @@ code {
588
  text-align: center !important;
589
  color: #6b7280 !important;
590
  margin-top: 2rem !important;
 
591
  }
592
 
593
  .footer strong {
@@ -635,108 +651,100 @@ with gr.Blocks(css=professional_css, title="Coding Copilot Pro", theme=gr.themes
635
  # Header
636
  gr.HTML("""
637
  <div class="header-container">
638
- <h1 class="header-title">⚑ CODING COPILOT PRO</h1>
639
  <p class="header-subtitle">Advanced AI-Powered Development Assistant β€’ Powered by Claude 3 Haiku</p>
640
  </div>
641
  """)
642
 
643
- # Main interface
644
- with gr.Row(equal_height=True):
645
- # Sidebar
646
- with gr.Column(scale=1, min_width=300):
647
- gr.HTML('<div class="sidebar">')
648
-
649
- gr.HTML('<h3 class="sidebar-title">πŸš€ CAPABILITIES</h3>')
650
- gr.Markdown("""
651
- <div class="sidebar-content">
652
-
653
- **πŸ’» Code Generation:**
654
- β€’ Complete applications & modules
655
- β€’ Production-ready implementations
656
- β€’ Custom algorithms & data structures
657
- β€’ API integrations & web services
658
-
659
- **πŸ”§ Code Analysis:**
660
- β€’ Comprehensive code reviews
661
- β€’ Performance optimization
662
- β€’ Security vulnerability detection
663
- β€’ Architecture recommendations
664
-
665
- **πŸ› Debugging & Testing:**
666
- β€’ Error detection & fixes
667
- β€’ Unit test generation
668
- β€’ Code refactoring
669
- β€’ Best practices enforcement
670
 
671
- **πŸ“š Documentation:**
672
- β€’ Comprehensive docstrings
673
- β€’ API documentation
674
- β€’ Code explanations
675
- β€’ Technical specifications
676
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  </div>
678
- """, elem_classes=["sidebar-content"])
 
679
 
680
- gr.HTML('<h3 class="sidebar-title">⚑ QUICK ACTIONS</h3>')
 
 
681
 
682
- with gr.Column():
683
- quick_review = gr.Button("πŸ“‹ COMPREHENSIVE REVIEW", elem_classes=["quick-action-button"])
684
- quick_debug = gr.Button("πŸ› DEBUG & FIX", elem_classes=["quick-action-button"])
685
- quick_optimize = gr.Button("⚑ OPTIMIZE CODE", elem_classes=["quick-action-button"])
686
- quick_explain = gr.Button("πŸ“– EXPLAIN & DOCUMENT", elem_classes=["quick-action-button"])
687
- quick_generate = gr.Button("πŸ”₯ GENERATE NEW CODE", elem_classes=["quick-action-button"])
688
- quick_test = gr.Button("πŸ§ͺ CREATE TESTS", elem_classes=["quick-action-button"])
689
 
690
  gr.HTML('</div>')
691
 
692
- # Main chat area
693
- with gr.Column(scale=3):
694
- gr.HTML('<div class="main-container">')
695
 
696
  # Chat interface
697
  chatbot = gr.Chatbot(
698
- height=600,
699
  show_label=False,
700
  container=False,
701
  bubble_full_width=False,
702
  avatar_images=("πŸ‘¨β€πŸ’»", "πŸ€–"),
703
- elem_classes=["chat-container"]
704
  )
705
 
706
- # Download section
707
- download_status = gr.HTML("", visible=True)
708
- download_file = gr.File(label="πŸ“₯ Download Generated Code", visible=False)
709
-
710
- # Input section
711
- gr.HTML('<div class="input-section">')
712
-
713
- # File upload
714
- with gr.Row():
715
  files = gr.File(
716
  label="πŸ“Ž Upload Code Files (.py, .ipynb)",
717
  file_count="multiple",
718
  file_types=[".py", ".ipynb"],
719
- elem_classes=["file-upload"]
 
 
720
  )
721
 
722
- # Message input and buttons
723
- with gr.Row(elem_classes=["input-row"]):
724
- msg = gr.Textbox(
725
- label="",
726
- placeholder="Describe what you want to build, analyze, or improve... Type 'continue' to extend previous code.",
727
- show_label=False,
728
- lines=2,
729
- max_lines=4,
730
- scale=4,
731
- elem_classes=["message-input"]
732
- )
733
-
734
- with gr.Column(scale=1):
735
- submit = gr.Button("SEND", variant="primary", elem_classes=["primary-button"])
736
- clear = gr.Button("CLEAR", variant="secondary", elem_classes=["secondary-button"])
737
 
738
- gr.HTML('</div>')
739
- gr.HTML('</div>')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
740
 
741
  # Hidden state
742
  chat_history = gr.State([])
@@ -804,7 +812,7 @@ with gr.Blocks(css=professional_css, title="Coding Copilot Pro", theme=gr.themes
804
  # Footer
805
  gr.HTML("""
806
  <div class="footer">
807
- <p><strong>CODING COPILOT PRO</strong> β€’ Professional Development Assistant</p>
808
  <p>Upload your code files and start building β€’ Advanced AI β€’ Secure & Private</p>
809
  </div>
810
  """)
 
251
  # Initialize the copilot
252
  copilot = CodingCopilot()
253
 
254
+ # Enhanced Professional CSS Theme with Better Layout
255
  professional_css = """
256
  /* Global Styles */
257
  * {
 
259
  }
260
 
261
  .gradio-container {
262
+ max-width: 1600px !important;
263
  margin: 0 auto !important;
264
  background: #0a0a0a !important;
265
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
266
  color: #ffffff !important;
267
+ padding: 1rem !important;
268
  }
269
 
270
  /* Header Styles */
271
  .header-container {
272
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1b1b 50%, #1a1a1a 100%) !important;
273
  border: 1px solid #dc2626 !important;
274
+ border-radius: 16px !important;
275
  padding: 2rem !important;
276
+ margin-bottom: 1.5rem !important;
277
+ box-shadow: 0 8px 32px rgba(220, 38, 38, 0.15) !important;
278
+ text-align: center !important;
279
  }
280
 
281
  .header-title {
 
283
  font-size: 2.5rem !important;
284
  font-weight: 700 !important;
285
  margin: 0 !important;
 
286
  background: linear-gradient(135deg, #ffffff 0%, #dc2626 100%) !important;
287
  -webkit-background-clip: text !important;
288
  -webkit-text-fill-color: transparent !important;
 
292
  .header-subtitle {
293
  color: #a1a1aa !important;
294
  font-size: 1.1rem !important;
 
295
  margin: 0.5rem 0 0 0 !important;
296
  font-weight: 400 !important;
297
  }
298
 
299
+ /* Main Layout - Two Column */
300
+ .main-layout {
301
+ display: flex !important;
302
+ gap: 1.5rem !important;
303
+ height: 100% !important;
304
+ align-items: stretch !important;
 
305
  }
306
 
307
  /* Sidebar */
308
  .sidebar {
309
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%) !important;
310
+ border: 1px solid #dc2626 !important;
311
+ border-radius: 16px !important;
312
  padding: 2rem !important;
313
+ min-width: 350px !important;
314
+ max-width: 350px !important;
315
+ box-shadow: 0 8px 32px rgba(220, 38, 38, 0.1) !important;
316
+ }
317
+
318
+ .sidebar-section {
319
+ margin-bottom: 2rem !important;
320
  }
321
 
322
  .sidebar-title {
323
  color: #dc2626 !important;
324
  font-weight: 700 !important;
325
  font-size: 1.2rem !important;
326
+ margin-bottom: 1rem !important;
327
  text-transform: uppercase !important;
328
  letter-spacing: 0.5px !important;
329
+ display: flex !important;
330
+ align-items: center !important;
331
+ gap: 0.5rem !important;
332
  }
333
 
334
+ .capabilities-list {
335
  color: #d1d5db !important;
336
  font-size: 0.9rem !important;
337
  line-height: 1.6 !important;
338
+ margin-bottom: 0 !important;
339
  }
340
 
341
+ .capabilities-list strong {
342
  color: #ffffff !important;
343
+ display: block !important;
344
+ margin-bottom: 0.3rem !important;
345
  }
346
 
347
+ .capability-item {
348
+ margin-bottom: 1rem !important;
349
+ padding: 0.5rem 0 !important;
350
+ border-bottom: 1px solid #262626 !important;
351
+ }
352
+
353
+ .capability-item:last-child {
354
+ border-bottom: none !important;
355
+ }
356
+
357
+ /* Quick Action Buttons */
358
+ .quick-action-button {
359
+ background: #1a1a1a !important;
360
+ color: #dc2626 !important;
361
+ border: 1px solid #dc2626 !important;
362
+ border-radius: 10px !important;
363
+ padding: 0.75rem 1rem !important;
364
+ font-weight: 500 !important;
365
+ cursor: pointer !important;
366
+ transition: all 0.3s ease !important;
367
+ margin-bottom: 0.5rem !important;
368
+ width: 100% !important;
369
+ text-align: left !important;
370
+ font-size: 0.9rem !important;
371
+ display: flex !important;
372
+ align-items: center !important;
373
+ gap: 0.5rem !important;
374
+ }
375
+
376
+ .quick-action-button:hover {
377
+ background: #dc2626 !important;
378
+ color: #ffffff !important;
379
+ transform: translateX(4px) !important;
380
+ box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2) !important;
381
+ }
382
+
383
+ /* Chat Container */
384
  .chat-container {
385
+ background: linear-gradient(180deg, #111111 0%, #0a0a0a 100%) !important;
386
+ border: 1px solid #262626 !important;
387
+ border-radius: 16px !important;
388
+ flex: 1 !important;
389
+ display: flex !important;
390
+ flex-direction: column !important;
391
+ overflow: hidden !important;
392
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
393
+ }
394
+
395
+ /* Chat Interface */
396
+ .chat-interface {
397
+ background: transparent !important;
398
  border: none !important;
399
+ flex: 1 !important;
400
+ min-height: 500px !important;
401
+ max-height: 500px !important;
402
  overflow-y: auto !important;
403
+ padding: 1rem !important;
404
  }
405
 
406
  .chatbot {
407
  background: transparent !important;
408
  border: none !important;
409
+ height: 100% !important;
410
  }
411
 
412
+ /* Compact File Upload */
413
+ .file-upload-compact {
414
+ background: #1a1a1a !important;
415
+ border: 1px solid #404040 !important;
416
+ border-radius: 10px !important;
417
+ padding: 0.75rem !important;
418
+ margin: 1rem !important;
419
+ transition: all 0.3s ease !important;
420
+ }
421
+
422
+ .file-upload-compact:hover {
423
+ border-color: #dc2626 !important;
424
+ background: #262626 !important;
425
+ }
426
+
427
+ /* Input Section */
428
  .input-section {
429
  background: #1a1a1a !important;
430
  border-top: 1px solid #262626 !important;
431
+ padding: 1rem !important;
432
  }
433
 
434
  .input-row {
435
  display: flex !important;
436
+ gap: 0.75rem !important;
437
  align-items: flex-end !important;
438
  }
439
 
440
  .message-input {
441
  background: #262626 !important;
442
  border: 1px solid #404040 !important;
443
+ border-radius: 10px !important;
444
  color: #ffffff !important;
445
+ padding: 0.75rem !important;
446
+ font-size: 0.95rem !important;
447
+ line-height: 1.4 !important;
448
  resize: vertical !important;
449
  transition: all 0.3s ease !important;
450
+ flex: 1 !important;
451
  }
452
 
453
  .message-input:focus {
 
465
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
466
  color: white !important;
467
  border: none !important;
468
+ border-radius: 10px !important;
469
+ padding: 0.75rem 1.5rem !important;
470
  font-weight: 600 !important;
471
+ font-size: 0.9rem !important;
472
  cursor: pointer !important;
473
  transition: all 0.3s ease !important;
474
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.2) !important;
475
  text-transform: uppercase !important;
476
  letter-spacing: 0.5px !important;
477
+ min-width: 80px !important;
478
  }
479
 
480
  .primary-button:hover {
 
487
  background: #262626 !important;
488
  color: #ffffff !important;
489
  border: 1px solid #404040 !important;
490
+ border-radius: 10px !important;
491
  padding: 0.75rem 1.5rem !important;
492
  font-weight: 500 !important;
493
  cursor: pointer !important;
 
495
  text-transform: uppercase !important;
496
  letter-spacing: 0.5px !important;
497
  font-size: 0.9rem !important;
498
+ min-width: 80px !important;
499
  }
500
 
501
  .secondary-button:hover {
 
504
  transform: translateY(-1px) !important;
505
  }
506
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  /* Download Section */
508
  .download-section {
509
  background: #1a1a1a !important;
510
+ border: 1px solid #dc2626 !important;
511
+ border-radius: 10px !important;
512
  padding: 1rem !important;
513
+ margin: 1rem !important;
514
  }
515
 
516
  .download-title {
 
520
  font-size: 1rem !important;
521
  }
522
 
523
+ /* Icons */
524
+ .emoji-icon {
525
+ font-size: 1.2rem !important;
526
+ margin-right: 0.3rem !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  }
528
 
529
  /* Scrollbar */
530
  ::-webkit-scrollbar {
531
+ width: 6px !important;
532
+ height: 6px !important;
533
  }
534
 
535
  ::-webkit-scrollbar-track {
 
538
 
539
  ::-webkit-scrollbar-thumb {
540
  background: #404040 !important;
541
+ border-radius: 3px !important;
542
  }
543
 
544
  ::-webkit-scrollbar-thumb:hover {
 
546
  }
547
 
548
  /* Mobile Responsiveness */
549
+ @media (max-width: 1024px) {
550
+ .main-layout {
551
+ flex-direction: column !important;
552
+ }
553
+
554
+ .sidebar {
555
+ min-width: auto !important;
556
+ max-width: none !important;
557
+ order: 2 !important;
558
+ }
559
+
560
+ .chat-container {
561
+ order: 1 !important;
562
+ }
563
+ }
564
+
565
  @media (max-width: 768px) {
566
  .gradio-container {
567
+ padding: 0.5rem !important;
568
  }
569
 
570
  .header-title {
 
572
  }
573
 
574
  .sidebar {
 
575
  padding: 1rem !important;
576
  }
577
 
578
  .input-row {
579
  flex-direction: column !important;
580
+ gap: 0.5rem !important;
581
  }
582
 
583
+ .primary-button, .secondary-button {
584
  width: 100% !important;
585
  }
586
  }
 
603
  text-align: center !important;
604
  color: #6b7280 !important;
605
  margin-top: 2rem !important;
606
+ border-radius: 12px !important;
607
  }
608
 
609
  .footer strong {
 
651
  # Header
652
  gr.HTML("""
653
  <div class="header-container">
654
+ <h1 class="header-title">πŸš€ CODING COPILOT PRO</h1>
655
  <p class="header-subtitle">Advanced AI-Powered Development Assistant β€’ Powered by Claude 3 Haiku</p>
656
  </div>
657
  """)
658
 
659
+ # Main layout with two columns
660
+ with gr.Row(elem_classes=["main-layout"]):
661
+
662
+ # Sidebar with capabilities and quick actions
663
+ with gr.Column(elem_classes=["sidebar"]):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
 
665
+ # Capabilities Section
666
+ gr.HTML('<div class="sidebar-section">')
667
+ gr.HTML('<h3 class="sidebar-title"><span class="emoji-icon">🎯</span>CAPABILITIES</h3>')
 
 
668
 
669
+ gr.HTML("""
670
+ <div class="capabilities-list">
671
+ <div class="capability-item">
672
+ <strong>πŸ’» Code Generation</strong>
673
+ Complete applications, modules, algorithms & APIs
674
+ </div>
675
+ <div class="capability-item">
676
+ <strong>πŸ” Code Analysis</strong>
677
+ Reviews, optimization, security & architecture
678
+ </div>
679
+ <div class="capability-item">
680
+ <strong>πŸ› Debug & Test</strong>
681
+ Error fixes, unit tests & refactoring
682
+ </div>
683
+ <div class="capability-item">
684
+ <strong>πŸ“š Documentation</strong>
685
+ Docstrings, API docs & explanations
686
+ </div>
687
  </div>
688
+ """)
689
+ gr.HTML('</div>')
690
 
691
+ # Quick Actions Section
692
+ gr.HTML('<div class="sidebar-section">')
693
+ gr.HTML('<h3 class="sidebar-title"><span class="emoji-icon">⚑</span>QUICK ACTIONS</h3>')
694
 
695
+ quick_review = gr.Button("πŸ“‹ Comprehensive Review", elem_classes=["quick-action-button"])
696
+ quick_debug = gr.Button("πŸ› Debug & Fix", elem_classes=["quick-action-button"])
697
+ quick_optimize = gr.Button("⚑ Optimize Code", elem_classes=["quick-action-button"])
698
+ quick_explain = gr.Button("πŸ“– Explain & Document", elem_classes=["quick-action-button"])
699
+ quick_generate = gr.Button("πŸ”₯ Generate New Code", elem_classes=["quick-action-button"])
700
+ quick_test = gr.Button("πŸ§ͺ Create Tests", elem_classes=["quick-action-button"])
 
701
 
702
  gr.HTML('</div>')
703
 
704
+ # Chat container
705
+ with gr.Column(elem_classes=["chat-container"]):
 
706
 
707
  # Chat interface
708
  chatbot = gr.Chatbot(
709
+ height=500,
710
  show_label=False,
711
  container=False,
712
  bubble_full_width=False,
713
  avatar_images=("πŸ‘¨β€πŸ’»", "πŸ€–"),
714
+ elem_classes=["chat-interface"]
715
  )
716
 
717
+ # Compact file upload section
718
+ with gr.Row(elem_classes=["file-upload-compact"]):
 
 
 
 
 
 
 
719
  files = gr.File(
720
  label="πŸ“Ž Upload Code Files (.py, .ipynb)",
721
  file_count="multiple",
722
  file_types=[".py", ".ipynb"],
723
+ scale=1,
724
+ show_label=True,
725
+ container=True
726
  )
727
 
728
+ # Download section
729
+ download_status = gr.HTML("", visible=True)
730
+ download_file = gr.File(label="πŸ“₯ Download Generated Code", visible=False)
 
 
 
 
 
 
 
 
 
 
 
 
731
 
732
+ # Input section
733
+ with gr.Row(elem_classes=["input-section"]):
734
+ with gr.Column(scale=1):
735
+ with gr.Row(elem_classes=["input-row"]):
736
+ msg = gr.Textbox(
737
+ label="",
738
+ placeholder="Describe what you want to build, analyze, or improve... Type 'continue' to extend previous code.",
739
+ show_label=False,
740
+ lines=2,
741
+ max_lines=4,
742
+ elem_classes=["message-input"]
743
+ )
744
+
745
+ with gr.Column(min_width=100):
746
+ submit = gr.Button("SEND", variant="primary", elem_classes=["primary-button"])
747
+ clear = gr.Button("CLEAR", variant="secondary", elem_classes=["secondary-button"])
748
 
749
  # Hidden state
750
  chat_history = gr.State([])
 
812
  # Footer
813
  gr.HTML("""
814
  <div class="footer">
815
+ <p><strong>πŸš€ CODING COPILOT PRO</strong> β€’ Professional Development Assistant</p>
816
  <p>Upload your code files and start building β€’ Advanced AI β€’ Secure & Private</p>
817
  </div>
818
  """)