salekml commited on
Commit
eebce7e
·
verified ·
1 Parent(s): e582725

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +482 -519
app.py CHANGED
@@ -8,6 +8,44 @@ import random
8
  # =========================
9
  WEATHER_API_KEY = "3a97c8c63350b72e8439c42e8d371b07"
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  # =========================
12
  # 📿 50 Moral Hadiths (English + Bengali)
13
  # =========================
@@ -117,258 +155,13 @@ HADITHS = [
117
  "happy_message": "Celebrate others' success - there's enough blessings for everyone! 🎉",
118
  "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 💖"
119
  },
120
- {
121
- "english": "Help your brother, whether he is an oppressor or oppressed.",
122
- "bengali": "তোমার ভাইকে সাহায্য করো, সে অত্যাচারী হোক বা অত্যাচারিত।",
123
- "reference": "Sahih Bukhari & Muslim",
124
- "happy_message": "True help means guiding toward justice and goodness! ⚖️",
125
- "salam": "As-Salamu Alaikum! Be a helper and a guide! 🌟"
126
- },
127
- {
128
- "english": "Avoid suspicion, for suspicion is the worst of false tales.",
129
- "bengali": "সন্দেহ এড়িয়ে চলো, কারণ সন্দেহ সবচেয়ে খারাপ মিথ্যা কথা।",
130
- "reference": "Sahih Bukhari & Muslim",
131
- "happy_message": "Think good of others - positivity attracts blessings! 🌞",
132
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Think positive! 💭"
133
- },
134
- {
135
- "english": "The best charity is that given in secret.",
136
- "bengali": "সর্বোত্তম সদকা হলো যা গোপনে দেওয়া হয়।",
137
- "reference": "Sahih Bukhari",
138
- "happy_message": "Give quietly and let Allah reward you abundantly! 🎁",
139
- "salam": "As-Salamu Alaikum! May your charity be blessed! 🤲"
140
- },
141
- {
142
- "english": "Protect yourself from hellfire even by giving half a date in charity.",
143
- "bengali": "এমনকি অর্ধেক খেজুর দান করে হলেও নিজেকে জাহান্নাম থেকে রক্ষা করো।",
144
- "reference": "Sahih Bukhari & Muslim",
145
- "happy_message": "No charity is too small when given with a sincere heart! 💝",
146
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 🌙"
147
- },
148
- {
149
- "english": "Whoever alleviates the hardship of a believer in this world, Allah will alleviate his hardship on the Day of Judgment.",
150
- "bengali": "যে কেউ এই দুনিয়ায় একজন মুমিনের কষ্ট লাঘব করে, আল্লাহ কিয়ামতের দিন তার কষ্ট লাঘব করবেন।",
151
- "reference": "Sahih Muslim",
152
- "happy_message": "Help ease someone's burden today - Allah sees everything! 👁️",
153
- "salam": "As-Salamu Alaikum! May Allah ease your difficulties! 🤲"
154
- },
155
- {
156
- "english": "Treat your parents with kindness.",
157
- "bengali": "তোমার পিতামাতার সাথে সদয় ব্যবহার করো।",
158
- "reference": "Sahih Bukhari & Muslim",
159
- "happy_message": "Show love to your parents - their prayers are powerful! 👨‍👩‍👦",
160
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Honor your parents! 💕"
161
- },
162
- {
163
- "english": "The rights of neighbors are very important in Islam.",
164
- "bengali": "ইসলামে প্রতিবেশীদের অধিকার অত্যন্ত গুরুত্বপূর্ণ।",
165
- "reference": "Sahih Bukhari",
166
- "happy_message": "A kind neighbor makes a happy community! 🏘️",
167
- "salam": "As-Salamu Alaikum! Be a blessing to your neighbors! 🌟"
168
- },
169
- {
170
- "english": "Help your neighbor even if he is a stranger.",
171
- "bengali": "তোমার প্রতিবেশীকে সাহায্য করো যদিও সে অপরিচিত।",
172
- "reference": "Sahih Muslim",
173
- "happy_message": "Kindness to neighbors brings peace to your home! 🏡",
174
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 💚"
175
- },
176
- {
177
- "english": "A good word is charity.",
178
- "bengali": "একটি ভালো কথা সদকা।",
179
- "reference": "Sahih Bukhari & Muslim",
180
- "happy_message": "Your kind words can heal hearts - speak them freely! 💬💖",
181
- "salam": "As-Salamu Alaikum! Speak words of kindness! 🌸"
182
- },
183
- {
184
- "english": "Do not mock others, nor insult them, nor defame them.",
185
- "bengali": "অন্যদের উপহাস করো না, অপমান করো না, তাদের মানহানি করো না।",
186
- "reference": "Sahih Muslim",
187
- "happy_message": "Respect everyone - we're all Allah's creation! 🌍",
188
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Show respect to all! 🙏"
189
- },
190
- {
191
- "english": "Avoid anger and forgive others.",
192
- "bengali": "রাগ এড়িয়ে চলো এবং অন্যদের ক্ষমা করো।",
193
- "reference": "Sahih Bukhari",
194
- "happy_message": "Forgiveness sets you free and brings inner peace! 🕊️",
195
- "salam": "As-Salamu Alaikum! Choose peace over anger! ☮️"
196
- },
197
- {
198
- "english": "Visit the sick, feed the hungry, and free the captives.",
199
- "bengali": "অসুস্থদের দেখতে যাও, ক্ষুধার্তদের খাওয়াও এবং বন্দীদের মুক্ত করো।",
200
- "reference": "Sahih Bukhari",
201
- "happy_message": "Your compassion in action makes the world better! 🌎",
202
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 🤲"
203
- },
204
- {
205
- "english": "Be merciful to the young, and respect the elderly.",
206
- "bengali": "তরুণদের প্রতি দয়ালু হও এবং বয়স্কদের সম্মান করো।",
207
- "reference": "Abu Dawud",
208
- "happy_message": "Love the young, honor the old - this is beautiful! 👶👴",
209
- "salam": "As-Salamu Alaikum! Respect all ages! 🌈"
210
- },
211
- {
212
- "english": "Speak softly; harsh speech turns people away.",
213
- "bengali": "মৃদু কথা বলো; কঠোর কথা মানুষকে দূরে সরিয়ে দেয়।",
214
- "reference": "Tirmidhi",
215
- "happy_message": "Gentle words open hearts and minds! 💝",
216
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Be gentle! 🌺"
217
- },
218
- {
219
- "english": "Do not waste food; it is a blessing.",
220
- "bengali": "খাবার নষ্ট করো না; এটি একটি আশীর্বাদ।",
221
- "reference": "Sahih Bukhari & Muslim",
222
- "happy_message": "Gratitude for food brings more blessings! 🍽️",
223
- "salam": "As-Salamu Alaikum! Be grateful for every bite! 🙏"
224
- },
225
- {
226
- "english": "Help animals; treat them with kindness.",
227
- "bengali": "পশুদের সাহায্য করো; তাদের সাথে দয়ালু আচরণ করো।",
228
- "reference": "Sahih Bukhari",
229
- "happy_message": "Kindness to animals shows a pure heart! 🐾",
230
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 🦋"
231
- },
232
- {
233
- "english": "Do not oppress anyone, and do not be oppressed.",
234
- "bengali": "কাউকে অত্যাচার করো না এবং অত্যাচারিত হয়ো না।",
235
- "reference": "Sahih Muslim",
236
- "happy_message": "Stand for justice and be strong in faith! ⚖️",
237
- "salam": "As-Salamu Alaikum! Justice brings peace! ☮️"
238
- },
239
- {
240
- "english": "Be truthful; it leads to righteousness.",
241
- "bengali": "সত্যবাদী হও; এটি ধার্মিকতার দিকে নিয়ে যায়।",
242
- "reference": "Sahih Bukhari & Muslim",
243
- "happy_message": "Truth is a shield that protects you always! 🛡️",
244
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Speak truth! 💎"
245
- },
246
- {
247
- "english": "Do not break promises or betray trusts.",
248
- "bengali": "প্রতিশ্রুতি ভঙ্গ করো না বা আমানতের খিয়ানত করো না।",
249
- "reference": "Sahih Muslim",
250
- "happy_message": "Trustworthiness makes you a person of honor! 🏆",
251
- "salam": "As-Salamu Alaikum! Be trustworthy always! 🤝"
252
- },
253
- {
254
- "english": "Maintain ties of kinship.",
255
- "bengali": "আত্মীয়তার বন্ধন বজায় রাখো।",
256
- "reference": "Sahih Bukhari & Muslim",
257
- "happy_message": "Family bonds bring blessings and joy! 👨‍👩‍👧‍👦",
258
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 💕"
259
- },
260
- {
261
- "english": "Give the best gift to your family.",
262
- "bengali": "তোমার পরিবারকে সর্বোত্তম উপহার দাও।",
263
- "reference": "Tirmidhi",
264
- "happy_message": "Your time and love are the best gifts! 🎁",
265
- "salam": "As-Salamu Alaikum! Cherish your family! ❤️"
266
- },
267
- {
268
- "english": "Smile in your brother's face; it is charity.",
269
- "bengali": "তোমার ভাইয়ের মুখে হাসি দাও; এটি সদকা।",
270
- "reference": "Sahih Bukhari & Muslim",
271
- "happy_message": "Your smile is a beautiful sadaqah! 😊",
272
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Keep smiling! 🌟"
273
- },
274
- {
275
- "english": "Feed your neighbor before yourself.",
276
- "bengali": "নিজের আগে তোমার প্রতিবেশীকে খাওয়াও।",
277
- "reference": "Sahih Muslim",
278
- "happy_message": "Sharing brings multiplied blessings! 🍲",
279
- "salam": "As-Salamu Alaikum! Share your blessings! 🌙"
280
- },
281
- {
282
- "english": "Be grateful to Allah and to people around you.",
283
- "bengali": "আল্লাহর এবং তোমার আশেপাশের মানুষের প্রতি কৃতজ্ঞ হও।",
284
- "reference": "Sahih Muslim",
285
- "happy_message": "Gratitude opens doors to more blessings! 🚪✨",
286
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 🙏"
287
- },
288
- {
289
- "english": "Speak gently to children; harshness harms the soul.",
290
- "bengali": "শিশুদের সাথে কোমলভাবে কথা বলো; কঠোরতা আত্মাকে ক্ষতিগ্রস্ত করে।",
291
- "reference": "Abu Dawud",
292
- "happy_message": "Nurture young hearts with love and kindness! 👶💖",
293
- "salam": "As-Salamu Alaikum! Be gentle with children! 🌸"
294
- },
295
- {
296
- "english": "Be humble; arrogance distances you from Allah.",
297
- "bengali": "বিনয়ী হও; অহংকার তোমাকে আল্লাহ থেকে দূরে সরিয়ে দেয়।",
298
- "reference": "Sahih Muslim",
299
- "happy_message": "Humility elevates you in the eyes of Allah! 🌙",
300
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Stay humble! 🙇"
301
- },
302
- {
303
- "english": "Forgive others to be forgiven.",
304
- "bengali": "ক্ষমা পেতে হলে অন্যদের ক্ষমা করো।",
305
- "reference": "Sahih Bukhari & Muslim",
306
- "happy_message": "Forgiveness is freedom for your soul! 🕊️",
307
- "salam": "As-Salamu Alaikum! Practice forgiveness! 💝"
308
- },
309
- {
310
- "english": "Do not be jealous of others' blessings.",
311
- "bengali": "অন্যদের আশীর্বাদে ঈর্ষান্বিত হয়ো না।",
312
- "reference": "Sahih Muslim",
313
- "happy_message": "Your blessings are on their way - be patient! ⏰",
314
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 🌟"
315
- },
316
- {
317
- "english": "A Muslim is one from whose tongue and hand people are safe.",
318
- "bengali": "মুসলিম সেই ব্যক্তি যার জিহ্বা ও হাত থেকে মানুষ নিরাপদ।",
319
- "reference": "Sahih Bukhari & Muslim",
320
- "happy_message": "Be a source of safety and peace for others! 🛡️",
321
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Be harmless! 🕊️"
322
- },
323
- {
324
- "english": "Pray for your brother in his absence.",
325
- "bengali": "তোমার ভাইয়ের অনুপস্থিতিতে তার জন্য দোয়া করো।",
326
- "reference": "Sahih Muslim",
327
- "happy_message": "Silent prayers for others bring angels' blessings to you! 👼",
328
- "salam": "As-Salamu Alaikum! Pray for each other! 🤲"
329
- },
330
- {
331
- "english": "The best deed is that done regularly, even if small.",
332
- "bengali": "সর্বোত্তম কাজ হলো যা নিয়মিত করা হয়, এমনকি ছোট হলেও।",
333
- "reference": "Sahih Bukhari & Muslim",
334
- "happy_message": "Consistency in small deeds brings great rewards! 🌟",
335
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 💫"
336
- },
337
- {
338
- "english": "Do not abandon prayer; it nurtures your heart.",
339
- "bengali": "নামাজ ত্যাগ করো না; এটি তোমার হৃদয়কে পুষ্টি দেয়।",
340
- "reference": "Sahih Muslim",
341
- "happy_message": "Prayer is your direct connection to peace! 🕌",
342
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Pray regularly! 📿"
343
- },
344
- {
345
- "english": "Be patient in hardship; it is the key to faith.",
346
- "bengali": "কষ্টে ধৈর্য ধরো; এটি ঈমানের চাবিকাঠি।",
347
- "reference": "Sahih Bukhari & Muslim",
348
- "happy_message": "After hardship comes ease - hold on! 🌈",
349
- "salam": "As-Salamu Alaikum! Stay patient and hopeful! 🌙"
350
- },
351
- {
352
- "english": "Avoid idle talk; it wastes the soul.",
353
- "bengali": "অলস কথা এড়িয়ে চলো; এটি আত্মাকে নষ্ট করে।",
354
- "reference": "Abu Dawud",
355
- "happy_message": "Use your words wisely - they matter! 💬",
356
- "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 🌟"
357
- },
358
- {
359
- "english": "Love for others what you love for yourself; this is faith.",
360
- "bengali": "অন্যদের জন্য তাই ভালোবাসো যা নিজের জন্য ভালোবাসো; এটিই ঈমান।",
361
- "reference": "Sahih Bukhari & Muslim",
362
- "happy_message": "Wishing well for others brings blessings to you! 🌟",
363
- "salam": "As-Salamu Alaikum Wa Rahmatullah! Love and be loved! 💖"
364
- }
365
  ]
