Nischal Subedi commited on
Commit
7b7dadd
·
1 Parent(s): b217ae2
Files changed (1) hide show
  1. app.py +92 -107
app.py CHANGED
@@ -243,6 +243,8 @@ Answer:"""
243
  raise RuntimeError(f"Failed to process PDF '{pdf_path}': {e}") from e
244
 
245
  # --- GRADIO INTERFACE (NEW UI DESIGN) ---
 
 
246
  def gradio_interface(self):
247
  def query_interface_wrapper(api_key: str, query: str, state: str) -> str:
248
  # Basic client-side validation for immediate feedback (redundant but good UX)
@@ -293,52 +295,33 @@ Answer:"""
293
  /* Import legible fonts from Google Fonts */
294
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
295
 
296
- /* Root variables for consistent light theme */
297
- :root {
298
- --primary-color: #FF8C00;
299
- --primary-hover: #E07B00;
300
- --background-primary: hsl(30, 100%, 99.9%);
301
- --background-secondary: hsl(30, 100%, 96%);
302
- --text-primary: #4A3C32;
303
- --text-secondary: #8C7B6F;
304
- --border-color: hsl(30, 70%, 85%);
305
- --border-focus: #FF8C00;
306
- --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
307
- --shadow-md: 0 4px 10px rgba(0,0,0,0.1);
308
- --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
309
- --error-bg: #FFF0E0;
310
- --error-border: #FFD2B2;
311
- --error-text: #E05C00;
312
- }
313
-
314
- body, html {
315
- background-color: var(--background-secondary) !important;
316
- color: var(--text-primary) !important;
317
- transition: background-color 0.3s, color 0.3s;
318
  }
319
  .gradio-container {
320
  max-width: 900px !important;
321
  margin: 0 auto !important;
322
  padding: 1.5rem !important;
323
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
324
- background-color: var(--background-secondary) !important;
325
  box-shadow: none !important;
326
- color: var(--text-primary) !important;
327
  }
328
  .main-dashboard-container > * {
329
- background-color: var(--background-primary) !important;
330
  }
331
  .app-header-wrapper {
332
- background: linear-gradient(145deg, var(--background-primary) 0%, var(--background-secondary) 100%) !important;
333
- border: 2px solid var(--border-color) !important;
334
  border-radius: 16px !important;
335
  padding: 2.5rem 1.5rem !important;
336
  margin-bottom: 1.5rem !important;
337
- box-shadow: var(--shadow-md) !important;
338
  position: relative;
339
  overflow: hidden;
340
  text-align: center !important;
341
- color: var(--text-primary) !important;
342
  }
343
  .app-header-wrapper::before {
344
  content: '';
@@ -356,7 +339,7 @@ Answer:"""
356
  font-size: 8.5rem !important;
357
  margin-bottom: 0.75rem !important;
358
  display: block !important;
359
- color: var(--primary-color) !important;
360
  position: relative;
361
  z-index: 1;
362
  animation: float-icon 3s ease-in-out infinite alternate;
@@ -370,7 +353,7 @@ Answer:"""
370
  font-family: 'Poppins', sans-serif !important;
371
  font-size: 3rem !important;
372
  font-weight: 800 !important;
373
- color: var(--text-primary) !important;
374
  margin: 0 0 0.75rem 0 !important;
375
  line-height: 1.1 !important;
376
  letter-spacing: -0.03em !important;
@@ -381,7 +364,7 @@ Answer:"""
381
  }
382
  .app-header-tagline {
383
  font-size: 1.25rem !important;
384
- color: var(--text-secondary) !important;
385
  font-weight: 400 !important;
386
  margin: 0 !important;
387
  max-width: 700px;
@@ -395,17 +378,17 @@ Answer:"""
395
  gap: 1.25rem !important;
396
  }
