GoogleCalc commited on
Commit
e50cebd
·
verified ·
1 Parent(s): 74820bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +338 -84
app.py CHANGED
@@ -571,7 +571,7 @@ def get_share_links(app_url="https://howmuchfeed.com"):
571
 
572
 
573
  # ============================================================
574
- # FEED CALCULATION - MOBILE-FRIENDLY
575
  # ============================================================
576
 
577
  def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_code, breed, request: gr.Request):
@@ -645,7 +645,7 @@ def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_c
645
  # Generate share links
646
  share_links = get_share_links()
647
 
648
- # Output HTML - MOBILE-FRIENDLY
649
  starter_bags_display = f"{starter_bags:.1f}"
650
  finisher_bags_display = f"{finisher_bags:.1f}"
651
 
@@ -654,93 +654,339 @@ def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_c
654
  age_text += f" + {days} day{'s' if days != 1 else ''}"
655
 
656
  html = f"""
657
- <div style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 1.5; color: #1a1a1a; background: white; border-radius: 12px; padding: 16px;">
658
-
659
- <!-- Quick Answer -->
660
- <div style="background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;">
661
- <div style="font-size: 12px; font-weight: 700; color: #16a34a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;">Here Is Your Result</div>
662
- <div style="font-size: 16px; font-weight: 700; color: #166534;">
663
- You need <span style="background: #166534; color: white; border-radius: 6px; padding: 2px 12px; font-size: 20px;">{total_bags:.1f}</span> bags of {bag_size} kg poultry feed<br>
664
- to raise <strong>{birds:,}</strong> {breed} broilers from day-old to <strong>{age_text} ({total_days} days)</strong>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
  </div>
666
- <div style="margin-top: 6px; font-size: 16px; font-weight: 700; color: #1e40af;">
667
- Buy <span style="background: #1e40af; color: white; border-radius: 6px; padding: 2px 12px; font-size: 18px;">{rounded_bags}</span> bags to make sure you have enough feed.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  </div>
669
- <div style="margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #4b5563;">
 
 
 
 
 
 
 
 
 
670
  <span>🐔 <strong>{birds:,}</strong></span>
671
  <span>📅 <strong>{age_text}</strong></span>
672
  <span>🏷️ <strong>{breed}</strong></span>
673
  </div>
674
- <div style="margin-top: 6px; display: flex; gap: 6px; font-size: 12px;">
675
- <span style="background: {breed_color}; color: white; padding: 2px 10px; border-radius: 10px; font-weight: 600;">{breed}</span>
676
- <span style="background: #6b7280; color: white; padding: 2px 10px; border-radius: 10px; font-weight: 600;">{country_name}</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  </div>
678
  </div>
679
 
680
- <!-- Feed Breakdown -->
681
- <div style="margin-bottom: 14px;">
682
- <div style="font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;">Feed Breakdown</div>
683
- <table style="width: 100%; border-collapse: collapse; font-size: 14px;">
684
- <tr style="border-bottom: 1px solid #e5e7eb;">
685
- <td style="padding: 6px 4px;"><strong>Starter</strong></td>
686
- <td style="padding: 6px 4px; text-align: right;">{starter_kg:,.1f} kg</td>
687
- <td style="padding: 6px 4px; text-align: right; font-weight: 700; color: #1e293b;">{starter_bags_display} bags</td>
688
- </tr>
689
- <tr style="border-bottom: 1px solid #e5e7eb;">
690
- <td style="padding: 6px 4px;"><strong>Finisher</strong></td>
691
- <td style="padding: 6px 4px; text-align: right;">{finisher_kg:,.1f} kg</td>
692
- <td style="padding: 6px 4px; text-align: right; font-weight: 700; color: #1e293b;">{finisher_bags_display} bags</td>
693
- </tr>
694
- <tr>
695
- <td style="padding: 6px 4px; font-weight: 700;">TOTAL</td>
696
- <td style="padding: 6px 4px; text-align: right; font-weight: 700;">{total_feed_kg:,.1f} kg</td>
697
- <td style="padding: 6px 4px; text-align: right; font-weight: 700; font-size: 16px; color: #166534;">{total_bags:.1f} bags</td>
698
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
  </table>
700
  </div>
701
 
702
- <!-- Feed Cost -->
703
- <div style="background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px;">
704
- <div style="font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;">Feed Cost Estimate</div>
705
- <div style="display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px;">
706
- <span style="color: #4b5563;">Approx</span>
707
- <span style="background: #1e40af; color: white; border-radius: 6px; padding: 2px 12px; font-size: 18px; font-weight: 700;">{rounded_bags} bags</span>
708
- <span style="color: #4b5563;">× {currency_symbol}{price_per_bag:,.0f}</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709
  </div>
710
- <div style="font-size: 24px; font-weight: 800; color: #1e40af; margin-top: 2px;">
 
 
 
 
 
 
 
711
  {currency_symbol}{total_cost:,.0f}
712
  </div>
713
  </div>
714
 
715
  <!-- Expected Performance -->
716
- <div style="border-top: 1px solid #e5e7eb; padding-top: 12px; margin-bottom: 14px;">
717
- <div style="font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;">Expected Performance</div>
718
- <div style="display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px;">
719
- <div>Body weight: <span style="font-weight: 700;">{expected_weight:.3f} kg</span></div>
720
- <div>Flock weight: <span style="font-weight: 700;">{flock_weight:,.1f} kg</span></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  </div>
722
  </div>
723
 
724
- <!-- Share Results -->
725
- <div style="border-top: 1px solid #e5e7eb; padding-top: 12px;">
726
- <div style="font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;">Share Results</div>
727
- <div style="display: flex; gap: 8px; flex-wrap: wrap;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
728
  <a href="{share_links['whatsapp']}" target="_blank" style="text-decoration: none;">
729
- <button style="background: #25D366; color: white; padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;">WhatsApp</button>
 
 
 
 
 
 
 
 
 
 
730
  </a>
731
  <a href="{share_links['email']}" target="_blank" style="text-decoration: none;">
732
- <button style="background: #ea4335; color: white; padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;">Email</button>
 
 
 
 
 
 
 
 
 
 
733
  </a>
734
  <a href="{share_links['facebook']}" target="_blank" style="text-decoration: none;">
735
- <button style="background: #1877f2; color: white; padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;">Facebook</button>
 
 
 
 
 
 
 
 
 
 
736
  </a>
737
  <a href="{share_links['twitter']}" target="_blank" style="text-decoration: none;">
738
- <button style="background: #000000; color: white; padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;">Twitter/X</button>
 
 
 
 
 
 
 
 
 
 
739
  </a>
740
  </div>
741
  </div>
742
 
743
- <div style="margin-top: 12px; font-size: 11px; color: #9ca3af; border-top: 1px solid #f3f4f6; padding-top: 8px;">
 
 
 
 
 
 
 
744
  Estimate based on {breed} benchmark. Actual results may vary.
745
  </div>
746
  </div>
@@ -960,47 +1206,46 @@ def export_calculations_wrapper():
960
 
961
 
962
  # ============================================================
963
- # MOBILE-FRIENDLY CSS
964
  # ============================================================
965
 
966
  CSS = """
