Nischal Subedi commited on
Commit
8ebc2da
·
1 Parent(s): 7f1c90c
Files changed (1) hide show
  1. app.py +30 -12
app.py CHANGED
@@ -432,10 +432,10 @@ Answer:"""
432
  }
433
  /* Card sections with clear boundaries and subtle dynamic effects */
434
  .dashboard-card-section {
435
- /* Background already set by .main-dashboard-container > * to primary white */
436
  border: 2px solid var(--border-color) !important; /* Distinct border */
437
  border-radius: 12px !important;
438
- padding: 0 !important; /* Removed padding to allow gradient bar to control it */
439
  box-shadow: var(--shadow-sm) !important; /* Subtle shadow */
440
  transition: all 0.3s ease-out !important; /* Smoother transition */
441
  cursor: default; /* Indicate not directly clickable (unless examples) */
@@ -454,13 +454,13 @@ Answer:"""
454
  flex-direction: column !important; /* Ensure content stacks vertically if needed */
455
  }
456
 
457
- /* NEW: Class for the gradient title bar within each card */
458
- .section-title-gradient-bar {
459
- background: linear-gradient(145deg, var(--background-primary) 0%, var(--background-secondary) 100%) !important;
460
  padding: 1.25rem 1.75rem !important; /* Inner padding for the title bar */
461
  border-top-left-radius: 10px !important; /* Match parent's border radius */
462
  border-top-right-radius: 10px !important;
463
- margin-bottom: 1.5rem !important; /* Space below the title bar */
464
  text-align: center !important; /* Ensure content inside this bar is centered */
465
  box-sizing: border-box; /* Include padding in width */
466
  width: 100%; /* Ensure it spans full width */
@@ -473,7 +473,7 @@ Answer:"""
473
  font-weight: 700 !important; /* Bolder */
474
  color: var(--text-primary) !important;
475
  margin: 0 !important; /* No margin on h3 itself as parent handles spacing */
476
- padding-bottom: 0.3rem !important; /* REDUCED to bring text closer to border */
477
  border-bottom: 2px solid var(--border-color) !important; /* Underline effect */
478
  line-height: 1.1 !important; /* Ensure line height does not add extra space */
479
  display: inline-block !important; /* Allow centering within text-align: center of parent */
@@ -498,14 +498,21 @@ Answer:"""
498
  padding: 0 !important; /* Remove default paragraph padding */
499
  white-space: normal !important; /* Ensure text wraps */
500
  }
501
- .dashboard-card-section strong {
 
502
  color: var(--primary-color) !important; /* Highlight strong text with primary color */
503
  }
504
 
505
  /* Overrides for common Gradio internal elements that might have default backgrounds */
506
- .gr-block, .gr-box, .gr-prose, .gr-form, .gr-panel, .gr-columns, .gr-column {
507
- background-color: transparent !important; /* Ensure these are transparent to show parent's color */
 
 
508
  color: var(--text-primary) !important; /* Ensure text color is consistent */
 
 
 
 
509
  }
510
 
511
 
@@ -612,11 +619,13 @@ Answer:"""
612
  text-align: left !important; /* Ensure these labels are left-aligned */
613
  }
614
  /* Info text styling below inputs (e.g., for API Key) */
615
- .gr-prose { /* This class is used by Gradio for info text */
 
616
  font-size: 0.9rem !important;
617
  color: var(--text-secondary) !important;
618
  margin-top: 0.4rem !important; /* More space for info text */
619
  text-align: left !important; /* Ensure info text is left aligned */
 
620
  }
621
  /* Input column layout improvements */
622
  .input-column { /* Renamed from .input-row */
@@ -830,6 +839,10 @@ Answer:"""
830
  text-align: center !important; /* Ensure footer text is centered */
831
  white-space: normal !important; /* Allow text to wrap */
832
  }
 
 
 
 