397
  .dashboard-card-section {
398
- background-color: var(--background-primary) !important;
399
- border: 2px solid var(--border-color) !important;
400
  border-radius: 12px !important;
401
  padding: 0 !important;
402
- box-shadow: var(--shadow-sm) !important;
403
  transition: all 0.3s ease-out !important;
404
  cursor: default;
405
- color: var(--text-primary) !important;
406
  }
407
  .dashboard-card-section:hover {
408
- box-shadow: var(--shadow-md) !important;
409
  transform: translateY(-3px) !important;
410
  }
411
  .full-width-center {
@@ -417,7 +400,7 @@ Answer:"""
417
  background-color: transparent !important;
418
  }
419
  .section-title-gradient-bar {
420
- background-color: var(--background-secondary) !important;
421
  padding: 1.25rem 1.75rem !important;
422
  border-top-left-radius: 10px !important;
423
  border-top-right-radius: 10px !important;
@@ -425,16 +408,16 @@ Answer:"""
425
  text-align: center !important;
426
  box-sizing: border-box;
427
  width: 100%;
428
- color: var(--text-primary) !important;
429
  }
430
  .section-title {
431
  font-family: 'Poppins', sans-serif !important;
432
  font-size: 1.7rem !important;
433
  font-weight: 700 !important;
434
- color: var(--text-primary) !important;
435
  margin: 0 !important;
436
  padding-bottom: 0 !important;
437
- border-bottom: 2px solid var(--border-color) !important;
438
  line-height: 1.1 !important;
439
  display: inline-block !important;
440
  text-align: center !important;
@@ -442,14 +425,14 @@ Answer:"""
442
  }
443
  .dashboard-card-content-area {
444
  padding: 0 1.75rem 1.75rem 1.75rem !important;
445
- background-color: var(--background-primary) !important;
446
  box-sizing: border-box;
447
  width: 100%;
448
- color: var(--text-primary) !important;
449
  }
450
  .dashboard-card-section p {
451
  line-height: 1.7 !important;
452
- color: var(--text-primary) !important;
453
  font-size: 1rem !important;
454
  text-align: left !important;
455
  background-color: transparent !important;
@@ -459,13 +442,13 @@ Answer:"""
459
  }
460
  .dashboard-card-section strong, .dashboard-card-section b {
461
  font-weight: 700 !important;
462
- color: var(--primary-color) !important;
463
  }
464
  .gr-block, .gr-box, .gr-prose, .gr-form, .gr-panel,
465
  .gr-columns, .gr-column,
466
  .gradio-html, .gradio-markdown, .gradio-textbox, .gradio-radio, .gradio-button {
467
  background-color: transparent !important;
468
- color: var(--text-primary) !important;
469
  white-space: normal !important;
470
  overflow-wrap: break-word;
471
  word-break: break-word;
@@ -474,30 +457,30 @@ Answer:"""
474
  .gradio-textbox input,
475
  .gradio-radio label,
476
  .placeholder {
477
- background-color: var(--background-primary) !important;
478
- color: var(--text-primary) !important;
479
  }
480
  .gradio-textbox {
481
  margin-bottom: 0.5rem !important;
482
  }
483
  .gradio-textbox textarea,
484
  .gradio-textbox input {
485
- border: 2px solid var(--border-color) !important;
486
  border-radius: 8px !important;
487
  padding: 0.85rem 1rem !important;
488
  font-size: 0.98rem !important;
489
  font-family: 'Inter', sans-serif !important;
490
- color: var(--text-primary) !important;
491
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
492
- box-shadow: var(--shadow-sm) !important;
493
  }
494
  .gradio-textbox .scroll-hide {
495
- background-color: var(--background-primary) !important;
496
  }
497
  .gradio-textbox textarea:focus,
498
  .gradio-textbox input:focus {
499
  outline: none !important;
500
- border-color: var(--border-focus) !important;
501
  box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.2) !important;
502
  }
503
  .gradio-radio {
@@ -512,37 +495,37 @@ Answer:"""
512
  justify-content: center !important;
513
  align-items: center !important;
514
  padding: 0.75rem 1rem !important;
515
- border: 2px solid var(--border-color) !important;
516
  border-radius: 8px !important;
517
- color: var(--text-primary) !important;
518
  font-weight: 500 !important;
519
  cursor: pointer !important;
520
  transition: all 0.2s ease-out !important;
521
- box-shadow: var(--shadow-sm) !important;
522
  margin: 0.2rem 0 !important;
523
  width: 100 !important;
524
  box-sizing: border-box !important;
525
  }