366
 
367
  # =========================
368
  # 🕌 Get Real Prayer Times from Aladhan API
369
  # =========================
370
- def get_prayer_times(city, country):
371
- """Get real-time prayer times using Aladhan API"""
372
  try:
373
  # Get current date
374
  today = datetime.now()
@@ -378,7 +171,7 @@ def get_prayer_times(city, country):
378
  url = f"http://api.aladhan.com/v1/timingsByCity/{date_str}"
379
  params = {
380
  "city": city,
381
- "country": country,
382
  "method": 2 # ISNA (Islamic Society of North America)
383
  }
384
 
@@ -425,78 +218,79 @@ def get_temperature_advice(temp, weather_main):
425
  advice = []
426
 
427
  if temp > 35:
428
- advice.append("🔥 **Extreme Heat Alert!**")
429
- advice.append("• Stay indoors during peak hours (12 PM - 4 PM)")
430
- advice.append("• Shopping: Go early morning (6-9 AM) or after sunset (7-10 PM)")
431
- advice.append("• Drink water every 15-20 minutes during non-fasting hours")
432
- advice.append("• Avoid heavy physical activity - rest is important!")
433
- advice.append("• Perfect for indoor ibadah, Quran reading, or family time")
434
  elif temp > 30:
435
- advice.append("🌡️ **Hot Weather**")
436
- advice.append("• Morning walks: Best before 9 AM")
437
- advice.append("• Shopping: Evening after 6 PM is comfortable")
438
- advice.append("• Hydration: 8-10 glasses during Sehri to Iftar gap")
439
- advice.append("• Light outdoor activities okay in evening")
440
- advice.append("• Use umbrella and sunscreen if going out during day")
441
  elif temp > 25:
442
- advice.append("☀️ **Pleasant Warm Weather**")
443
- advice.append("• Perfect for evening walks after Iftar (30-45 mins)")
444
- advice.append("• Shopping: Comfortable anytime, best 4-8 PM")
445
- advice.append("• Moderate outdoor activities are fine")
446
- advice.append("• Great weather for family outings to parks/masjid")
447
- advice.append("• Don't forget regular hydration!")
448
  elif temp > 20:
449
- advice.append("🌤️ **Comfortable Weather**")
450
- advice.append("• Ideal for outdoor activities all day")
451
- advice.append("• Perfect for shopping, walking, light exercise")
452
- advice.append("• Comfortable clothing recommended")
453
- advice.append("• Great for community iftars and gatherings")
454
- advice.append("• Enjoy the beautiful weather - Allah's blessing!")
455
  elif temp > 15:
456
- advice.append("🍃 **Cool Weather**")
457
- advice.append("• Light jacket recommended for evening prayers")
458
- advice.append("• Perfect weather for Taraweeh walks")
459
- advice.append("• Good for visiting friends and family")
460
- advice.append("• Enjoy the cool, refreshing breeze!")
461
- advice.append("• Warm dates and tea perfect for Iftar")
462
  else:
463
- advice.append("❄️ **Cold Weather**")
464
- advice.append("• Wear warm clothes when going to masjid")
465
- advice.append("• Indoor activities recommended")
466
- advice.append("• Hot soups and drinks during Sehri and Iftar")
467
- advice.append("• Take special care of elderly and children")
468
- advice.append("• Warm blankets for Tahajjud prayers 🤲")
469
 
470
  # Weather-specific advice
471
  if weather_main == "rain":
472
- advice.append("\n☔ **Rainy Day Special:**")
473
- advice.append("• Carry umbrella for Taraweeh prayers")
474
- advice.append("• Perfect weather for indoor ibadah and dhikr")
475
- advice.append("• Make abundant dua - rain is blessed time! 🤲")
476
- advice.append("• Stay home if possible, read Quran with family")
477
  elif weather_main == "thunderstorm":
478
- advice.append("\n⛈️ **Thunderstorm Warning:**")
479
- advice.append("• Avoid going out unless absolutely necessary")
480
- advice.append("• Recite: SubhanAllahi wa bihamdihi (Glory to Allah)")
481
- advice.append("• Stay safe indoors with family")
482
- advice.append("• Perfect time for seeking Allah's protection")
483
  elif weather_main == "clouds":
484
- advice.append("\n☁️ **Cloudy & Pleasant:**")
485
- advice.append("• No harsh sun - excellent for shopping!")
486
- advice.append("• Comfortable for outdoor activities")
487
- advice.append("• Great day for visiting relatives")
488
 
489
  return "\n".join(advice)
490
 
491
  # =========================
492
  # 🌙 Main Ramadan Dashboard
493
  # =========================
494
- def get_ramadan_dashboard(city, country):
495
- if not city or not country:
496
  return """
497
- <div style="text-align:center; padding:40px; color:#ff6b6b; font-family: 'Poppins', sans-serif;">
498
- <h3>⚠️ Please enter both city and country</h3>
499
- <p>Example: City: Sylhet, Country: Bangladesh</p>
 
500
  </div>
501
  """
502
 
@@ -504,12 +298,10 @@ def get_ramadan_dashboard(city, country):
504
  daily_hadith = random.choice(HADITHS)
505
 
506
  # Get real prayer times
507
- prayer_times = get_prayer_times(city, country)
508
 
509
- # Get weather data
510
- city_query = city.strip()
511
- country_query = country.strip()
512
- weather_url = f"http://api.openweathermap.org/data/2.5/weather?q={city_query},{country_query}&appid={WEATHER_API_KEY}&units=metric"
513
 
514
  try:
515
  weather_response = requests.get(weather_url, timeout=10)
@@ -517,15 +309,16 @@ def get_ramadan_dashboard(city, country):
517
  except:
518
  return """
519
  <div style="text-align:center; padding:40px; color:#ff6b6b;">
520
- <h3>❌ Error connecting to weather service</h3>
 
521
  </div>
522
  """
523
 
524
  if weather_response.status_code != 200:
525
  return f"""
526
  <div style="text-align:center; padding:40px; color:#ff6b6b;">
527
- <h3>🔍 City '{city_query}' not found in '{country_query}'!</h3>
528
- <p>Please check spelling and try again</p>
529
  </div>
530
  """
531
 
@@ -540,15 +333,15 @@ def get_ramadan_dashboard(city, country):
540
  # Temperature advice
541
  temp_advice = get_temperature_advice(temp, weather_main)
542
 
543
- # Weather gradients
544
  weather_gradients = {
545
- "clear": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
546
- "clouds": "linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%)",
547
- "rain": "linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)",
548
- "drizzle": "linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)",
549
- "thunderstorm": "linear-gradient(135deg, #4b6cb7 0%, #182848 100%)",
550
- "snow": "linear-gradient(135deg, #e6dada 0%, #274046 100%)",
551
- "mist": "linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%)",
552
  }