967
- /* Force light theme */
968
- .gradio-container {
969
- max-width: 100% !important;
970
- padding: 8px !important;
971
  }
972
 
973
- body {
974
- background: #f6f8f4 !important;
975
  color: #1a1a1a !important;
976
  }
977
 
978
- /* Fix dark mode issues */
979
- .dark .gradio-container {
980
- background: #f6f8f4 !important;
981
- color: #1a1a1a !important;
982
  }
983
 
984
  .main-title {
985
  text-align: center;
986
- padding: 10px 5px 5px 5px;
987
  }
988
  .main-title h1 {
989
- font-size: 24px;
990
  margin-bottom: 2px;
 
991
  }
992
  .main-title p {
993
  font-size: 14px;
994
- color: #555;
995
  }
996
 
997
  .answer-box {
998
- background: white !important;
999
  border-radius: 12px !important;
1000
- padding: 12px 14px !important;
1001
  border: 1px solid #e5e7eb !important;
1002
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
1003
- min-height: 200px !important;
1004
  }
1005
 
1006
  .email-box {
@@ -1019,19 +1264,22 @@ button { min-height: 44px !important; }
1019
  background: #fffbeb !important;
1020
  }
1021
 
1022
- /* Force all text to be readable */
1023
- label, span, p, div, h1, h2, h3, h4 {
 
1024
  color: #1a1a1a !important;
 
1025
  }
1026
 
1027
- /* Fix dropdown text */
1028
- select, input, textarea {
1029
  color: #1a1a1a !important;
1030
- background: white !important;
1031
  }
1032
 
1033
- /* Fix table text */
1034
- table td, table th {
 
1035
  color: #1a1a1a !important;
1036
  }
1037
 