526
  .gradio-radio label span.text-lg {
527
  font-weight: 600 !important;
528
- color: var(--text-primary) !important;
529
  font-size: 0.98rem !important;
530
  }
531
  .gradio-radio label:hover {
532
- background-color: var(--background-secondary) !important;
533
- border-color: var(--primary-color) !important;
534
- box-shadow: var(--shadow-md) !important;
535
  transform: translateY(-2px) !important;
536
  }
537
  .gradio-radio input[type="radio"]:checked + label {
538
- background-color: var(--primary-color) !important;
539
- color: var(--text-primary) !important;
540
- border-color: var(--primary-hover) !important;
541
- box-shadow: var(--shadow-md) !important;
542
  transform: translateY(-1px) !important;
543
  }
544
  .gradio-radio input[type="radio"]:checked + label span.text-lg {
545
- color: var(--text-primary) !important;
546
  }
547
  .gradio-radio .gr-form {
548
  padding: 0 !important;
@@ -550,7 +533,7 @@ Answer:"""
550
  .gradio-textbox label,
551
  .gradio-radio > label {
552
  font-weight: 600 !important;
553
- color: var(--text-primary) !important;
554
  font-size: 1rem !important;
555
  margin-bottom: 0.6rem !important;
556
  display: block !important;
@@ -558,7 +541,7 @@ Answer:"""
558
  }
559
  .gr-prose {
560
  font-size: 0.9rem !important;
561
- color: var(--text-secondary) !important;
562
  margin-top: 0.4rem !important;
563
  text-align: left !important;
564
  background-color: transparent !important;
@@ -588,16 +571,16 @@ Answer:"""
588
  cursor: pointer !important;
589
  border: 2px solid transparent !important;
590
  text-align: center !important;
591
- color: var(--text-primary) !important;
592
  }
593
  .gr-button-primary {
594
- background-color: var(--primary-color) !important;
595
  color: white !important;
596
- box-shadow: var(--shadow-sm) !important;
597
  }
598
  .gr-button-primary:hover {
599
- background-color: var(--primary-hover) !important;
600
- box-shadow: var(--shadow-md) !important;
601
  transform: translateY(-2px) !important;
602
  }
603
  .gr-button-primary:active {
@@ -606,12 +589,12 @@ Answer:"""
606
  }
607
  .gr-button-secondary {
608
  background-color: transparent !important;
609
- color: var(--text-primary) !important;
610
- border-color: var(--border-color) !important;
611
  }
612
  .gr-button-secondary:hover {
613
- background-color: var(--background-secondary) !important;
614
- border-color: var(--primary-color) !important;
615
  transform: translateY(-2px) !important;
616
  }
617
  .gr-button-secondary:active {
@@ -619,12 +602,12 @@ Answer:"""
619
  box-shadow: none !important;
620
  }
621
  .output-content-wrapper {
622
- background-color: var(--background-primary) !important;
623
- border: 2px solid var(--border-color) !important;
624
  border-radius: 8px !important;
625
  padding: 1.5rem !important;
626
  min-height: 150px !important;
627
- color: var(--text-primary) !important;
628
  display: flex;
629
  flex-direction: column;
630
  justify-content: center;
@@ -638,7 +621,7 @@ Answer:"""
638
  overflow-wrap: break-word;
639
  word-break: break-word;
640
  text-align: left !important;
641
- color: var(--text-primary) !important;
642
  }