553
  gradient = weather_gradients.get(weather_main, "linear-gradient(135deg, #667eea 0%, #764ba2 100%)")
554
 
@@ -563,15 +356,15 @@ def get_ramadan_dashboard(city, country):
563
  }
564
  icon = weather_icons.get(weather_main, "🌤️")
565
 
566
- # Build HTML with beautiful animations
567
  html = f"""
568
  <style>
569
- @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&family=Noto+Sans+Bengali:wght@400;600;700&family=Amiri:wght@400;700&display=swap');
570
 
571
  @keyframes fadeInUp {{
572
  from {{
573
  opacity: 0;
574
- transform: translateY(40px);
575
  }}
576
  to {{
577
  opacity: 1;
@@ -585,336 +378,466 @@ def get_ramadan_dashboard(city, country):
585
  opacity: 1;
586
  }}
587
  50% {{
588
- transform: scale(1.05);
589
- opacity: 0.9;
590
  }}
591
  }}
592
 
593
  @keyframes float {{
594
  0%, 100% {{
595
- transform: translateY(0px);
596
  }}
597
  50% {{
598
- transform: translateY(-15px);
599
  }}
600
  }}
601
 
602
  @keyframes twinkle {{
603
  0%, 100% {{
604
  opacity: 1;
 
605
  }}
606
  50% {{
607
- opacity: 0.3;
 
608
  }}
609
  }}
610
 
611
  @keyframes slideInLeft {{
612
  from {{
613
  opacity: 0;
614
- transform: translateX(-50px);
615
  }}
616
  to {{
617
  opacity: 1;
618
- transform: translateX(0);
619
  }}
620
  }}
621
 
622
  @keyframes slideInRight {{
623
  from {{
624
  opacity: 0;
625
- transform: translateX(50px);
626
  }}
627
  to {{
628
  opacity: 1;
629
- transform: translateX(0);
630
  }}
631
  }}
632
 
633
  @keyframes glow {{
634
  0%, 100% {{
635
- box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
636
  }}
637
  50% {{
638
- box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
  }}
640
  }}
641
 
642
  .dashboard-container {{
643
- animation: fadeInUp 0.8s ease-out;
644
  font-family: 'Poppins', 'Noto Sans Bengali', sans-serif;
645
  }}
646
 
647
  .card {{
648
  background: white;
649
- border-radius: 25px;
650
- padding: 35px;
651
- margin: 25px 0;
652
- box-shadow: 0 15px 35px rgba(0,0,0,0.1);
653
- transition: all 0.4s ease;
654
- animation: fadeInUp 0.6s ease-out;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  }}
656
 
657
  .card:hover {{
658
- transform: translateY(-8px);
659
- box-shadow: 0 20px 50px rgba(0,0,0,0.15);
660
  }}
661
 
662
  .mosque-decoration {{
663
- animation: float 4s ease-in-out infinite;
664
- font-size: 50px;
665
  display: inline-block;
 
666
  }}
667
 
668
  .star {{
669
  animation: twinkle 2s ease-in-out infinite;
670
  display: inline-block;
 
671
  }}
672
 
673
  .crescent {{
674
- animation: pulse 3s ease-in-out infinite;
675
  display: inline-block;
 
676
  }}
677
 
678
  .ramzan-header {{
679
- animation: glow 2s ease-in-out infinite;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  }}
681
 
682
  .prayer-card {{
683
- animation: slideInLeft 0.8s ease-out;
684
  }}
685
 
686
  .weather-card {{
687
- animation: slideInRight 0.8s ease-out;
688
  }}
689
 
690
  .baby-decoration {{
691
- animation: float 3s ease-in-out infinite;
692
- font-size: 40px;
693
  display: inline-block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
694
  }}
695
  </style>
696
 
697
- <div class="dashboard-container" style="max-width: 900px; margin: 0 auto; padding: 20px; background: linear-gradient(135deg, #E8F5E9 0%, #F3E5F5 100%); border-radius: 30px;">
698
 
699
- <!-- Beautiful Ramadan Header with Decorations -->
700
- <div class="ramzan-header" style="text-align: center; background: linear-gradient(135deg, #1A237E 0%, #4A148C 100%); color: white; padding: 50px 30px; border-radius: 30px; margin-bottom: 30px; position: relative; overflow: hidden;">
701
- <div style="position: absolute; top: 10px; left: 20px; font-size: 30px;">
702
  <span class="star">⭐</span>
703
  <span class="star" style="animation-delay: 0.3s;">✨</span>
704
  <span class="star" style="animation-delay: 0.6s;">💫</span>
 
705
  </div>
706
- <div style="position: absolute; top: 10px; right: 20px; font-size: 30px;">
707
  <span class="star" style="animation-delay: 0.2s;">⭐</span>
708
  <span class="star" style="animation-delay: 0.5s;">✨</span>
709
  <span class="star" style="animation-delay: 0.8s;">💫</span>
 
710
  </div>
711
 
712
- <div style="margin-bottom: 20px;">
713
  <span class="mosque-decoration">🕌</span>
714
- <span class="crescent" style="font-size: 60px; margin: 0 20px;">🌙</span>
715
  <span class="mosque-decoration">🕌</span>
716
  </div>
717
 
718
- <h1 style="font-size: 52px; margin: 15px 0; text-shadow: 3px 3px 6px rgba(0,0,0,0.3); font-weight: 800;">
719
- Ramadan Mubarak
720
  </h1>
721
- <h2 style="font-size: 56px; margin: 10px 0; font-family: 'Noto Sans Bengali', sans-serif; text-shadow: 2px 2px 4px rgba(0,0,0,0.3);">
722
- রমজান মুবারক
723
  </h2>
724
 
725
- <div style="margin: 20px 0;">
726
  <span class="baby-decoration">👶🏽</span>
727
- <span class="baby-decoration" style="animation-delay: 0.5s;">🧒🏽</span>
728
- <span class="baby-decoration" style="animation-delay: 1s;">👼</span>
 
729
  </div>
730
 
731
- <p style="font-size: 24px; margin: 10px 0; opacity: 0.95;">
732
- 📍 {city_query.title()}, {country_query.title()}
733
- </p>
734
- <p style="font-size: 18px; opacity: 0.9;">
735
- {datetime.now().strftime("%A, %B %d, %Y")} | {datetime.now().strftime("%I:%M %p")}
736
- </p>
 
 
 
 
 
737
 
738
- <div style="margin-top: 25px; font-size: 28px;">
739
- <span class="star">🌟</span>
740
- <span class="star" style="animation-delay: 0.4s;">✨</span>
741
- <span class="star" style="animation-delay: 0.7s;">⭐</span>
 
742
  </div>
743
  </div>
744
 
745
  <!-- Real-Time Prayer Times Card -->
746
- <div class="card prayer-card" style="background: linear-gradient(135deg, #0F9D58 0%, #16C172 100%); color: white;">
747
- <div style="text-align: center; margin-bottom: 25px;">
748
- <h2 style="font-size: 38px; margin-bottom: 10px;">🕌 Prayer Times (Salah)</h2>
749
- <p style="font-size: 18px; opacity: 0.95;">Real-time for {city_query.title()}, {country_query.title()}</p>
750
  </div>
751
  """
752
 
753
  if prayer_times["success"]:
754
  html += f"""
755
- <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 30px;">
756
- <div style="text-align: center; background: rgba(255,255,255,0.25); padding: 25px; border-radius: 20px; backdrop-filter: blur(10px);">
757
- <div style="font-size: 48px; margin-bottom: 10px;">🌅</div>
758
- <h3 style="font-size: 22px; margin: 10px 0;">Sehri Ends (Fajr)</h3>
759
- <p style="font-size: 38px; font-weight: 800; margin: 10px 0;">{prayer_times['sehri_end']}</p>
760
- <p style="font-size: 15px; opacity: 0.9;">Stop eating before this time</p>
 
 
761
  </div>
762
- <div style="text-align: center; background: rgba(255,255,255,0.25); padding: 25px; border-radius: 20px; backdrop-filter: blur(10px);">
763
- <div style="font-size: 48px; margin-bottom: 10px;">🌇</div>
764
- <h3 style="font-size: 22px; margin: 10px 0;">Iftar Starts (Maghrib)</h3>
765
- <p style="font-size: 38px; font-weight: 800; margin: 10px 0;">{prayer_times['iftar_start']}</p>
766
- <p style="font-size: 15px; opacity: 0.9;">Break your fast at this time</p>
 
 
767
  </div>
768
  </div>
769
 
770
- <div style="background: rgba(255,255,255,0.2); padding: 25px; border-radius: 20px; backdrop-filter: blur(10px);">
771
- <h3 style="text-align: center; font-size: 24px; margin-bottom: 20px;">📿 Daily Prayer Schedule</h3>
772
- <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; text-align: center;">
773
- <div>
774
- <p style="font-size: 16px; opacity: 0.9; margin: 5px 0;">Sunrise</p>
775
- <p style="font-size: 24px; font-weight: 700;">{prayer_times['sunrise']}</p>
776
  </div>
777
- <div>
778
- <p style="font-size: 16px; opacity: 0.9; margin: 5px 0;">Dhuhr</p>
779
- <p style="font-size: 24px; font-weight: 700;">{prayer_times['dhuhr']}</p>
780
  </div>
781
- <div>
782
- <p style="font-size: 16px; opacity: 0.9; margin: 5px 0;">Asr</p>
783
- <p style="font-size: 24px; font-weight: 700;">{prayer_times['asr']}</p>
784
  </div>
785
  </div>
786
- <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; text-align: center; margin-top: 15px;">
787
- <div>
788
- <p style="font-size: 16px; opacity: 0.9; margin: 5px 0;">Sunset</p>
789
- <p style="font-size: 24px; font-weight: 700;">{prayer_times['sunset']}</p>
790
  </div>
791
- <div>
792
- <p style="font-size: 16px; opacity: 0.9; margin: 5px 0;">Isha</p>
793
- <p style="font-size: 24px; font-weight: 700;">{prayer_times['isha']}</p>
794
  </div>
795
  </div>
796
  </div>
797
  """
798
  else:
799
  html += """
800
- <div style="text-align: center; padding: 30px; background: rgba(255,255,255,0.2); border-radius: 20px;">
801
- <p style="font-size: 20px;">⚠️ Could not fetch prayer times</p>
802
- <p style="font-size: 16px; opacity: 0.9; margin-top: 10px;">Please check your city and country names</p>
 
803
  </div>
804
  """
