Subahdip627 commited on
Commit
3a9fe32
·
verified ·
1 Parent(s): 0edbaf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +94 -97
app.py CHANGED
@@ -13,7 +13,6 @@ import os
13
  # ============================================
14
  # CLEAN RESPONSIVE CSS - UPDATED WITH DARKER GRAY BACKGROUND
15
  # ============================================
16
-
17
  custom_css = """
18
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
19
 
@@ -25,6 +24,10 @@ custom_css = """
25
  --text-main: #111827;
26
  }
27
 
 
 
 
 
28
  body, .gradio-container {
29
  font-family: 'Inter', sans-serif !important;
30
  background-color: #e5e7eb !important;
@@ -50,42 +53,42 @@ h1 span {
50
  -webkit-text-fill-color: transparent;
51
  }
52
 
53
- /* ===== FIX FOR METRIC VALUES (0, 0.0, N/A) ===== */
 
 
 
 
 
 
 
 
54
  .metric-value {
55
  font-size: 2rem !important;
56
  font-weight: 700 !important;
57
  color: var(--primary) !important;
58
  }
59
 
60
- .metric-value strong {
61
- color: var(--primary) !important;
62
- }
63
 
64
- div:has(.metric-value) strong {
65
- color: var(--primary) !important;
 
66
  }
67
 
68
- /* Professional Academic Paper Search text - BLUE */
69
- .subtitle-text {
70
- color: #2563eb !important;
71
- font-weight: 500 !important;
72
  }
73
 
74
- /* Slider comment style - for black region */
75
- .slider-comment {
76
- color: #ffffff !important;
77
- font-size: 0.9rem !important;
78
- margin-top: 8px !important;
79
- margin-bottom: 8px !important;
80
- font-style: italic !important;
81
- background: #1f2937 !important;
82
- padding: 8px 12px !important;
83
- border-radius: 6px !important;
84
- border-left: 4px solid var(--primary) !important;
85
- font-weight: 500 !important;
86
  }
87
 
88
- /* Tab styling */
 
 
 
89
  .tab-nav {
90
  background-color: #f3f4f6 !important;
91
  border-radius: 8px !important;
@@ -105,40 +108,27 @@ div:has(.metric-value) strong {
105
  color: white !important;
106
  }
107
 
108
- /* Ensure all text in white cards is properly colored */
109
- .white-card p, .white-card li, .white-card div:not(.slider-comment) {
110
- color: #111827 !important;
111
- }
112
-
113
- .white-card label {
114
- color: var(--primary) !important;
115
- font-weight: 500 !important;
116
- }
117
-
118
- /* Button text color - PURE WHITE for all buttons */
119
- button, .gr-button, .lg.primary, button.variant-primary, .gr-button-primary,
120
- button.variant-secondary, .gr-button-secondary, button.secondary {
121
- color: #ffffff !important;
122
- font-weight: 600 !important;
123
- }
124
 
125
- /* Ensure button text stays white on hover/focus */
126
- button:hover, .gr-button:hover, button:focus, .gr-button:focus {
127
  color: #ffffff !important;
 
 
 
 
 
 
 
 
 
128
  }
129
 
130
- /* Primary button background */
131
- button.variant-primary, .gr-button-primary {
132
- background-color: var(--primary) !important;
133
- }
134
-
135
- /* Secondary button background - unified */
136
- button.variant-secondary, .gr-button-secondary, button.secondary {
137
- background-color: #6b7280 !important;
138
- }
139
 
140
- /* ===== DROPDOWN STYLING ===== */
141
- /* Main dropdown button - keep dark with white text */
142
  .gr-dropdown, .gr-dropdown select, select {
143
  background-color: #374151 !important;
144
  color: #ffffff !important;
@@ -146,74 +136,81 @@ button.variant-secondary, .gr-button-secondary, button.secondary {
146
  border-radius: 6px !important;
147
  }
148
 
149
- /* ===== FORCE DROPDOWN POPUP LIGHT GRAY (GRADIO PORTAL FIX) ===== */
 
 
 
 
 
 
 
150
 
151
- /* Target floating dropdown container */
152
- body div[role="listbox"],
153
- body div[role="menu"],
154
- body .gradio-container div[role="listbox"],
155
- body .gradio-container div[role="menu"] {
156
- background-color: #f3f4f6 !important; /* LIGHT GRAY */
157
  border: 1px solid #d1d5db !important;
158
- box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15) !important;
 
 
159
  }
160
 
161
- /* Target each option item */
162
- body div[role="option"] {
163
  background-color: #f3f4f6 !important;
164
  color: #111827 !important;
 
165
  }
166
 
167
  /* Hover state */
168
- body div[role="option"]:hover {
169
  background-color: #e5e7eb !important;
170
  color: #111827 !important;
171
  }
172
 
173
- /* Selected option */
174
- body div[role="option"][aria-selected="true"] {
 
 
175
  background-color: #2563eb !important;
176
  color: #ffffff !important;
177
  }
178
 
179
- /* Hover effect */
180
- .gr-dropdown-list .item:hover,
181
- .dropdown-list .item:hover,
182
- .gr-dropdown .options .option:hover,
183
- select option:hover,
184
- div[role="option"]:hover {
185
- background-color: #f3f4f6 !important; /* Light gray on hover */
186
- color: #111827 !important;
187
  }
188
-
189
- /* Selected option */
190
- .gr-dropdown-list .item.selected,
191
- .dropdown-list .item.selected,
192
- select option:checked,
193
- div[role="option"][aria-selected="true"] {
194
- background-color: var(--primary) !important;
195
- color: white !important;
 
 
 
196
  }
197
 
198
- /* ===== DROPDOWN POPUP - LIGHT GRAY + DARK TEXT ===== */
199
 
200
- body div[role="listbox"] {
201
- background: #f3f4f6 !important;
202
- border: 1px solid #d1d5db !important;
203
- }
204
 
205
- body div[role="option"] {
206
- background: #f3f4f6 !important;
207
- color: #111827 !important;
208
- }
209
 
210
- body div[role="option"]:hover {
211
- background: #e5e7eb !important;
212
- color: #111827 !important;
 
 
 
 
213
  }
214
 
215
- body div[role="option"][aria-selected="true"] {
216
- background: #2563eb !important;
 
217
  color: #ffffff !important;
218
  }
219
  """
@@ -587,7 +584,7 @@ def create_interface():
587
  with gr.Blocks(
588
  title="PaperSearchPro",
589
  css=custom_css,
590
- theme=gr.themes.Soft(
591
  primary_hue="blue",
592
  neutral_hue="gray"
593
  )) as demo:
 
13
  # ============================================
14
  # CLEAN RESPONSIVE CSS - UPDATED WITH DARKER GRAY BACKGROUND
15
  # ============================================
 
16
  custom_css = """
17
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
18
 
 
24
  --text-main: #111827;
25
  }
26
 
27
+ /* ================================================= */
28
+ /* GENERAL LAYOUT */
29
+ /* ================================================= */
30
+
31
  body, .gradio-container {
32
  font-family: 'Inter', sans-serif !important;
33
  background-color: #e5e7eb !important;
 
53
  -webkit-text-fill-color: transparent;
54
  }
55
 
56
+ .subtitle-text {
57
+ color: #2563eb !important;
58
+ font-weight: 500 !important;
59
+ }
60
+
61
+ /* ================================================= */
62
+ /* METRICS */
63
+ /* ================================================= */
64
+
65
  .metric-value {
66
  font-size: 2rem !important;
67
  font-weight: 700 !important;
68
  color: var(--primary) !important;
69
  }
70
 
71
+ /* ================================================= */
72
+ /* BUTTONS */
73
+ /* ================================================= */
74
 
75
+ button, .gr-button {
76
+ color: #ffffff !important;
77
+ font-weight: 600 !important;
78
  }
79
 
80
+ button.variant-primary {
81
+ background-color: var(--primary) !important;
 
 
82
  }
83
 
84
+ button.variant-secondary {
85
+ background-color: #6b7280 !important;
 
 
 
 
 
 
 
 
 
 
86
  }
87
 
88
+ /* ================================================= */
89
+ /* TABS */
90
+ /* ================================================= */
91
+
92
  .tab-nav {
93
  background-color: #f3f4f6 !important;
94
  border-radius: 8px !important;
 
108
  color: white !important;
109
  }
110
 
111
+ /* ================================================= */
112
+ /* SLIDER COMMENT */
113
+ /* ================================================= */
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
+ .slider-comment {
 
116
  color: #ffffff !important;
117
+ font-size: 0.9rem !important;
118
+ margin-top: 8px !important;
119
+ margin-bottom: 8px !important;
120
+ font-style: italic !important;
121
+ background: #1f2937 !important;
122
+ padding: 8px 12px !important;
123
+ border-radius: 6px !important;
124
+ border-left: 4px solid var(--primary) !important;
125
+ font-weight: 500 !important;
126
  }
127
 
128
+ /* ================================================= */
129
+ /* DROPDOWN BUTTON (Closed State) */
130
+ /* ================================================= */
 
 
 
 
 
 
131
 
 
 
132
  .gr-dropdown, .gr-dropdown select, select {
133
  background-color: #374151 !important;
134
  color: #ffffff !important;
 
136
  border-radius: 6px !important;
137
  }
138
 
139
+ /* ================================================= */
140
+ /* PERFECT DROPDOWN POPUP FIX (NO BLACK / NO WHITE) */
141
+ /* ================================================= */
142
+
143
+ /* Target HeadlessUI portal */
144
+ div[id^="headlessui-portal"] {
145
+ background: transparent !important;
146
+ }
147
 
148
+ /* Dropdown container */
149
+ div[id^="headlessui-portal"] div[role="listbox"] {
150
+ background-color: #f3f4f6 !important;
 
 
 
151
  border: 1px solid #d1d5db !important;
152
+ box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
153
+ border-radius: 8px !important;
154
+ overflow: hidden !important;
155
  }
156
 
157
+ /* All options */
158
+ div[id^="headlessui-portal"] div[role="option"] {
159
  background-color: #f3f4f6 !important;
160
  color: #111827 !important;
161
+ padding: 10px 14px !important;
162
  }
163
 
164
  /* Hover state */
165
+ div[id^="headlessui-portal"] div[role="option"]:hover {
166
  background-color: #e5e7eb !important;
167
  color: #111827 !important;
168
  }
169
 
170
+ /* Selected option (strong override) */
171
+ div[id^="headlessui-portal"] div[role="option"][aria-selected="true"],
172
+ div[id^="headlessui-portal"] div[role="option"].selected,
173
+ div[id^="headlessui-portal"] div[role="option"][data-headlessui-state~="selected"] {
174
  background-color: #2563eb !important;
175
  color: #ffffff !important;
176
  }
177
 
178
+ /* Fix checkmark icon color */
179
+ div[id^="headlessui-portal"] svg {
180
+ color: #ffffff !important;
181
+ fill: #ffffff !important;
 
 
 
 
182
  }
183
+ /* ================================================= */
184
+ /* METRIC LABEL BLACK BACKGROUND */
185
+ /* ================================================= */
186
+
187
+ .metric-label {
188
+ display: inline-block !important;
189
+ background-color: #111827 !important; /* Black */
190
+ color: #ffffff !important; /* White text */
191
+ padding: 6px 12px !important;
192
+ border-radius: 6px !important;
193
+ font-weight: 600 !important;
194
  }
195
 
 
196
 
 
 
 
 
197
 
198
+ /* ================================================= */
199
+ /* METRIC VALUE BLACK BACKGROUND FIX */
200
+ /* ================================================= */
 
201
 
202
+ .metric-value {
203
+ display: inline-block !important;
204
+ background-color: #111827 !important; /* Black */
205
+ color: #ffffff !important; /* White text */
206
+ padding: 6px 12px !important;
207
+ border-radius: 6px !important;
208
+ font-weight: 700 !important;
209
  }
210
 
211
+ /* Remove default white background from strong */
212
+ .metric-value strong {
213
+ background: transparent !important;
214
  color: #ffffff !important;
215
  }
216
  """
 
584
  with gr.Blocks(
585
  title="PaperSearchPro",
586
  css=custom_css,
587
+ theme=gr.themes.Default(
588
  primary_hue="blue",
589
  neutral_hue="gray"
590
  )) as demo: