Nischal Subedi commited on
Commit ·
ede9114
1
Parent(s): 1b02536
UI v31
Browse files
app.py
CHANGED
|
@@ -255,7 +255,7 @@ Answer:"""
|
|
| 255 |
if "<div class='error-message'>" in answer:
|
| 256 |
return answer
|
| 257 |
else:
|
| 258 |
-
# Use Markdown to
|
| 259 |
formatted_response_content = gr.Markdown.format(
|
| 260 |
f"<div class='response-header'><span class='response-icon'>📜</span>Response for {state}</div><hr class='divider'>{answer}"
|
| 261 |
)
|
|
@@ -286,40 +286,41 @@ Answer:"""
|
|
| 286 |
example_queries.append(["What basic rights do tenants have?", "California"])
|
| 287 |
|
| 288 |
|
| 289 |
-
# Custom CSS for the dark theme based on the provided image
|
| 290 |
custom_css = """
|
| 291 |
/* Import legible fonts from Google Fonts */
|
| 292 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
|
| 293 |
|
| 294 |
/* Root variables for consistent theming - based on image's dark theme */
|
| 295 |
:root {
|
| 296 |
-
--primary-color: hsl(150, 60%, 50%); /* Vibrant Seafoam Green for highlights (Submit button,
|
| 297 |
--primary-hover: hsl(150, 60%, 45%);
|
| 298 |
--accent-orange: hsl(30, 90%, 55%); /* Vibrant Orange for specific highlights (Disclaimer) */
|
| 299 |
|
| 300 |
--background-app: hsl(210, 15%, 15%); /* Dark charcoal/navy for overall background */
|
| 301 |
-
--background-card: hsl(210, 30%, 20%); /* Deep blue for content cards (
|
| 302 |
-
--background-input-output: hsl(
|
| 303 |
|
| 304 |
-
--text-
|
| 305 |
-
|
| 306 |
-
--text-muted-
|
| 307 |
-
--text-muted-
|
|
|
|
|
|
|
|
|
|
| 308 |
|
| 309 |
-
--border-light: hsl(210, 10%, 65%); /* Light gray for outer card borders */
|
| 310 |
-
--border-input: hsl(210, 15%, 45%); /* Mid-tone blue-gray for borders on dark input fields (original image) */
|
| 311 |
-
--border-white-input: hsl(210, 5%, 80%); /* Light gray border for white input fields (new) */
|
| 312 |
-
|
| 313 |
--shadow-sm: 0 1px 3px rgba(0,0,0,0.15);
|
| 314 |
--shadow-md: 0 4px 10px rgba(0,0,0,0.3);
|
| 315 |
--shadow-lg: 0 10px 20px rgba(0,0,0,0.4);
|
| 316 |
|
| 317 |
-
--error-bg: hsl(0, 70%, 20%);
|
| 318 |
--error-border: hsl(0, 70%, 35%);
|
| 319 |
-
--error-text: hsl(0, 90%, 80%);
|
| 320 |
|
| 321 |
-
--button-secondary-bg: hsl(0, 0%, 85%); /* Light gray
|
| 322 |
-
--button-secondary-text: hsl(210, 30%, 20%); /* Dark
|
|
|
|
|
|
|
| 323 |
}
|
| 324 |
|
| 325 |
/* Body and Gradio Container */
|
|
@@ -333,14 +334,14 @@ Answer:"""
|
|
| 333 |
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
|
| 334 |
background-color: var(--background-app) !important; /* Overall background */
|
| 335 |
box-shadow: none !important;
|
| 336 |
-
border: 2px solid var(--border-
|
| 337 |
border-radius: 16px !important;
|
| 338 |
}
|
| 339 |
|
| 340 |
/* Header Styling (title box) */
|
| 341 |
.app-header-wrapper {
|
| 342 |
background: var(--background-card) !important; /* Consistent deep blue with other cards (as per image) */
|
| 343 |
-
border: 2px solid var(--border-
|
| 344 |
border-radius: 16px !important;
|
| 345 |
padding: 2.5rem 1.5rem !important;
|
| 346 |
margin-bottom: 1.5rem !important;
|
|
@@ -348,7 +349,7 @@ Answer:"""
|
|
| 348 |
box-shadow: var(--shadow-md) !important;
|
| 349 |
position: relative;
|
| 350 |
overflow: hidden;
|
| 351 |
-
color: var(--text-
|
| 352 |
}
|
| 353 |
.app-header-wrapper::before { /* Subtle background pattern */
|
| 354 |
content: '';
|
|
@@ -367,7 +368,7 @@ Answer:"""
|
|
| 367 |
font-size: 4.5rem !important; /* Larger icon */
|
| 368 |
margin-bottom: 0.75rem !important;
|
| 369 |
display: block !important;
|
| 370 |
-
color: var(--border-
|
| 371 |
position: relative;
|
| 372 |
z-index: 1;
|
| 373 |
animation: float-icon 3s ease-in-out infinite alternate;
|
|
@@ -381,7 +382,7 @@ Answer:"""
|
|
| 381 |
font-family: 'Poppins', sans-serif !important;
|
| 382 |
font-size: 3rem !important;
|
| 383 |
font-weight: 800 !important;
|
| 384 |
-
color: var(--text-
|
| 385 |
margin: 0 0 0.75rem 0 !important;
|
| 386 |
line-height: 1.1 !important;
|
| 387 |
letter-spacing: -0.03em !important;
|
|
@@ -390,7 +391,7 @@ Answer:"""
|
|
| 390 |
}
|
| 391 |
.app-header-tagline {
|
| 392 |
font-size: 1.25rem !important;
|
| 393 |
-
color: var(--text-
|
| 394 |
font-weight: 400 !important;
|
| 395 |
margin: 0 !important;
|
| 396 |
max-width: 700px;
|
|
@@ -408,13 +409,13 @@ Answer:"""
|
|
| 408 |
}
|
| 409 |
.dashboard-card-section {
|
| 410 |
background: var(--background-card) !important; /* Deep blue for content cards */
|
| 411 |
-
border: 2px solid var(--border-
|
| 412 |
border-radius: 12px !important;
|
| 413 |
padding: 1.75rem !important;
|
| 414 |
box-shadow: var(--shadow-sm) !important;
|
| 415 |
transition: all 0.3s ease-out !important;
|
| 416 |
cursor: default;
|
| 417 |
-
color: var(--text-
|
| 418 |
}
|
| 419 |
.dashboard-card-section:hover {
|
| 420 |
box-shadow: var(--shadow-md) !important;
|
|
@@ -426,7 +427,7 @@ Answer:"""
|
|
| 426 |
font-family: 'Poppins', sans-serif !important;
|
| 427 |
font-size: 1.7rem !important;
|
| 428 |
font-weight: 700 !important;
|
| 429 |
-
color: var(--text-
|
| 430 |
text-align: left !important; /* LEFT-ALIGNED as per image */
|
| 431 |
margin: 0 0 1.25rem 0 !important;
|
| 432 |
padding-bottom: 0.75rem !important;
|
|
@@ -436,32 +437,32 @@ Answer:"""
|
|
| 436 |
}
|
| 437 |
.dashboard-card-section p {
|
| 438 |
line-height: 1.7 !important;
|
| 439 |
-
color: var(--text-
|
| 440 |
font-size: 1rem !important;
|
| 441 |
}
|
| 442 |
.dashboard-card-section strong {
|
| 443 |
color: var(--accent-orange) !important; /* Orange for specific strong text (e.g., Disclaimer) */
|
| 444 |
}
|
| 445 |
|
| 446 |
-
/* Input Styling (textboxes, dropdowns) - now
|
| 447 |
.gradio-textbox textarea,
|
| 448 |
.gradio-textbox input,
|
| 449 |
.gradio-dropdown > div > input[type="text"],
|
| 450 |
.gradio-dropdown .primary-wrap,
|
| 451 |
.gradio-dropdown .scroll-hide {
|
| 452 |
-
background: var(--background-input-output) !important; /*
|
| 453 |
-
border: 2px solid var(--border-
|
| 454 |
border-radius: 8px !important;
|
| 455 |
padding: 0.85rem 1rem !important;
|
| 456 |
font-size: 0.98rem !important;
|
| 457 |
font-family: 'Inter', sans-serif !important;
|
| 458 |
-
color: var(--text-dark) !important; /*
|
| 459 |
transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
|
| 460 |
box-shadow: var(--shadow-sm) !important;
|
| 461 |
}
|
| 462 |
.gradio-textbox textarea::placeholder,
|
| 463 |
.gradio-textbox input::placeholder {
|
| 464 |
-
color: var(--text-muted-
|
| 465 |
opacity: 0.7;
|
| 466 |
}
|
| 467 |
.gradio-textbox textarea:focus,
|
|
@@ -475,7 +476,7 @@ Answer:"""
|
|
| 475 |
.gradio-textbox label,
|
| 476 |
.gradio-dropdown label {
|
| 477 |
font-weight: 600 !important;
|
| 478 |
-
color: var(--text-
|
| 479 |
font-size: 1rem !important;
|
| 480 |
margin-bottom: 0.6rem !important;
|
| 481 |
display: block !important;
|
|
@@ -483,7 +484,7 @@ Answer:"""
|
|
| 483 |
.gradio-textbox .gr-form,
|
| 484 |
.gradio-dropdown .gr-form {
|
| 485 |
font-size: 0.9rem !important;
|
| 486 |
-
color: var(--text-muted-
|
| 487 |
margin-top: 0.4rem !important;
|
| 488 |
}
|
| 489 |
.input-row {
|
|
@@ -529,7 +530,7 @@ Answer:"""
|
|
| 529 |
.gr-button-secondary {
|
| 530 |
background: var(--button-secondary-bg) !important; /* Light gray button */
|
| 531 |
color: var(--button-secondary-text) !important; /* Dark text */
|
| 532 |
-
border-color: var(--border-
|
| 533 |
}
|
| 534 |
.gr-button-secondary:hover {
|
| 535 |
background: hsl(0, 0%, 75%) !important; /* Darker gray on hover */
|
|
@@ -541,14 +542,14 @@ Answer:"""
|
|
| 541 |
box-shadow: none !important;
|
| 542 |
}
|
| 543 |
|
| 544 |
-
/* Output Styling - now
|
| 545 |
.output-content-wrapper {
|
| 546 |
-
background: var(--background-input-output) !important; /*
|
| 547 |
-
border: 2px dashed var(--border-
|
| 548 |
border-radius: 8px !important;
|
| 549 |
padding: 1.5rem !important;
|
| 550 |
min-height: 150px !important;
|
| 551 |
-
color: var(--text-dark) !important; /*
|
| 552 |
display: flex;
|
| 553 |
flex-direction: column;
|
| 554 |
justify-content: center;
|
|
@@ -562,7 +563,7 @@ Answer:"""
|
|
| 562 |
overflow-wrap: break-word;
|
| 563 |
word-break: break-word;
|
| 564 |
text-align: left !important;
|
| 565 |
-
color: var(--text-dark) !important; /* Ensure this also overrides to
|
| 566 |
}
|
| 567 |
@keyframes fadeInAndSlideUp {
|
| 568 |
from { opacity: 0; transform: translateY(15px); }
|
|
@@ -583,7 +584,7 @@ Answer:"""
|
|
| 583 |
}
|
| 584 |
.divider {
|
| 585 |
border: none !important;
|
| 586 |
-
border-top: 1px dashed var(--border-
|
| 587 |
margin: 1rem 0 !important;
|
| 588 |
}
|
| 589 |
.error-message {
|
|
@@ -618,21 +619,21 @@ Answer:"""
|
|
| 618 |
opacity: 0.8;
|
| 619 |
}
|
| 620 |
.placeholder {
|
| 621 |
-
background: var(--background-input-output) !important; /*
|
| 622 |
-
border: 2px dashed var(--border-
|
| 623 |
border-radius: 8px !important;
|
| 624 |
padding: 2.5rem 1.5rem !important;
|
| 625 |
text-align: center !important;
|
| 626 |
-
color: var(--text-muted-
|
| 627 |
font-style: italic !important;
|
| 628 |
font-size: 1.1rem !important;
|
| 629 |
width: 100%;
|
| 630 |
box-sizing: border-box;
|
| 631 |
}
|
| 632 |
|
| 633 |
-
/* Examples Table Styling - now
|
| 634 |
.examples-section .gr-samples-table {
|
| 635 |
-
border: 2px solid var(--border-
|
| 636 |
border-radius: 8px !important;
|
| 637 |
overflow: hidden !important;
|
| 638 |
margin-top: 1rem !important;
|
|
@@ -647,17 +648,17 @@ Answer:"""
|
|
| 647 |
.examples-section .gr-samples-table th {
|
| 648 |
background: var(--background-card) !important; /* Deep blue for example header */
|
| 649 |
font-weight: 700 !important;
|
| 650 |
-
color: var(--text-
|
| 651 |
}
|
| 652 |
.examples-section .gr-samples-table td {
|
| 653 |
-
background: var(--background-input-output) !important; /*
|
| 654 |
-
color: var(--text-dark) !important; /*
|
| 655 |
-
border-top: 1px solid var(--border-
|
| 656 |
cursor: pointer !important;
|
| 657 |
transition: background 0.2s ease, transform 0.1s ease !important;
|
| 658 |
}
|
| 659 |
.examples-section .gr-samples-table tr:hover td {
|
| 660 |
-
background: hsl(
|
| 661 |
transform: translateX(5px);
|
| 662 |
}
|
| 663 |
.gr-examples .gr-label,
|
|
@@ -669,28 +670,28 @@ Answer:"""
|
|
| 669 |
/* Footer Styling */
|
| 670 |
.app-footer-wrapper {
|
| 671 |
background: var(--background-card) !important; /* Deep blue for footer */
|
| 672 |
-
border: 2px solid var(--border-
|
| 673 |
border-radius: 12px !important;
|
| 674 |
padding: 1.75rem !important;
|
| 675 |
margin-top: 1.5rem !important;
|
| 676 |
text-align: center !important;
|
| 677 |
-
color: var(--text-
|
| 678 |
}
|
| 679 |
.app-footer p {
|
| 680 |
margin: 0.6rem 0 !important;
|
| 681 |
font-size: 0.95rem !important;
|
| 682 |
-
color: var(--text-muted-
|
| 683 |
line-height: 1.6 !important;
|
| 684 |
}
|
| 685 |
.app-footer a {
|
| 686 |
-
color: var(--
|
| 687 |
text-decoration: none !important;
|
| 688 |
font-weight: 600 !important;
|
| 689 |
transition: text-decoration 0.2s ease, text-decoration-color 0.2s ease !important;
|
| 690 |
}
|
| 691 |
.app-footer a:hover {
|
| 692 |
text-decoration: underline !important;
|
| 693 |
-
text-decoration-color: var(--
|
| 694 |
}
|
| 695 |
|
| 696 |
/* Responsive Design */
|
|
@@ -744,7 +745,6 @@ Answer:"""
|
|
| 744 |
with gr.Column(elem_classes="main-dashboard-container"):
|
| 745 |
|
| 746 |
with gr.Group(elem_classes="dashboard-card-section"):
|
| 747 |
-
# Use a span to color "Disclaimer:" orange
|
| 748 |
gr.Markdown("<h3 class='sub-section-title'>Welcome & Disclaimer</h3>")
|
| 749 |
gr.Markdown(
|
| 750 |
"""
|
|
@@ -757,10 +757,10 @@ Answer:"""
|
|
| 757 |
with gr.Group(elem_classes="dashboard-card-section"):
|
| 758 |
gr.Markdown("<h3 class='sub-section-title'>OpenAI API Key</h3>")
|
| 759 |
api_key_input = gr.Textbox(
|
| 760 |
-
label="API Key",
|
| 761 |
type="password",
|
| 762 |
placeholder="Enter your OpenAI API key (e.g., sk-...)",
|
| 763 |
-
info="Required to process your query. Get one from OpenAI: platform.openai.com/api-keys",
|
| 764 |
lines=1,
|
| 765 |
elem_classes=["input-field-group"]
|
| 766 |
)
|
|
@@ -770,7 +770,7 @@ Answer:"""
|
|
| 770 |
with gr.Row(elem_classes="input-row"):
|
| 771 |
with gr.Column(elem_classes="input-field", scale=3):
|
| 772 |
query_input = gr.Textbox(
|
| 773 |
-
label="Your Question",
|
| 774 |
placeholder="E.g., What are the rules for security deposit returns in my state?",
|
| 775 |
lines=4,
|
| 776 |
max_lines=8,
|
|
@@ -778,7 +778,7 @@ Answer:"""
|
|
| 778 |
)
|
| 779 |
with gr.Column(elem_classes="input-field", scale=1):
|
| 780 |
state_input = gr.Dropdown(
|
| 781 |
-
label="Select State",
|
| 782 |
choices=dropdown_choices,
|
| 783 |
value=initial_value,
|
| 784 |
allow_custom_value=False,
|
|
@@ -790,9 +790,9 @@ Answer:"""
|
|
| 790 |
|
| 791 |
with gr.Group(elem_classes="dashboard-card-section"):
|
| 792 |
gr.Markdown("<h3 class='sub-section-title'>Legal Assistant's Response</h3>")
|
| 793 |
-
output = gr.HTML(
|
| 794 |
value="<div class='placeholder'>The answer will appear here after submitting your query.</div>",
|
| 795 |
-
elem_classes="output-content-wrapper"
|
| 796 |
)
|
| 797 |
|
| 798 |
with gr.Group(elem_classes="dashboard-card-section examples-section"):
|
|
|
|
| 255 |
if "<div class='error-message'>" in answer:
|
| 256 |
return answer
|
| 257 |
else:
|
| 258 |
+
# Use Markdown.format to correctly render markdown inside the HTML output
|
| 259 |
formatted_response_content = gr.Markdown.format(
|
| 260 |
f"<div class='response-header'><span class='response-icon'>📜</span>Response for {state}</div><hr class='divider'>{answer}"
|
| 261 |
)
|
|
|
|
| 286 |
example_queries.append(["What basic rights do tenants have?", "California"])
|
| 287 |
|
| 288 |
|
| 289 |
+
# Custom CSS for the dark theme based on the provided image and latest requests
|
| 290 |
custom_css = """
|
| 291 |
/* Import legible fonts from Google Fonts */
|
| 292 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
|
| 293 |
|
| 294 |
/* Root variables for consistent theming - based on image's dark theme */
|
| 295 |
:root {
|
| 296 |
+
--primary-color: hsl(150, 60%, 50%); /* Vibrant Seafoam Green for highlights (Submit button, focus) */
|
| 297 |
--primary-hover: hsl(150, 60%, 45%);
|
| 298 |
--accent-orange: hsl(30, 90%, 55%); /* Vibrant Orange for specific highlights (Disclaimer) */
|
| 299 |
|
| 300 |
--background-app: hsl(210, 15%, 15%); /* Dark charcoal/navy for overall background */
|
| 301 |
+
--background-card: hsl(210, 30%, 20%); /* Deep blue for main content cards (image primary blue) */
|
| 302 |
+
--background-input-output: hsl(210, 25%, 30%); /* Lighter blue/gray for input/output elements (image inner blue) */
|
| 303 |
|
| 304 |
+
--text-on-dark: hsl(0, 0%, 95%); /* Very light text (white/light gray) for dark backgrounds */
|
| 305 |
+
|
| 306 |
+
--text-muted-on-dark: hsl(210, 10%, 70%); /* Muted light text for secondary info on dark backgrounds */
|
| 307 |
+
--text-muted-on-input: hsl(210, 15%, 55%); /* Muted blue-gray for placeholders on input fields */
|
| 308 |
+
|
| 309 |
+
--border-card: hsl(210, 10%, 65%); /* Light gray for outer card borders (from image) */
|
| 310 |
+
--border-input: hsl(210, 15%, 45%); /* Mid-tone blue-gray for borders on inner elements */
|
| 311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
--shadow-sm: 0 1px 3px rgba(0,0,0,0.15);
|
| 313 |
--shadow-md: 0 4px 10px rgba(0,0,0,0.3);
|
| 314 |
--shadow-lg: 0 10px 20px rgba(0,0,0,0.4);
|
| 315 |
|
| 316 |
+
--error-bg: hsl(0, 70%, 20%);
|
| 317 |
--error-border: hsl(0, 70%, 35%);
|
| 318 |
+
--error-text: hsl(0, 90%, 80%);
|
| 319 |
|
| 320 |
+
--button-secondary-bg: hsl(0, 0%, 85%); /* Light gray button */
|
| 321 |
+
--button-secondary-text: hsl(210, 30%, 20%); /* Dark text for secondary button */
|
| 322 |
+
|
| 323 |
+
--link-footer-color: hsl(210, 20%, 65%); /* Specific blue for footer links as per image */
|
| 324 |
}
|
| 325 |
|
| 326 |
/* Body and Gradio Container */
|
|
|
|
| 334 |
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
|
| 335 |
background-color: var(--background-app) !important; /* Overall background */
|
| 336 |
box-shadow: none !important;
|
| 337 |
+
border: 2px solid var(--border-card) !important; /* Outer border as per image */
|
| 338 |
border-radius: 16px !important;
|
| 339 |
}
|
| 340 |
|
| 341 |
/* Header Styling (title box) */
|
| 342 |
.app-header-wrapper {
|
| 343 |
background: var(--background-card) !important; /* Consistent deep blue with other cards (as per image) */
|
| 344 |
+
border: 2px solid var(--border-card) !important; /* Border for header is the same as card border */
|
| 345 |
border-radius: 16px !important;
|
| 346 |
padding: 2.5rem 1.5rem !important;
|
| 347 |
margin-bottom: 1.5rem !important;
|
|
|
|
| 349 |
box-shadow: var(--shadow-md) !important;
|
| 350 |
position: relative;
|
| 351 |
overflow: hidden;
|
| 352 |
+
color: var(--text-on-dark) !important;
|
| 353 |
}
|
| 354 |
.app-header-wrapper::before { /* Subtle background pattern */
|
| 355 |
content: '';
|
|
|
|
| 368 |
font-size: 4.5rem !important; /* Larger icon */
|
| 369 |
margin-bottom: 0.75rem !important;
|
| 370 |
display: block !important;
|
| 371 |
+
color: var(--border-card) !important; /* Light gray for icon as per image */
|
| 372 |
position: relative;
|
| 373 |
z-index: 1;
|
| 374 |
animation: float-icon 3s ease-in-out infinite alternate;
|
|
|
|
| 382 |
font-family: 'Poppins', sans-serif !important;
|
| 383 |
font-size: 3rem !important;
|
| 384 |
font-weight: 800 !important;
|
| 385 |
+
color: var(--text-on-dark) !important; /* White for title */
|
| 386 |
margin: 0 0 0.75rem 0 !important;
|
| 387 |
line-height: 1.1 !important;
|
| 388 |
letter-spacing: -0.03em !important;
|
|
|
|
| 391 |
}
|
| 392 |
.app-header-tagline {
|
| 393 |
font-size: 1.25rem !important;
|
| 394 |
+
color: var(--text-on-dark) !important; /* White for tagline */
|
| 395 |
font-weight: 400 !important;
|
| 396 |
margin: 0 !important;
|
| 397 |
max-width: 700px;
|
|
|
|
| 409 |
}
|
| 410 |
.dashboard-card-section {
|
| 411 |
background: var(--background-card) !important; /* Deep blue for content cards */
|
| 412 |
+
border: 2px solid var(--border-card) !important; /* Border for all cards */
|
| 413 |
border-radius: 12px !important;
|
| 414 |
padding: 1.75rem !important;
|
| 415 |
box-shadow: var(--shadow-sm) !important;
|
| 416 |
transition: all 0.3s ease-out !important;
|
| 417 |
cursor: default;
|
| 418 |
+
color: var(--text-on-dark) !important; /* Ensure card content text is light */
|
| 419 |
}
|
| 420 |
.dashboard-card-section:hover {
|
| 421 |
box-shadow: var(--shadow-md) !important;
|
|
|
|
| 427 |
font-family: 'Poppins', sans-serif !important;
|
| 428 |
font-size: 1.7rem !important;
|
| 429 |
font-weight: 700 !important;
|
| 430 |
+
color: var(--text-on-dark) !important; /* White for titles */
|
| 431 |
text-align: left !important; /* LEFT-ALIGNED as per image */
|
| 432 |
margin: 0 0 1.25rem 0 !important;
|
| 433 |
padding-bottom: 0.75rem !important;
|
|
|
|
| 437 |
}
|
| 438 |
.dashboard-card-section p {
|
| 439 |
line-height: 1.7 !important;
|
| 440 |
+
color: var(--text-on-dark) !important; /* Text on dark cards is white */
|
| 441 |
font-size: 1rem !important;
|
| 442 |
}
|
| 443 |
.dashboard-card-section strong {
|
| 444 |
color: var(--accent-orange) !important; /* Orange for specific strong text (e.g., Disclaimer) */
|
| 445 |
}
|
| 446 |
|
| 447 |
+
/* Input Styling (textboxes, dropdowns) - now light blue-gray backgrounds */
|
| 448 |
.gradio-textbox textarea,
|
| 449 |
.gradio-textbox input,
|
| 450 |
.gradio-dropdown > div > input[type="text"],
|
| 451 |
.gradio-dropdown .primary-wrap,
|
| 452 |
.gradio-dropdown .scroll-hide {
|
| 453 |
+
background: var(--background-input-output) !important; /* Light blue-gray background for inputs */
|
| 454 |
+
border: 2px solid var(--border-input) !important; /* Mid-tone blue-gray border for inner elements */
|
| 455 |
border-radius: 8px !important;
|
| 456 |
padding: 0.85rem 1rem !important;
|
| 457 |
font-size: 0.98rem !important;
|
| 458 |
font-family: 'Inter', sans-serif !important;
|
| 459 |
+
color: var(--text-on-dark) !important; /* Light text for inputs */
|
| 460 |
transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
|
| 461 |
box-shadow: var(--shadow-sm) !important;
|
| 462 |
}
|
| 463 |
.gradio-textbox textarea::placeholder,
|
| 464 |
.gradio-textbox input::placeholder {
|
| 465 |
+
color: var(--text-muted-on-input) !important; /* Muted blue-gray placeholder text */
|
| 466 |
opacity: 0.7;
|
| 467 |
}
|
| 468 |
.gradio-textbox textarea:focus,
|
|
|
|
| 476 |
.gradio-textbox label,
|
| 477 |
.gradio-dropdown label {
|
| 478 |
font-weight: 600 !important;
|
| 479 |
+
color: var(--text-on-dark) !important; /* Labels (on dark card background) are white */
|
| 480 |
font-size: 1rem !important;
|
| 481 |
margin-bottom: 0.6rem !important;
|
| 482 |
display: block !important;
|
|
|
|
| 484 |
.gradio-textbox .gr-form,
|
| 485 |
.gradio-dropdown .gr-form {
|
| 486 |
font-size: 0.9rem !important;
|
| 487 |
+
color: var(--text-muted-on-dark) !important; /* Info text (on dark card background) is muted light */
|
| 488 |
margin-top: 0.4rem !important;
|
| 489 |
}
|
| 490 |
.input-row {
|
|
|
|
| 530 |
.gr-button-secondary {
|
| 531 |
background: var(--button-secondary-bg) !important; /* Light gray button */
|
| 532 |
color: var(--button-secondary-text) !important; /* Dark text */
|
| 533 |
+
border-color: var(--border-card) !important; /* Border matches general card border */
|
| 534 |
}
|
| 535 |
.gr-button-secondary:hover {
|
| 536 |
background: hsl(0, 0%, 75%) !important; /* Darker gray on hover */
|
|
|
|
| 542 |
box-shadow: none !important;
|
| 543 |
}
|
| 544 |
|
| 545 |
+
/* Output Styling - now light blue-gray background */
|
| 546 |
.output-content-wrapper {
|
| 547 |
+
background: var(--background-input-output) !important; /* Light blue-gray background for output box */
|
| 548 |
+
border: 2px dashed var(--border-input) !important; /* Dashed light blue-gray border */
|
| 549 |
border-radius: 8px !important;
|
| 550 |
padding: 1.5rem !important;
|
| 551 |
min-height: 150px !important;
|
| 552 |
+
color: var(--text-on-dark) !important; /* Light text for output */
|
| 553 |
display: flex;
|
| 554 |
flex-direction: column;
|
| 555 |
justify-content: center;
|
|
|
|
| 563 |
overflow-wrap: break-word;
|
| 564 |
word-break: break-word;
|
| 565 |
text-align: left !important;
|
| 566 |
+
color: var(--text-on-dark) !important; /* Ensure this also overrides to light text */
|
| 567 |
}
|
| 568 |
@keyframes fadeInAndSlideUp {
|
| 569 |
from { opacity: 0; transform: translateY(15px); }
|
|
|
|
| 584 |
}
|
| 585 |
.divider {
|
| 586 |
border: none !important;
|
| 587 |
+
border-top: 1px dashed var(--border-input) !important; /* Dashed light blue-gray divider */
|
| 588 |
margin: 1rem 0 !important;
|
| 589 |
}
|
| 590 |
.error-message {
|
|
|
|
| 619 |
opacity: 0.8;
|
| 620 |
}
|
| 621 |
.placeholder {
|
| 622 |
+
background: var(--background-input-output) !important; /* Light blue-gray background for placeholder */
|
| 623 |
+
border: 2px dashed var(--border-input) !important; /* Dashed light blue-gray border */
|
| 624 |
border-radius: 8px !important;
|
| 625 |
padding: 2.5rem 1.5rem !important;
|
| 626 |
text-align: center !important;
|
| 627 |
+
color: var(--text-muted-on-input) !important; /* Muted blue-gray text for placeholder */
|
| 628 |
font-style: italic !important;
|
| 629 |
font-size: 1.1rem !important;
|
| 630 |
width: 100%;
|
| 631 |
box-sizing: border-box;
|
| 632 |
}
|
| 633 |
|
| 634 |
+
/* Examples Table Styling - now light blue-gray background rows */
|
| 635 |
.examples-section .gr-samples-table {
|
| 636 |
+
border: 2px solid var(--border-card) !important; /* Outer table border matches cards */
|
| 637 |
border-radius: 8px !important;
|
| 638 |
overflow: hidden !important;
|
| 639 |
margin-top: 1rem !important;
|
|
|
|
| 648 |
.examples-section .gr-samples-table th {
|
| 649 |
background: var(--background-card) !important; /* Deep blue for example header */
|
| 650 |
font-weight: 700 !important;
|
| 651 |
+
color: var(--text-on-dark) !important; /* White text for header */
|
| 652 |
}
|
| 653 |
.examples-section .gr-samples-table td {
|
| 654 |
+
background: var(--background-input-output) !important; /* Light blue-gray for example rows */
|
| 655 |
+
color: var(--text-on-dark) !important; /* Light text for example rows */
|
| 656 |
+
border-top: 1px solid var(--border-input) !important; /* Mid-tone blue-gray border between rows */
|
| 657 |
cursor: pointer !important;
|
| 658 |
transition: background 0.2s ease, transform 0.1s ease !important;
|
| 659 |
}
|
| 660 |
.examples-section .gr-samples-table tr:hover td {
|
| 661 |
+
background: hsl(210, 25%, 35%) !important; /* Slightly darker light blue-gray on hover */
|
| 662 |
transform: translateX(5px);
|
| 663 |
}
|
| 664 |
.gr-examples .gr-label,
|
|
|
|
| 670 |
/* Footer Styling */
|
| 671 |
.app-footer-wrapper {
|
| 672 |
background: var(--background-card) !important; /* Deep blue for footer */
|
| 673 |
+
border: 2px solid var(--border-card) !important;
|
| 674 |
border-radius: 12px !important;
|
| 675 |
padding: 1.75rem !important;
|
| 676 |
margin-top: 1.5rem !important;
|
| 677 |
text-align: center !important;
|
| 678 |
+
color: var(--text-muted-on-dark) !important; /* Muted light text for footer */
|
| 679 |
}
|
| 680 |
.app-footer p {
|
| 681 |
margin: 0.6rem 0 !important;
|
| 682 |
font-size: 0.95rem !important;
|
| 683 |
+
color: var(--text-muted-on-dark) !important; /* Muted light text */
|
| 684 |
line-height: 1.6 !important;
|
| 685 |
}
|
| 686 |
.app-footer a {
|
| 687 |
+
color: var(--link-footer-color) !important; /* BLUE highlight for links (as per image) */
|
| 688 |
text-decoration: none !important;
|
| 689 |
font-weight: 600 !important;
|
| 690 |
transition: text-decoration 0.2s ease, text-decoration-color 0.2s ease !important;
|
| 691 |
}
|
| 692 |
.app-footer a:hover {
|
| 693 |
text-decoration: underline !important;
|
| 694 |
+
text-decoration-color: var(--link-footer-color) !important; /* Blue underline on hover */
|
| 695 |
}
|
| 696 |
|
| 697 |
/* Responsive Design */
|
|
|
|
| 745 |
with gr.Column(elem_classes="main-dashboard-container"):
|
| 746 |
|
| 747 |
with gr.Group(elem_classes="dashboard-card-section"):
|
|
|
|
| 748 |
gr.Markdown("<h3 class='sub-section-title'>Welcome & Disclaimer</h3>")
|
| 749 |
gr.Markdown(
|
| 750 |
"""
|
|
|
|
| 757 |
with gr.Group(elem_classes="dashboard-card-section"):
|
| 758 |
gr.Markdown("<h3 class='sub-section-title'>OpenAI API Key</h3>")
|
| 759 |
api_key_input = gr.Textbox(
|
| 760 |
+
label="API Key",
|
| 761 |
type="password",
|
| 762 |
placeholder="Enter your OpenAI API key (e.g., sk-...)",
|
| 763 |
+
info="Required to process your query. Get one from OpenAI: platform.openai.com/api-keys",
|
| 764 |
lines=1,
|
| 765 |
elem_classes=["input-field-group"]
|
| 766 |
)
|
|
|
|
| 770 |
with gr.Row(elem_classes="input-row"):
|
| 771 |
with gr.Column(elem_classes="input-field", scale=3):
|
| 772 |
query_input = gr.Textbox(
|
| 773 |
+
label="Your Question",
|
| 774 |
placeholder="E.g., What are the rules for security deposit returns in my state?",
|
| 775 |
lines=4,
|
| 776 |
max_lines=8,
|
|
|
|
| 778 |
)
|
| 779 |
with gr.Column(elem_classes="input-field", scale=1):
|
| 780 |
state_input = gr.Dropdown(
|
| 781 |
+
label="Select State",
|
| 782 |
choices=dropdown_choices,
|
| 783 |
value=initial_value,
|
| 784 |
allow_custom_value=False,
|
|
|
|
| 790 |
|
| 791 |
with gr.Group(elem_classes="dashboard-card-section"):
|
| 792 |
gr.Markdown("<h3 class='sub-section-title'>Legal Assistant's Response</h3>")
|
| 793 |
+
output = gr.HTML(
|
| 794 |
value="<div class='placeholder'>The answer will appear here after submitting your query.</div>",
|
| 795 |
+
elem_classes="output-content-wrapper"
|
| 796 |
)
|
| 797 |
|
| 798 |
with gr.Group(elem_classes="dashboard-card-section examples-section"):
|