805
 
806
  html += f"""
807
  </div>
808
 
809
- <!-- Weather Card with Animation -->
810
  <div class="card weather-card">
811
- <div style="text-align: center; margin-bottom: 20px;">
812
- <h2 style="color: #667eea; font-size: 34px; margin-bottom: 10px;">🌡️ Live Weather</h2>
813
  </div>
814
- <div style="text-align: center; background: {gradient}; color: white; padding: 40px; border-radius: 20px; position: relative;">
815
- <div style="font-size: 100px; margin: 20px 0; animation: float 3s ease-in-out infinite;">
816
  {icon}
817
  </div>
818
- <h1 style="font-size: 72px; margin: 15px 0; font-weight: 800;">{temp:.1f}°C</h1>
819
- <p style="font-size: 28px; margin: 10px 0; text-transform: capitalize;">{description}</p>
820
- <p style="font-size: 20px; opacity: 0.9;">Feels like {feels_like:.1f}°C</p>
821
- <div style="margin-top: 25px; font-size: 18px; display: flex; justify-content: center; gap: 30px;">
822
- <span>💧 {humidity}%</span>
823
- <span>🌬️ {wind_speed} m/s</span>
 
 
 
 
824
  </div>
825
  </div>
826
  </div>
827
 
828
  <!-- Temperature-Based Recommendations -->
829
- <div class="card" style="animation-delay: 0.2s;">
830
- <h2 style="color: #FF6B6B; font-size: 32px; margin-bottom: 25px; text-align: center;">
831
- 💡 Your Personalized Ramadan Guide
832
  </h2>
833
- <div style="background: linear-gradient(135deg, #FFF5F5 0%, #FFE5E5 100%); padding: 30px; border-radius: 20px; border-left: 6px solid #FF6B6B;">
834
- <div style="line-height: 2; white-space: pre-line; font-size: 16px;">
 
 
 
835
  {temp_advice}
836
  </div>
837
  </div>
838
 
839
- <div style="margin-top: 25px; text-align: center; background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%); padding: 20px; border-radius: 15px;">
840
- <p style="font-size: 18px; color: #1565C0; font-weight: 600;">
841
- 💙 Remember: Your health is important during fasting. Listen to your body!
 
 
 
842
  </p>
843
  </div>
844
  </div>
845
 
846
- <!-- Daily Hadith Card with Beautiful Design -->
847
- <div class="card" style="background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); color: white; animation-delay: 0.3s;">
848
- <div style="text-align: center; margin-bottom: 30px;">
849
- <h2 style="font-size: 38px; margin-bottom: 15px;">📿 Today's Hadith of the Day</h2>
850
- <div style="font-size: 30px; margin: 15px 0;">
851
- <span class="star">✨</span>
852
- <span class="star" style="animation-delay: 0.3s;">⭐</span>
853
- <span class="star" style="animation-delay: 0.6s;">💫</span>
 
854
  </div>
855
  </div>
856
 
857
- <div style="background: rgba(255,255,255,0.25); padding: 30px; border-radius: 20px; margin-bottom: 25px; backdrop-filter: blur(10px);">
858
- <p style="font-size: 22px; line-height: 1.9; margin-bottom: 20px; font-style: italic; text-align: center;">
859
  "{daily_hadith['english']}"
860
  </p>
861
- <div style="height: 2px; background: rgba(255,255,255,0.3); margin: 20px 0;"></div>
862
- <p style="font-size: 20px; line-height: 1.9; font-family: 'Noto Sans Bengali', sans-serif; opacity: 0.95; text-align: center;">
863
  "{daily_hadith['bengali']}"
864
  </p>
865
- <p style="text-align: right; font-size: 18px; margin-top: 20px; opacity: 0.9; font-weight: 600;">
866
  — {daily_hadith['reference']}
867
  </p>
868
  </div>
869
 
870
- <div style="background: rgba(255,255,255,0.2); padding: 25px; border-radius: 20px; margin-bottom: 20px; text-align: center;">
871
- <div style="font-size: 35px; margin-bottom: 15px;">
872
  <span class="baby-decoration">😊</span>
873
  <span class="baby-decoration" style="animation-delay: 0.3s;">💖</span>
874
  <span class="baby-decoration" style="animation-delay: 0.6s;">✨</span>
 
875
  </div>
876
- <p style="font-size: 20px; line-height: 1.7;">
877
  {daily_hadith['happy_message']}
878
  </p>
879
  </div>
880
 
881
- <div style="text-align: center; background: rgba(255,255,255,0.15); padding: 25px; border-radius: 20px;">
882
- <p style="font-size: 26px; font-weight: 700; margin: 10px 0;">
883
  {daily_hadith['salam']}
884
  </p>
885
  </div>
886
  </div>
887
 
888
- <!-- Beautiful Footer with Islamic Decoration -->
889
- <div style="text-align: center; padding: 40px 30px; background: linear-gradient(135deg, #1A237E 0%, #4A148C 100%); color: white; border-radius: 25px; margin-top: 30px;">
890
- <div style="font-size: 40px; margin-bottom: 20px;">
891
- <span class="mosque-decoration">🕌</span>
892
- <span class="crescent" style="font-size: 50px; margin: 0 15px;">🌙</span>
893
- <span class="mosque-decoration">🕌</span>
894
- </div>
895
-
896
- <h3 style="font-size: 28px; margin: 15px 0; font-weight: 700;">
897
- May Allah Accept Your Fasting & Prayers
898
- </h3>
899
- <h3 style="font-size: 26px; margin: 10px 0; font-family: 'Noto Sans Bengali', sans-serif;">
900
- আল্লাহ আপনার রোজা ও নামাজ কবুল করুন
901
- </h3>
902
-
903
- <div style="margin: 25px 0; font-size: 35px;">
904
- <span class="baby-decoration">👶🏽</span>
905
- <span class="baby-decoration" style="animation-delay: 0.4s;">🧒🏽</span>
906
- <span class="baby-decoration" style="animation-delay: 0.8s;">👼</span>
907
- </div>
908
 
909
- <p style="font-size: 20px; opacity: 0.95; margin: 10px 0;">
910
- Ramadan Kareem! রমজান করীম!
911
- </p>
912
-
913
- <div style="margin-top: 20px; font-size: 28px;">
914
- <span class="star">🌟</span>
915
- <span class="star" style="animation-delay: 0.3s;">✨</span>
916
- <span class="star" style="animation-delay: 0.6s;">⭐</span>
917
- <span class="star" style="animation-delay: 0.9s;">💫</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
918
  </div>
919
  </div>
920
 
@@ -924,11 +847,11 @@ def get_ramadan_dashboard(city, country):
924
  return html
925
 
926
  # =========================
927
- # 🎨 Gradio Interface
928
  # =========================
929
  custom_css = """