833
  .app-footer a {
834
  color: var(--primary-color) !important;
835
  text-decoration: none !important;
@@ -919,10 +932,14 @@ Answer:"""
919
  label="API Key",
920
  type="password", # Hides the input for security
921
  placeholder="Enter your OpenAI API key (e.g., sk-...)",
922
- info="Required to process your query. Get one from OpenAI: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)", # Made link clickable
923
  lines=1,
924
  elem_classes=["input-field-group"] # Custom class for input styling
925
  )
 
 
 
 
 
926
 
927
  # Query Input and State Selection Card
928
  with gr.Group(elem_classes="dashboard-card-section"):
@@ -981,6 +998,7 @@ Answer:"""
981
 
982
  # Footer Section - contains disclaimer and developer info (now including the full disclaimer)
983
  with gr.Group(elem_classes="app-footer-wrapper"):
 
984
  gr.Markdown(
985
  """
986
  <p>**Disclaimer:** This tool is for informational purposes only and does not constitute legal advice. For specific legal guidance, always consult with a licensed attorney in your jurisdiction.</p>
 
432
  }
433
  /* Card sections with clear boundaries and subtle dynamic effects */
434
  .dashboard-card-section {
435
+ background-color: var(--background-primary) !important; /* Solid primary background for card body */
436
  border: 2px solid var(--border-color) !important; /* Distinct border */
437
  border-radius: 12px !important;
438
+ padding: 0 !important; /* Removed padding to allow gradient bar and content area to control it */
439
  box-shadow: var(--shadow-sm) !important; /* Subtle shadow */
440
  transition: all 0.3s ease-out !important; /* Smoother transition */
441
  cursor: default; /* Indicate not directly clickable (unless examples) */
 
454
  flex-direction: column !important; /* Ensure content stacks vertically if needed */
455
  }
456
 
457
+ /* NEW: Class for the solid color title bar within each card */
458
+ .section-title-gradient-bar { /* Renamed for clarity to avoid confusion with actual gradient */
459
+ background-color: var(--background-secondary) !important; /* Solid warm peach/cream */
460
  padding: 1.25rem 1.75rem !important; /* Inner padding for the title bar */
461
  border-top-left-radius: 10px !important; /* Match parent's border radius */
462
  border-top-right-radius: 10px !important;
463
+ margin-bottom: 1rem !important; /* Reduced space below the title bar */
464
  text-align: center !important; /* Ensure content inside this bar is centered */
465
  box-sizing: border-box; /* Include padding in width */
466
  width: 100%; /* Ensure it spans full width */
 
473
  font-weight: 700 !important; /* Bolder */
474
  color: var(--text-primary) !important;
475
  margin: 0 !important; /* No margin on h3 itself as parent handles spacing */
476
+ padding-bottom: 0.2rem !important; /* REDUCED to bring text closer to border */
477
  border-bottom: 2px solid var(--border-color) !important; /* Underline effect */
478
  line-height: 1.1 !important; /* Ensure line height does not add extra space */
479
  display: inline-block !important; /* Allow centering within text-align: center of parent */
 
498
  padding: 0 !important; /* Remove default paragraph padding */
499
  white-space: normal !important; /* Ensure text wraps */
500
  }
501
+ .dashboard-card-section strong, .dashboard-card-section b {
502
+ font-weight: 700 !important; /* Ensure bold is actually bold */
503
  color: var(--primary-color) !important; /* Highlight strong text with primary color */
504
  }
505
 
506
  /* Overrides for common Gradio internal elements that might have default backgrounds */
507
+ /* These ensure transparency or explicit primary background for common Gradio containers */
508
+ .gr-block, .gr-box, .gr-prose, .gr-form, .gr-panel, .gr-columns, .gr-column,
509
+ .gradio-html, .gradio-markdown {
510
+ background-color: transparent !important;
511
  color: var(--text-primary) !important; /* Ensure text color is consistent */
512
+ /* Ensure text wrapping for markdown as well */
513
+ white-space: normal !important;
514
+ overflow-wrap: break-word;
515
+ word-break: break-word;
516
  }
517
 
518
 
 
619
  text-align: left !important; /* Ensure these labels are left-aligned */
620
  }
621
  /* Info text styling below inputs (e.g., for API Key) */
622
+ /* Specifically target gr-prose if it is the direct child of a gr.Block or gr.Group */
623
+ .gr-prose {
624
  font-size: 0.9rem !important;
625
  color: var(--text-secondary) !important;
626
  margin-top: 0.4rem !important; /* More space for info text */
627
  text-align: left !important; /* Ensure info text is left aligned */
628
+ background-color: transparent !important; /* Ensure no unwanted background */
629
  }
630
  /* Input column layout improvements */
631
  .input-column { /* Renamed from .input-row */
 
839
  text-align: center !important; /* Ensure footer text is centered */
840
  white-space: normal !important; /* Allow text to wrap */
841
  }
842
+ .app-footer strong, .app-footer b {
843
+ font-weight: 700 !important; /* Ensure bold is actually bold */
844
+ color: var(--primary-color) !important; /* Highlight strong text with primary color */
845
+ }
846
  .app-footer a {
847
  color: var(--primary-color) !important;
848
  text-decoration: none !important;
 
932
  label="API Key",
933
  type="password", # Hides the input for security
934
  placeholder="Enter your OpenAI API key (e.g., sk-...)",
 
935
  lines=1,
936
  elem_classes=["input-field-group"] # Custom class for input styling
937
  )
938
+ # Separate Markdown for the clickable info link
939
+ gr.Markdown(
940
+ "Required to process your query. Get one from OpenAI: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)",
941
+ elem_classes="gr-prose" # Reuse Gradio's info text class for styling
942
+ )
943
 
944
  # Query Input and State Selection Card
945
  with gr.Group(elem_classes="dashboard-card-section"):
 
998
 
999
  # Footer Section - contains disclaimer and developer info (now including the full disclaimer)
1000
  with gr.Group(elem_classes="app-footer-wrapper"):
1001
+ # Use p tags to ensure proper text wrapping and centering.
1002
  gr.Markdown(
1003
  """
1004
  <p>**Disclaimer:** This tool is for informational purposes only and does not constitute legal advice. For specific legal guidance, always consult with a licensed attorney in your jurisdiction.</p>