-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1278 lines (1178 loc) · 96.5 KB
/
index.html
File metadata and controls
1278 lines (1178 loc) · 96.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="bn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Mail Factory - Trusted Gmail Exchange & Earning Platform in Bangladesh</title>
<meta name="description" content="Mail Factory is the most trusted Gmail exchange platform in Bangladesh. Buy, sell, and exchange Gmails securely. Earn money online with fast payments via bKash, Nagad, and more.">
<meta name="keywords" content="Gmail Exchange, Buy Gmail, Sell Gmail, Earn Money Online BD, Mail Factory, Gmail Marketing, Trusted Exchange, bKash Payment, Online Income BD">
<meta name="author" content="Mail Factory Team">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://exchanger-pro.web.app/" />
<meta property="og:type" content="website">
<meta property="og:url" content="https://exchanger-pro.web.app/">
<meta property="og:title" content="Mail Factory - Trusted Gmail Exchange Platform">
<meta property="og:description" content="Join Mail Factory to exchange Gmails safely and earn money. Fast payment system with 24/7 support.">
<meta property="og:image" content="https://z-cdn-media.chatglm.cn/files/254f7f82-610d-4700-abc8-2e10435c149a.png?auth_key=1874890147-5ce8a86650d0488299a25b07660a73f8-0-b25e70b5ad3109adec869d78d8584440">
<meta name="theme-color" content="#4F46E5">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Mail Factory">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<style>
:root {
--primary-color: #4F46E5;
--primary-light: #818CF8;
--primary-dark: #3730A3;
--accent-color: #10B981;
--bg-body: #F3F4F6;
--text-main: #1F2937;
--gradient-main: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #6D28D9 100%);
--shadow-card: 0 4px 24px rgba(79, 70, 229, 0.08);
--radius-card: 20px;
}
body { background-color: var(--bg-body); font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text-main); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
.page-container { padding-bottom: 80px; padding-top: 15px; }
/* ===== LOADER ===== */
#app-loader {
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: var(--gradient-main); z-index: 999999;
display: flex; flex-direction: column; align-items: center; justify-content: center;
transition: opacity 0.5s ease, visibility 0.5s ease;
}
#app-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo-wrap {
width: 96px; height: 96px; margin-bottom: 24px;
animation: loaderFloat 2s ease-in-out infinite;
filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
}
.loader-logo-wrap img { width: 96px; height: 96px; object-fit: contain; }
@keyframes loaderFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.03); } }
.loader-spinner { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.loader-text { color: rgba(255,255,255,0.8); margin-top: 18px; font-weight: 600; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.loader-brand { color: white; font-size: 20px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.5px; }
.loader-brand span:first-child { color: white; }
.loader-brand span:last-child { background: linear-gradient(135deg, #FFD700, #FFA500); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ===== NETWORK ERROR ===== */
.network-overlay {
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(255, 255, 255, 0.97); z-index: 99998;
display: none; flex-direction: column; align-items: center; justify-content: center;
text-align: center; padding: 20px;
}
.network-overlay.show { display: flex; }
.network-overlay i { font-size: 60px; color: #ef4444; margin-bottom: 20px; animation: shake 0.5s infinite; }
@keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } 100% { transform: translateX(0); } }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 10px; }
.swal2-popup.swal2-toast { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-radius: 12px; padding: 10px 20px; border-left: 5px solid var(--primary-color); }
.swal2-container { z-index: 99999 !important; }
/* ===== NAVBAR ===== */
.navbar {
background: var(--gradient-main) !important;
box-shadow: 0 4px 30px rgba(79, 70, 229, 0.35);
padding: 8px 15px;
position: sticky; top: 0; z-index: 1001;
display: flex; justify-content: center; align-items: center;
min-height: 64px;
border-bottom: 1px solid rgba(255,255,255,0.08);
}
.navbar-brand-center { display: flex; align-items: center; gap: 11px; text-decoration: none; position: relative; }
.nav-logo-icon {
width: 38px; height: 38px;
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
transition: transform 0.3s;
}
.navbar-brand-center:active .nav-logo-icon { transform: scale(0.92); }
.nav-logo-icon img { width: 38px; height: 38px; object-fit: contain; }
.nav-text-block { display: flex; align-items: baseline; line-height: 1; gap: 1px; }
.nav-text-mail { font-size: 19px; font-weight: 800; color: white; letter-spacing: -0.5px; text-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.nav-text-factory {
font-size: 19px; font-weight: 900;
background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF6B35 100%);
-webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
letter-spacing: -0.5px; filter: drop-shadow(0 1px 2px rgba(255, 165, 0, 0.3));
}
.nav-slogan {
position: absolute; bottom: -12px; left: 49px;
font-size: 7px; color: rgba(255,255,255,0.55);
text-transform: uppercase; letter-spacing: 2.5px; font-weight: 600; white-space: nowrap;
}
/* ===== BOTTOM NAV ===== */
.nav-bottom { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255,255,255,0.97); backdrop-filter: blur(16px); display: flex; justify-content: space-around; padding: 5px 0 12px 0; z-index: 1000; box-shadow: 0 -4px 24px rgba(0,0,0,0.06); border-top: 1px solid rgba(0,0,0,0.04); }
.nav-item { color: #9CA3AF; font-size: 10px; font-weight: 600; transition: 0.3s; width: 25%; text-align: center; padding: 4px 0; cursor: pointer; position: relative; }
.nav-item.active { color: var(--primary-color); }
.nav-item i { font-size: 21px; margin-bottom: 2px; display: block; transition: transform 0.3s; }
.nav-item.active i { transform: scale(1.15) translateY(-1px); }
.nav-item.active::before { content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%); width: 20px; height: 3px; background: var(--primary-color); border-radius: 0 0 4px 4px; }
/* ===== FLOATING BUTTONS ===== */
.social-float { position: fixed; bottom: 82px; right: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 999; }
.float-btn { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 6px 24px rgba(0,0,0,0.18); color: white; transition: transform 0.2s; text-decoration: none; }
.float-btn:active { transform: scale(0.9); }
.wa-btn { background: linear-gradient(135deg, #25D366, #128C7E); }
.tg-btn { background: linear-gradient(135deg, #0088cc, #0055aa); }
/* ===== INSTALL BANNER ===== */
.install-banner {
background: linear-gradient(135deg, #0EA5E9 0%, #4F46E5 50%, #7C3AED 100%);
border-radius: 18px; padding: 14px 16px; margin-bottom: 15px;
display: flex; align-items: center; gap: 12px;
box-shadow: 0 8px 28px rgba(79, 70, 229, 0.25);
cursor: pointer; transition: transform 0.2s; position: relative; overflow: hidden;
}
.install-banner:active { transform: scale(0.98); }
.install-banner::before { content: ''; position: absolute; top: -40%; right: -15%; width: 140px; height: 140px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.install-banner-icon { width: 44px; height: 44px; flex-shrink: 0; position: relative; z-index: 1; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.2)); }
.install-banner-text { flex-grow: 1; position: relative; z-index: 1; }
.install-banner-text h6 { color: white; font-weight: 700; font-size: 13px; margin-bottom: 1px; }
.install-banner-text small { color: rgba(255,255,255,0.8); font-size: 11px; }
.install-banner-arrow { color: white; font-size: 18px; position: relative; z-index: 1; opacity: 0.7; }
.install-banner-close {
position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,0.15);
border: none; color: white; width: 20px; height: 20px; border-radius: 50%;
font-size: 10px; display: flex; align-items: center; justify-content: center;
cursor: pointer; z-index: 2; line-height: 1; transition: background 0.2s;
}
/* ===== HOME CARDS ===== */
.home-card {
background: white; border-radius: var(--radius-card); padding: 20px; margin-bottom: 15px;
box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,0.03);
animation: fadeInUp 0.5s ease-out forwards; opacity: 0;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.home-card:nth-child(2) { animation-delay: 0.05s; }
.home-card:nth-child(3) { animation-delay: 0.1s; }
.home-card:nth-child(4) { animation-delay: 0.15s; }
.home-card:nth-child(5) { animation-delay: 0.2s; }
/* ===== RATE CARD ===== */
.rate-card-v2 { background: white; border-radius: 18px; margin-bottom: 15px; box-shadow: 0 4px 18px rgba(0,0,0,0.04); overflow: hidden; border: 1px solid rgba(0,0,0,0.03); }
.rate-card-header { background: linear-gradient(135deg, #f8fafc, #f1f5f9); padding: 12px 20px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.level-badge-v2 { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #4F46E5; font-size: 14px; }
.rate-grid-v2 { display: grid; grid-template-columns: 1fr 1fr; padding: 16px; gap: 14px; }
.rate-box-v2 { background: linear-gradient(135deg, #f9fafb, #f3f4f6); border-radius: 14px; padding: 16px; text-align: center; border: 1px solid #e5e7eb; transition: transform 0.2s; }
.rate-box-v2:active { transform: scale(0.97); }
.rate-box-v2.new { border-left: 4px solid #10b981; }
.rate-box-v2.old { border-left: 4px solid #8b5cf6; }
.rb-title { font-size: 11px; color: #6b7280; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.rb-value { font-size: 24px; font-weight: 800; color: #111827; }
.rb-value small { font-size: 11px; font-weight: 600; color: #9ca3af; }
/* ===== COUNTDOWN ===== */
.review-time-container-v3 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 15px; }
.rt-card-v3 { background: white; border-radius: 18px; padding: 16px; text-align: center; border: 1px solid rgba(0,0,0,0.03); box-shadow: 0 4px 16px rgba(0,0,0,0.03); overflow: hidden; }
.rt-card-v3.type-left { border-top: 4px solid var(--primary-color); background: linear-gradient(to bottom, rgba(79, 70, 229, 0.04), white); }
.rt-card-v3.type-right { border-top: 4px solid #10B981; background: linear-gradient(to bottom, rgba(16, 185, 129, 0.04), white); }
.rt-v3-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-size: 16px; }
.type-left .rt-v3-icon { background: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.type-right .rt-v3-icon { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.rt-v3-title { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 2px; line-height: 1.3; }
.rt-v3-date { font-size: 9px; color: #9ca3af; margin-bottom: 8px; }
.rt-v3-time-box { background: #f8fafc; border-radius: 10px; padding: 8px; border: 1px solid #e5e7eb; }
.rt-v3-sec { font-size: 24px; font-weight: 800; font-family: 'Courier New', monospace; color: #111; letter-spacing: 1px; }
.rt-v3-label { font-size: 10px; color: #10B981; font-weight: 700; background: #ecfdf5; display: inline-block; padding: 2px 8px; border-radius: 10px; margin-top: 5px; }
.countdown-active { animation: pulse 1s infinite; color: #059669 !important; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
/* ===== EXCHANGE ===== */
.trans-card { border: 1px solid rgba(0,0,0,0.03); }
.trans-btn { background: var(--gradient-main); color: white; border: none; padding: 14px; border-radius: 14px; font-weight: 700; width: 100%; font-size: 16px; transition: 0.2s; box-shadow: 0 4px 18px rgba(79, 70, 229, 0.25); display: flex; align-items: center; justify-content: center; gap: 8px; }
.trans-btn:active { transform: scale(0.98); }
.trans-btn:disabled { background: #9ca3af; cursor: not-allowed; box-shadow: none; transform: none; }
.form-select-custom {
background-color: #f8fafc; border: 2px solid #e5e7eb; border-radius: 12px; padding: 12px 16px; font-weight: 600; color: #374151; width: 100%; cursor: pointer; transition: all 0.2s;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3E");
background-position: right 12px center; background-repeat: no-repeat; background-size: 16px 12px; -webkit-appearance: none; appearance: none;
}
.form-select-custom:focus { outline: none; border-color: var(--primary-color); background-color: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
/* ===== TRUST BOX ===== */
.trust-box-new { text-align: center; }
.tbn-title { font-size: 14px; font-weight: 700; color: #374151; margin-bottom: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tbn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tbn-item { background: linear-gradient(135deg, #f9fafb, #f3f4f6); border-radius: 16px; padding: 16px 5px; transition: all 0.2s; border: 1px solid #e5e7eb; }
.tbn-item:active { transform: scale(0.95); border-color: var(--primary-light); }
.tbn-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; color: white; font-size: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.tbn-icon.t1 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tbn-icon.t2 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.tbn-icon.t3 { background: linear-gradient(135deg, #10b981, #059669); }
.tbn-text { font-size: 11px; font-weight: 700; color: #4b5563; }
/* ===== GMAIL ROWS ===== */
.gmail-row { background: white; border-radius: 14px; padding: 14px; margin-bottom: 10px; position: relative; border: 1.5px solid #e5e7eb; transition: all 0.3s; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.gmail-row:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08); }
.gmail-row input { border: none; background: #f8fafc; border-radius: 8px; padding: 10px 12px; font-size: 14px; width: 100%; margin-bottom: 8px; transition: background 0.2s; }
.gmail-row input:focus { outline: none; background: #eef2ff; }
.gmail-row .remove-btn { position: absolute; top: -8px; right: -8px; background: #ef4444; color: white; border: 2px solid white; border-radius: 50%; width: 24px; height: 24px; font-size: 12px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.gmail-row .remove-btn:active { transform: scale(0.85); }
/* ===== HISTORY ===== */
.history-tabs-container { background: white; padding: 6px; border-radius: 18px; margin-bottom: 15px; box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,0.03); }
.history-tabs { display: flex; gap: 6px; }
.h-tab-btn { flex: 1; border: none; background: transparent; padding: 10px 5px; font-weight: 600; color: #9CA3AF; font-size: 10px; border-radius: 14px; transition: 0.3s; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.h-tab-btn i { font-size: 18px; transition: 0.3s; }
.h-tab-btn.active { background: var(--gradient-main); color: white; box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3); }
/* ===== SELLERS ===== */
.seller-card { background: white; border-radius: 16px; padding: 14px; margin-bottom: 10px; display: flex; align-items: center; box-shadow: 0 2px 12px rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.03); transition: 0.2s; }
.seller-card:active { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); }
.seller-rank { width: 44px; height: 44px; border-radius: 50%; background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-weight: 900; margin-right: 14px; color: #9CA3AF; font-size: 15px; flex-shrink: 0; }
.seller-rank.gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3); }
.seller-rank.silver { background: linear-gradient(135deg, #C0C0C0, #A9A9A9); color: white; box-shadow: 0 4px 10px rgba(192, 192, 192, 0.3); }
.seller-info { flex-grow: 1; }
.seller-name { font-weight: 700; font-size: 14px; color: #111827; }
.seller-income-label { font-size: 10px; color: #9ca3af; font-weight: 600; }
.seller-amount { font-weight: 800; color: var(--primary-color); font-size: 17px; text-align: right; }
.seller-amount small { font-size: 10px; font-weight: 600; color: #9ca3af; }
/* ===== PROFILE ===== */
.profile-header { background: var(--gradient-main); padding: 30px 20px 70px; margin: -15px -15px 20px -15px; color: white; text-align: center; position: relative; border-radius: 0 0 30px 30px; overflow: hidden; }
.profile-header::before { content: ''; position: absolute; top: -30%; right: -20%; width: 200px; height: 200px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.profile-header::after { content: ''; position: absolute; bottom: -20%; left: -10%; width: 120px; height: 120px; background: rgba(255,255,255,0.04); border-radius: 50%; }
.ph-logo-custom {
width: 82px; height: 82px;
margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;
position: relative; z-index: 1;
filter: drop-shadow(0 6px 16px rgba(0,0,0,0.2));
animation: profileLogoEntry 0.6s ease-out;
}
.ph-logo-custom img { width: 82px; height: 82px; object-fit: contain; }
@keyframes profileLogoEntry { from { opacity: 0; transform: scale(0.7) rotate(-10deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.ph-name { font-size: 22px; font-weight: 700; margin-bottom: 5px; position: relative; z-index: 1; }
.balance-card-profile { background: white; border-radius: 22px; padding: 22px 16px; margin: -50px auto 20px; position: relative; z-index: 10; box-shadow: 0 12px 36px rgba(0,0,0,0.1); max-width: 100%; display: flex; justify-content: space-around; align-items: center; }
.bal-icon-box { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 6px; }
.bal-main .bal-icon-box { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: var(--primary-color); }
.bal-hold .bal-icon-box { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.withdraw-main-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: white; border: 2px solid var(--primary-color); color: var(--primary-color); padding: 15px; border-radius: 16px; width: 100%; font-weight: 700; font-size: 16px; box-shadow: 0 5px 18px rgba(79, 70, 229, 0.1); transition: 0.2s; margin-bottom: 20px; cursor: pointer; }
.withdraw-main-btn:active { background: var(--primary-color); color: white; }
.withdraw-main-btn.disabled-wd { background: #f3f4f6; border: 2px solid #d1d5db; color: #9ca3af; cursor: not-allowed; box-shadow: none; pointer-events: none; }
.stats-card-mobile { border-radius: 18px; overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow-card); border: none; }
.stat-box { background: linear-gradient(135deg, #f8fafc, #f1f5f9); border-radius: 14px; padding: 14px 10px; text-align: center; height: 100%; transition: all 0.2s; border: 1px solid transparent; }
.stat-box:active { border-color: var(--primary-color); transform: scale(0.97); }
.stat-box .val { font-size: 22px; font-weight: 800; margin-bottom: 2px; display: block; }
.stat-box .label { font-size: 10px; color: #9ca3af; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-box.total .val { color: var(--primary-color); }
.stat-box.pend .val { color: #eab308; }
.stat-box.app .val { color: #22c55e; }
.stat-box.rej .val { color: #ef4444; }
.level-card { background: white; border-radius: 18px; padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,0.03); }
.progress { transition: width 1s ease-in-out; }
.referral-card-new { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 22px; padding: 24px 20px; color: white; margin-bottom: 20px; box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3); position: relative; overflow: hidden; }
.referral-card-new::before { content: ''; position: absolute; top: -30%; right: -15%; width: 160px; height: 160px; background: rgba(255,255,255,0.06); border-radius: 50%; }
.ref-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; text-align: center; position: relative; z-index: 1; }
.ref-stat-val { font-size: 26px; font-weight: 800; }
.ref-stat-label { font-size: 10px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.ref-input-group { background: rgba(255,255,255,0.12); border-radius: 14px; padding: 12px; display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; border: 1px solid rgba(255,255,255,0.1); }
.ref-code-text { font-size: 18px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.settings-card { background: white; border-radius: 18px; padding: 8px; margin-bottom: 20px; box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,0.03); }
.settings-item { display: flex; align-items: center; padding: 14px; border-radius: 14px; transition: 0.2s; cursor: pointer; }
.settings-item:active { background: #f3f4f6; }
.settings-item i { font-size: 20px; margin-right: 14px; width: 24px; text-align: center; }
.settings-item .text { flex-grow: 1; }
.settings-item .text h6 { margin: 0; font-size: 14px; font-weight: 600; color: #111827; }
.settings-item .text small { color: #9ca3af; font-size: 11px; }
.settings-item.danger i, .settings-item.danger h6 { color: #ef4444; }
.install-app-btn {
display: flex; align-items: center; justify-content: center; gap: 10px;
background: linear-gradient(135deg, #0EA5E9 0%, #4F46E5 100%);
color: white; padding: 14px; border-radius: 16px; width: 100%;
font-weight: 700; font-size: 15px; box-shadow: 0 6px 20px rgba(79, 70, 229, 0.2);
border: none; transition: 0.2s; margin-top: 12px; margin-bottom: 15px; cursor: pointer;
}
.install-app-btn:active { transform: scale(0.98); opacity: 0.9; }
/* ===== AUTH PAGE ===== */
#auth-page { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--gradient-main); z-index: 2000; overflow-y: auto; }
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; }
.auth-container::before { content: ''; position: absolute; top: -10%; left: -10%; width: 200px; height: 200px; background: rgba(255,255,255,0.04); border-radius: 50%; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.2); position: relative; z-index: 1; }
.auth-header { padding: 36px 20px 20px; text-align: center; position: relative; }
.auth-header::after { content: ''; position: absolute; bottom: 0; left: 20px; right: 20px; height: 1px; background: linear-gradient(90deg, transparent, #e5e7eb, transparent); }
.auth-logo-box {
width: 88px; height: 88px;
display: flex; align-items: center; justify-content: center;
margin: 0 auto 16px;
filter: drop-shadow(0 6px 16px rgba(0,0,0,0.12));
transition: transform 0.3s;
}
.auth-logo-box:hover { transform: scale(1.05) rotate(-2deg); }
.auth-logo-box img { width: 88px; height: 88px; object-fit: contain; }
.auth-title { font-size: 21px; font-weight: 800; margin-bottom: 5px; line-height: 1.3; color: var(--primary-color); }
.auth-subtitle { font-size: 13px; color: #6B7280; margin-bottom: 10px; line-height: 1.5; }
.trust-badges { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.trust-badge-item { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: #9CA3AF; font-weight: 600; }
.trust-badge-item i { font-size: 18px; margin-bottom: 4px; color: var(--primary-color); }
.auth-body { padding: 24px 28px 30px; }
.form-control { border-radius: 12px; border: 2px solid #e5e7eb; font-size: 15px; padding: 12px 14px; transition: all 0.2s; background: #f9fafc; }
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08); background: #fff; }
.btn-main { background: var(--gradient-main); border: none; font-weight: 700; border-radius: 14px; padding: 13px; box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25); color: white; width: 100%; position: relative; cursor: pointer; transition: 0.2s; }
.btn-main:active { transform: scale(0.98); }
.btn-main .spinner-border { width: 1.2rem; height: 1.2rem; }
/* ===== WITHDRAW PAGE ===== */
#withdraw-page { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-body); z-index: 1500; overflow-y: auto; animation: slideUp 0.3s ease-out; }
.wd-header { background: var(--gradient-main); padding: 50px 20px 30px; color: white; text-align: center; border-radius: 0 0 30px 30px; position: relative; overflow: hidden; }
.wd-header::before { content: ''; position: absolute; top: -20%; right: -15%; width: 160px; height: 160px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.wd-back-btn { position: absolute; top: 15px; left: 15px; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.1); color: white; width: 36px; height: 36px; border-radius: 12px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); transition: 0.2s; }
.wd-back-btn:active { transform: scale(0.9); }
.wd-balance-box { background: rgba(255,255,255,0.12); border-radius: 14px; padding: 16px; margin-top: 16px; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(10px); }
.wd-body { padding: 20px; }
.payment-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.pm-card { background: white; border: 2px solid #e5e7eb; border-radius: 14px; padding: 14px 5px; text-align: center; cursor: pointer; transition: 0.2s; }
.pm-card.active { border-color: var(--primary-color); background: rgba(79, 70, 229, 0.04); box-shadow: 0 4px 16px rgba(79, 70, 229, 0.15); }
.pm-card i { font-size: 24px; margin-bottom: 5px; display: block; }
.pm-card span { font-size: 11px; font-weight: 700; }
.pm-card.method-bkash i { color: #E2136E; }
.pm-card.method-nagad i { color: #F6921D; }
.pm-card.method-binance i { color: #F0B90B; }
.content-section { display: none; padding: 15px; animation: slideUp 0.3s ease-out; }
.content-section.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
</style>
</head>
<body>
<!-- ===== APP LOADER ===== -->
<div id="app-loader">
<div class="loader-logo-wrap">
<img src="https://z-cdn-media.chatglm.cn/files/254f7f82-610d-4700-abc8-2e10435c149a.png?auth_key=1874890147-5ce8a86650d0488299a25b07660a73f8-0-b25e70b5ad3109adec869d78d8584440" alt="Mail Factory">
</div>
<div class="loader-brand"><span>Mail </span><span>Factory</span></div>
<div class="loader-spinner"></div>
<div class="loader-text">Loading your experience...</div>
</div>
<!-- ===== NETWORK ERROR ===== -->
<div id="networkErrorOverlay" class="network-overlay">
<i class="bi bi-wifi-off"></i>
<h4>🚫 No Internet Connection</h4>
<p>Please check your network and try again.</p>
</div>
<!-- ===== AUTH PAGE ===== -->
<div id="auth-page">
<div class="auth-container">
<div class="auth-card">
<div class="auth-header">
<div class="auth-logo-box">
<img src="https://z-cdn-media.chatglm.cn/files/254f7f82-610d-4700-abc8-2e10435c149a.png?auth_key=1874890147-5ce8a86650d0488299a25b07660a73f8-0-b25e70b5ad3109adec869d78d8584440" alt="Mail Factory">
</div>
<div id="auth-dynamic-header">
<div class="auth-title" id="authTitle">Welcome Back to Mail Factory</div>
<div class="auth-subtitle" id="authSubtitle">আপনার একাউন্টে লগইন করে এক্সচেঞ্জ এবং ব্যালেন্স ম্যানেজ করুন।</div>
</div>
<div class="trust-badges" style="margin-top: 22px;">
<div class="trust-badge-item"><i class="bi bi-shield-lock-fill"></i><span>Trusted</span></div>
<div class="trust-badge-item"><i class="bi bi-lightning-charge-fill"></i><span>Fast</span></div>
<div class="trust-badge-item"><i class="bi bi-people-fill"></i><span>50K+ Users</span></div>
</div>
</div>
<div class="auth-body">
<div id="login-form">
<div class="form-floating mb-3"><input type="text" class="form-control" id="loginEmail" placeholder="Email"><label>Gmail Address</label></div>
<div class="form-floating mb-4"><input type="password" class="form-control" id="loginPass" placeholder="Password"><label>Password</label></div>
<button class="btn btn-main py-3 fw-bold" id="loginBtn" onclick="window.handleLogin()">
<span id="loginBtnText">Login</span>
<span id="loginBtnSpinner" class="spinner-border spinner-border-sm d-none" role="status"></span>
</button>
<p class="text-center small mt-3 mb-0">একাউন্ট নেই? <a href="#" onclick="toggleAuth('reg')" class="fw-bold" style="color:var(--primary-color)">Register করুন</a></p>
</div>
<div id="reg-form" style="display: none;">
<div class="form-floating mb-3"><input type="text" class="form-control" id="regName" placeholder="Name"><label>Full Name</label></div>
<div class="form-floating mb-3"><input type="text" class="form-control" id="regEmail" placeholder="Email"><label>Gmail Address</label></div>
<div class="form-floating mb-3"><input type="password" class="form-control" id="regPass" placeholder="Pass"><label>Password</label></div>
<div class="form-floating mb-4"><input type="password" class="form-control" id="regConfirmPass" placeholder="Confirm"><label>Confirm Password</label></div>
<button class="btn btn-main py-3 fw-bold" id="regBtn" onclick="window.handleRegister()">
<span id="regBtnText">Register / Sign Up</span>
<span id="regBtnSpinner" class="spinner-border spinner-border-sm d-none" role="status"></span>
</button>
<p class="text-center small mt-4 mb-0">আগে থেকেই একাউন্ট আছে? <a href="#" onclick="toggleAuth('login')" class="fw-bold" style="color:var(--primary-color)">Login করুন</a></p>
</div>
</div>
</div>
</div>
</div>
<!-- ===== WITHDRAW PAGE ===== -->
<div id="withdraw-page">
<div class="wd-header">
<button class="wd-back-btn" onclick="window.closeWithdrawPage()"><i class="bi bi-x-lg"></i></button>
<h5 class="fw-bold mb-0">Withdraw Funds 💸</h5>
<div class="wd-balance-box">
<div class="d-flex justify-content-around">
<div><small style="font-size: 10px; opacity: 0.8;">Main Balance</small><h4 class="fw-bold mb-0">৳ <span id="wdMainBalance">0.00</span></h4></div>
<div class="border-start"></div>
<div><small style="font-size: 10px; opacity: 0.8;">Hold Balance</small><h4 class="fw-bold mb-0 text-warning">৳ <span id="wdHoldBalance">0.00</span></h4></div>
</div>
</div>
</div>
<div class="wd-body" id="wdBodyContent">
<div class="card p-3 border-0 shadow-sm mb-3" style="border-radius:16px;">
<label class="text-muted small fw-bold mb-2">পেমেন্ট মেথড সিলেক্ট করুন</label>
<div id="paymentMethodGrid" class="payment-method-grid"></div>
<input type="hidden" id="selectedMethod" value="">
<input type="hidden" id="selectedMethodName" value="">
</div>
<div class="card p-3 border-0 shadow-sm mb-3" style="border-radius:16px;">
<div class="mb-3"><label class="form-label text-muted small fw-bold">একাউন্ট নম্বর</label><input type="text" class="form-control" id="wdAccNumber" placeholder="Number/Address" style="border-radius:12px;"></div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">টাকার পরিমাণ</label>
<input type="number" class="form-control" id="wdAmount" placeholder="Amount" min="100" style="border-radius:12px;">
<div class="form-text text-danger small fw-bold" id="wdMinLabel">সর্বনিম্ন উত্তোলন: 100 টাকা</div>
</div>
</div>
<button class="btn btn-main w-100 py-3 fw-bold" id="withdrawSubmitBtn" onclick="window.processWithdraw()">
<span id="withdrawBtnText">Submit Request</span>
<span id="withdrawBtnSpinner" class="spinner-border spinner-border-sm d-none" role="status"></span>
</button>
</div>
</div>
<!-- ===== FLOATING SOCIAL ===== -->
<div class="social-float" id="socialFloat">
<a href="https://t.me/gmail_marketing02" target="_blank" class="float-btn tg-btn"><i class="bi bi-telegram"></i></a>
<a href="https://wa.me/8801964182265" target="_blank" class="float-btn wa-btn"><i class="bi bi-whatsapp"></i></a>
</div>
<!-- ===== NAVBAR ===== -->
<nav class="navbar navbar-dark">
<a class="navbar-brand-center" href="#" onclick="switchTab('home')">
<div class="nav-logo-icon">
<img src="https://z-cdn-media.chatglm.cn/files/254f7f82-610d-4700-abc8-2e10435c149a.png?auth_key=1874890147-5ce8a86650d0488299a25b07660a73f8-0-b25e70b5ad3109adec869d78d8584440" alt="Mail Factory">
</div>
<div style="display:flex; flex-direction:column; position:relative;">
<div class="nav-text-block">
<span class="nav-text-mail">Mail </span>
<span class="nav-text-factory">Factory</span>
</div>
<span class="nav-slogan">★ TRUSTED & FAST ★</span>
</div>
</a>
</nav>
<!-- ===== MAIN CONTENT ===== -->
<div class="container mt-2 page-container">
<!-- HOME -->
<div id="home" class="content-section active">
<div class="install-banner" id="installBanner" onclick="window.handleInstallClick()">
<img src="https://z-cdn-media.chatglm.cn/files/254f7f82-610d-4700-abc8-2e10435c149a.png?auth_key=1874890147-5ce8a86650d0488299a25b07660a73f8-0-b25e70b5ad3109adec869d78d8584440" class="install-banner-icon" alt="Mail Factory">
<div class="install-banner-text">
<h6>📱 Install Mail Factory App</h6>
<small>ফাস্ট অ্যাক্সেস পেতে অ্যাপ ইনস্টল করুন</small>
</div>
<i class="bi bi-chevron-right install-banner-arrow"></i>
<button class="install-banner-close" onclick="event.stopPropagation(); window.dismissInstallBanner()"><i class="bi bi-x"></i></button>
</div>
<div class="alert shadow-sm border-0 mb-3" style="background:linear-gradient(135deg,#f0fdf4,#ecfdf5); border-left:4px solid #10B981; border-radius:14px; display:flex; align-items:center; padding:12px 14px;">
<i class="bi bi-patch-check-fill me-3 fs-4" style="color:#10B981"></i>
<div class="small"><b>১০০% নিরাপদ :</b> আমরা সততার সাথে সার্ভিস দিচ্ছি।</div>
</div>
<div class="rate-card-v2">
<div class="rate-card-header">
<div class="level-badge-v2"><i class="bi bi-award-fill"></i><span id="homeLevelTitle">Level 1 Rate</span></div>
<span class="badge px-2 py-1" style="font-size:9px; background:#ecfdf5; color:#059669; border:1px solid #a7f3d0; font-weight:700;">● Active</span>
</div>
<div class="rate-grid-v2">
<div class="rate-box-v2 new"><div class="rb-title">New Gmail</div><div class="rb-value" id="rateNew">10 <small>টাকা</small></div></div>
<div class="rate-box-v2 old"><div class="rb-title">Old Gmail</div><div class="rb-value" id="rateOld">8 <small>টাকা</small></div></div>
</div>
</div>
<div class="home-card trans-card">
<h6 class="mb-3 fw-bold text-dark"><i class="bi bi-currency-exchange text-primary me-2"></i>লেনদেন শুরু করুন</h6>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Choose Gmail Type</label>
<select class="form-select-custom" id="dollarType" onchange="window.updateTotal()">
<option value="new">New Gmail (Level Rate)</option>
<option value="old">Old Gmail (Level Rate)</option>
</select>
</div>
<button class="trans-btn" id="startTransBtn" onclick="protectedAction('exchange_step')">Start Gmail Selling <i class="bi bi-arrow-right-circle ms-2"></i></button>
</div>
<div id="reviewTimeContainer" class="review-time-container-v3"></div>
<div class="home-card trust-box-new">
<div class="tbn-title"><i class="bi bi-shield-check text-primary"></i> কেন আমাদের বেছে নিবেন?</div>
<div class="tbn-grid">
<div class="tbn-item"><div class="tbn-icon t1"><i class="bi bi-lightning-charge-fill"></i></div><div class="tbn-text">দ্রুত পেমেন্ট</div></div>
<div class="tbn-item"><div class="tbn-icon t2"><i class="bi bi-shield-lock-fill"></i></div><div class="tbn-text">নিরাপদ ডাটা</div></div>
<div class="tbn-item"><div class="tbn-icon t3"><i class="bi bi-headset"></i></div><div class="tbn-text">২৪/৭ সাপোর্ট</div></div>
</div>
</div>
</div>
<!-- EXCHANGE STEP -->
<div id="exchange_step" class="content-section">
<div class="d-flex align-items-center mb-3">
<button class="btn btn-sm btn-light me-2 rounded-circle shadow-sm" onclick="switchTab('home')" style="width:32px; height:32px; padding:0;"><i class="bi bi-chevron-left"></i></button>
<h6 class="mb-0 fw-bold text-dark">Enter Gmail Details :</h6>
</div>
<div class="alert py-2 px-3 d-flex justify-content-between align-items-center mb-3" style="border-radius:12px; font-size:13px; background:#eef2ff; border:1px solid #c7d2fe; color:#3730a3;">
<span><i class="bi bi-tag me-1"></i>Your Level Rate:</span><b id="currentRateDisplay">10 টাকা</b>
</div>
<form id="gmailForm">
<div id="gmailRows"></div>
<button type="button" class="btn btn-outline-primary btn-sm mb-3 w-100 py-2" style="border-radius:12px; border-width:2px;" onclick="window.addMoreRow()"><i class="bi bi-plus-circle me-1"></i>Add Another</button>
<div class="card p-3 mb-3 bg-white border text-center shadow-sm" style="border-radius:14px;">
<small class="text-muted" style="font-size:11px;">Estimated Earnings</small>
<h3 class="mb-0 fw-bold" style="color:#059669;">৳ <span id="tempTotal">0</span></h3>
</div>
<div id="masterError" class="alert alert-danger py-2 text-center fw-bold" style="display:none; border-radius:12px; font-size:12px;"></div>
<button type="button" id="submitBtn" class="trans-btn" onclick="window.validateAndSubmit()"><span id="btnText">Confirm & Submit</span><span id="btnLoad" class="spinner-border spinner-border-sm d-none"></span></button>
</form>
</div>
<!-- HISTORY -->
<div id="history" class="content-section">
<div class="history-tabs-container">
<div class="history-tabs">
<button class="h-tab-btn active" onclick="showHistoryTab('sub', event)"><i class="bi bi-list-check"></i> Submissions</button>
<button class="h-tab-btn" onclick="showHistoryTab('wd', event)"><i class="bi bi-cash-stack"></i> Withdraws</button>
<button class="h-tab-btn" onclick="showHistoryTab('trend', event)"><i class="bi bi-fire"></i> Trending</button>
</div>
</div>
<div id="broadcastBox" class="alert py-2 px-3 shadow-sm border-0 d-flex align-items-center mb-3" style="display:none; border-radius:14px; background:linear-gradient(135deg,#fffbeb,#fef3c7); border-left:4px solid #f59e0b;"><i class="bi bi-megaphone-fill me-2 text-danger fs-5"></i><span id="broadcastText" class="fw-bold text-dark small"></span></div>
<div id="history_sub"><div class="card border-0 shadow-sm" style="border-radius:16px;"><ul class="list-group list-group-flush" id="historyList" style="border-radius:16px;"><li class="list-group-item text-center text-muted py-4 border-0">লোড হচ্ছে...</li></ul></div></div>
<div id="history_wd" style="display:none;"><div class="card border-0 shadow-sm" style="border-radius:16px;"><ul class="list-group list-group-flush" id="withdrawHistoryList"><li class="list-group-item text-center text-muted py-4 border-0">লোড হচ্ছে...</li></ul></div></div>
<div id="history_trend" style="display:none;"><div id="trendingList"></div></div>
</div>
<!-- SELLERS -->
<div id="sellers" class="content-section">
<h5 class="mb-3 text-center fw-bold text-dark">🏆 Top Sellers</h5>
<div id="topSellersList"></div>
</div>
<!-- PROFILE -->
<div id="profile" class="content-section">
<div class="profile-header">
<div class="ph-logo-custom">
<img src="https://z-cdn-media.chatglm.cn/files/254f7f82-610d-4700-abc8-2e10435c149a.png?auth_key=1874890147-5ce8a86650d0488299a25b07660a73f8-0-b25e70b5ad3109adec869d78d8584440" alt="Mail Factory">
</div>
<div class="ph-name" id="userDisplayName">User</div>
<span class="badge px-3 py-1 rounded-pill shadow-sm" id="levelNameDisplay" style="background:rgba(255,255,255,0.2);color:white;font-weight:700;font-size:12px;border:1px solid rgba(255,255,255,0.2);">Level 1</span>
</div>
<div class="balance-card-profile container">
<div class="text-center bal-main"><div class="bal-icon-box mx-auto"><i class="bi bi-wallet2"></i></div><small class="text-muted d-block" style="font-size:11px;">Main Balance</small><h3 class="fw-bold text-primary mb-0">৳ <span id="mainBalance">0.00</span></h3></div>
<div class="text-center bal-hold"><div class="bal-icon-box mx-auto"><i class="bi bi-hourglass-split"></i></div><small class="text-muted d-block" style="font-size:11px;">Hold Balance</small><h3 class="fw-bold mb-0" style="color:#d97706;">৳ <span id="holdBalance">0.00</span></h3></div>
</div>
<div class="container" style="padding-top: 0;">
<button class="withdraw-main-btn" id="withdrawMainBtn" onclick="window.openWithdrawPage()"><i class="bi bi-cash-stack"></i> <span id="withdrawBtnLabel">Withdraw Funds 💸</span></button>
<div class="card stats-card-mobile"><div class="card-body p-3">
<h6 class="text-muted text-uppercase mb-3 small" style="font-size:11px; letter-spacing:0.5px;">Submission Status</h6>
<div class="row g-3">
<div class="col-6"><div class="stat-box total"><span class="val" id="statTotal">0</span><span class="label">Total</span></div></div>
<div class="col-6"><div class="stat-box app"><span class="val" id="statApproved">0</span><span class="label">Approved</span></div></div>
<div class="col-6"><div class="stat-box pend"><span class="val" id="statPending">0</span><span class="label">Pending</span></div></div>
<div class="col-6"><div class="stat-box rej"><span class="val" id="statRejected">0</span><span class="label">Rejected</span></div></div>
</div>
</div></div>
<div class="level-card">
<div class="d-flex justify-content-between align-items-center mb-2">
<h6 class="mb-0 fw-bold" style="font-size:15px;">Level Progress</h6>
<span style="background:linear-gradient(135deg,#e0e7ff,#c7d2fe);color:#3730a3;padding:4px 12px;border-radius:10px;font-weight:700;font-size:12px;"><span id="levelCurrentRate">10</span> ৳/ Gmail</span>
</div>
<small class="text-muted">Approved: <span id="levelTotalApproved">0</span></small>
<div class="progress mt-2" style="height:8px;border-radius:10px;background:#f1f5f9;"><div class="progress-bar" id="levelProgressBar" style="width:0%;background:var(--gradient-main);border-radius:10px;"></div></div>
<div class="d-flex justify-content-between mt-2"><span class="small text-muted">Current Level</span><span class="small fw-bold text-primary" id="levelRemainCount">Next: 40 Left</span></div>
</div>
<div class="referral-card-new">
<div class="d-flex align-items-center mb-3" style="position:relative;z-index:1;"><i class="bi bi-gift-fill fs-3 me-3"></i><div><h6 class="mb-0 fw-bold">Invite & Earn</h6><small style="opacity:0.85">Commission: <span id="commRateDisplay">0</span>%</small></div></div>
<div class="ref-stats-grid">
<div><div class="ref-stat-val" id="totalReferred">0</div><div class="ref-stat-label">Total Refers</div></div>
<div><div class="ref-stat-val">৳ <span id="referralEarnings">0.00</span></div><div class="ref-stat-label">Total Earned</div></div>
</div>
<div class="ref-input-group">
<div class="flex-grow-1"><small class="d-block" style="font-size:10px;opacity:0.8">Your Code</small><span class="ref-code-text" id="myReferralCode">LOADING</span></div>
<button class="btn btn-light btn-sm px-3" style="border-radius:10px;font-weight:600;font-size:12px;" onclick="window.copyRefLink()"><i class="bi bi-clipboard-check me-1"></i>Copy</button>
</div>
<input type="hidden" id="refLinkInput" value="Loading...">
</div>
<div class="settings-card">
<div class="settings-item" onclick="window.openSupport()"><i class="bi bi-headset text-primary"></i><div class="text"><h6>Live Support</h6><small>Contact us via Telegram</small></div><i class="bi bi-chevron-right text-muted"></i></div>
<div class="settings-item" onclick="window.showChangePasswordModal()"><i class="bi bi-key text-warning"></i><div class="text"><h6>Change Password</h6><small>Update your account password</small></div><i class="bi bi-chevron-right text-muted"></i></div>
<div class="settings-item" onclick="window.logoutAllDevices()"><i class="bi bi-phone text-info"></i><div class="text"><h6>Logout All Devices</h6><small>Secure your account remotely</small></div><i class="bi bi-chevron-right text-muted"></i></div>
<div class="settings-item danger" onclick="window.handleDeleteAccount()"><i class="bi bi-person-x"></i><div class="text"><h6>Delete Account</h6><small>Permanently delete your data</small></div><i class="bi bi-chevron-right text-muted"></i></div>
</div>
<button id="installAppBtn" class="install-app-btn" onclick="window.handleInstallClick()"><i class="bi bi-box-arrow-in-down"></i> Download App</button>
<button class="btn btn-outline-danger w-100 btn-sm rounded-pill py-2 mb-5" onclick="window.handleLogout()" style="font-weight:600;"><i class="bi bi-box-arrow-right me-2"></i>Logout</button>
</div>
</div>
</div>
<!-- ===== BOTTOM NAV ===== -->
<div class="nav-bottom shadow">
<div class="nav-item active" id="home-btn" onclick="switchTab('home')"><i class="bi bi-house-door"></i><span>Home</span></div>
<div class="nav-item" id="history-btn" onclick="protectedAction('history')"><i class="bi bi-clock-history"></i><span>History</span></div>
<div class="nav-item" id="sellers-btn" onclick="switchTab('sellers')"><i class="bi bi-star"></i><span>Seller</span></div>
<div class="nav-item" id="profile-btn" onclick="protectedAction('profile')"><i class="bi bi-person"></i><span>Profile</span></div>
</div>
<script>
/* ============================================================
LOGO URL — এক জায়গায় পরিবর্তন করলেই সব জায়গায় আপডেট হবে
============================================================ */
const LOGO_URL = "https://z-cdn-media.chatglm.cn/files/254f7f82-610d-4700-abc8-2e10435c149a.png?auth_key=1874890147-5ce8a86650d0488299a25b07660a73f8-0-b25e70b5ad3109adec869d78d8584440";
/* ============================================================
PWA — লোগোতে ইতিমধ্যেই ব্যাকগ্রাউন্ড আছে, তাই সরাসরি ব্যবহার
============================================================ */
var deferredPrompt = null;
function setupPWA() {
// ফেভিকন — সরাসরি লোগো
var fl = document.createElement('link');
fl.rel = 'icon'; fl.type = 'image/png'; fl.href = LOGO_URL;
document.head.appendChild(fl);
// Apple touch icon
var al = document.createElement('link');
al.rel = 'apple-touch-icon'; al.href = LOGO_URL;
document.head.appendChild(al);
// Manifest — লোগোতে ইতিমধ্যেই পারফেক্ট bg আছে
var manifest = {
name: "Mail Factory",
short_name: "Mail Factory",
description: "Trusted Gmail Exchange & Earning Platform in Bangladesh",
start_url: "./",
display: "standalone",
background_color: "#F3F4F6",
theme_color: "#4F46E5",
orientation: "portrait-primary",
categories: ["business", "finance"],
icons: [
{ src: LOGO_URL, sizes: "192x192", type: "image/png", purpose: "any" },
{ src: LOGO_URL, sizes: "512x512", type: "image/png", purpose: "any" }
]
};
var blob = new Blob([JSON.stringify(manifest)], { type: 'application/json' });
var mLink = document.createElement('link');
mLink.rel = 'manifest';
mLink.href = URL.createObjectURL(blob);
document.head.appendChild(mLink);
// Service Worker
if ('serviceWorker' in navigator) {
var swCode = [
'self.addEventListener("install",function(e){self.skipWaiting();});',
'self.addEventListener("activate",function(e){e.waitUntil(clients.claim());});',
'self.addEventListener("fetch",function(e){e.respondWith(fetch(e.request).catch(function(){return new Response("Offline",{status:503});}));});'
].join('\n');
var swBlob = new Blob([swCode], { type: 'application/javascript' });
var swURL = URL.createObjectURL(swBlob);
navigator.serviceWorker.register(swURL, { scope: './' }).catch(function() {});
}
window.addEventListener('beforeinstallprompt', function(e) {
e.preventDefault(); deferredPrompt = e;
});
window.addEventListener('appinstalled', function() {
deferredPrompt = null;
var b = document.getElementById('installBanner'); if (b) b.style.display = 'none';
var btn = document.getElementById('installAppBtn'); if (btn) btn.style.display = 'none';
});
}
/* ============================================================
INSTALL HANDLERS
============================================================ */
window.handleInstallClick = function() {
if (deferredPrompt) {
deferredPrompt.prompt();
deferredPrompt.userChoice.then(function(r) {
if (r.outcome === 'accepted') { var b = document.getElementById('installBanner'); if (b) b.style.display = 'none'; }
deferredPrompt = null;
});
} else {
var ua = navigator.userAgent || '';
var html;
if (/iPad|iPhone|iPod/.test(ua) && !window.MSStream) {
html = '<div style="text-align:left;font-size:14px;line-height:1.8;"><div style="background:#f0f9ff;padding:15px;border-radius:14px;margin-bottom:15px;"><b>🍎 iPhone / iPad:</b></div><div style="padding-left:10px;"><p>১️⃣ সাফারির নিচে <b>Share</b> বাটন ট্যাপ করুন</p><p>২️⃣ <b>"Add to Home Screen"</b> সিলেক্ট করুন</p><p>৩️⃣ <b>"Add"</b> ট্যাপ করুন</p></div></div>';
} else if (/android/i.test(ua)) {
html = '<div style="text-align:left;font-size:14px;line-height:1.8;"><div style="background:#f0fdf4;padding:15px;border-radius:14px;margin-bottom:15px;"><b>🤖 Android:</b></div><div style="padding-left:10px;"><p>১️⃣ ব্রাউজারের <b>তিনটি ডট (⋮)</b> মেনু ট্যাপ করুন</p><p>২️⃣ <b>"Install App"</b> সিলেক্ট করুন</p><p>৩️⃣ <b>"Install"</b> কনফার্ম করুন</p></div></div>';
} else {
html = '<div style="text-align:left;font-size:14px;line-height:1.8;"><div style="background:#f5f3ff;padding:15px;border-radius:14px;margin-bottom:15px;"><b>💻 Desktop:</b></div><div style="padding-left:10px;"><p>১️⃣ Chrome এর ডানদিকে <b>Install icon</b> ক্লিক করুন</p><p>২️⃣ অথবা ⋮ মেনু থেকে <b>"Install Mail Factory"</b></p></div></div>';
}
Swal.fire({ icon: 'info', title: '📱 App ইনস্টল করুন', html: html, confirmButtonColor: '#4F46E5', confirmButtonText: 'বুঝেছি' });
}
};
window.dismissInstallBanner = function() {
var b = document.getElementById('installBanner');
if (b) { b.style.transition = 'all 0.3s'; b.style.opacity = '0'; b.style.transform = 'translateY(-10px)'; setTimeout(function() { b.style.display = 'none'; }, 300); }
localStorage.setItem('mf_banner_dismissed', '1');
};
/* ============================================================
PAGE LOAD
============================================================ */
document.addEventListener('DOMContentLoaded', function() {
setupPWA();
if (localStorage.getItem('mf_banner_dismissed') === '1') {
var b = document.getElementById('installBanner'); if (b) b.style.display = 'none';
}
initAppRoute();
addMoreRow();
addMoreRow();
});
</script>
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-app.js";
import { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword, onAuthStateChanged, signOut, updatePassword, reauthenticateWithCredential, EmailAuthProvider, deleteUser } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-auth.js";
import { getDatabase, ref, set, get, update, push, onValue, increment, query, orderByChild, equalTo, remove } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-database.js";
const firebaseConfig = {
apiKey: "AIzaSyAbsa0uvBYhkEYoLxuHwD4TQi5GDdAzQpg",
authDomain: "exchanger-pro.firebaseapp.com",
databaseURL: "https://exchanger-pro-default-rtdb.firebaseio.com",
projectId: "exchanger-pro",
storageBucket: "exchanger-pro.firebasestorage.app",
messagingSenderId: "889959520630",
appId: "1:889959520630:web:f4cbf82f236b616e1f8257"
};
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
const db = getDatabase(app);
window.currentUser = null;
window.isAppReady = false;
window.isWithdrawDisabled = false;
const urlParams = new URLSearchParams(window.location.search);
const referrerCodeParam = urlParams.get('ref');
window.currentDynamicRate = 10;
window.baseOldRate = 8;
let currentUserApprovedCount = 0;
let lastBroadcastMessage = "";
let levels = [{ level: 1, approved: 0, rate: 10, old_rate: 8 }];
const defaultReviewShifts = {
shift1: { title: "শুভ রাত্রি প্রথম সময়", time: "12:00 AM", active: true, order: 1 },
shift2: { title: "শুভ দিনের প্রথম সময়", time: "07:00 AM", active: true, order: 2 }
};
const defaultPaymentMethods = {
bkash: { name: "bKash", icon: "bi-wallet2", color: "#E2136E", active: true },
nagad: { name: "Nagad", icon: "bi-wallet2", color: "#F6921D", active: true },
binance: { name: "USDT", icon: "bi-app-indicator", color: "#F0B90B", active: true }
};
const appLoader = document.getElementById('app-loader');
const networkOverlay = document.getElementById('networkErrorOverlay');
const updateNetworkStatus = () => { if (!navigator.onLine) networkOverlay.classList.add('show'); else networkOverlay.classList.remove('show'); };
window.addEventListener('online', updateNetworkStatus);
window.addEventListener('offline', updateNetworkStatus);
window.hideLoader = () => { appLoader.classList.add('hidden'); window.isAppReady = true; };
updateNetworkStatus();
let globalTimerInterval = null;
let activeShifts = defaultReviewShifts;
function initTimerSystem() {
const container = document.getElementById('reviewTimeContainer');
if(!container) return;
const now = new Date();
const dateStr = now.toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' });
container.innerHTML = '<div class="rt-card-v3 type-left"><div class="rt-v3-icon"><i class="bi bi-moon-stars-fill"></i></div><div class="rt-v3-title" id="shift-title-1">Loading...</div><div class="rt-v3-date">(' + dateStr + ')</div><div class="rt-v3-time-box"><div class="rt-v3-sec" id="shift-timer-1">--:--:--</div><div class="rt-v3-label" id="shift-label-1">Waiting...</div></div></div><div class="rt-card-v3 type-right"><div class="rt-v3-icon"><i class="bi bi-sun-fill"></i></div><div class="rt-v3-title" id="shift-title-2">Loading...</div><div class="rt-v3-date">(' + dateStr + ')</div><div class="rt-v3-time-box"><div class="rt-v3-sec" id="shift-timer-2">--:--:--</div><div class="rt-v3-label" id="shift-label-2">Waiting...</div></div></div>';
if(!globalTimerInterval) globalTimerInterval = setInterval(updateTimers, 1000);
updateTimers();
}
function updateTimers() {
const now = new Date();
const allShifts = Object.values(activeShifts).sort((a, b) => (a.order || 0) - (b.order || 0));
if(allShifts.length > 0) updateSingleTimer(1, allShifts[0], now);
if(allShifts.length > 1) updateSingleTimer(2, allShifts[1], now);
}
function updateSingleTimer(index, shiftData, now) {
const titleEl = document.getElementById('shift-title-' + index);
const timerEl = document.getElementById('shift-timer-' + index);
const labelEl = document.getElementById('shift-label-' + index);
if(!titleEl || !shiftData) return;
titleEl.innerText = shiftData.title || "Shift " + index;
if(shiftData.active === false) {
timerEl.innerText = "00:00:00"; timerEl.classList.remove('countdown-active');
labelEl.innerText = "Disabled"; labelEl.className = "rt-v3-label"; labelEl.style.background = "#fee2e2"; labelEl.style.color = "#ef4444"; return;
} else { labelEl.style.background = ""; labelEl.style.color = ""; }
const parts = (shiftData.time || "12:00 AM").match(/(\d+):(\d+) (AM|PM)/i);
if(parts) {
let hours = parseInt(parts[1]); const mins = parseInt(parts[2]); const ampm = parts[3].toUpperCase();
if(ampm === 'PM' && hours !== 12) hours += 12; if(ampm === 'AM' && hours === 12) hours = 0;
const targetToday = new Date(); targetToday.setHours(hours, mins, 0, 0);
let target = targetToday; if(target <= now) target.setDate(target.getDate() + 1);
const diff = target - now;
if(diff > 0) {
const h = Math.floor((diff % (1000*60*60*24)) / (1000*60*60));
const m = Math.floor((diff % (1000*60*60)) / (1000*60));
const s = Math.floor((diff % (1000*60)) / 1000);
timerEl.innerText = String(h).padStart(2,'0')+':'+String(m).padStart(2,'0')+':'+String(s).padStart(2,'0');
timerEl.classList.add('countdown-active'); labelEl.innerText = shiftData.time; labelEl.className = "rt-v3-label";
} else { timerEl.innerText = "00:00:00"; timerEl.classList.remove('countdown-active'); }
} else { timerEl.innerText = "Invalid Time"; }
}
initTimerSystem();
function renderPaymentMethods(methods) {
const container = document.getElementById('paymentMethodGrid');
let html = ''; let firstMethodKey = null;
Object.keys(methods).forEach(key => {
const m = methods[key];
if(m.active) {
if(!firstMethodKey) firstMethodKey = key;
html += '<div class="pm-card method-'+key+'" onclick="window.selectPaymentMethod(this,\''+key+'\',\''+m.name+'\')"><i class="bi '+m.icon+'" style="color:'+m.color+'"></i><span>'+m.name+'</span></div>';
}
});
container.innerHTML = html;
if(firstMethodKey) {
const fc = container.querySelector('.pm-card'); if(fc) fc.classList.add('active');
document.getElementById('selectedMethod').value = firstMethodKey;
document.getElementById('selectedMethodName').value = methods[firstMethodKey].name;
}
}
renderPaymentMethods(defaultPaymentMethods);
function getDeviceInfo() {
const ua = navigator.userAgent;
if(/android/i.test(ua)) return "Android Device"; if(/iPad|iPhone|iPod/.test(ua)) return "iOS Device";
if(/Win/.test(ua)) return "Windows PC"; if(/Mac/.test(ua)) return "Macintosh"; if(/Linux/.test(ua)) return "Linux";
return "Unknown Device";
}
function getUserLevel(totalApproved) {
const sortedLevels = [...levels].sort((a, b) => a.approved - b.approved);
let currentLevel = sortedLevels[0]; let nextLevel = sortedLevels[1] || null;
for(let i = 0; i < sortedLevels.length; i++) {
if(totalApproved >= sortedLevels[i].approved) { currentLevel = sortedLevels[i]; nextLevel = (i+1 < sortedLevels.length) ? sortedLevels[i+1] : null; } else { break; }
}
return { current: currentLevel, next: nextLevel };
}
function syncRatesAndTotal() {
const ld = getUserLevel(currentUserApprovedCount);
window.currentDynamicRate = ld.current.rate; window.baseOldRate = ld.current.old_rate;
const rd = document.getElementById('currentRateDisplay'); if(rd) rd.innerText = window.currentDynamicRate + " টাকা";
const ht = document.getElementById('homeLevelTitle'); const rn = document.getElementById('rateNew'); const ro = document.getElementById('rateOld');
if(window.currentUser) {
if(ht) ht.innerText = 'Level '+ld.current.level+' Rate';
if(rn) rn.innerHTML = window.currentDynamicRate+' <small>টাকা</small>';
if(ro) ro.innerHTML = window.baseOldRate+' <small>টাকা</small>';
} else {
const dl = levels[0];
if(ht) ht.innerText = "Level 1 Rate";
if(rn) rn.innerHTML = dl.rate+' <small>টাকা</small>';
if(ro) ro.innerHTML = dl.old_rate+' <small>টাকা</small>';
}
if(typeof window.updateTotal === 'function') window.updateTotal();
}
function showToast(icon, title) {
const Toast = Swal.mixin({ toast: true, position: 'bottom-start', showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (t) => { t.addEventListener('mouseenter', Swal.stopTimer); t.addEventListener('mouseleave', Swal.resumeTimer); } });
Toast.fire({ icon, title });
}
function showPopup(icon, title, text) { Swal.fire({ icon, title, html: text, confirmButtonColor: '#4F46E5', background: '#fff' }); }
function showError(title, msg) { showPopup('error', title, msg); }
function getErrorReason(error) {
let msg = "Unknown error occurred.";
switch(error.code) {
case 'auth/email-already-in-use': msg = 'This email is already in use.'; break;
case 'auth/invalid-email': msg = 'Invalid email format.'; break;
case 'auth/weak-password': msg = 'Password is too weak. Minimum 6 characters.'; break;
case 'auth/user-not-found': msg = 'No account found with this email.'; break;
case 'auth/wrong-password': msg = 'Incorrect password.'; break;
case 'auth/invalid-credential': msg = 'Invalid email or password.'; break;
case 'auth/too-many-requests': msg = 'Too many failed attempts.'; break;
case 'auth/requires-recent-login': msg = 'Please login again to continue.'; break;
default: msg = error.message || "An unexpected error occurred.";
}
return msg;
}
function syncWithdrawUI(isDisabled) {
window.isWithdrawDisabled = isDisabled;
const wdBtn = document.getElementById('withdrawMainBtn');
const wdLabel = document.getElementById('withdrawBtnLabel');
const wdSubmitBtn = document.getElementById('withdrawSubmitBtn');
if(isDisabled) {
wdBtn.classList.add('disabled-wd'); wdLabel.innerHTML = '⚠️ Withdraw Temporary Closed';
wdSubmitBtn.disabled = true; document.getElementById('withdrawBtnText').innerText = 'Withdraw Closed';
} else {
wdBtn.classList.remove('disabled-wd'); wdLabel.innerHTML = 'Withdraw Funds 💸';
wdSubmitBtn.disabled = false; document.getElementById('withdrawBtnText').innerText = 'Submit Request';
}
}
onValue(ref(db, "settings"), (snap) => {
const data = snap.exists() ? snap.val() : {};
if(data.review_shifts) {
activeShifts = data.review_shifts;
const keys = Object.keys(activeShifts);
const s1 = document.getElementById('shift-title-1'); const s2 = document.getElementById('shift-title-2');
if(keys.length > 0 && s1) s1.innerText = activeShifts[keys[0]].title;
if(keys.length > 1 && s2) s2.innerText = activeShifts[keys[1]].title;
}
renderPaymentMethods(data.payment_methods || defaultPaymentMethods);
const isM = data.maintenance_mode || false;
const sb = document.getElementById('startTransBtn'); const sub = document.getElementById('submitBtn');
if(isM) { if(sb){sb.disabled=true;sb.innerHTML="⚠️ কাজটি সাময়িকভাবে স্থগিত ⏳";} if(sub){sub.disabled=true;document.getElementById('btnText').innerText="Maintenance Mode";} }
else { if(sb){sb.disabled=false;sb.innerHTML='Start Gmail Selling <i class="bi bi-arrow-right-circle ms-2"></i>';} if(sub){sub.disabled=false;document.getElementById('btnText').innerText="Confirm & Submit";} }
syncWithdrawUI(data.withdraw_disabled || false);
if(data.levels) { levels=[]; Object.keys(data.levels).forEach(k=>{const l=data.levels[k];levels.push({level:Number(k),approved:l.req||0,rate:l.new_rate||10,old_rate:l.old_rate||8});}); }
syncRatesAndTotal();
const cr = data.commission_percent || 0; const cd = document.getElementById('commRateDisplay'); if(cd) cd.innerText = cr;
const minW = data.min_withdraw || 100;
document.getElementById('wdMinLabel').innerText = 'সর্বনিম্ন উত্তোলন: '+minW+' টাকা';
document.getElementById('wdAmount').setAttribute('min', minW);
if(data.broadcast) {
document.getElementById('broadcastText').innerText = data.broadcast;
document.getElementById('broadcastBox').style.display = 'flex';
if(data.broadcast !== lastBroadcastMessage) { Swal.fire({icon:'info',title:'📢 Notifications',text:data.broadcast,confirmButtonColor:'#4F46E5'}); lastBroadcastMessage = data.broadcast; }
} else { document.getElementById('broadcastBox').style.display = 'none'; lastBroadcastMessage = ""; }
});
function renderSellers(snap, cid) {
const list = document.getElementById(cid); let h = ''; const users = [];
snap.forEach(c => { const u = c.val(); if(u.isTopSeller === true) users.push(u); });
users.sort((a,b) => (Number(b.balance)||0) - (Number(a.balance)||0));
users.forEach((u,i) => {
let badge = i===0?'🥇':(i===1?'🥈':(i===2?'🥉':'')); let rc = i===0?'gold':(i===1?'silver':'');
h += '<div class="seller-card"><div class="seller-rank '+rc+'">'+(badge||(i+1))+'</div><div class="seller-info"><div class="seller-name">'+u.username+'</div><div class="seller-income-label">Total Income</div></div><div class="text-end"><div class="seller-amount">'+(Number(u.balance)||0).toFixed(0)+' <small>BDT</small></div></div></div>';
});
if(!users.length) h = '<div class="text-center text-muted p-4" style="border-radius:16px;background:white;">No sellers found</div>';
list.innerHTML = h;
}
onValue(ref(db, "users"), (snap) => { renderSellers(snap, 'topSellersList'); renderSellers(snap, 'trendingList'); });
onAuthStateChanged(auth, (user) => {
window.currentUser = user;
if(user) {
onValue(ref(db, 'users/'+user.uid+'/forceLogout'), (s) => { if(s.exists() && s.val()===true) { update(ref(db,'users/'+user.uid),{forceLogout:false}); signOut(auth); showPopup('info','Session Expired','Logged out from all devices.'); } });
onValue(ref(db, 'users/'+user.uid), (snap) => {
if(snap.exists()) {
const d = snap.val();
if(!window.isAppReady) window.hideLoader();
if(d.admin_message) { showPopup('info','ব্যক্তিগত বার্তা',d.admin_message); update(ref(db,'users/'+user.uid),{admin_message:null}); }
if(d.is_blocked) { showPopup('error','Account Blocked','আপনার একাউন্ট ব্লক করা হয়েছে।'); signOut(auth); return; }
document.getElementById('userDisplayName').innerText = d.username || "User";
document.getElementById('mainBalance').innerText = (Number(d.balance)||0).toFixed(2);
document.getElementById('holdBalance').innerText = (Number(d.hold)||0).toFixed(2);
document.getElementById('wdMainBalance').innerText = (Number(d.balance)||0).toFixed(2);
document.getElementById('wdHoldBalance').innerText = (Number(d.hold)||0).toFixed(2);
const rc = d.referralCode || "N/A"; document.getElementById('myReferralCode').innerText = rc;
let host = window.location.origin; if(!host||host==='null') host='https://exchanger-pro.web.app';
document.getElementById('refLinkInput').value = host+window.location.pathname+"?ref="+rc;
document.getElementById('referralEarnings').innerText = (Number(d.referralEarnings)||0).toFixed(2);
if(d.paymentNumber) document.getElementById('wdAccNumber').value = d.paymentNumber;