930
  .gradio-container {
931
- background: linear-gradient(135deg, #E8F5E9 0%, #F3E5F5 50%, #FFF9C4 100%) !important;
932
  }
933
 
934
  footer {
@@ -936,49 +859,90 @@ custom_css = """
936
  }
937
 
938
  .contain {
939
- max-width: 1100px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
940
  }
941
  """
942
 
943
- demo = gr.Interface(
944
- fn=get_ramadan_dashboard,
945
- inputs=[
946
- gr.Textbox(
947
- label="🏙️ City Name",
948
- placeholder="e.g., Sylhet, Dhaka, Mecca, London, New York...",
949
- lines=1
950
- ),
951
- gr.Textbox(
952
- label="🌍 Country Name",
953
- placeholder="e.g., Bangladesh, Saudi Arabia, United Kingdom, USA...",
954
- lines=1
955
- ),
956
- ],
957
- outputs=gr.HTML(label="🌙 Your Complete Ramadan Companion"),
958
- title="🕌 Ultimate Ramadan Dashboard 2025 - رمضان مبارك",
959
- description="""
960
- <div style='text-align: center; padding: 25px; background: linear-gradient(135deg, #1A237E 0%, #4A148C 100%); color: white; border-radius: 20px;'>
961
- <h2 style='font-size: 32px; margin-bottom: 15px;'>🌙 Your Complete Ramadan Companion 🕌</h2>
962
- <p style='font-size: 18px; margin: 10px 0;'>✨ Real Prayer Times • Live Weather • Daily Hadith • Smart Advice ✨</p>
963
- <p style='font-size: 16px; opacity: 0.95;'>Get personalized recommendations for shopping, rest, walks & more based on your weather!</p>
964
- <div style='margin-top: 15px; font-size: 24px;'>
965
- <span>🕌</span> <span>🌙</span> <span>⭐</span> <span>✨</span> <span>👶🏽</span>
966
  </div>
967
- </div>
968
- """,
969
- examples=[
970
- ["Sylhet", "Bangladesh"],
971
- ["Dhaka", "Bangladesh"],
972
- ["Mecca", "Saudi Arabia"],
973
- ["Medina", "Saudi Arabia"],
974
- ["Istanbul", "Turkey"],
975
- ["London", "United Kingdom"],
976
- ["Dubai", "United Arab Emirates"],
977
- ["New York", "USA"],
978
- ["Toronto", "Canada"],
979
- ],
980
- cache_examples=False,
981
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
982
 
983
  if __name__ == "__main__":
984
  demo.launch(
@@ -989,5 +953,4 @@ if __name__ == "__main__":
989
  primary_hue="purple",
990
  secondary_hue="blue",
991
  ),
992
- css=custom_css,
993
  )
 
8
  # =========================
9
  WEATHER_API_KEY = "3a97c8c63350b72e8439c42e8d371b07"
10
 
11
+ # =========================
12
+ # 🇧🇩 Bangladesh Divisions & Districts
13
+ # =========================
14
+ BANGLADESH_LOCATIONS = {
15
+ "Dhaka Division": [
16
+ "Dhaka", "Faridpur", "Gazipur", "Gopalganj", "Kishoreganj",
17
+ "Madaripur", "Manikganj", "Munshiganj", "Narayanganj", "Narsingdi",
18
+ "Rajbari", "Shariatpur", "Tangail"
19
+ ],
20
+ "Chattogram Division": [
21
+ "Chattogram", "Bandarban", "Brahmanbaria", "Chandpur", "Cumilla",
22
+ "Cox's Bazar", "Feni", "Khagrachhari", "Lakshmipur", "Noakhali",
23
+ "Rangamati"
24
+ ],
25
+ "Rajshahi Division": [
26
+ "Rajshahi", "Bogura", "Joypurhat", "Naogaon", "Natore",
27
+ "Chapainawabganj", "Pabna", "Sirajganj"
28
+ ],
29
+ "Khulna Division": [
30
+ "Khulna", "Bagerhat", "Chuadanga", "Jessore", "Jhenaidah",
31
+ "Kushtia", "Magura", "Meherpur", "Narail", "Satkhira"
32
+ ],
33
+ "Barishal Division": [
34
+ "Barishal", "Barguna", "Bhola", "Jhalokathi", "Patuakhali",
35
+ "Pirojpur"
36
+ ],
37
+ "Sylhet Division": [
38
+ "Sylhet", "Habiganj", "Moulvibazar", "Sunamganj"
39
+ ],
40
+ "Rangpur Division": [
41
+ "Rangpur", "Dinajpur", "Gaibandha", "Kurigram", "Lalmonirhat",
42
+ "Nilphamari", "Panchagarh", "Thakurgaon"
43
+ ],
44
+ "Mymensingh Division": [
45
+ "Mymensingh", "Jamalpur", "Netrokona", "Sherpur"
46
+ ]
47
+ }
48
+
49
  # =========================
50
  # 📿 50 Moral Hadiths (English + Bengali)
51
  # =========================
 
155
  "happy_message": "Celebrate others' success - there's enough blessings for everyone! 🎉",
156
  "salam": "As-Salamu Alaikum Wa Rahmatullahi Wa Barakatuh! 💖"
157
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  ]
159
 
160
  # =========================
161
  # 🕌 Get Real Prayer Times from Aladhan API
162
  # =========================
163
+ def get_prayer_times(city):
164
+ """Get real-time prayer times using Aladhan API for Bangladesh"""
165
  try:
166
  # Get current date
167
  today = datetime.now()
 
171
  url = f"http://api.aladhan.com/v1/timingsByCity/{date_str}"
172
  params = {
173
  "city": city,
174
+ "country": "Bangladesh",
175
  "method": 2 # ISNA (Islamic Society of North America)
176
  }
177
 
 
218
  advice = []
219
 
220
  if temp > 35:
221
+ advice.append("🔥 **অত্যন্ত গরম সতর্কতা!**")
222
+ advice.append("• দুপুর ১২টা থেকে বিকেল ৪টা পর্যন্ত ঘরের ভিতরে থাকুন")
223
+ advice.append("• কেনাকাটা: ভোর -৯টা অথবা সন্ধ্যা -১০টায় যান")
224
+ advice.append("• ইফতারের পর প্রতি ১৫-২০ মিনিটে পানি পান করুন")
225
+ advice.append("• ভারী শারীরিক পরিশ্রম এড়িয়ে চলুন - বিশ্রাম নিন!")
226
+ advice.append("• ঘরে থেকে কুরআন তিলাওয়াত পরিবারের সাথে সময় কাটান")
227
  elif temp > 30:
228
+ advice.append("🌡️ **গরম আবহাওয়া**")
229
+ advice.append("• সকালের হাঁটা: সকাল ৯টার আগে সবচেয়ে ভালো")
230
+ advice.append("• কেনাকাটা: সন্ধ্যা ৬টার পর আরামদায়ক")
231
+ advice.append("• হাইড্রেশন: সেহরি থেকে ইফতার পর্যন্ত ৮-১০ গ্লাস পানি")
232
+ advice.append("• সন্ধ্যায় হালকা বাইরের কাজকর্ম করা যায়")
233
+ advice.append("• দিনে বাইরে গেলে ছাতা সানস্ক্রিন ব্যবহার করুন")
234
  elif temp > 25:
235
+ advice.append("☀️ **মনোরম উষ্ণ আবহাওয়া**")
236
+ advice.append("• ইফতারের পর সন্ধ্যার হাঁটার জন্য চমৎকার (৩০-৪৫ মিনিট)")
237
+ advice.append("• কেনাকাটা: যেকোনো সময় আরামদায়ক, বিকেল -৮টা সবচেয়ে ভালো")
238
+ advice.append("• মাঝারি বাইরের কাজকর্ম ঠিক আছে")
239
+ advice.append("• পার্ক/মসজিদে পরিবারের সাথে বেড়ানোর জন্য দারুণ আবহাওয়া")
240
+ advice.append("• নিয়মিত পানি পান ভুলবেন না!")
241
  elif temp > 20:
242
+ advice.append("🌤️ **আরামদায়ক আবহাওয়া**")
243
+ advice.append("• সারাদিন বাইরের কাজের জন্য আদর্শ")
244
+ advice.append("• কেনাকাটা, হাঁটা, হালকা ব্যায়ামের জন্য উপযুক্ত")
245
+ advice.append("• আরামদায়ক পোশাক পরিধান করুন")
246
+ advice.append("• কমিউনিটি ইফতার সমাবেশের জন্য দারুণ")
247
+ advice.append("• সুন্দর আবহাওয়া উপভোগ করুন - আল্লাহর রহমত!")
248
  elif temp > 15:
249
+ advice.append("🍃 **শীতল আবহাওয়া**")
250
+ advice.append("• সন্ধ্যার নামাজের জন্য হালকা জ্যাকেট পরুন")
251
+ advice.append("• তারাবীহ'র পর হাঁটার জন্য চমৎকার আবহাওয়া")
252
+ advice.append("• আত্মীয়-স্বজন দেখতে যাওয়ার জন্য ভালো")
253
+ advice.append("• শীতল, সতেজ বাতাস উপভোগ করুন!")
254
+ advice.append("• ইফতারে গরম খেজুর চা উপযুক্ত")
255
  else:
256
+ advice.append("❄️ **ঠান্ডা আবহাওয়া**")
257
+ advice.append("• মসজিদে যাওয়ার সময় গরম কাপড় পরুন")
258
+ advice.append("• ঘরের ভিতরের কাজকর্ম করুন")
259
+ advice.append("• সেহরি ইফতারে গরম স্যুপ পানীয়")
260
+ advice.append("• বয়স্ক শিশুদের বিশেষ যত্ন নিন")
261
+ advice.append("• তাহাজ্জুদ নামাজের জন্য উষ্ণ কম্বল 🤲")
262
 
263
  # Weather-specific advice
264
  if weather_main == "rain":
265
+ advice.append("\n☔ **বৃষ্টির দিনের বিশেষ:**")
266
+ advice.append("• তারাবীহ নামাজের জন্য ছাতা নিন")
267
+ advice.append("• ঘরে থেকে ইবাদত জিকিরের জন্য উপযুক্ত")
268
+ advice.append("• প্রচুর দোয়া করুন - বৃষ্টি বরকতময় সময়! 🤲")
269
+ advice.append("• সম্ভব হলে ঘরে থাকুন, পরিবারের সাথে কুরআন পড়ুন")
270
  elif weather_main == "thunderstorm":
271
+ advice.append("\n⛈️ **ঝড়ের সতর্কতা:**")
272
+ advice.append("• একান্ত প্রয়োজন ছাড়া বাইরে যাবেন না")
273
+ advice.append("• পড়ুন: সুবহানাল্লাহি ওয়া বিহামদিহি")
274
+ advice.append("• পরিবারের সাথে নিরাপদে ঘরে থাকুন")
275
+ advice.append("• আল্লাহর আশ্রয় প্রার্থনার জন্য উপযুক্ত সময়")
276
  elif weather_main == "clouds":
277
+ advice.append("\n☁️ **মেঘলা মনোরম:**")
278
+ advice.append("• কড়া রোদ নেই - কেনাকাটার জন্য চমৎকার!")
279
+ advice.append("• বাইরের কাজের জন্য আরামদায়ক")
280
+ advice.append("• আত্মীয়স্বজন দেখতে যাওয়ার জন্য দারুণ দিন")
281
 
282
  return "\n".join(advice)
283
 
284
  # =========================
285
  # 🌙 Main Ramadan Dashboard
286
  # =========================
287
+ def get_ramadan_dashboard(division, district):
288
+ if not division or not district:
289
  return """
290
+ <div style="text-align:center; padding:60px; background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%); color:white; border-radius: 30px; font-family: 'Poppins', sans-serif;">
291
+ <h2 style="font-size: 36px; margin-bottom: 20px;">⚠️ দয়া করে বিভাগ এবং জেলা নির্বাচন করুন</h2>
292
+ <p style="font-size: 20px;">Please select Division and District</p>
293
+ <div style="margin-top: 30px; font-size: 50px;">🕌 🌙 ⭐</div>
294
  </div>
295
  """
296
 
 
298
  daily_hadith = random.choice(HADITHS)
299
 
300
  # Get real prayer times
301
+ prayer_times = get_prayer_times(district)
302
 
303
+ # Get weather data for Bangladesh
304
+ weather_url = f"http://api.openweathermap.org/data/2.5/weather?q={district},Bangladesh&appid={WEATHER_API_KEY}&units=metric"
 
 
305
 
306
  try:
307
  weather_response = requests.get(weather_url, timeout=10)
 
309
  except:
310
  return """
311
  <div style="text-align:center; padding:40px; color:#ff6b6b;">
312
+ <h3>❌ আবহাওয়া সেবার সাথে সংযোগ ত্রুটি</h3>
313
+ <p>Error connecting to weather service</p>
314
  </div>
315
  """
316
 
317
  if weather_response.status_code != 200:
318
  return f"""
319
  <div style="text-align:center; padding:40px; color:#ff6b6b;">
320
+ <h3>🔍 '{district}' জেলা খুঁজে পাওয়া যায়নি!</h3>
321
+ <p>District not found! Please check selection</p>
322
  </div>
323
  """
324
 
 
333
  # Temperature advice
334
  temp_advice = get_temperature_advice(temp, weather_main)
335
 
336
+ # Weather gradients with vibrant colors
337
  weather_gradients = {
338
+ "clear": "linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",
339
+ "clouds": "linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)",
340
+ "rain": "linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)",
341
+ "drizzle": "linear-gradient(135deg, #fa709a 0%, #fee140 100%)",
342
+ "thunderstorm": "linear-gradient(135deg, #30cfd0 0%, #330867 100%)",
343
+ "snow": "linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)",
344
+ "mist": "linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)",
345
  }
346
  gradient = weather_gradients.get(weather_main, "linear-gradient(135deg, #667eea 0%, #764ba2 100%)")
347
 
 
356
  }
357
  icon = weather_icons.get(weather_main, "🌤️")
358
 