643
  @keyframes fadeInAndSlideUp {
644
  from { opacity: 0; transform: translateY(15px); }
@@ -647,7 +630,7 @@ Answer:"""
647
  .response-header {
648
  font-size: 1.3rem !important;
649
  font-weight: 700 !important;
650
- color: var(--primary-color) !important;
651
  margin-bottom: 0.75rem !important;
652
  display: flex !important;
653
  align-items: center !important;
@@ -658,17 +641,17 @@ Answer:"""
658
  }
659
  .response-icon {
660
  font-size: 1.5rem !important;
661
- color: var(--primary-color) !important;
662
  }
663
  .divider {
664
  border: none !important;
665
- border-top: 1px dashed var(--border-color) !important;
666
  margin: 1rem 0 !important;
667
  }
668
  .error-message {
669
- background-color: var(--error-bg) !important;
670
- border: 2px solid var(--error-border) !important;
671
- color: var(--error-text) !important;
672
  padding: 1.25rem !important;
673
  border-radius: 8px !important;
674
  display: flex !important;
@@ -682,7 +665,7 @@ Answer:"""
682
  box-sizing: border-box;
683
  }
684
  .error-message a {
685
- color: var(--error-text) !important;
686
  text-decoration: underline !important;
687
  }
688
  .error-icon {
@@ -692,24 +675,24 @@ Answer:"""
692
  }
693
  .error-details {
694
  font-size: 0.85rem !important;
695
- color: var(--error-text) !important;
696
  margin-top: 0.5rem !important;
697
  opacity: 0.8;
698
  }
699
  .placeholder {
700
- background-color: var(--background-primary) !important;
701
- border: 2px dashed var(--border-color) !important;
702
  border-radius: 8px !important;
703
  padding: 2.5rem 1.5rem !important;
704
  text-align: center !important;
705
- color: var(--text-secondary) !important;
706
  font-style: italic !important;
707
  font-size: 1.1rem !important;
708
  width: 100%;
709
  box-sizing: border-box;
710
  }
711
  .examples-section .gr-samples-table {
712
- border: 2px solid var(--border-color) !important;
713
  border-radius: 8px !important;
714
  overflow: hidden !important;
715
  margin-top: 1rem !important;
@@ -720,22 +703,22 @@ Answer:"""
720
  border: none !important;
721
  font-size: 0.95rem !important;
722
  text-align: left !important;
723
- color: var(--text-primary) !important;
724
  }
725
  .examples-section .gr-samples-table th {
726
- background-color: var(--background-secondary) !important;
727
  font-weight: 700 !important;
728
- color: var(--text-primary) !important;
729
  }
730
  .examples-section .gr-samples-table td {
731
- background-color: var(--background-primary) !important;
732
- color: var(--text-primary) !important;
733
- border-top: 1px solid var(--border-color) !important;
734
  cursor: pointer !important;
735
  transition: background 0.2s ease, transform 0.1s ease !important;
736
  }
737
  .examples-section .gr-samples-table tr:hover td {
738
- background-color: var(--background-secondary) !important;
739
  transform: translateX(5px);
740
  }
741
  .gr-examples .gr-label,
@@ -744,20 +727,20 @@ Answer:"""
744
  display: none !important;
745
  }
746
  .app-footer-wrapper {
747
- background: linear-gradient(145deg, var(--background-primary) 0%, var(--background-secondary) 100%) !important;
748
- border: 2px solid var(--border-color) !important;
749
  border-radius: 12px !important;
750
  padding: 1.75rem !important;
751
  margin-top: 1.5rem !important;
752
  margin-bottom: 1.5rem !important;
753
  text-align: center !important;
754
- color: var(--text-primary) !important;
755
  }