@@ -1051,16 +1299,22 @@ table td, table th {
1051
  }
1052
 
1053
  .answer-box {
1054
- padding: 8px 10px !important;
1055
  }
1056
  }
 
 
 
 
 
 
1057
  """
1058
 
1059
  # ============================================================
1060
  # UI
1061
  # ============================================================
1062
 
1063
- with gr.Blocks(title=APP_NAME, css=CSS) as demo:
1064
 
1065
  gr.HTML("""
1066
  <div class="main-title">
@@ -1155,7 +1409,7 @@ with gr.Blocks(title=APP_NAME, css=CSS) as demo:
1155
  gr.Markdown("## 🎯 Quick Answer")
1156
  result = gr.HTML(
1157
  value="""
1158
- <div style="font-size: 14px; color: #9ca3af; text-align: center; padding: 30px 10px; background: white; border-radius: 12px;">
1159
  <div style="font-size: 40px; margin-bottom: 10px;">🐔</div>
1160
  <div>Select your breed, enter details and click <strong>Calculate</strong></div>
1161
  <div style="font-size: 13px; margin-top: 6px;">Your feed estimate will appear here</div>
 
571
 
572
 
573
  # ============================================================
574
+ # FEED CALCULATION - MOBILE-FRIENDLY WITH FIXED COLORS
575
  # ============================================================
576
 
577
  def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_code, breed, request: gr.Request):
 
645
  # Generate share links
646
  share_links = get_share_links()
647
 
648
+ # Output HTML - COMPLETELY REWRITTEN FOR MOBILE
649
  starter_bags_display = f"{starter_bags:.1f}"
650
  finisher_bags_display = f"{finisher_bags:.1f}"
651
 
 
654
  age_text += f" + {days} day{'s' if days != 1 else ''}"
655
 
656
  html = f"""
657
+ <div style="
658
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
659
+ font-size: 15px;
660
+ line-height: 1.5;
661
+ color: #1a1a1a;
662
+ background: #ffffff;
663
+ border-radius: 12px;
664
+ padding: 12px 14px;
665
+ border: 1px solid #e5e7eb;
666
+ box-shadow: 0 1px 3px rgba(0,0,0,0.05);
667
+ margin: 0;
668
+ width: 100%;
669
+ box-sizing: border-box;
670
+ ">
671
+
672
+ <!-- Quick Answer Box -->
673
+ <div style="
674
+ background: #f0fdf4;
675
+ border: 2px solid #22c55e;
676
+ border-radius: 10px;
677
+ padding: 14px 16px;
678
+ margin-bottom: 14px;
679
+ background-color: #f0fdf4 !important;
680
+ ">
681
+ <div style="
682
+ font-size: 12px;
683
+ font-weight: 700;
684
+ color: #16a34a;
685
+ text-transform: uppercase;
686
+ letter-spacing: 0.5px;
687
+ margin-bottom: 4px;
688
+ background: transparent;
689
+ ">Here Is Your Result</div>
690
+
691
+ <div style="
692
+ font-size: 16px;
693
+ font-weight: 700;
694
+ color: #166534;
695
+ background: transparent;
696
+ ">
697
+ You need
698
+ <span style="
699
+ display: inline-block;
700
+ background: #166534;
701
+ color: #ffffff;
702
+ border-radius: 6px;
703
+ padding: 2px 12px;
704
+ font-size: 20px;
705
+ font-weight: 800;
706
+ background-color: #166534 !important;
707
+ ">{total_bags:.1f}</span>
708
+ bags of {bag_size} kg poultry feed to raise <strong>{birds:,}</strong> {breed} broilers from day-old to <strong>{age_text} ({total_days} days)</strong>
709
  </div>
710
+
711
+ <div style="
712
+ margin-top: 6px;
713
+ font-size: 16px;
714
+ font-weight: 700;
715
+ color: #1e40af;
716
+ background: transparent;
717
+ ">
718
+ Buy
719
+ <span style="
720
+ display: inline-block;
721
+ background: #1e40af;
722
+ color: #ffffff;
723
+ border-radius: 6px;
724
+ padding: 2px 12px;
725
+ font-size: 18px;
726
+ font-weight: 800;
727
+ background-color: #1e40af !important;
728
+ ">{rounded_bags}</span>
729
+ bags to make sure you have enough feed.
730
  </div>
731
+
732
+ <div style="
733
+ margin-top: 6px;
734
+ display: flex;
735
+ gap: 10px;
736
+ flex-wrap: wrap;
737
+ font-size: 13px;
738
+ color: #4b5563;
739
+ background: transparent;
740
+ ">
741
  <span>🐔 <strong>{birds:,}</strong></span>
742
  <span>📅 <strong>{age_text}</strong></span>
743
  <span>🏷️ <strong>{breed}</strong></span>
744
  </div>
745
+
746
+ <div style="
747
+ margin-top: 6px;
748
+ display: flex;
749
+ gap: 6px;
750
+ font-size: 12px;
751
+ background: transparent;
752
+ ">
753
+ <span style="
754
+ background: {breed_color};
755
+ color: #ffffff;
756
+ padding: 2px 10px;
757
+ border-radius: 10px;
758
+ font-weight: 600;
759
+ background-color: {breed_color} !important;
760
+ ">{breed}</span>
761
+ <span style="
762
+ background: #6b7280;
763
+ color: #ffffff;
764
+ padding: 2px 10px;
765
+ border-radius: 10px;
766
+ font-weight: 600;
767
+ background-color: #6b7280 !important;
768
+ ">{country_name}</span>
769
  </div>
770
  </div>
771
 
772
+ <!-- Feed Breakdown Table -->
773
+ <div style="margin-bottom: 12px; background: transparent;">
774
+ <div style="
775
+ font-size: 12px;
776
+ font-weight: 700;
777
+ color: #6b7280;
778
+ text-transform: uppercase;
779
+ letter-spacing: 0.5px;
780
+ margin-bottom: 6px;
781
+ background: transparent;
782
+ ">Feed Breakdown</div>
783
+
784
+ <table style="
785
+ width: 100%;
786
+ border-collapse: collapse;
787
+ font-size: 14px;
788
+ background: #ffffff;
789
+ border: 1px solid #e5e7eb;
790
+ border-radius: 8px;
791
+ overflow: hidden;
792
+ ">
793
+ <thead>
794
+ <tr style="background: #f8fafc; border-bottom: 2px solid #e5e7eb;">
795
+ <th style="padding: 8px 10px; text-align: left; font-weight: 600; color: #1a1a1a; background: #f8fafc;">Stage</th>
796
+ <th style="padding: 8px 10px; text-align: right; font-weight: 600; color: #1a1a1a; background: #f8fafc;">Feed (kg)</th>
797
+ <th style="padding: 8px 10px; text-align: right; font-weight: 600; color: #1a1a1a; background: #f8fafc;">Bags (25 kg)</th>
798
+ </tr>
799
+ </thead>
800
+ <tbody>
801
+ <tr style="border-bottom: 1px solid #e5e7eb;">
802
+ <td style="padding: 8px 10px; color: #1a1a1a; background: #ffffff;"><strong>Starter</strong></td>
803
+ <td style="padding: 8px 10px; text-align: right; color: #1a1a1a; background: #ffffff;">{starter_kg:,.1f}</td>
804
+ <td style="padding: 8px 10px; text-align: right; font-weight: 700; color: #1e293b; background: #ffffff;">{starter_bags_display}</td>
805
+ </tr>
806
+ <tr style="border-bottom: 1px solid #e5e7eb;">
807
+ <td style="padding: 8px 10px; color: #1a1a1a; background: #ffffff;"><strong>Finisher</strong></td>
808
+ <td style="padding: 8px 10px; text-align: right; color: #1a1a1a; background: #ffffff;">{finisher_kg:,.1f}</td>
809
+ <td style="padding: 8px 10px; text-align: right; font-weight: 700; color: #1e293b; background: #ffffff;">{finisher_bags_display}</td>
810
+ </tr>
811
+ <tr style="background: #f8fafc; font-weight: 700;">
812
+ <td style="padding: 8px 10px; color: #1a1a1a; background: #f8fafc;">TOTAL</td>
813
+ <td style="padding: 8px 10px; text-align: right; color: #1a1a1a; background: #f8fafc;">{total_feed_kg:,.1f}</td>
814
+ <td style="padding: 8px 10px; text-align: right; font-weight: 800; font-size: 16px; color: #166534; background: #f8fafc;">{total_bags:.1f}</td>
815
+ </tr>
816
+ </tbody>
817
  </table>
818
  </div>
819
 
820
+ <!-- Feed Cost Box -->
821
+ <div style="
822
+ background: #eff6ff;
823
+ border: 2px solid #3b82f6;
824
+ border-radius: 10px;
825
+ padding: 12px 16px;
826
+ margin-bottom: 12px;
827
+ background-color: #eff6ff !important;
828
+ ">
829
+ <div style="
830
+ font-size: 12px;
831
+ font-weight: 700;
832
+ color: #6b7280;
833
+ text-transform: uppercase;
834
+ letter-spacing: 0.5px;
835
+ margin-bottom: 2px;
836
+ background: transparent;
837
+ ">Feed Cost Estimate</div>
838
+
839
+ <div style="
840
+ display: flex;
841
+ align-items: baseline;
842
+ gap: 6px;
843
+ flex-wrap: wrap;
844
+ font-size: 14px;
845
+ background: transparent;
846
+ ">
847
+ <span style="color: #4b5563; background: transparent;">Approx</span>
848
+ <span style="
849
+ display: inline-block;
850
+ background: #1e40af;
851
+ color: #ffffff;
852
+ border-radius: 6px;
853
+ padding: 2px 12px;
854
+ font-size: 18px;
855
+ font-weight: 700;
856
+ background-color: #1e40af !important;
857
+ ">{rounded_bags}</span>
858
+ <span style="color: #4b5563; background: transparent;">bags × {currency_symbol}{price_per_bag:,.0f}</span>
859
  </div>
860
+
861
+ <div style="
862
+ font-size: 24px;
863
+ font-weight: 800;
864
+ color: #1e40af;
865
+ margin-top: 2px;
866
+ background: transparent;
867
+ ">
868
  {currency_symbol}{total_cost:,.0f}
869
  </div>
870
  </div>
871
 
872
  <!-- Expected Performance -->
873
+ <div style="
874
+ border-top: 1px solid #e5e7eb;
875
+ padding-top: 10px;
876
+ margin-bottom: 12px;
877
+ background: transparent;
878
+ ">
879
+ <div style="
880
+ font-size: 12px;
881
+ font-weight: 700;
882
+ color: #6b7280;
883
+ text-transform: uppercase;
884
+ letter-spacing: 0.5px;
885
+ margin-bottom: 4px;
886
+ background: transparent;
887
+ ">Expected Performance</div>
888
+
889
+ <div style="
890
+ display: flex;
891
+ gap: 16px;
892
+ flex-wrap: wrap;
893
+ font-size: 14px;
894
+ background: transparent;
895
+ ">
896
+ <div style="background: transparent;">
897
+ Body weight: <span style="font-weight: 700; color: #1a1a1a;">{expected_weight:.3f} kg</span>
898
+ </div>
899
+ <div style="background: transparent;">
900
+ Flock weight: <span style="font-weight: 700; color: #1a1a1a;">{flock_weight:,.1f} kg</span>
901
+ </div>
902
  </div>
903
  </div>
904
 
905
+ <!-- Share Buttons -->
906
+ <div style="
907
+ border-top: 1px solid #e5e7eb;
908
+ padding-top: 12px;
909
+ background: transparent;
910
+ ">
911
+ <div style="
912
+ font-size: 12px;
913
+ font-weight: 700;
914
+ color: #6b7280;
915
+ text-transform: uppercase;
916
+ letter-spacing: 0.5px;
917
+ margin-bottom: 6px;
918
+ background: transparent;
919
+ ">Share Results</div>
920
+
921
+ <div style="
922
+ display: flex;
923
+ gap: 8px;
924
+ flex-wrap: wrap;
925
+ background: transparent;
926
+ ">
927
  <a href="{share_links['whatsapp']}" target="_blank" style="text-decoration: none;">
928
+ <span style="
929
+ display: inline-block;
930
+ background: #25D366;
931
+ color: #ffffff;
932
+ padding: 6px 14px;
933
+ border-radius: 6px;
934
+ font-size: 13px;
935
+ font-weight: 600;
936
+ cursor: pointer;
937
+ background-color: #25D366 !important;
938
+ ">WhatsApp</span>
939
  </a>
940
  <a href="{share_links['email']}" target="_blank" style="text-decoration: none;">
941
+ <span style="
942
+ display: inline-block;
943
+ background: #ea4335;
944
+ color: #ffffff;
945
+ padding: 6px 14px;
946
+ border-radius: 6px;
947
+ font-size: 13px;
948
+ font-weight: 600;
949
+ cursor: pointer;
950
+ background-color: #ea4335 !important;
951
+ ">Email</span>
952
  </a>
953
  <a href="{share_links['facebook']}" target="_blank" style="text-decoration: none;">
954
+ <span style="
955
+ display: inline-block;
956
+ background: #1877f2;
957
+ color: #ffffff;
958
+ padding: 6px 14px;
959
+ border-radius: 6px;
960
+ font-size: 13px;
961
+ font-weight: 600;
962
+ cursor: pointer;
963
+ background-color: #1877f2 !important;
964
+ ">Facebook</span>
965
  </a>
966
  <a href="{share_links['twitter']}" target="_blank" style="text-decoration: none;">
967
+ <span style="
968
+ display: inline-block;
969
+ background: #000000;
970
+ color: #ffffff;
971
+ padding: 6px 14px;
972
+ border-radius: 6px;
973
+ font-size: 13px;
974
+ font-weight: 600;
975
+ cursor: pointer;
976
+ background-color: #000000 !important;
977
+ ">Twitter/X</span>
978
  </a>
979
  </div>
980
  </div>
981
 
982
+ <div style="
983
+ margin-top: 10px;
984
+ font-size: 11px;
985
+ color: #9ca3af;
986
+ border-top: 1px solid #f3f4f6;
987
+ padding-top: 8px;
988
+ background: transparent;
989
+ ">
990
  Estimate based on {breed} benchmark. Actual results may vary.
991
  </div>
992
  </div>
 
1206
 
1207
 
1208
  # ============================================================
1209
+ # CSS - FORCE LIGHT THEME
1210
  # ============================================================
1211
 
1212
  CSS = """
1213
+ /* Reset everything - force light theme */
1214
+ * {
1215
+ color: #1a1a1a !important;
 
1216
  }
1217
 
1218
+ body, .gradio-container, .gradio-row, .gradio-column, .gradio-group {
1219
+ background-color: #f6f8f4 !important;
1220
  color: #1a1a1a !important;
1221
  }
1222
 
1223
+ .gradio-container {
1224
+ max-width: 100% !important;
1225
+ padding: 6px 8px !important;
1226
+ background-color: #f6f8f4 !important;
1227
  }
1228
 
1229
  .main-title {
1230
  text-align: center;
1231
+ padding: 8px 4px 4px 4px;
1232
  }
1233
  .main-title h1 {
1234
+ font-size: 22px;
1235
  margin-bottom: 2px;
1236
+ color: #1a1a1a !important;
1237
  }
1238
  .main-title p {
1239
  font-size: 14px;
1240
+ color: #555 !important;
1241
  }
1242
 
1243
  .answer-box {
1244
+ background: #ffffff !important;
1245
  border-radius: 12px !important;
1246
+ padding: 8px 10px !important;
1247
  border: 1px solid #e5e7eb !important;
1248
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
 
1249
  }
1250
 
1251
  .email-box {
 
1264
  background: #fffbeb !important;
1265
  }
1266
 
1267
+ /* Fix all text inputs */
1268
+ input, select, textarea {
1269
+ background: #ffffff !important;
1270
  color: #1a1a1a !important;
1271
+ border: 1px solid #d1d5db !important;
1272
  }
1273
 
1274
+ /* Fix labels */
1275
+ label, span, p, div, h1, h2, h3, h4 {
1276
  color: #1a1a1a !important;
1277
+ background: transparent !important;
1278
  }
1279
 
1280
+ /* Fix dropdowns */
1281
+ select option {
1282
+ background: #ffffff !important;
1283
  color: #1a1a1a !important;
1284
  }
1285
 
 
1299
  }
1300
 
1301
  .answer-box {
1302
+ padding: 6px 8px !important;
1303
  }
1304
  }
1305
+
1306
+ /* Override dark mode completely */
1307
+ .dark, .dark * {
1308
+ background-color: #f6f8f4 !important;
1309
+ color: #1a1a1a !important;
1310
+ }
1311
  """
1312
 
1313
  # ============================================================
1314
  # UI
1315
  # ============================================================
1316
 
1317
+ with gr.Blocks(title=APP_NAME, css=CSS, theme=gr.themes.Default()) as demo:
1318
 
1319
  gr.HTML("""
1320
  <div class="main-title">
 
1409
  gr.Markdown("## 🎯 Quick Answer")
1410
  result = gr.HTML(
1411
  value="""
1412
+ <div style="font-size: 14px; color: #9ca3af; text-align: center; padding: 30px 10px; background: #ffffff; border-radius: 12px;">
1413
  <div style="font-size: 40px; margin-bottom: 10px;">🐔</div>
1414
  <div>Select your breed, enter details and click <strong>Calculate</strong></div>
1415
  <div style="font-size: 13px; margin-top: 6px;">Your feed estimate will appear here</div>