Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -175,69 +175,120 @@ def search_hadith(query, top_k):
|
|
| 175 |
# Custom CSS (polished, professional)
|
| 176 |
# ===============================
|
| 177 |
custom_css = """
|
| 178 |
-
/*
|
| 179 |
-
body
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
.results { margin-top: 10px; }
|
| 182 |
-
|
|
|
|
| 183 |
.card {
|
| 184 |
-
background: #ffffff;
|
| 185 |
-
border-radius: 12px;
|
| 186 |
-
padding: 18px;
|
| 187 |
-
margin-bottom: 14px;
|
| 188 |
-
box-shadow: 0 6px 20px rgba(18, 38, 63, 0.
|
| 189 |
-
border: 1px solid
|
|
|
|
| 190 |
}
|
| 191 |
-
|
|
|
|
| 192 |
.card-header {
|
| 193 |
-
display: flex;
|
| 194 |
-
justify-content: space-between;
|
| 195 |
-
align-items: flex-start;
|
| 196 |
-
gap: 12px;
|
| 197 |
-
margin-bottom: 10px;
|
| 198 |
}
|
| 199 |
-
.card-header .left { display:flex; flex-direction: column; gap:6px; }
|
|
|
|
|
|
|
| 200 |
.index {
|
| 201 |
-
display:inline-block;
|
| 202 |
-
background: linear-gradient(90deg,#2563eb,#06b6d4);
|
| 203 |
-
color:
|
| 204 |
-
padding:
|
| 205 |
-
border-radius: 20px;
|
| 206 |
-
font-weight:
|
| 207 |
-
font-size: 13px;
|
| 208 |
-
width: fit-content;
|
| 209 |
}
|
|
|
|
|
|
|
| 210 |
.title {
|
| 211 |
-
font-size:
|
| 212 |
-
font-weight: 700;
|
| 213 |
-
color: #0f172a;
|
| 214 |
}
|
| 215 |
.topic {
|
| 216 |
-
font-size: 13px;
|
| 217 |
-
color: #475569;
|
| 218 |
-
margin-top:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
}
|
| 220 |
-
|
| 221 |
-
.
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
| 230 |
.footer a {
|
| 231 |
-
text-decoration: none;
|
| 232 |
-
color: #2563eb
|
|
|
|
|
|
|
| 233 |
}
|
| 234 |
-
.footer a:hover { text-decoration: underline; }
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
|
|
|
|
|
|
| 238 |
@media (max-width: 700px) {
|
| 239 |
-
.card-header { flex-direction: column; align-items: flex-start; }
|
| 240 |
-
.right-meta { text-align: left; }
|
| 241 |
}
|
| 242 |
"""
|
| 243 |
|
|
|
|
| 175 |
# Custom CSS (polished, professional)
|
| 176 |
# ===============================
|
| 177 |
custom_css = """
|
| 178 |
+
/* ββ Force light background on the whole page ββ */
|
| 179 |
+
body, .gradio-container, .gradio-container * {
|
| 180 |
+
font-family: Inter, 'Segoe UI', Tahoma, Arial, sans-serif !important;
|
| 181 |
+
}
|
| 182 |
+
.gradio-container {
|
| 183 |
+
background-color: #f5f7fb !important;
|
| 184 |
+
max-width: 1400px !important;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
/* ββ Results wrapper ββ */
|
| 188 |
.results { margin-top: 10px; }
|
| 189 |
+
|
| 190 |
+
/* ββ Card ββ */
|
| 191 |
.card {
|
| 192 |
+
background: #ffffff !important;
|
| 193 |
+
border-radius: 12px !important;
|
| 194 |
+
padding: 18px !important;
|
| 195 |
+
margin-bottom: 14px !important;
|
| 196 |
+
box-shadow: 0 6px 20px rgba(18, 38, 63, 0.08) !important;
|
| 197 |
+
border: 1px solid #e2e8f0 !important;
|
| 198 |
+
color: #0f172a !important;
|
| 199 |
}
|
| 200 |
+
|
| 201 |
+
/* ββ Card header ββ */
|
| 202 |
.card-header {
|
| 203 |
+
display: flex !important;
|
| 204 |
+
justify-content: space-between !important;
|
| 205 |
+
align-items: flex-start !important;
|
| 206 |
+
gap: 12px !important;
|
| 207 |
+
margin-bottom: 10px !important;
|
| 208 |
}
|
| 209 |
+
.card-header .left { display:flex !important; flex-direction: column !important; gap:6px !important; }
|
| 210 |
+
|
| 211 |
+
/* ββ Rank badge ββ */
|
| 212 |
.index {
|
| 213 |
+
display: inline-block !important;
|
| 214 |
+
background: linear-gradient(90deg, #2563eb, #06b6d4) !important;
|
| 215 |
+
color: #ffffff !important;
|
| 216 |
+
padding: 4px 12px !important;
|
| 217 |
+
border-radius: 20px !important;
|
| 218 |
+
font-weight: 700 !important;
|
| 219 |
+
font-size: 13px !important;
|
| 220 |
+
width: fit-content !important;
|
| 221 |
}
|
| 222 |
+
|
| 223 |
+
/* ββ Title & topic ββ */
|
| 224 |
.title {
|
| 225 |
+
font-size: 17px !important;
|
| 226 |
+
font-weight: 700 !important;
|
| 227 |
+
color: #0f172a !important;
|
| 228 |
}
|
| 229 |
.topic {
|
| 230 |
+
font-size: 13px !important;
|
| 231 |
+
color: #475569 !important;
|
| 232 |
+
margin-top: 2px !important;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
/* ββ Right meta ββ */
|
| 236 |
+
.right-meta { text-align: right !important; min-width: 100px !important; }
|
| 237 |
+
.meta { font-size: 12px !important; color: #64748b !important; }
|
| 238 |
+
.meta-val { color: #1e293b !important; font-weight: 600 !important; margin-left: 4px !important; }
|
| 239 |
+
|
| 240 |
+
/* ββ Hadith text block (RTL Arabic) ββ */
|
| 241 |
+
.text-rtl {
|
| 242 |
+
direction: rtl !important;
|
| 243 |
+
text-align: right !important;
|
| 244 |
+
margin-top: 8px !important;
|
| 245 |
+
margin-bottom: 10px !important;
|
| 246 |
+
background: #f8fafc !important;
|
| 247 |
+
border-radius: 8px !important;
|
| 248 |
+
padding: 10px 14px !important;
|
| 249 |
+
border-right: 4px solid #2563eb !important;
|
| 250 |
+
}
|
| 251 |
+
.text-rtl details > summary {
|
| 252 |
+
cursor: pointer !important;
|
| 253 |
+
font-size: 16px !important;
|
| 254 |
+
color: #1e293b !important;
|
| 255 |
+
line-height: 2.0 !important;
|
| 256 |
+
list-style: none !important;
|
| 257 |
+
}
|
| 258 |
+
.text-rtl details > summary::-webkit-details-marker { display: none !important; }
|
| 259 |
+
.text-rtl details > summary::before {
|
| 260 |
+
content: "βΆ ";
|
| 261 |
+
font-size: 11px;
|
| 262 |
+
color: #2563eb;
|
| 263 |
+
margin-left: 6px;
|
| 264 |
}
|
| 265 |
+
.text-rtl details[open] > summary::before { content: "βΌ "; }
|
| 266 |
+
.text-rtl .full-text {
|
| 267 |
+
margin-top: 10px !important;
|
| 268 |
+
font-size: 16px !important;
|
| 269 |
+
color: #1e293b !important;
|
| 270 |
+
line-height: 2.0 !important;
|
| 271 |
+
border-top: 1px solid #e2e8f0 !important;
|
| 272 |
+
padding-top: 8px !important;
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
/* ββ Footer link ββ */
|
| 276 |
+
.footer { margin-top: 10px !important; }
|
| 277 |
.footer a {
|
| 278 |
+
text-decoration: none !important;
|
| 279 |
+
color: #2563eb !important;
|
| 280 |
+
font-weight: 600 !important;
|
| 281 |
+
font-size: 13px !important;
|
| 282 |
}
|
| 283 |
+
.footer a:hover { text-decoration: underline !important; }
|
| 284 |
+
|
| 285 |
+
/* ββ Empty state ββ */
|
| 286 |
+
.empty { font-size: 15px !important; color: #64748b !important; text-align: center !important; padding: 20px !important; }
|
| 287 |
+
|
| 288 |
+
/* ββ Responsive ββ */
|
| 289 |
@media (max-width: 700px) {
|
| 290 |
+
.card-header { flex-direction: column !important; align-items: flex-start !important; }
|
| 291 |
+
.right-meta { text-align: left !important; }
|
| 292 |
}
|
| 293 |
"""
|
| 294 |
|