756
  .app-footer p {
757
  margin: 0 !important;
758
  max-width: 90% !important;
759
  font-size: 0.95rem !important;
760
- color: var(--text-secondary) !important;
761
  line-height: 1.6 !important;
762
  background-color: transparent !important;
763
  text-align: center !important;
@@ -765,10 +748,10 @@ Answer:"""
765
  }
766
  .app-footer strong, .app-footer b {
767
  font-weight: 700 !important;
768
- color: var(--primary-color) !important;
769
  }
770
  .app-footer a {
771
- color: var(--primary-color) !important;
772
  text-decoration: underline !important;
773
  font-weight: 600 !important;
774
  }
@@ -815,7 +798,10 @@ Answer:"""
815
  }
816
  """
817
 
818
- with gr.Blocks(css=custom_css, title="Landlord-Tenant Rights Assistant") as demo:
 
 
 
819
  with gr.Group(elem_classes="app-header-wrapper"):
820
  gr.Markdown(
821
  """
@@ -933,7 +919,6 @@ Answer:"""
933
  )
934
 
935
  return demo
936
-
937
  # --- Main Execution Block (UNCHANGED from original logic) ---
938
  if __name__ == "__main__":
939
  logging.info("Starting Landlord-Tenant Rights Bot application...")
 
243
  raise RuntimeError(f"Failed to process PDF '{pdf_path}': {e}") from e
244
 
245
  # --- GRADIO INTERFACE (NEW UI DESIGN) ---
246
+ import gradio as gr
247
+
248
  def gradio_interface(self):
249
  def query_interface_wrapper(api_key: str, query: str, state: str) -> str:
250
  # Basic client-side validation for immediate feedback (redundant but good UX)
 
295
  /* Import legible fonts from Google Fonts */
296
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
297
 
298
+ /* Forcefully override default styles with high specificity */
299
+ html, body, .gradio-container {
300
+ background-color: hsl(30, 100%, 96%) !important;
301
+ color: #4A3C32 !important;
302
+ transition: background-color 0.3s, color 0.3s !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
  .gradio-container {
305
  max-width: 900px !important;
306
  margin: 0 auto !important;
307
  padding: 1.5rem !important;
308
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
 
309
  box-shadow: none !important;
 
310
  }
311
  .main-dashboard-container > * {
312
+ background-color: hsl(30, 100%, 99.9%) !important;
313
  }
314
  .app-header-wrapper {
315
+ background: linear-gradient(145deg, hsl(30, 100%, 99.9%) 0%, hsl(30, 100%, 96%) 100%) !important;
316
+ border: 2px solid hsl(30, 70%, 85%) !important;
317
  border-radius: 16px !important;
318
  padding: 2.5rem 1.5rem !important;
319
  margin-bottom: 1.5rem !important;
320
+ box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
321
  position: relative;
322
  overflow: hidden;
323
  text-align: center !important;
324
+ color: #4A3C32 !important;
325
  }
326
  .app-header-wrapper::before {
327
  content: '';
 
339
  font-size: 8.5rem !important;
340
  margin-bottom: 0.75rem !important;
341
  display: block !important;
342
+ color: #FF8C00 !important;
343
  position: relative;
344
  z-index: 1;
345
  animation: float-icon 3s ease-in-out infinite alternate;
 
353
  font-family: 'Poppins', sans-serif !important;
354
  font-size: 3rem !important;
355
  font-weight: 800 !important;
356
+ color: #4A3C32 !important;
357
  margin: 0 0 0.75rem 0 !important;
358
  line-height: 1.1 !important;
359
  letter-spacing: -0.03em !important;
 
364
  }
365
  .app-header-tagline {
366
  font-size: 1.25rem !important;
367
+ color: #8C7B6F !important;
368
  font-weight: 400 !important;
369
  margin: 0 !important;
370
  max-width: 700px;
 
378
  gap: 1.25rem !important;
379
  }
380
  .dashboard-card-section {
381
+ background-color: hsl(30, 100%, 99.9%) !important;
382
+ border: 2px solid hsl(30, 70%, 85%) !important;
383
  border-radius: 12px !important;
384
  padding: 0 !important;
385
+ box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
386
  transition: all 0.3s ease-out !important;
387
  cursor: default;
388
+ color: #4A3C32 !important;
389
  }
390
  .dashboard-card-section:hover {
391
+ box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
392
  transform: translateY(-3px) !important;
393
  }
394
  .full-width-center {
 
400
  background-color: transparent !important;
401
  }
402
  .section-title-gradient-bar {
403
+ background-color: hsl(30, 100%, 96%) !important;
404
  padding: 1.25rem 1.75rem !important;
405
  border-top-left-radius: 10px !important;
406
  border-top-right-radius: 10px !important;
 
408
  text-align: center !important;
409
  box-sizing: border-box;
410
  width: 100%;
411
+ color: #4A3C32 !important;
412
  }
413
  .section-title {
414
  font-family: 'Poppins', sans-serif !important;
415
  font-size: 1.7rem !important;
416
  font-weight: 700 !important;
417
+ color: #4A3C32 !important;
418
  margin: 0 !important;
419
  padding-bottom: 0 !important;
420
+ border-bottom: 2px solid hsl(30, 70%, 85%) !important;
421
  line-height: 1.1 !important;
422
  display: inline-block !important;
423
  text-align: center !important;
 
425
  }
426
  .dashboard-card-content-area {
427
  padding: 0 1.75rem 1.75rem 1.75rem !important;
428
+ background-color: hsl(30, 100%, 99.9%) !important;
429
  box-sizing: border-box;
430
  width: 100%;
431
+ color: #4A3C32 !important;
432
  }
433
  .dashboard-card-section p {
434
  line-height: 1.7 !important;
435
+ color: #4A3C32 !important;
436
  font-size: 1rem !important;
437
  text-align: left !important;
438
  background-color: transparent !important;
 
442
  }
443
  .dashboard-card-section strong, .dashboard-card-section b {
444
  font-weight: 700 !important;
445
+ color: #FF8C00 !important;
446
  }
447
  .gr-block, .gr-box, .gr-prose, .gr-form, .gr-panel,
448
  .gr-columns, .gr-column,
449
  .gradio-html, .gradio-markdown, .gradio-textbox, .gradio-radio, .gradio-button {
450
  background-color: transparent !important;
451
+ color: #4A3C32 !important;
452
  white-space: normal !important;
453
  overflow-wrap: break-word;
454
  word-break: break-word;
 
457
  .gradio-textbox input,
458
  .gradio-radio label,
459
  .placeholder {
460
+ background-color: hsl(30, 100%, 99.9%) !important;
461
+ color: #4A3C32 !important;
462
  }
463
  .gradio-textbox {
464
  margin-bottom: 0.5rem !important;
465
  }
466
  .gradio-textbox textarea,
467
  .gradio-textbox input {
468
+ border: 2px solid hsl(30, 70%, 85%) !important;
469
  border-radius: 8px !important;
470
  padding: 0.85rem 1rem !important;
471
  font-size: 0.98rem !important;
472
  font-family: 'Inter', sans-serif !important;
473
+ color: #4A3C32 !important;
474
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
475
+ box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
476
  }
477
  .gradio-textbox .scroll-hide {
478
+ background-color: hsl(30, 100%, 99.9%) !important;
479
  }
480
  .gradio-textbox textarea:focus,
481
  .gradio-textbox input:focus {
482
  outline: none !important;
483
+ border-color: #FF8C00 !important;
484
  box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.2) !important;
485
  }
486
  .gradio-radio {
 
495
  justify-content: center !important;
496
  align-items: center !important;
497
  padding: 0.75rem 1rem !important;
498
+ border: 2px solid hsl(30, 70%, 85%) !important;
499
  border-radius: 8px !important;
500
+ color: #4A3C32 !important;
501
  font-weight: 500 !important;
502
  cursor: pointer !important;
503
  transition: all 0.2s ease-out !important;
504
+ box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
505
  margin: 0.2rem 0 !important;
506
  width: 100 !important;
507
  box-sizing: border-box !important;
508
  }
509
  .gradio-radio label span.text-lg {
510
  font-weight: 600 !important;
511
+ color: #4A3C32 !important;
512
  font-size: 0.98rem !important;
513
  }
514
  .gradio-radio label:hover {
515
+ background-color: hsl(30, 100%, 96%) !important;
516
+ border-color: #FF8C00 !important;
517
+ box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
518
  transform: translateY(-2px) !important;
519
  }
520
  .gradio-radio input[type="radio"]:checked + label {
521
+ background-color: #FF8C00 !important;
522
+ color: #4A3C32 !important;
523
+ border-color: #E07B00 !important;
524
+ box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
525
  transform: translateY(-1px) !important;
526
  }
527
  .gradio-radio input[type="radio"]:checked + label span.text-lg {
528
+ color: #4A3C32 !important;
529
  }
530
  .gradio-radio .gr-form {
531
  padding: 0 !important;
 
533
  .gradio-textbox label,
534
  .gradio-radio > label {
535
  font-weight: 600 !important;
536
+ color: #4A3C32 !important;
537
  font-size: 1rem !important;
538
  margin-bottom: 0.6rem !important;
539
  display: block !important;
 
541
  }
542
  .gr-prose {
543
  font-size: 0.9rem !important;
544
+ color: #8C7B6F !important;
545
  margin-top: 0.4rem !important;
546
  text-align: left !important;
547
  background-color: transparent !important;
 
571
  cursor: pointer !important;
572
  border: 2px solid transparent !important;
573
  text-align: center !important;
574
+ color: #4A3C32 !important;
575
  }
576
  .gr-button-primary {
577
+ background-color: #FF8C00 !important;
578
  color: white !important;
579
+ box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
580
  }
581
  .gr-button-primary:hover {
582
+ background-color: #E07B00 !important;
583
+ box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
584
  transform: translateY(-2px) !important;
585
  }
586
  .gr-button-primary:active {
 
589
  }
590
  .gr-button-secondary {
591
  background-color: transparent !important;
592
+ color: #4A3C32 !important;
593
+ border-color: hsl(30, 70%, 85%) !important;
594
  }
595
  .gr-button-secondary:hover {
596
+ background-color: hsl(30, 100%, 96%) !important;
597
+ border-color: #FF8C00 !important;
598
  transform: translateY(-2px) !important;
599
  }
600
  .gr-button-secondary:active {
 
602
  box-shadow: none !important;
603
  }
604
  .output-content-wrapper {
605
+ background-color: hsl(30, 100%, 99.9%) !important;
606
+ border: 2px solid hsl(30, 70%, 85%) !important;
607
  border-radius: 8px !important;
608
  padding: 1.5rem !important;
609
  min-height: 150px !important;
610
+ color: #4A3C32 !important;
611
  display: flex;
612
  flex-direction: column;
613
  justify-content: center;
 
621
  overflow-wrap: break-word;
622
  word-break: break-word;
623
  text-align: left !important;
624
+ color: #4A3C32 !important;
625
  }
626
  @keyframes fadeInAndSlideUp {
627
  from { opacity: 0; transform: translateY(15px); }
 
630
  .response-header {
631
  font-size: 1.3rem !important;
632
  font-weight: 700 !important;
633
+ color: #FF8C00 !important;
634
  margin-bottom: 0.75rem !important;
635
  display: flex !important;
636
  align-items: center !important;
 
641
  }
642
  .response-icon {
643
  font-size: 1.5rem !important;
644
+ color: #FF8C00 !important;
645
  }
646
  .divider {
647
  border: none !important;
648
+ border-top: 1px dashed hsl(30, 70%, 85%) !important;
649
  margin: 1rem 0 !important;
650
  }
651
  .error-message {
652
+ background-color: #FFF0E0 !important;
653
+ border: 2px solid #FFD2B2 !important;
654
+ color: #E05C00 !important;
655
  padding: 1.25rem !important;
656
  border-radius: 8px !important;
657
  display: flex !important;
 
665
  box-sizing: border-box;
666
  }
667
  .error-message a {
668
+ color: #E05C00 !important;
669
  text-decoration: underline !important;
670
  }
671
  .error-icon {
 
675
  }
676
  .error-details {
677
  font-size: 0.85rem !important;
678
+ color: #E05C00 !important;
679
  margin-top: 0.5rem !important;
680
  opacity: 0.8;
681
  }
682
  .placeholder {
683
+ background-color: hsl(30, 100%, 99.9%) !important;
684
+ border: 2px dashed hsl(30, 70%, 85%) !important;
685
  border-radius: 8px !important;
686
  padding: 2.5rem 1.5rem !important;
687
  text-align: center !important;
688
+ color: #8C7B6F !important;
689
  font-style: italic !important;
690
  font-size: 1.1rem !important;
691
  width: 100%;
692
  box-sizing: border-box;
693
  }
694
  .examples-section .gr-samples-table {
695
+ border: 2px solid hsl(30, 70%, 85%) !important;
696
  border-radius: 8px !important;
697
  overflow: hidden !important;
698
  margin-top: 1rem !important;
 
703
  border: none !important;
704
  font-size: 0.95rem !important;
705
  text-align: left !important;
706
+ color: #4A3C32 !important;
707
  }
708
  .examples-section .gr-samples-table th {
709
+ background-color: hsl(30, 100%, 96%) !important;
710
  font-weight: 700 !important;
711
+ color: #4A3C32 !important;
712
  }
713
  .examples-section .gr-samples-table td {
714
+ background-color: hsl(30, 100%, 99.9%) !important;
715
+ color: #4A3C32 !important;
716
+ border-top: 1px solid hsl(30, 70%, 85%) !important;
717
  cursor: pointer !important;
718
  transition: background 0.2s ease, transform 0.1s ease !important;
719
  }
720
  .examples-section .gr-samples-table tr:hover td {
721
+ background-color: hsl(30, 100%, 96%) !important;
722
  transform: translateX(5px);
723
  }
724
  .gr-examples .gr-label,
 
727
  display: none !important;
728
  }
729
  .app-footer-wrapper {
730
+ background: linear-gradient(145deg, hsl(30, 100%, 99.9%) 0%, hsl(30, 100%, 96%) 100%) !important;
731
+ border: 2px solid hsl(30, 70%, 85%) !important;
732
  border-radius: 12px !important;
733
  padding: 1.75rem !important;
734
  margin-top: 1.5rem !important;
735
  margin-bottom: 1.5rem !important;
736
  text-align: center !important;
737
+ color: #4A3C32 !important;
738
  }
739
  .app-footer p {
740
  margin: 0 !important;
741
  max-width: 90% !important;
742
  font-size: 0.95rem !important;
743
+ color: #8C7B6F !important;
744
  line-height: 1.6 !important;
745
  background-color: transparent !important;
746
  text-align: center !important;
 
748
  }
749
  .app-footer strong, .app-footer b {
750
  font-weight: 700 !important;
751
+ color: #FF8C00 !important;
752
  }
753
  .app-footer a {
754
+ color: #FF8C00 !important;
755
  text-decoration: underline !important;
756
  font-weight: 600 !important;
757
  }
 
798
  }
799
  """
800
 
801
+ # Explicitly set Gradio theme to avoid platform defaults
802
+ custom_theme = gr.themes.Default(primary_hue="orange", secondary_hue="neutral", neutral_hue="beige")
803
+
804
+ with gr.Blocks(css=custom_css, theme=custom_theme, title="Landlord-Tenant Rights Assistant") as demo:
805
  with gr.Group(elem_classes="app-header-wrapper"):
806
  gr.Markdown(
807
  """
 
919
  )
920
 
921
  return demo
 
922
  # --- Main Execution Block (UNCHANGED from original logic) ---
923
  if __name__ == "__main__":
924
  logging.info("Starting Landlord-Tenant Rights Bot application...")