359
+ # Build HTML with enhanced animations and professional design
360
  html = f"""
361
  <style>
362
+ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800;900&family=Noto+Sans+Bengali:wght@400;600;700;900&family=Amiri:wght@400;700&display=swap');
363
 
364
  @keyframes fadeInUp {{
365
  from {{
366
  opacity: 0;
367
+ transform: translateY(60px);
368
  }}
369
  to {{
370
  opacity: 1;
 
378
  opacity: 1;
379
  }}
380
  50% {{
381
+ transform: scale(1.08);
382
+ opacity: 0.85;
383
  }}
384
  }}
385
 
386
  @keyframes float {{
387
  0%, 100% {{
388
+ transform: translateY(0px) rotate(0deg);
389
  }}
390
  50% {{
391
+ transform: translateY(-20px) rotate(5deg);
392
  }}
393
  }}
394
 
395
  @keyframes twinkle {{
396
  0%, 100% {{
397
  opacity: 1;
398
+ transform: scale(1);
399
  }}
400
  50% {{
401
+ opacity: 0.2;
402
+ transform: scale(0.8);
403
  }}
404
  }}
405
 
406
  @keyframes slideInLeft {{
407
  from {{
408
  opacity: 0;
409
+ transform: translateX(-100px) rotate(-5deg);
410
  }}
411
  to {{
412
  opacity: 1;
413
+ transform: translateX(0) rotate(0deg);
414
  }}
415
  }}
416
 
417
  @keyframes slideInRight {{
418
  from {{
419
  opacity: 0;
420
+ transform: translateX(100px) rotate(5deg);
421
  }}
422
  to {{
423
  opacity: 1;
424
+ transform: translateX(0) rotate(0deg);
425
  }}
426
  }}
427
 
428
  @keyframes glow {{
429
  0%, 100% {{
430
+ box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.4);
431
  }}
432
  50% {{
433
+ box-shadow: 0 0 50px rgba(255, 215, 0, 0.9), 0 0 100px rgba(255, 215, 0, 0.6);
434
+ }}
435
+ }}
436
+
437
+ @keyframes rainbow {{
438
+ 0% {{ filter: hue-rotate(0deg); }}
439
+ 100% {{ filter: hue-rotate(360deg); }}
440
+ }}
441
+
442
+ @keyframes bounceIn {{
443
+ 0% {{
444
+ opacity: 0;
445
+ transform: scale(0.3);
446
+ }}
447
+ 50% {{
448
+ opacity: 1;
449
+ transform: scale(1.05);
450
+ }}
451
+ 70% {{
452
+ transform: scale(0.9);
453
+ }}
454
+ 100% {{
455
+ transform: scale(1);
456
+ }}
457
+ }}
458
+
459
+ @keyframes rotateGlow {{
460
+ 0% {{
461
+ transform: rotate(0deg);
462
+ filter: brightness(1);
463
+ }}
464
+ 50% {{
465
+ transform: rotate(180deg);
466
+ filter: brightness(1.3);
467
+ }}
468
+ 100% {{
469
+ transform: rotate(360deg);
470
+ filter: brightness(1);
471
  }}
472
  }}
473
 
474
  .dashboard-container {{
475
+ animation: fadeInUp 1s ease-out;
476
  font-family: 'Poppins', 'Noto Sans Bengali', sans-serif;
477
  }}
478
 
479
  .card {{
480
  background: white;
481
+ border-radius: 30px;
482
+ padding: 40px;
483
+ margin: 30px 0;
484
+ box-shadow: 0 20px 60px rgba(0,0,0,0.15);
485
+ transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
486
+ animation: fadeInUp 0.8s ease-out;
487
+ position: relative;
488
+ overflow: hidden;
489
+ }}
490
+
491
+ .card::before {{
492
+ content: '';
493
+ position: absolute;
494
+ top: -50%;
495
+ left: -50%;
496
+ width: 200%;
497
+ height: 200%;
498
+ background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
499
+ transform: rotate(45deg);
500
+ animation: shimmer 3s infinite;
501
+ }}
502
+
503
+ @keyframes shimmer {{
504
+ 0% {{ transform: translateX(-100%) translateY(-100%) rotate(45deg); }}
505
+ 100% {{ transform: translateX(100%) translateY(100%) rotate(45deg); }}
506
  }}
507
 
508
  .card:hover {{
509
+ transform: translateY(-15px) scale(1.02);
510
+ box-shadow: 0 30px 80px rgba(0,0,0,0.25);
511
  }}
512
 
513
  .mosque-decoration {{
514
+ animation: float 5s ease-in-out infinite;
515
+ font-size: 60px;
516
  display: inline-block;
517
+ filter: drop-shadow(0 0 10px rgba(255,215,0,0.5));
518
  }}
519
 
520
  .star {{
521
  animation: twinkle 2s ease-in-out infinite;
522
  display: inline-block;
523
+ filter: drop-shadow(0 0 5px rgba(255,255,255,0.8));
524
  }}
525
 
526
  .crescent {{
527
+ animation: rotateGlow 6s linear infinite;
528
  display: inline-block;
529
+ filter: drop-shadow(0 0 20px rgba(255,215,0,0.8));
530
  }}
531
 
532
  .ramzan-header {{
533
+ animation: glow 3s ease-in-out infinite;
534
+ position: relative;
535
+ overflow: hidden;
536
+ }}
537
+
538
+ .ramzan-header::before {{
539
+ content: '';
540
+ position: absolute;
541
+ top: 0;
542
+ left: -100%;
543
+ width: 100%;
544
+ height: 100%;
545
+ background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
546
+ animation: slide 3s infinite;
547
+ }}
548
+
549
+ @keyframes slide {{
550
+ 0% {{ left: -100%; }}
551
+ 100% {{ left: 100%; }}
552
  }}
553
 
554
  .prayer-card {{
555
+ animation: slideInLeft 1s ease-out;
556
  }}
557
 
558
  .weather-card {{
559
+ animation: slideInRight 1s ease-out;
560
  }}
561
 
562
  .baby-decoration {{
563
+ animation: bounceIn 2s ease-out infinite;
564
+ font-size: 45px;
565
  display: inline-block;
566
+ filter: drop-shadow(0 0 8px rgba(255,192,203,0.6));
567
+ }}
568
+
569
+ .gradient-text {{
570
+ background: linear-gradient(45deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
571
+ -webkit-background-clip: text;
572
+ -webkit-text-fill-color: transparent;
573
+ background-clip: text;
574
+ animation: rainbow 5s linear infinite;
575
+ }}
576
+
577
+ .pulse-glow {{
578
+ animation: pulse 2s ease-in-out infinite;
579
+ filter: drop-shadow(0 0 15px currentColor);
580
  }}
581
  </style>
582
 
583
+ <div class="dashboard-container" style="max-width: 1000px; margin: 0 auto; padding: 25px; background: linear-gradient(135deg, #E8F5E9 0%, #F3E5F5 50%, #FFF9C4 100%); border-radius: 40px;">
584
 
585
+ <!-- Beautiful Ramadan Header with Advanced Decorations -->
586
+ <div class="ramzan-header" style="text-align: center; background: linear-gradient(135deg, #1A237E 0%, #4A148C 50%, #880E4F 100%); color: white; padding: 60px 40px; border-radius: 40px; margin-bottom: 35px; position: relative; overflow: hidden;">
587
+ <div style="position: absolute; top: 15px; left: 30px; font-size: 35px;">
588
  <span class="star">⭐</span>
589
  <span class="star" style="animation-delay: 0.3s;">✨</span>
590
  <span class="star" style="animation-delay: 0.6s;">💫</span>
591
+ <span class="star" style="animation-delay: 0.9s;">🌟</span>
592
  </div>
593
+ <div style="position: absolute; top: 15px; right: 30px; font-size: 35px;">
594
  <span class="star" style="animation-delay: 0.2s;">⭐</span>
595
  <span class="star" style="animation-delay: 0.5s;">✨</span>
596
  <span class="star" style="animation-delay: 0.8s;">💫</span>
597
+ <span class="star" style="animation-delay: 1.1s;">🌟</span>
598
  </div>
599
 
600
+ <div style="margin-bottom: 25px;">
601
  <span class="mosque-decoration">🕌</span>
602
+ <span class="crescent" style="font-size: 70px; margin: 0 25px;">🌙</span>
603
  <span class="mosque-decoration">🕌</span>
604
  </div>
605
 
606
+ <h1 style="font-size: 58px; margin: 20px 0; text-shadow: 4px 4px 8px rgba(0,0,0,0.4); font-weight: 900; letter-spacing: 2px;">
607
+ Ramadan Mubarak 2025
608
  </h1>
609
+ <h2 style="font-size: 62px; margin: 15px 0; font-family: 'Noto Sans Bengali', sans-serif; text-shadow: 3px 3px 6px rgba(0,0,0,0.4); font-weight: 900;">
610
+ রমজান মুবারক ১৪৪৬
611
  </h2>
612
 
613
+ <div style="margin: 25px 0;">
614
  <span class="baby-decoration">👶🏽</span>
615
+ <span class="baby-decoration" style="animation-delay: 0.4s;">🧒🏽</span>
616
+ <span class="baby-decoration" style="animation-delay: 0.8s;">👼</span>
617
+ <span class="baby-decoration" style="animation-delay: 1.2s;">😇</span>
618
  </div>
619
 
620
+ <div style="background: rgba(255,255,255,0.15); padding: 20px; border-radius: 20px; backdrop-filter: blur(10px); margin: 20px auto; max-width: 600px;">
621
+ <p style="font-size: 28px; margin: 10px 0; opacity: 0.95; font-weight: 700;">
622
+ 🇧🇩 {district}, {division}
623
+ </p>
624
+ <p style="font-size: 32px; margin: 10px 0; font-family: 'Noto Sans Bengali', sans-serif; font-weight: 700;">
625
+ {district}, {division}
626
+ </p>
627
+ <p style="font-size: 20px; opacity: 0.9; margin-top: 10px;">
628
+ {datetime.now().strftime("%A, %B %d, %Y")} | {datetime.now().strftime("%I:%M %p")}
629
+ </p>
630
+ </div>
631
 
632
+ <div style="margin-top: 30px; font-size: 32px;">
633
+ <span class="star pulse-glow">🌟</span>
634
+ <span class="star pulse-glow" style="animation-delay: 0.3s;">✨</span>
635
+ <span class="star pulse-glow" style="animation-delay: 0.6s;">⭐</span>
636
+ <span class="star pulse-glow" style="animation-delay: 0.9s;">💫</span>
637
  </div>
638
  </div>
639
 
640
  <!-- Real-Time Prayer Times Card -->
641
+ <div class="card prayer-card" style="background: linear-gradient(135deg, #0F9D58 0%, #16C172 50%, #10B981 100%); color: white;">
642
+ <div style="text-align: center; margin-bottom: 30px;">
643
+ <h2 style="font-size: 42px; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); font-weight: 800;">🕌 নামাজের সময়সূচী (Prayer Times)</h2>
644
+ <p style="font-size: 20px; opacity: 0.95;">রিয়েল-টাইম সময় • Real-time for {district}, Bangladesh</p>
645
  </div>
646
  """
