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