647
 
648
  if prayer_times["success"]:
649
  html += f"""
650
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; margin-bottom: 35px;">
651
+ <div style="text-align: center; background: rgba(255,255,255,0.3); padding: 30px; border-radius: 25px; backdrop-filter: blur(15px); transition: all 0.3s ease; border: 2px solid rgba(255,255,255,0.4);">
652
+ <div style="font-size: 55px; margin-bottom: 15px; animation: float 3s ease-in-out infinite;">🌅</div>
653
+ <h3 style="font-size: 26px; margin: 12px 0; font-weight: 700;">সেহরি শেষ (Sehri Ends)</h3>
654
+ <h3 style="font-size: 24px; margin: 10px 0; font-weight: 600;">ফজর (Fajr)</h3>
655
+ <p style="font-size: 44px; font-weight: 900; margin: 15px 0; text-shadow: 2px 2px 4px rgba(0,0,0,0.2);">{prayer_times['sehri_end']}</p>
656
+ <p style="font-size: 17px; opacity: 0.95; font-weight: 600;">এই সময়ের আগে খাওয়া বন্ধ করুন</p>
657
+ <p style="font-size: 16px; opacity: 0.9;">Stop eating before this time</p>
658
  </div>
659
+ <div style="text-align: center; background: rgba(255,255,255,0.3); padding: 30px; border-radius: 25px; backdrop-filter: blur(15px); transition: all 0.3s ease; border: 2px solid rgba(255,255,255,0.4);">
660
+ <div style="font-size: 55px; margin-bottom: 15px; animation: float 3s ease-in-out infinite; animation-delay: 0.5s;">🌇</div>
661
+ <h3 style="font-size: 26px; margin: 12px 0; font-weight: 700;">ইফতার শুরু (Iftar Starts)</h3>
662
+ <h3 style="font-size: 24px; margin: 10px 0; font-weight: 600;">মাগরিব (Maghrib)</h3>
663
+ <p style="font-size: 44px; font-weight: 900; margin: 15px 0; text-shadow: 2px 2px 4px rgba(0,0,0,0.2);">{prayer_times['iftar_start']}</p>
664
+ <p style="font-size: 17px; opacity: 0.95; font-weight: 600;">এই সময়ে রোজা ভাঙ্গুন</p>
665
+ <p style="font-size: 16px; opacity: 0.9;">Break your fast at this time</p>
666
  </div>
667
  </div>
668
 
669
+ <div style="background: rgba(255,255,255,0.25); padding: 30px; border-radius: 25px; backdrop-filter: blur(15px); border: 2px solid rgba(255,255,255,0.3);">
670
+ <h3 style="text-align: center; font-size: 28px; margin-bottom: 25px; font-weight: 700;">📿 দৈনিক নামাজের সময়সূচী (Daily Prayer Schedule)</h3>
671
+ <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: center;">
672
+ <div style="background: rgba(255,255,255,0.2); padding: 20px; border-radius: 20px;">
673
+ <p style="font-size: 18px; opacity: 0.95; margin: 8px 0; font-weight: 600;">সূর্যোদয় (Sunrise)</p>
674
+ <p style="font-size: 28px; font-weight: 800; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">{prayer_times['sunrise']}</p>
675
  </div>
676
+ <div style="background: rgba(255,255,255,0.2); padding: 20px; border-radius: 20px;">
677
+ <p style="font-size: 18px; opacity: 0.95; margin: 8px 0; font-weight: 600;">যোহর (Dhuhr)</p>
678
+ <p style="font-size: 28px; font-weight: 800; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">{prayer_times['dhuhr']}</p>
679
  </div>
680
+ <div style="background: rgba(255,255,255,0.2); padding: 20px; border-radius: 20px;">
681
+ <p style="font-size: 18px; opacity: 0.95; margin: 8px 0; font-weight: 600;">আসর (Asr)</p>
682
+ <p style="font-size: 28px; font-weight: 800; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">{prayer_times['asr']}</p>
683
  </div>
684
  </div>
685
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; text-align: center; margin-top: 20px;">
686
+ <div style="background: rgba(255,255,255,0.2); padding: 20px; border-radius: 20px;">
687
+ <p style="font-size: 18px; opacity: 0.95; margin: 8px 0; font-weight: 600;">সূর্যাস্ত (Sunset)</p>
688
+ <p style="font-size: 28px; font-weight: 800; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">{prayer_times['sunset']}</p>
689
  </div>
690
+ <div style="background: rgba(255,255,255,0.2); padding: 20px; border-radius: 20px;">
691
+ <p style="font-size: 18px; opacity: 0.95; margin: 8px 0; font-weight: 600;">এশা (Isha)</p>
692
+ <p style="font-size: 28px; font-weight: 800; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">{prayer_times['isha']}</p>
693
  </div>
694
  </div>
695
  </div>
696
  """
697
  else:
698
  html += """
699
+ <div style="text-align: center; padding: 40px; background: rgba(255,255,255,0.25); border-radius: 25px; border: 2px solid rgba(255,255,255,0.3);">
700
+ <p style="font-size: 24px; font-weight: 700;">⚠️ নামাজের সময় পাওয়া যায়নি</p>
701
+ <p style="font-size: 20px; opacity: 0.95; margin-top: 12px;">Could not fetch prayer times</p>
702
+ <p style="font-size: 18px; opacity: 0.9; margin-top: 10px;">দয়া করে আপনার জেলার নাম চেক করুন</p>
703
  </div>
704
  """
705
 
706
  html += f"""
707
  </div>
708
 
709
+ <!-- Weather Card with Advanced Animation -->
710
  <div class="card weather-card">
711
+ <div style="text-align: center; margin-bottom: 25px;">
712
+ <h2 class="gradient-text" style="font-size: 40px; margin-bottom: 12px; font-weight: 800;">🌡️ লাইভ আবহাওয়া (Live Weather)</h2>
713
  </div>
714
+ <div style="text-align: center; background: {gradient}; color: white; padding: 50px; border-radius: 30px; position: relative; box-shadow: 0 15px 40px rgba(0,0,0,0.2);">
715
+ <div style="font-size: 120px; margin: 25px 0; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));">
716
  {icon}
717
  </div>
718
+ <h1 style="font-size: 84px; margin: 20px 0; font-weight: 900; text-shadow: 3px 3px 6px rgba(0,0,0,0.3);">{temp:.1f}°C</h1>
719
+ <p style="font-size: 32px; margin: 15px 0; text-transform: capitalize; font-weight: 700; text-shadow: 2px 2px 4px rgba(0,0,0,0.2);">{description}</p>
720
+ <p style="font-size: 24px; opacity: 0.95; font-weight: 600;">অনুভূতি (Feels like) {feels_like:.1f}°C</p>
721
+ <div style="margin-top: 30px; font-size: 22px; display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;">
722
+ <div style="background: rgba(255,255,255,0.2); padding: 15px 30px; border-radius: 20px; backdrop-filter: blur(10px);">
723
+ <span style="font-weight: 700;">💧 আর্দ্রতা: {humidity}%</span>
724
+ </div>
725
+ <div style="background: rgba(255,255,255,0.2); padding: 15px 30px; border-radius: 20px; backdrop-filter: blur(10px);">
726
+ <span style="font-weight: 700;">🌬️ বাতাস: {wind_speed} m/s</span>
727
+ </div>
728
  </div>
729
  </div>
730
  </div>
731
 
732
  <!-- Temperature-Based Recommendations -->
733
+ <div class="card" style="animation-delay: 0.3s;">
734
+ <h2 class="gradient-text" style="font-size: 38px; margin-bottom: 30px; text-align: center; font-weight: 800;">
735
+ 💡 আপনার ব্যক্তিগত রমজান গাইড
736
  </h2>
737
+ <h3 style="text-align: center; color: #FF6B6B; font-size: 28px; margin-bottom: 25px; font-weight: 700;">
738
+ Your Personalized Ramadan Guide
739
+ </h3>
740
+ <div style="background: linear-gradient(135deg, #FFF5F5 0%, #FFE5E5 50%, #FFF0F5 100%); padding: 35px; border-radius: 25px; border-left: 8px solid #FF6B6B; box-shadow: inset 0 0 20px rgba(255,107,107,0.1);">
741
+ <div style="line-height: 2.2; white-space: pre-line; font-size: 18px; font-weight: 500; color: #2c3e50;">
742
  {temp_advice}
743
  </div>
744
  </div>
745
 
746
+ <div style="margin-top: 30px; text-align: center; background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 50%, #90CAF9 100%); padding: 25px; border-radius: 20px; border: 2px solid #2196F3;">
747
+ <p style="font-size: 20px; color: #0D47A1; font-weight: 700; line-height: 1.6;">
748
+ 💙 মনে রাখবেন: রোজার সময় আপনার স্বাস্থ্য গুরুত্বপূর্ণ। আপনার শরীরের কথা শুনুন!
749
+ </p>
750
+ <p style="font-size: 18px; color: #1565C0; font-weight: 600; margin-top: 10px;">
751
+ Remember: Your health is important during fasting. Listen to your body!
752
  </p>
753
  </div>
754
  </div>
755
 
756
+ <!-- Daily Hadith Card with Enhanced Design -->
757
+ <div class="card" style="background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%); color: white; animation-delay: 0.4s; border: 3px solid rgba(255,255,255,0.3);">
758
+ <div style="text-align: center; margin-bottom: 35px;">
759
+ <h2 style="font-size: 44px; margin-bottom: 20px; text-shadow: 3px 3px 6px rgba(0,0,0,0.3); font-weight: 900;">📿 আজকের হাদিস (Today's Hadith)</h2>
760
+ <div style="font-size: 35px; margin: 20px 0;">
761
+ <span class="star pulse-glow">✨</span>
762
+ <span class="star pulse-glow" style="animation-delay: 0.3s;">⭐</span>
763
+ <span class="star pulse-glow" style="animation-delay: 0.6s;">💫</span>
764
+ <span class="star pulse-glow" style="animation-delay: 0.9s;">🌟</span>
765
  </div>
766
  </div>
767
 
768
+ <div style="background: rgba(255,255,255,0.3); padding: 35px; border-radius: 25px; margin-bottom: 30px; backdrop-filter: blur(15px); border: 2px solid rgba(255,255,255,0.4); box-shadow: 0 10px 30px rgba(0,0,0,0.2);">
769
+ <p style="font-size: 24px; line-height: 2; margin-bottom: 25px; font-style: italic; text-align: center; font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">
770
  "{daily_hadith['english']}"
771
  </p>
772
+ <div style="height: 3px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent); margin: 25px 0;"></div>
773
+ <p style="font-size: 22px; line-height: 2; font-family: 'Noto Sans Bengali', sans-serif; opacity: 0.98; text-align: center; font-weight: 700; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">
774
  "{daily_hadith['bengali']}"
775
  </p>
776
+ <p style="text-align: right; font-size: 20px; margin-top: 25px; opacity: 0.95; font-weight: 700; font-style: italic;">
777
  — {daily_hadith['reference']}
778
  </p>
779
  </div>
780
 
781
+ <div style="background: rgba(255,255,255,0.25); padding: 30px; border-radius: 25px; margin-bottom: 25px; text-align: center; border: 2px solid rgba(255,255,255,0.3);">
782
+ <div style="font-size: 40px; margin-bottom: 20px;">
783
  <span class="baby-decoration">😊</span>
784
  <span class="baby-decoration" style="animation-delay: 0.3s;">💖</span>
785
  <span class="baby-decoration" style="animation-delay: 0.6s;">✨</span>
786
+ <span class="baby-decoration" style="animation-delay: 0.9s;">🌟</span>
787
  </div>
788
+ <p style="font-size: 22px; line-height: 1.8; font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">
789
  {daily_hadith['happy_message']}
790
  </p>
791
  </div>
792
 
793
+ <div style="text-align: center; background: rgba(255,255,255,0.2); padding: 30px; border-radius: 25px; border: 2px solid rgba(255,255,255,0.3);">
794
+ <p style="font-size: 30px; font-weight: 800; margin: 12px 0; text-shadow: 2px 2px 4px rgba(0,0,0,0.3);">
795
  {daily_hadith['salam']}
796
  </p>
797
  </div>
798
  </div>
799
 
800
+ <!-- Beautiful Footer with Enhanced Islamic Decoration -->
801
+ <div style="text-align: center; padding: 50px 40px; background: linear-gradient(135deg, #1A237E 0%, #4A148C 50%, #880E4F 100%); color: white; border-radius: 30px; margin-top: 35px; box-shadow: 0 15px 50px rgba(0,0,0,0.3); position: relative; overflow: hidden;">
802
+ <div style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url('data:image/svg+xml,%3Csvg width=\"100\" height=\"100\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M0 0h100v100H0z\" fill=\"none\"/%3E%3Cpath d=\"M50 30l5 15h16l-13 9 5 15-13-9-13 9 5-15-13-9h16z\" fill=\"rgba(255,255,255,0.05)\"/%3E%3C/svg%3E'); opacity: 0.3;"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
803
 
804
+ <div style="position: relative; z-index: 1;">
805
+ <div style="font-size: 50px; margin-bottom: 25px;">
806
+ <span class="mosque-decoration">🕌</span>
807
+ <span class="crescent" style="font-size: 60px; margin: 0 20px;">🌙</span>
808
+ <span class="mosque-decoration">🕌</span>
809
+ </div>
810
+
811
+ <h3 style="font-size: 32px; margin: 20px 0; font-weight: 800; text-shadow: 2px 2px 4px rgba(0,0,0,0.4);">
812
+ May Allah Accept Your Fasting & Prayers
813
+ </h3>
814
+ <h3 style="font-size: 36px; margin: 15px 0; font-family: 'Noto Sans Bengali', sans-serif; font-weight: 900; text-shadow: 2px 2px 4px rgba(0,0,0,0.4);">
815
+ আল্লাহ আপনার রোজা ও নামাজ কবুল করুন
816
+ </h3>
817
+
818
+ <div style="margin: 30px 0; font-size: 40px;">
819
+ <span class="baby-decoration">👶🏽</span>
820
+ <span class="baby-decoration" style="animation-delay: 0.3s;">🧒🏽</span>
821
+ <span class="baby-decoration" style="animation-delay: 0.6s;">👼</span>
822
+ <span class="baby-decoration" style="animation-delay: 0.9s;">😇</span>
823
+ </div>
824
+
825
+ <div style="background: rgba(255,255,255,0.15); padding: 20px; border-radius: 20px; backdrop-filter: blur(10px); margin: 25px auto; max-width: 500px;">
826
+ <p style="font-size: 24px; opacity: 0.98; margin: 10px 0; font-weight: 700;">
827
+ Ramadan Kareem 2025! 🌙
828
+ </p>
829
+ <p style="font-size: 28px; opacity: 0.98; margin: 10px 0; font-family: 'Noto Sans Bengali', sans-serif; font-weight: 800;">
830
+ রমজান করীম ১৪৪৬! ✨
831
+ </p>
832
+ </div>
833
+
834
+ <div style="margin-top: 25px; font-size: 32px;">
835
+ <span class="star pulse-glow">🌟</span>
836
+ <span class="star pulse-glow" style="animation-delay: 0.2s;">✨</span>
837
+ <span class="star pulse-glow" style="animation-delay: 0.4s;">⭐</span>
838
+ <span class="star pulse-glow" style="animation-delay: 0.6s;">💫</span>
839
+ <span class="star pulse-glow" style="animation-delay: 0.8s;">🌟</span>
840
+ </div>
841
  </div>
842
  </div>
843
 
 
847
  return html
848
 
849
  # =========================
850
+ # 🎨 Gradio Interface with Bangladesh Divisions & Districts
851
  # =========================
852
  custom_css = """
853
  .gradio-container {
854
+ background: linear-gradient(135deg, #E8F5E9 0%, #F3E5F5 40%, #FFF9C4 70%, #FFEBEE 100%) !important;
855
  }
856
 
857
  footer {
 
859
  }
860
 
861
  .contain {
862
+ max-width: 1200px !important;
863
+ }
864
+
865
+ .gr-button {
866
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
867
+ border: none !important;
868
+ color: white !important;
869
+ font-weight: 600 !important;
870
+ font-size: 16px !important;
871
+ padding: 12px 30px !important;
872
+ border-radius: 15px !important;
873
+ transition: all 0.3s ease !important;
874
+ }
875
+
876
+ .gr-button:hover {
877
+ transform: translateY(-2px) !important;
878
+ box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4) !important;
879
  }
880
  """
881
 
882
+ def update_districts(division):
883
+ """Update district dropdown based on selected division"""
884
+ if division in BANGLADESH_LOCATIONS:
885
+ return gr.Dropdown(
886
+ choices=BANGLADESH_LOCATIONS[division],
887
+ value=BANGLADESH_LOCATIONS[division][0],
888
+ label=f"🏘️ জেলা নির্বাচন করুন (Select District) - {division}",
889
+ interactive=True
890
+ )
891
+ return gr.Dropdown(choices=[], label="🏘️ জেলা নির্বাচন করুন (Select District)", interactive=True)
892
+
893
+ with gr.Blocks(css=custom_css) as demo:
894
+ gr.HTML("""
895
+ <div style='text-align: center; padding: 35px; background: linear-gradient(135deg, #1A237E 0%, #4A148C 50%, #880E4F 100%); color: white; border-radius: 25px; margin-bottom: 30px; box-shadow: 0 15px 40px rgba(0,0,0,0.2);'>
896
+ <h1 style='font-size: 48px; margin-bottom: 20px; font-weight: 900; text-shadow: 3px 3px 6px rgba(0,0,0,0.4);'>🕌 রমজান ড্যাশবোর্ড ২০২৫ 🌙</h1>
897
+ <h2 style='font-size: 42px; margin-bottom: 20px; font-weight: 800;'>Ultimate Ramadan Dashboard 2025</h2>
898
+ <p style='font-size: 22px; margin: 12px 0; font-weight: 600;'>✨ রিয়েল-টাইম নামাজের সময় • লাইভ আবহাওয়া • দৈনিক হাদিস • স্মার্ট পরামর্শ ✨</p>
899
+ <p style='font-size: 20px; margin: 10px 0; opacity: 0.95;'>Real Prayer Times Live Weather Daily Hadith • Smart Advice</p>
900
+ <p style='font-size: 18px; opacity: 0.95; margin-top: 15px;'>🇧🇩 সমস্ত বাংলাদেশ বিভাগ জেলা সমর্থিত • All Bangladesh Divisions & Districts Supported</p>
901
+ <div style='margin-top: 20px; font-size: 28px;'>
902
+ <span>🕌</span> <span>🌙</span> <span>⭐</span> <span>✨</span> <span>👶🏽</span> <span>💫</span>
903
+ </div>
 
904
  </div>
905
+ """)
906
+
907
+ with gr.Row():
908
+ division_dropdown = gr.Dropdown(
909
+ choices=list(BANGLADESH_LOCATIONS.keys()),
910
+ value="Dhaka Division",
911
+ label="🗺️ বিভাগ নির্বাচন করুন (Select Division)",
912
+ interactive=True
913
+ )
914
+
915
+ district_dropdown = gr.Dropdown(
916
+ choices=BANGLADESH_LOCATIONS["Dhaka Division"],
917
+ value="Dhaka",
918
+ label="🏘️ জেলা নির্বাচন করুন (Select District)",
919
+ interactive=True
920
+ )
921
+
922
+ submit_btn = gr.Button("🌙 রমজান ড্যাশবোর্ড দেখুন (View Ramadan Dashboard)", size="lg")
923
+
924
+ output = gr.HTML(label="🌙 Your Complete Ramadan Companion")
925
+
926
+ # Update districts when division changes
927
+ division_dropdown.change(
928
+ fn=update_districts,
929
+ inputs=[division_dropdown],
930
+ outputs=[district_dropdown]
931
+ )
932
+
933
+ # Submit button click
934
+ submit_btn.click(
935
+ fn=get_ramadan_dashboard,
936
+ inputs=[division_dropdown, district_dropdown],
937
+ outputs=[output]
938
+ )
939
+
940
+ # Auto-load on page load
941
+ demo.load(
942
+ fn=get_ramadan_dashboard,
943
+ inputs=[division_dropdown, district_dropdown],
944
+ outputs=[output]
945
+ )
946
 
947
  if __name__ == "__main__":
948
  demo.launch(
 
953
  primary_hue="purple",
954
  secondary_hue="blue",
955
  ),
 
956
  )