File size: 82,943 Bytes
504392a
 
 
 
 
 
757db24
 
504392a
 
 
6fa48cc
 
 
 
504392a
6fa48cc
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
 
6fa48cc
 
 
 
504392a
 
6fa48cc
 
 
504392a
6fa48cc
504392a
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
757db24
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
 
 
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4ba6270
 
 
 
 
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
 
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82e1386
 
6fa48cc
 
 
 
 
 
 
 
 
82e1386
6fa48cc
 
 
 
 
 
 
 
07e7f0a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f0117b
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f0117b
82e1386
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353b8f2
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353b8f2
6fa48cc
 
 
 
 
 
353b8f2
6fa48cc
 
 
 
 
 
 
 
 
 
489f090
6fa48cc
489f090
6fa48cc
489f090
6fa48cc
 
489f090
6fa48cc
 
 
 
611e0a5
 
 
 
 
 
 
8b6de29
611e0a5
 
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489f090
6fa48cc
 
 
 
 
 
 
 
 
 
 
93cb3c0
20b3de1
504392a
 
 
 
 
 
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
757db24
6fa48cc
 
 
 
 
757db24
6fa48cc
 
3ae4480
 
6fa48cc
3ae4480
6fa48cc
 
 
 
 
3ae4480
6fa48cc
3ae4480
 
 
 
 
 
6fa48cc
3ae4480
 
6fa48cc
3ae4480
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
 
6fa48cc
 
8bf6976
6fa48cc
 
 
757db24
6fa48cc
 
 
 
 
 
0a563e9
6fa48cc
 
 
504392a
6fa48cc
 
 
 
 
504392a
6fa48cc
 
 
504392a
6fa48cc
 
 
504392a
6fa48cc
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bf6976
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ae4480
6fa48cc
 
 
 
 
 
 
3ae4480
4ba6270
 
 
 
 
 
 
 
 
 
6fa48cc
 
da113c8
 
 
6fa48cc
 
 
da113c8
 
757db24
da113c8
6fa48cc
 
 
 
 
 
 
 
4ba6270
 
 
 
 
 
6fa48cc
 
 
 
da113c8
 
 
4ba6270
da113c8
6fa48cc
 
 
da113c8
 
 
2f0117b
da113c8
3ae4480
 
 
 
 
 
 
 
0a563e9
da113c8
 
6fa48cc
 
 
da113c8
 
0a563e9
8bf6976
 
6fa48cc
 
 
8bf6976
 
6fa48cc
 
da113c8
2f0117b
0a563e9
da113c8
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
2f0117b
3ae4480
 
 
2f0117b
6fa48cc
 
3ae4480
 
 
 
 
6fa48cc
 
3ae4480
 
 
 
6fa48cc
 
 
 
 
0a563e9
 
 
 
 
 
 
6fa48cc
 
 
 
0a563e9
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a563e9
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
 
6fa48cc
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
504392a
6fa48cc
504392a
6fa48cc
 
 
757db24
6fa48cc
504392a
6fa48cc
 
 
 
504392a
 
6fa48cc
 
 
 
 
 
 
 
 
 
4ba6270
 
 
 
 
 
 
 
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
504392a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bf6976
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bf6976
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bf6976
6fa48cc
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
 
 
 
504392a
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504392a
6fa48cc
 
 
07e7f0a
6fa48cc
 
07e7f0a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
07e7f0a
 
 
 
 
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
07e7f0a
 
6fa48cc
 
07e7f0a
6fa48cc
07e7f0a
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59c4a20
6fa48cc
 
 
59c4a20
6fa48cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
757db24
6fa48cc
611e0a5
6fa48cc
 
 
 
 
 
 
 
611e0a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ae4480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6fa48cc
 
504392a
 
 
6fa48cc
 
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
<!-- 
https://thewitcher-sagi-ai-tools.static.hf.space/index.html
https://huggingface.co/spaces/theWitcher/sagi-ai-tools 

https://chatgpt.com/c/67efa5ae-ab80-8005-a7d4-de3ced6ccec4

https://bit.ly/a-tools

-->

<!DOCTYPE html>
<html dir="rtl" lang="he">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ארגז הכלים שלי לבינה מלאכותית</title>
    <link
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
      rel="stylesheet"
    />

    <style>
      @import url('https://fonts.googleapis.com/css2?family=Arimo:wght@400;500;600;700&display=swap');

      body {
        font-family: 'Arimo', sans-serif;
        background-color: #f9fafb;
      }

      .tool-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
          0 10px 10px -5px rgba(0, 0, 0, 0.04);
      }

      .category-filter .active {
        background-color: #3b82f6;
        color: white;
      }

      .gradient-text {
        background: linear-gradient(90deg, #3b82f6, #8b5cf6);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
      }

      /* RTL specific styles */
      [dir='rtl'] .rotate-180 {
        transform: rotate(180deg);
      }

      /* Mobile menu styles */
      .mobile-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
      }

      .mobile-menu.open {
        max-height: 500px;
      }

      /* Admin badge */
      .admin-badge {
        position: absolute;
        top: -8px;
        right: -8px;
        background-color: #ef4444;
        color: white;
        border-radius: 9999px;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
      }

      /* Futuristic profile image */
      .profile-container {
        position: relative;
        width: 200px;
        height: 200px;
        margin: 0 auto;
      }

      .profile-image {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        border: 4px solid #3b82f6;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
        position: relative;
        z-index: 2;
      }

      .tech-circle {
        position: absolute;
        border-radius: 50%;
        border: 2px solid rgba(59, 130, 246, 0.7);
        animation: rotate infinite linear;
      }

      .tech-circle-1 {
        width: 220px;
        height: 220px;
        top: -10px;
        left: -10px;
        animation-duration: 15s;
        border-style: dashed;
      }

      .tech-circle-2 {
        width: 240px;
        height: 240px;
        top: -20px;
        left: -20px;
        animation-duration: 20s;
        animation-direction: reverse;
      }

      .tech-circle-3 {
        width: 260px;
        height: 260px;
        top: -30px;
        left: -30px;
        animation-duration: 25s;
        border-style: dotted;
      }

      @keyframes rotate {
        from {
          transform: rotate(0deg);
        }
        to {
          transform: rotate(360deg);
        }
      }

      .tech-dots {
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        z-index: 1;
      }

      .tech-dot {
        position: absolute;
        width: 8px;
        height: 8px;
        background-color: #8b5cf6;
        border-radius: 50%;
        transform: translate(-50%, -50%);
      }

      /* Futuristic AI elements */
      .ai-particle {
        position: absolute;
        background: linear-gradient(135deg, #3b82f6, #8b5cf6);
        border-radius: 50%;
        opacity: 0.6;
        filter: blur(10px);
        z-index: 0;
      }

      .ai-circuit {
        position: absolute;
        width: 100%;
        height: 100%;
        background-image: radial-gradient(
            circle at center,
            transparent 0%,
            #f9fafb 100%
          ),
          linear-gradient(
            90deg,
            transparent 49%,
            rgba(59, 130, 246, 0.1) 50%,
            transparent 51%
          ),
          linear-gradient(
            0deg,
            transparent 49%,
            rgba(59, 130, 246, 0.1) 50%,
            transparent 51%
          );
        background-size: 20px 20px;
        border-radius: 50%;
        opacity: 0.3;
      }
      /* Added cursor style for clickable stats */
      .clickable-stat:hover {
        cursor: pointer;
        background-color: #f3f4f6; /* Slightly lighter gray on hover */
      }
    </style>
    <!-- Google tag (gtag.js) -->
    <script
      async
      src="https://www.googletagmanager.com/gtag/js?id=G-JVF8N1DVSG"
    ></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag() {
        dataLayer.push(arguments);
      }
      gtag('js', new Date());

      gtag('config', 'G-JVF8N1DVSG');
    </script>
    <link href="favicon-32.png" rel="icon" sizes="32x32" type="image/png" />
    <link href="manifest.json" rel="manifest" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="AI Tools" name="apple-mobile-web-app-title" />
    <link href="icon-192.png" rel="apple-touch-icon" />
    <meta content="#3b82f6" name="theme-color" />
  </head>
  <body class="min-h-screen">
    <div
      id="newToolBanner"
      class="hidden bg-green-100 text-green-800 text-center py-2 text-sm font-semibold"
    >
      🎉 התווסף כלי חדש: <span id="newToolName"></span><a href="#toolsContainer" class="underline">צפו עכשיו</a>
      <button id="closeBanner" class="ml-4 text-green-800 font-bold">×</button>
    </div>

    <!-- Header -->
    <header
      class="sticky top-0 z-50 backdrop-blur-md bg-white/80 shadow-md border-b border-gray-200"
    >
      <div class="container mx-auto px-4 py-4">
        <div class="flex justify-between items-center">
          <div class="flex items-center">
            <!-- Mobile menu button -->
            <button id="mobileMenuButton" class="md:hidden text-gray-600 mr-4">
              <i class="fas fa-bars text-xl"></i>
            </button>

            <div>
              <h1 class="text-2xl md:text-3xl font-bold gradient-text">
                ארגז הכלים שלי ל-AI
              </h1>
              <p class="text-gray-600 text-sm md:text-base mt-1">
                אוסף כלי הבינה המלאכותית המומלצים שלי
              </p>
            </div>
          </div>

          <div class="hidden md:flex items-center space-x-4 space-x-reverse">
            <!-- /* --- Refresh Button - Still useful for resetting filters/sort --- */ -->
            <button
              id="refreshBtn"
              class="px-5 py-2 rounded-xl bg-gradient-to-l from-blue-600 to-indigo-500 text-white shadow-md hover:shadow-lg hover:from-blue-700 hover:to-indigo-600 transition-all duration-300"
            >
              <i class="fas fa-sync-alt ml-2"></i> אפס תצוגה
            </button>

            <!-- /* --- Admin Edit Button - Uncomment if needed --- */ -->
            <button
              id="editJsonBtn"
              class="px-5 py-2 rounded-xl bg-gradient-to-l from-pink-500 to-purple-600 text-white shadow-md hover:shadow-lg hover:from-pink-600 hover:to-purple-700 transition-all duration-300 relative"
            >
              <i class="fas fa-edit ml-2"></i> הציעו כלי חדש
              <span class="admin-badge">N</span>
            </button>
          </div>
        </div>

        <!-- /* --- Mobile menu --- */ -->
        <div id="mobileMenu" class="mobile-menu md:hidden mt-4">
          <div class="flex flex-col space-y-2 py-2">
            <button
              id="refreshBtnMobile"
              class="px-5 py-2 rounded-xl bg-gradient-to-l from-blue-600 to-indigo-500 text-white shadow-md hover:shadow-lg hover:from-blue-700 hover:to-indigo-600 transition-all duration-300"
            >
              <i class="fas fa-sync-alt ml-2"></i> אפס תצוגה
            </button>
            <!-- /* --- Admin Edit Button (Mobile) - Uncomment if needed --- */ -->
            <button
              id="editJsonBtn"
              class="px-5 py-2 rounded-xl bg-gradient-to-l from-pink-500 to-purple-600 text-white shadow-md hover:shadow-lg hover:from-pink-600 hover:to-purple-700 transition-all duration-300 relative"
            >
              <i class="fas fa-edit ml-2"></i> הציעו כלי חדש
              <span class="admin-badge">N</span>
            </button>
          </div>
        </div>
      </div>
    </header>

    <!-- /* --- Main Content --- */ -->
    <main class="container mx-auto px-4 py-8">
      <!-- /* --- About Me Section --- */ -->
      <div
        class="bg-white rounded-lg shadow-sm p-6 border border-gray-100 mb-8 relative overflow-hidden"
      >
        <!-- /* ... (content unchanged) ... */ -->
        <div
          class="ai-particle"
          style="width: 100px; height: 100px; top: -30px; right: -30px"
        ></div>
        <div
          class="ai-particle"
          style="width: 150px; height: 150px; bottom: -50px; left: -50px"
        ></div>
        <div
          class="ai-particle"
          style="width: 80px; height: 80px; top: 50%; right: 20%"
        ></div>

        <h2 class="text-2xl font-bold mb-6 text-gray-800 border-b pb-2">
          קצת עליי
        </h2>
        <div class="flex flex-col md:flex-row gap-6">
          <div class="md:w-1/3">
            <div class="profile-container">
              <div class="ai-circuit"></div>
              <div class="tech-circle tech-circle-1"></div>
              <div class="tech-circle tech-circle-2"></div>
              <div class="tech-circle tech-circle-3"></div>
              <div class="tech-dots">
                <div class="tech-dot" style="top: 10%; left: 50%"></div>
                <div class="tech-dot" style="top: 50%; left: 10%"></div>
                <div class="tech-dot" style="top: 90%; left: 50%"></div>
                <div class="tech-dot" style="top: 50%; left: 90%"></div>
                <div class="tech-dot" style="top: 30%; left: 30%"></div>
                <div class="tech-dot" style="top: 70%; left: 70%"></div>
                <div class="tech-dot" style="top: 30%; left: 70%"></div>
                <div class="tech-dot" style="top: 70%; left: 30%"></div>
              </div>
              <img
                src="https://i.imgur.com/cnlxCuj.jpeg"
                alt="שגיא בר און"
                class="profile-image"
              />
            </div>
          </div>
          <div class="md:w-2/3">
            <h3 class="text-xl font-semibold mb-4">שגיא בר און</h3>
            <p class="text-gray-700 mb-4">
              אני חוקר ויועץ בתחום הבינה המלאכותית, מאסטר NLP, ובעל ניסיון של
              למעלה מ-25 שנה בתעשיית ההייטק. בעל מומחיות רחבה בפיתוח תוכנה,
              אוטומציה, ניהול פרויקטים ואסטרטגיה עסקית.
            </p>
            <p class="text-gray-700 mb-4">
              מרצה אורח באוניברסיטת רייכמן וחבר בסגל הבוחנים של מה"ט - המכון
              הממשלתי להכשרה בטכנולוגיה ובמדע - לבחינות מהנדסי תוכנה
              באוניברסיטאות ובמכללות, וכן מנטור לAI במסגרת משרד החינוך.
            </p>
            <p class="text-gray-700 mb-4">
              בעל תואר שני במנהל עסקים עם התמחות בבינה מלאכותית, תואר ראשון
              (BSc) במדעי המחשב והנדסאי תוכנה. ההרצאות משלבות ידע עדכני, חשיבה
              ביקורתית והתנסות חווייתית, מתוך מטרה להעצים אנשים ולאפשר להם
              להשתמש בטכנולוגיה בחוכמה ובקלות.
            </p>
            <p class="text-gray-700">
              שמתי לי למטרה להנגיש, להסביר ולחבר את הטכנולוגיה בצורה פשוטה
              וברורה לכולם.
            </p>
          </div>
        </div>
      </div>

      <!-- /* --- Search and Filters --- */ -->
      <div class="mb-8">
        <!-- /* ... (content unchanged) ... */ -->
        <div
          class="flex flex-col md:flex-row md:items-center md:justify-between gap-4"
        >
          <div class="relative w-full md:w-96">
            <input
              type="text"
              id="searchInput"
              placeholder="חפש כלים..."
              class="w-full pr-10 pl-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition"
            />
            <i class="fas fa-search absolute right-3 top-3.5 text-gray-400"></i>
          </div>
          <div class="flex items-center space-x-2 space-x-reverse">
            <span class="text-gray-600 hidden md:block">סנן לפי:</span>
            <div class="category-filter flex flex-wrap gap-2">
              <button
                class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50"
                data-category="all"
              >
                הכל
              </button>
              <button
                class="filter-btn px-3 py-1 rounded-full border text-sm transition border-yellow-400 text-yellow-700 bg-yellow-100 hover:bg-yellow-200"
                data-category="free"
              >
                חינם
              </button>
              <button
                class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50"
                data-category="productivity"
              >
                פרודוקטיביות
              </button>
              <button
                class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50"
                data-category="writing"
              >
                כתיבה
              </button>
              <button
                class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50"
                data-category="design"
              >
                עיצוב
              </button>
              <button
                class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50"
                data-category="coding"
              >
                תכנות
              </button>
              <button
                class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50"
                data-category="video"
              >
                וידאו
              </button>
            </div>
          </div>
        </div>
      </div>

      <!-- /* --- Stats --- */ -->
      <div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
        <!-- /* ... (content unchanged, including clickable stat boxes) ... */ -->
        <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
          <div class="flex items-center">
            <div class="p-3 rounded-full bg-blue-50 text-blue-600 ml-3">
              <i class="fas fa-tools text-lg"></i>
            </div>
            <div>
              <p class="text-gray-500 text-sm">סה"כ כלים</p>
              <h3 class="text-xl font-semibold" id="totalTools">0</h3>
            </div>
          </div>
        </div>
        <div
          id="topRatedStatBox"
          class="bg-white p-4 rounded-lg shadow-sm border border-gray-100 transition clickable-stat"
        >
          <div class="flex items-center">
            <div class="p-3 rounded-full bg-purple-50 text-purple-600 ml-3">
              <i class="fas fa-star text-lg"></i>
            </div>
            <div>
              <p class="text-gray-500 text-sm">מובילים בדירוג</p>
              <h3 class="text-xl font-semibold" id="topRated">0</h3>
            </div>
          </div>
        </div>
        <div
          id="newToolsStatBox"
          class="bg-white p-4 rounded-lg shadow-sm border border-gray-100 transition clickable-stat"
        >
          <div class="flex items-center">
            <div class="p-3 rounded-full bg-green-50 text-green-600 ml-3">
              <i class="fas fa-bolt text-lg"></i>
            </div>
            <div>
              <p class="text-gray-500 text-sm">חדשים השבוע</p>
              <h3 class="text-xl font-semibold" id="newTools">0</h3>
            </div>
          </div>
        </div>
        <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
          <div class="flex items-center">
            <div class="p-3 rounded-full bg-yellow-50 text-yellow-600 ml-3">
              <i class="fas fa-tags text-lg"></i>
            </div>
            <div>
              <p class="text-gray-500 text-sm">קטגוריות</p>
              <h3 class="text-xl font-semibold" id="totalCategories">0</h3>
            </div>
          </div>
        </div>
      </div>

      <!-- /* --- Tools Grid --- */ -->
      <div
        class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"
        id="toolsContainer"
      >
        <!-- /* --- Tools will be loaded here --- */ -->
        <p id="loadingMessage" class="text-center text-gray-500 col-span-full">
          טוען כלים...
        </p>
      </div>

      <!-- /* --- YouTube Videos Section --- */ -->
      <div class="mt-16">
        <!-- /* ... (content unchanged) ... */ -->
        <h2 class="text-2xl font-bold mb-6 text-gray-800 border-b pb-2">
          סרטונים נבחרים מערוץ היוטיוב שלי
        </h2>
        <div
          class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"
          id="videosContainer"
        >
          <!-- /* --- Videos will be loaded here --- */ -->
        </div>
      </div>
    </main>

    <!-- /* --- JSON Editor Modal (Admin Feature) --- */ -->
    <div
      id="jsonEditorModal"
      class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"
    >
      <!-- /* ... (content unchanged) ... */ -->
      <div
        class="bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col"
      >
        <div
          class="px-6 py-4 border-b border-gray-200 flex justify-between items-center"
        >
          <h3 class="text-lg font-semibold">עריכת הנתונים ב-JSON</h3>
          <button id="closeModalBtn" class="text-gray-500 hover:text-gray-700">
            <i class="fas fa-times"></i>
          </button>
        </div>
        <div class="p-6 flex-1 overflow-auto">
          <div class="flex mb-4">
            <button
              id="showToolsBtn"
              class="px-4 py-2 bg-blue-600 text-white rounded-l-lg"
            >
              כלים
            </button>
            <button
              id="showVideosBtn"
              class="px-4 py-2 bg-gray-200 text-gray-700 rounded-r-lg"
            >
              סרטונים
            </button>
          </div>
          <textarea
            id="jsonEditor"
            class="w-full h-96 p-4 border border-gray-300 rounded-lg font-mono text-sm"
            spellcheck="false"
            style="direction: ltr; text-align: left"
          ></textarea>
        </div>
        <div
          class="px-6 py-4 border-t border-gray-200 flex justify-end space-x-3 space-x-reverse"
        >
          <button
            id="cancelEditBtn"
            class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 transition"
          >
            ביטול
          </button>
          <button
            id="saveJsonBtn"
            class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition"
          >
            שמור שינויים (באחסון המקומי)
          </button>
        </div>
      </div>
    </div>
    <div
      id="suggestToolModal"
      class="fixed inset-0 bg-black bg-opacity-40 flex items-center justify-center z-[9999] px-4 hidden"
    >
      <div
        class="bg-white rounded-lg w-full max-w-md shadow-lg max-h-[90vh] overflow-hidden flex flex-col text-right relative"
      >
        <!-- תוכן -->
        <div class="p-6 overflow-y-auto flex-grow">
          <h2 class="text-xl font-semibold mb-4">הצעת כלי חדש</h2>
          <form id="suggestToolForm" class="space-y-4">
            <div>
              <label class="block mb-1">שם הכלי</label>
              <input
                type="text"
                name="name"
                required
                class="w-full border rounded p-2"
              />
            </div>

            <div>
              <label class="block mb-1">לינק</label>
              <input
                type="url"
                name="url"
                required
                placeholder="כתובת URL של הכלי: לדוגמא: https://linktr.ee/sagib"
                dir="ltr"
                class="w-full border rounded p-2"
              />
            </div>

            <div>
              <label class="block mb-1">תיאור קצר</label>
              <textarea
                name="description"
                required
                class="w-full border rounded p-2"
              ></textarea>
            </div>

            <div>
              <label class="block mb-1">השם שלך</label>
              <input
                type="text"
                name="userName"
                placeholder="איך לקרוא לך כשנחזור אליך?"
                class="w-full border rounded p-2"
              />
            </div>

            <div>
              <label class="block mb-1">מס' טלפון נייד</label>
              <input
                type="tel"
                name="userPhone"
                placeholder="05X-XXXXXXX"
                class="w-full border rounded p-2"
                dir="ltr"
              />
            </div>

            <p class="text-sm text-gray-500">
              נשמח לחזור אליך כשהכלי שצעת נוסף לאתר ❤️
            </p>
            <p class="text-sm text-gray-500 italic">
              ✦ הפרטים שלך נשמרים אצלנו רק לצורך עדכון – אין שימוש אחר.
            </p>
          </form>
        </div>

        <!-- כפתורים קבועים בתחתית -->
        <div
          class="sticky bottom-0 bg-white/80 backdrop-blur-md px-6 py-4 border-t flex justify-center space-x-4 space-x-reverse z-10 rounded-b-lg"
        >
          <button
            type="button"
            onclick="closeSuggestModal()"
            class="px-5 py-2 bg-gray-200 text-gray-800 rounded hover:bg-gray-300"
          >
            ביטול
          </button>
          <button
            type="submit"
            form="suggestToolForm"
            class="px-6 py-2 bg-purple-600 text-white rounded hover:bg-purple-700"
          >
            שלח
          </button>
        </div>
      </div>
    </div>
    <div
      id="videoModal"
      class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center hidden z-[9999]"
    >
      <div
        class="bg-white rounded-lg overflow-hidden w-full max-w-3xl shadow-lg relative"
      >
        <button
          onclick="closeVideoModal()"
          class="absolute top-2 left-2 text-gray-700 hover:text-red-600 text-xl"
        >
          <i class="fas fa-times"></i>
        </button>
        <iframe
          id="videoIframe"
          class="w-full h-[300px] sm:h-[500px]"
          src=""
          frameborder="0"
          allowfullscreen
        ></iframe>
      </div>
    </div>

    <!-- /* --- Footer --- */ -->
    <footer
      class="fixed bottom-0 left-0 w-full z-50 backdrop-blur-md bg-white/80 shadow-xl border-t border-gray-200"
    >
      <!-- הוספת כפתור צ'אט צף לקובץ index.html -->
      <!-- Improved Chat Component -->
      <div id="chatBubble" class="fixed bottom-8 right-5 z-[9999]">
        <!-- Introductory message -->
        <div
          id="chatIntro"
          class="bg-white p-3 rounded-lg shadow-md mb-2 text-sm max-w-xs chat-intro-enter hidden"
        >
          שלום! אני עוזר AI של שגיא. אשמח לעזור לך למצוא כלי AI מתאים או לענות
          על שאלות.
          <button onclick="hideChatIntro()" class="text-gray-500 float-left">
            <i class="fas fa-times"></i>
          </button>
        </div>

        <!-- Chat Button -->
        <button
          id="chatButton"
          onclick="toggleChatWindow()"
          class="chat-pulse bg-gradient-to-r from-purple-500 to-indigo-600 hover:from-purple-600 hover:to-indigo-700 text-white px-4 py-3 rounded-full shadow-xl flex items-center space-x-2 space-x-reverse"
        >
          <i class="fas fa-robot"></i>
          <span>צ'אט</span>
        </button>

        <!-- Chat Window -->
        <div
          id="chatWindow"
          class="hidden mt-3 w-[360px] h-[500px] bg-white rounded-2xl shadow-2xl border border-gray-200 overflow-hidden relative"
        >
          <!-- Chat Header -->
          <div
            class="bg-gradient-to-r from-purple-500 to-indigo-600 text-white p-3 flex justify-between items-center"
          >
            <button onclick="toggleChatWindow()" class="text-white">
              <i class="fas fa-times"></i>
            </button>
            <div class="chat-header">
              צ'אט עם הבינה של שגיא
              <span
                id="toolsCount"
                class="ml-2 text-sm bg-white text-purple-600 font-semibold px-2 py-1 rounded-full shadow-sm"
              ></span>
            </div>
            <!-- <div class="font-medium">עוזר AI של שגיא</div> -->
            <div class="w-6"></div>
            <!-- Spacer for balance -->
          </div>

          <!-- Chat iframe -->
          <iframe
            src="https://sagi-ba-sagi-ai-tools-chatbot-main-g1prqf.streamlit.app/?embed=true"
            class="w-full h-full border-none"
          ></iframe>
        </div>
      </div>

      <script>
        function toggleChatWindow() {
          const chatWindow = document.getElementById('chatWindow');
          chatWindow.classList.toggle('hidden');
        }
      </script>

      <!-- <span>© 2025 כל הזכויות שמורות לשגיא בר און.</span> -->
      <div class="container mx-auto px-4 py-3 text-center space-y-2">
        <!-- כפתור התקנת אפליקציה -->
        <div id="installAppContainer" class="flex justify-center">
          <button
            id="installAppBtn"
            class="mt-2 px-4 py-2 rounded-xl bg-gradient-to-br from-green-500 to-emerald-600 text-white font-bold shadow hover:scale-105 transition"
            style="display: none"
          >
            📲 התקנת האפליקציה
          </button>
        </div>

        <div class="flex justify-center gap-4">
          <!-- אייקונים -->
          <a
            href="https://chat.whatsapp.com/GPFASYBEA9CFGUMCVZ5RXP"
            target="_blank"
            class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-green-500 hover:bg-green-500 hover:text-white transition"
            ><i class="fab fa-whatsapp"></i
          ></a>
          <a
            href="http://www.linkedin.com/in/sagi-bar-on"
            target="_blank"
            class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-blue-500 hover:bg-blue-700 hover:text-white transition"
            ><i class="fab fa-linkedin-in"></i
          ></a>
          <a
            href="https://www.facebook.com/SAGI.BARON"
            target="_blank"
            class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-blue-600 hover:bg-blue-800 hover:text-white transition"
            ><i class="fab fa-facebook-f"></i
          ></a>
          <a
            href="https://www.youtube.com/@SAGIBARON"
            target="_blank"
            class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-red-500 hover:bg-red-700 hover:text-white transition"
            ><i class="fab fa-youtube"></i
          ></a>
        </div>
        <button
          id="editJsonBtnFooter"
          class="px-4 py-2 rounded-xl bg-gradient-to-br from-pink-500 to-purple-600 text-white font-bold shadow hover:scale-105 transition"
        >
          <i class="fas fa-pen-to-square ml-2"></i> הציעו כלי חדש
        </button>
        <p class="text-gray-500 text-xs">
          © 2025 כל הזכויות שמורות לשגיא בר און
        </p>
      </div>
      <!-- זהו ה־div הסוגר של ה־container -->
    </footer>

    <!-- /* --- Load Tailwind CSS via CDN --- */ -->
    <script src="https://cdn.tailwindcss.com"></script>

    <!-- /* ----------------------------------- */
    /* ------- START OF JAVASCRIPT ------- */
    /* ----------------------------------- */ -->
    <script>
      // --- DOM Elements ---
      const toolsContainer = document.getElementById('toolsContainer');
      const videosContainer = document.getElementById('videosContainer');
      const searchInput = document.getElementById('searchInput');
      const filterButtons = document.querySelectorAll('.filter-btn');
      const totalToolsElement = document.getElementById('totalTools');
      const topRatedElement = document.getElementById('topRated');
      const newToolsElement = document.getElementById('newTools');
      const totalCategoriesElement = document.getElementById('totalCategories');
      const mobileMenuButton = document.getElementById('mobileMenuButton');
      const mobileMenu = document.getElementById('mobileMenu');
      const jsonEditorModal = document.getElementById('jsonEditorModal');
      const jsonEditor = document.getElementById('jsonEditor');
      const closeModalBtn = document.getElementById('closeModalBtn');
      const cancelEditBtn = document.getElementById('cancelEditBtn');
      const saveJsonBtn = document.getElementById('saveJsonBtn');
      const showToolsBtn = document.getElementById('showToolsBtn');
      const showVideosBtn = document.getElementById('showVideosBtn');
      const refreshBtn = document.getElementById('refreshBtn');
      const refreshBtnMobile = document.getElementById('refreshBtnMobile');
      const loadingMessage = document.getElementById('loadingMessage'); // For showing loading status

      const topRatedStatBox = document.getElementById('topRatedStatBox');
      const newToolsStatBox = document.getElementById('newToolsStatBox');
      const totalToolsStatBox = document
        .querySelector('[id="totalTools"]')
        .closest('.bg-white');
      let filteredStatView = null; // 'topRated', 'newTools', או null

      if (totalToolsStatBox) {
        totalToolsStatBox.classList.add('clickable-stat');
        totalToolsStatBox.addEventListener('click', () => {
          filteredStatView = null;
          currentSearchTerm = '';
          currentCategory = 'all';
          document
            .querySelectorAll('.filter-btn')
            .forEach((btn) => btn.classList.remove('active'));
          const allBtn = document.querySelector(
            '.filter-btn[data-category="all"]'
          );
          if (allBtn) allBtn.classList.add('active');
          renderTools();
          scrollToTools();
        });
      }

      if (topRatedStatBox) {
        topRatedStatBox.addEventListener('click', () => {
          filteredStatView = 'topRated';
          currentSearchTerm = '';
          currentCategory = 'all';
          renderTools();
          scrollToTools();
        });
      }

      if (newToolsStatBox) {
        newToolsStatBox.addEventListener('click', () => {
          filteredStatView = 'newTools';
          currentSearchTerm = '';
          currentCategory = 'all';
          renderTools();
          scrollToTools();
        });
      }

      // --- State ---
      let currentCategory = 'all';
      let currentSearchTerm = '';
      let toolsData = { tools: [], videos: [] }; // Holds the data fetched from server
      let currentSort = 'newest'; // 'newest', 'rating'

      // --- Initialize ---
      async function init() {
        showLoading('טוען נתונים...');

        try {
          await loadData(); // המתנה לטעינת הנתונים

          renderTools();
          renderVideos();
          updateStats();
          setupEventListeners();
          updateCategoryFilters(); // הוספת כפתור המועדפים

          // הגדרת כפתור "הכל" כפעיל בהתחלה
          const allFilterBtn = document.querySelector(
            '.filter-btn[data-category="all"]'
          );
          if (allFilterBtn) {
            allFilterBtn.classList.add('active');
          }

          hideLoading();
        } catch (error) {
          console.error('שגיאה באתחול:', error);
          showError('אירעה שגיאה בטעינת האתר. אנא נסה לרענן את הדף.');
          hideLoading();
        }
      }

      const speechSynthesis = window.speechSynthesis;
      let currentUtterance = null;

      // פונקציה להקראת טקסט בעברית
      function speakText(text) {
        // עצירת הקראה קודמת אם יש
        if (speechSynthesis.speaking) {
          speechSynthesis.cancel();

          // אם זאת אותה הקראה שכבר פועלת, פשוט נעצור ונצא
          if (currentUtterance && currentUtterance.text === text) {
            currentUtterance = null;
            return;
          }
        }

        // יצירת הקראה חדשה
        const utterance = new SpeechSynthesisUtterance(text);

        // הגדרת השפה לעברית
        utterance.lang = 'he-IL';

        // בדיקת קולות זמינים ובחירת קול עברי
        const voices = speechSynthesis.getVoices();

        if (voices.length) {
          const hebrewVoice = voices.find((voice) =>
            /he|hebrew|ivrit/i.test(voice.lang)
          );

          if (hebrewVoice) {
            utterance.voice = hebrewVoice;
            console.log('נבחר קול עברי:', hebrewVoice.name);
          } else {
            console.log('לא נמצא קול עברי, משתמש בקול ברירת מחדל');
          }
          // ננסה להשתמש בקול גוגל
          const googleVoice = voices.find(
            (voice) =>
              voice.name.includes('Google') &&
              (voice.name.includes('US') || voice.name.includes('UK'))
          );

          if (googleVoice) {
            utterance.voice = googleVoice;
          }
        } else {
          // במקרה שהקולות עדיין לא נטענו, נגדיר מאזין חד-פעמי
          speechSynthesis.addEventListener(
            'voiceschanged',
            function loadVoice() {
              const voices = speechSynthesis.getVoices();
              const hebrewVoice = voices.find((voice) =>
                /he|hebrew|ivrit/i.test(voice.lang)
              );
              if (hebrewVoice) {
                utterance.voice = hebrewVoice;
                console.log('נבחר קול עברי (מדחייה):', hebrewVoice.name);
              }
              // הסרת המאזין אחרי הפעלה ראשונה
              speechSynthesis.removeEventListener('voiceschanged', loadVoice);
            },
            { once: true }
          );
        }

        // שמירת ההקראה הנוכחית
        currentUtterance = utterance;

        // טיפול באירוע סיום הקראה
        utterance.onend = () => {
          currentUtterance = null;

          // עדכון כל הכפתורים למצב "לא מנגן"
          document.querySelectorAll('.speak-button').forEach((btn) => {
            btn.innerHTML = '<i class="fas fa-volume-up"></i>';
            btn.classList.remove('speaking');
          });
        };

        // הפעלת ההקראה
        speechSynthesis.speak(utterance);
      }

      // --- UI Feedback ---
      function showLoading() {
        if (loadingMessage) loadingMessage.style.display = 'block';
        if (toolsContainer) toolsContainer.innerHTML = ''; // Clear container while loading
      }

      function hideLoading() {
        if (loadingMessage) loadingMessage.style.display = 'none';
      }

      function showError(message) {
        if (toolsContainer) {
          toolsContainer.innerHTML = `<p class="text-center text-red-600 col-span-full">${message}</p>`;
        }
        hideLoading(); // Make sure loading message is hidden
      }

      // --- Data Fetching ---
      async function fetchDefaultData() {
        console.log('Fetching latest data from server...'); // Log fetching attempt
        try {
          const [toolsResponse, videosResponse] = await Promise.all([
            fetch('tools.json?cacheBust=' + Date.now()), // Cache busting
            fetch('videos.json?cacheBust=' + Date.now()), // Cache busting
          ]);

          if (!toolsResponse.ok || !videosResponse.ok) {
            const errorMsg = `HTTP error! Status: Tools ${toolsResponse.status}, Videos ${videosResponse.status}`;
            console.error(errorMsg);
            throw new Error('שגיאה בקבלת נתונים מהשרת.'); // User-friendly error
          }

          const [toolsArray, videosArray] = await Promise.all([
            toolsResponse.json(),
            videosResponse.json(),
          ]);

          // --- Process fetched data with defaults ---
          const processedTools = toolsArray.map((tool) => ({
            ...tool,
            rating: tool.rating ?? 0,
            isNew: tool.isNew ?? false,
            category: tool.category ?? 'general',
            icon: tool.icon || 'fas fa-tools',
            url: tool.url || '#',
            description: tool.description || 'אין תיאור זמין.',
            name: tool.name || 'שם לא ידוע',
          }));
          const processedVideos = videosArray.map((video) => ({
            ...video,
            url: video.url || '#',
            title: video.title || 'כותרת חסרה',
            description: video.description || 'אין תיאור זמין.',
            date: video.date ?? new Date().toISOString(),
          }));

          console.log('Data fetched successfully.');
          return { tools: processedTools, videos: processedVideos };
        } catch (error) {
          console.error('Failed to fetch default data:', error);
          // Re-throw the error or a more specific one to be caught by the caller
          throw new Error(
            'כשל בטעינת נתוני ברירת המחדל מהשרת. בדוק את הקבצים tools.json ו-videos.json.'
          );
        }
      }

      // --- Data Loading Strategy ---
      // MODIFIED: Always fetch fresh data from the server on load.
      async function loadData() {
        console.log('loadData called - fetching fresh data.');
        try {
          toolsData = await fetchDefaultData();
          // Note: We are NOT saving to localStorage here anymore for loading purposes.
          // saveData(); // Removed - No longer saving fetched data automatically
        } catch (error) {
          console.error('Error in loadData:', error);
          toolsData = { tools: [], videos: [] }; // Set empty data on error
          // Re-throw error so init() can handle UI feedback
          throw error;
        }
      }

      // --- Save Data to Local Storage (Used ONLY by JSON Editor) ---
      // Note: Data saved here will be overwritten on next page load/refresh.
      function saveData() {
        try {
          // Save the current state (potentially modified by editor) to localStorage
          localStorage.setItem('aiToolsData', JSON.stringify(toolsData));
          console.log(
            'Data saved to localStorage (by editor). Will be overwritten on next load.'
          );
        } catch (e) {
          console.error('Error saving data to localStorage:', e);
          alert('שגיאה בשמירת הנתונים באחסון המקומי.');
        }
      }

      // --- Sorting Function (Unchanged) ---
      function sortTools(sortBy) {
        if (!toolsData || !Array.isArray(toolsData.tools)) return;
        console.log('Sorting by:', sortBy);
        currentSort = sortBy;
        toolsData.tools.sort((a, b) => {
          if (sortBy === 'newest') {
            const aIsNew = a.isNew || false;
            const bIsNew = b.isNew || false;
            if (aIsNew !== bIsNew) return bIsNew - aIsNew;
            return 0;
          } else if (sortBy === 'rating') {
            const aRating = a.rating || 0;
            const bRating = b.rating || 0;
            if (bRating !== aRating) return bRating - aRating;
            return 0;
          }
          return 0;
        });
      }
      function scrollToTools() {
        const toolsSection = document.getElementById('toolsContainer');
        if (toolsSection) {
          toolsSection.scrollIntoView({ behavior: 'smooth', block: 'start' });
        }
      }

      // --- Rendering Functions (Unchanged logic, but added hideLoading) ---
      function renderTools() {
        hideLoading(); // Ensure loading message is hidden before rendering
        if (!toolsContainer || !toolsData || !Array.isArray(toolsData.tools)) {
          console.error(
            'Cannot render tools: Missing container or invalid data.'
          );
          showError('שגיאה בהצגת הכלים.');
          return;
        }
        const filteredTools = filterTools();
        toolsContainer.innerHTML = ''; // Clear previous content

        if (
          filteredTools.length === 0 &&
          currentSearchTerm === '' &&
          currentCategory === 'all'
        ) {
          // Show specific message if no tools loaded at all
          showError('לא נטענו כלים. בדוק את קובץ tools.json או נסה לרענן.');
        } else if (filteredTools.length === 0) {
          toolsContainer.innerHTML =
            '<p class="text-center text-gray-500 col-span-full">לא נמצאו כלים התואמים את החיפוש, הסינון והמיון.</p>';
        } else {
          filteredTools.forEach((tool, index) => {
            const toolCard = document.createElement('div');
            toolCard.className = `relative tool-card bg-white rounded-lg shadow-sm border border-gray-100 p-6 transition duration-300 ${
              tool.isFeatured ? 'ring-2 ring-blue-500' : ''
            }`;

            // הכנת הטקסט להקראה - שילוב של שם הכלי והתיאור שלו
            const speakableText = `${tool.name}. ${tool.description}`;

            // הוספת מאפיין לסינון כלים חינמיים
            if (tool.free) {
              toolCard.setAttribute('data-free', 'true');
              toolCard.classList.add(
                'border',
                'border-yellow-400',
                'shadow-md'
              );
            }
            toolCard.setAttribute('data-tool', 'true');

            toolCard.innerHTML = `
                    <div class="flex items-center justify-between mb-4">
                        <div class="flex items-center gap-4">
                            <!-- לוגו הכלי -->
                            <img src="${tool.logo}" alt="${
              tool.name
            } Logo" class="w-14 h-14 object-contain rounded bg-white p-1 shadow-sm">

                            <div>
                                <!-- שם הכלי, תגית 'חדש!' וכפתור רמקול -->
                                <div class="flex items-center gap-2">
                                    <h3 class="text-xl font-semibold">${
                                      tool.name
                                    }</h3>
                                    ${
                                      tool.isNew
                                        ? `<span class="text-xs bg-green-500 text-white px-2 py-1 rounded-full animate-pulse">חדש!</span>`
                                        : ''
                                    }
                                    ${
                                      tool.free
                                        ? `<span class="text-xs bg-yellow-400 text-black px-2 py-1 rounded-full">חינם</span>`
                                        : ''
                                    }

                                    <button title="הקרא תיאור" onclick="event.stopPropagation(); speakText('${tool.description.replace(
                                      /'/g,
                                      "\\'"
                                    )}')" class="text-blue-600 hover:text-blue-800 focus:outline-none">
                                        <i class="fas fa-volume-up"></i>
                                    </button>
                                </div>

                                <!-- תגית קטגוריה -->
                                <span class="text-xs px-2 py-1 rounded-full ${getCategoryBadgeColor(
                                  tool.category
                                )}">
                                    ${getCategoryName(tool.category)}
                                </span>
                            </div>
                        </div>

                        <!-- כפתור מועדפים -->
                        <div class="flex items-center gap-2">
                            <button class="favorite-btn p-2 text-yellow-400 hover:text-yellow-500 transition" data-id="${index}" title="הוסף למועדפים">
                                <i class="far fa-star text-xl"></i>
                            </button>
                            <!-- אייקון הכלי -->
                            <i class="${tool.icon} text-gray-500 text-2xl"></i>
                        </div>
                    </div>

                    <!-- תיאור -->
                    <p class="text-gray-700 mb-4 text-base leading-relaxed min-h-[60px]">${
                      tool.description
                    }</p>

                    <!-- דירוג + יוטיוב -->
                    <div class="flex justify-between items-center mb-4">
                        <div class="flex items-center gap-3">
                            ${renderRatingStars(tool.rating)}
                            ${
                              tool.video
                                ? `
                                <button title="צפה בהדרכה" onclick="openVideoModal('${tool.video}')" class="text-red-500 hover:text-red-600 transition text-xl">
                                    <i class="fab fa-youtube"></i>
                                </button>`
                                : ''
                            }
                        </div>
                    </div>

                    <!-- כפתור גישה לכלי -->
                    <a href="${
                      tool.url
                    }" target="_blank" rel="noopener noreferrer"
                        class="inline-block w-full text-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition ${
                          tool.url === '#'
                            ? 'opacity-50 cursor-not-allowed'
                            : ''
                        }">
                        <i class="fas fa-external-link-alt ml-2"></i> ${
                          tool.url !== '#' ? 'גישה לכלי' : 'אין קישור'
                        }
                    </a>
                    
                    <!-- כפתורי שיתוף -->
                    ${renderShareButtons(tool)}
                `;

            toolsContainer.appendChild(toolCard);

            // אנימציה של הופעה חלקה
            requestAnimationFrame(() => {
              toolCard.classList.add('visible');
            });
          });

          // הפעלת פונקציות האתחול לאחר הוספת הכלים לדף
          setupFavorites();
          setupShareButtons();

          // הוספת סגנון CSS לכפתור הקראה פעיל
          if (!document.getElementById('speakButtonStyle')) {
            const style = document.createElement('style');
            style.id = 'speakButtonStyle';
            style.innerHTML = `
                    .speak-button.speaking { color: #4f46e5; animation: pulse 1.5s infinite; }
                    @keyframes pulse {
                    0% { transform: scale(1); }
                    50% { transform: scale(1.2); }
                    100% { transform: scale(1); }
                    }
                `;
            document.head.appendChild(style);
          }
        }
      }

      // פונקציה נוספת שמוחקת את ההקראה בעת עזיבת העמוד
      function cleanupSpeech() {
        if (speechSynthesis) {
          speechSynthesis.cancel();
        }
      }

      // הוספת אירוע לניקוי ההקראה בעת עזיבת העמוד
      window.addEventListener('beforeunload', cleanupSpeech);

      // עדכון אירוע הקלקה על כפתור הקראה - להוסיף מחלקת CSS ולשנות אייקון
      document.addEventListener('click', function (e) {
        if (e.target.closest('.speak-button')) {
          const button = e.target.closest('.speak-button');

          // החלפת האייקון והוספת מחלקת CSS מהבהבת
          if (speechSynthesis.speaking && currentUtterance) {
            // אם יש הקראה פעילה, נעדכן את כל הכפתורים
            document.querySelectorAll('.speak-button').forEach((btn) => {
              btn.innerHTML = '<i class="fas fa-volume-up"></i>';
              btn.classList.remove('speaking');
            });

            // ואז נעדכן את הכפתור הנוכחי אם ההקראה ממשיכה
            if (!button.classList.contains('speaking')) {
              button.innerHTML = '<i class="fas fa-volume-mute"></i>';
              button.classList.add('speaking');
            }
          } else {
            button.innerHTML = '<i class="fas fa-volume-up"></i>';
            button.classList.remove('speaking');
          }
        }
      });

      function renderVideos() {
        // ... (renderVideos logic remains the same as before) ...
        if (
          !videosContainer ||
          !toolsData ||
          !Array.isArray(toolsData.videos)
        ) {
          console.error(
            'Cannot render videos: Missing container or invalid data.'
          );
          if (videosContainer)
            videosContainer.innerHTML =
              '<p class="text-center text-red-500 col-span-full">שגיאה בהצגת הסרטונים.</p>';
          return;
        }
        videosContainer.innerHTML = '';
        if (toolsData.videos.length === 0) {
          videosContainer.innerHTML =
            '<p class="text-center text-gray-500 col-span-full">אין סרטונים להצגה.</p>';
        } else {
          toolsData.videos.forEach((video) => {
            const videoId = getYouTubeID(video.url);
            const embedUrl = videoId
              ? `https://www.youtube.com/embed/${videoId}`
              : '#';
            const videoCard = document.createElement('div');
            videoCard.className =
              'bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden';
            videoCard.innerHTML = `
                         <div class="relative pt-[56.25%] ${
                           !videoId
                             ? 'bg-gray-200 flex items-center justify-center'
                             : ''
                         }">
                             ${
                               videoId
                                 ? `<iframe class="absolute top-0 left-0 w-full h-full" src="${embedUrl}" frameborder="0" title="${video.title}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`
                                 : `<p class="text-gray-500 text-sm p-4">${
                                     video.url === '#'
                                       ? 'אין קישור וידאו'
                                       : 'קישור וידאו לא תקין'
                                   }</p>`
                             }
                         </div>
                         <div class="p-4">
                             <h3 class="text-lg font-semibold mb-2">${
                               video.title
                             }</h3>
                             <p class="text-gray-600 text-sm mb-3 min-h-[40px]">${
                               video.description
                             }</p>
                             <p class="text-gray-500 text-xs">${formatDate(
                               video.date
                             )}</p>
                         </div>`;
            videosContainer.appendChild(videoCard);
          });
        }
      }

      // --- Helper Functions (Filtering, Stats, Stars, Category, Date - Unchanged) ---
      function filterTools() {
        if (!toolsData || !Array.isArray(toolsData.tools)) return [];

        let filtered = toolsData.tools;

        if (filteredStatView === 'topRated') {
          filtered = filtered.filter((tool) => tool.rating === 5);
        } else if (filteredStatView === 'newTools') {
          filtered = filtered.filter((tool) => tool.isNew);
        }

        return filtered.filter((tool) => {
          const searchTermLower = currentSearchTerm.toLowerCase();
          const nameMatch = tool.name.toLowerCase().includes(searchTermLower);
          const descMatch = tool.description
            .toLowerCase()
            .includes(searchTermLower);
          const categoryNameMatch = getCategoryName(tool.category)
            .toLowerCase()
            .includes(searchTermLower);
          const matchesSearch = nameMatch || descMatch || categoryNameMatch;

          let matchesCategoryFilter = true;
          if (currentCategory === 'free') {
            matchesCategoryFilter = tool.free === true;
          } else {
            matchesCategoryFilter =
              currentCategory === 'all' || tool.category === currentCategory;
          }

          return matchesCategoryFilter && matchesSearch;
        });
      }

      function updateStats() {
        /* ... (unchanged) ... */
        const toolsCount =
          toolsData && Array.isArray(toolsData.tools)
            ? toolsData.tools.length
            : 0;
        totalToolsElement.textContent = toolsCount;
        const topRatedCount =
          toolsCount > 0
            ? toolsData.tools.filter((tool) => tool.rating >= 5).length
            : 0;
        topRatedElement.textContent = topRatedCount;
        const newToolsCount =
          toolsCount > 0
            ? toolsData.tools.filter((tool) => tool.isNew).length
            : 0;
        newToolsElement.textContent = newToolsCount;
        const categories =
          toolsCount > 0
            ? new Set(toolsData.tools.map((tool) => tool.category))
            : new Set();
        totalCategoriesElement.textContent = categories.size;
      }

      function renderRatingStars(rating) {
        /* ... (unchanged) ... */
        let stars = '';
        const filledStars = Math.max(0, Math.min(5, Math.round(rating)));
        for (let i = 1; i <= 5; i++) {
          stars += `<i class="${
            i <= filledStars
              ? 'fas fa-star text-yellow-400'
              : 'far fa-star text-gray-300'
          } ml-1"></i>`;
        }
        return stars;
      }
      function getCategoryName(category) {
        /* ... (unchanged) ... */
        const categories = {
          'ai-agents': 'סוכן AI',
          productivity: 'פרודוקטיביות',
          writing: 'כתיבה',
          design: 'עיצוב',
          coding: 'תכנות',
          video: 'וידאו',
          image: 'תמונה',
          education: 'חינוך',
          data: 'נתונים',
          search: 'חיפוש',
          builder: 'בנייה',
          'customer-support': 'תמיכה',
          automation: 'אוטומציה',
          hosting: 'אחסון',
          agents: 'סוכנים',
          directory: 'אינדקס',
          utility: 'כלי עזר',
          platform: 'פלטפורמה',
          media: 'מדיה',
          presentation: 'מצגות',
          audio: 'שמע',
          infrastructure: 'תשתיות',
          nlp: 'עיבוד שפה',
          accessibility: 'נגישות',
          general: 'כללי',
        };
        return categories[category] || category || 'כללי';
      }
      function getCategoryColor(category) {
        /* ... (unchanged) ... */
        const colors = {
          productivity: 'bg-blue-600',
          writing: 'bg-purple-600',
          design: 'bg-pink-600',
          coding: 'bg-green-600',
          video: 'bg-red-600',
          image: 'bg-yellow-600',
          education: 'bg-indigo-600',
          data: 'bg-cyan-600',
          search: 'bg-teal-600',
          builder: 'bg-orange-600',
          'customer-support': 'bg-lime-600',
          automation: 'bg-sky-600',
          hosting: 'bg-amber-600',
          agents: 'bg-violet-600',
          directory: 'bg-fuchsia-600',
          utility: 'bg-rose-600',
          platform: 'bg-emerald-600',
          media: 'bg-stone-600',
          presentation: 'bg-red-500',
          audio: 'bg-blue-500',
          infrastructure: 'bg-gray-700',
          nlp: 'bg-purple-500',
          accessibility: 'bg-green-500',
          general: 'bg-gray-600',
        };
        return colors[category] || 'bg-gray-600';
      }
      function getCategoryBadgeColor(category) {
        /* ... (unchanged) ... */
        const colors = {
          productivity: 'bg-blue-100 text-blue-800',
          writing: 'bg-purple-100 text-purple-800',
          design: 'bg-pink-100 text-pink-800',
          coding: 'bg-green-100 text-green-800',
          video: 'bg-red-100 text-red-800',
          image: 'bg-yellow-100 text-yellow-800',
          education: 'bg-indigo-100 text-indigo-800',
          data: 'bg-cyan-100 text-cyan-800',
          search: 'bg-teal-100 text-teal-800',
          builder: 'bg-orange-100 text-orange-800',
          'customer-support': 'bg-lime-100 text-lime-800',
          automation: 'bg-sky-100 text-sky-800',
          hosting: 'bg-amber-100 text-amber-800',
          agents: 'bg-violet-100 text-violet-800',
          directory: 'bg-fuchsia-100 text-fuchsia-800',
          utility: 'bg-rose-100 text-rose-800',
          platform: 'bg-emerald-100 text-emerald-800',
          media: 'bg-stone-100 text-stone-800',
          presentation: 'bg-red-100 text-red-800',
          audio: 'bg-blue-100 text-blue-800',
          infrastructure: 'bg-gray-200 text-gray-800',
          nlp: 'bg-purple-100 text-purple-800',
          accessibility: 'bg-green-100 text-green-800',
          general: 'bg-gray-100 text-gray-800',
        };
        return colors[category] || 'bg-gray-100 text-gray-800';
      }
      function getYouTubeID(url) {
        /* ... (unchanged) ... */
        if (!url || url === '#') return '';
        const match = url.match(
          /(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/))([^?&\/\s]+)/
        );
        return match ? match[1] : '';
      }
      function formatDate(dateString) {
        /* ... (unchanged, includes fallback parsing) ... */
        if (!dateString) return 'תאריך לא זמין';
        try {
          const date = new Date(dateString);
          if (isNaN(date.getTime())) {
            console.warn('Could not parse date directly:', dateString);
            const parts = dateString.match(
              /(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/
            );
            if (parts) {
              const isoDate = new Date(
                `${parts[3]}-${parts[2].padStart(2, '0')}-${parts[1].padStart(
                  2,
                  '0'
                )}T00:00:00Z`
              );
              if (!isNaN(isoDate.getTime()))
                return isoDate.toLocaleDateString('he-IL', {
                  year: 'numeric',
                  month: 'long',
                  day: 'numeric',
                });
            }
            return 'תאריך לא תקין';
          }
          return date.toLocaleDateString('he-IL', {
            year: 'numeric',
            month: 'long',
            day: 'numeric',
          });
        } catch (e) {
          console.error('Error formatting date:', dateString, e);
          return 'תאריך לא תקין';
        }
      }

      // --- Event Listeners Setup ---
      function setupEventListeners() {
        // Search input
        searchInput.addEventListener('input', (e) => {
          currentSearchTerm = e.target.value;
          localStorage.setItem('searchTerm', currentSearchTerm); // שמור בזיכרון הדפדפן
          renderTools();
        });

        // Filter buttons
        filterButtons.forEach((button) => {
          button.addEventListener('click', () => {
            filterButtons.forEach((btn) => btn.classList.remove('active'));
            button.classList.add('active');
            currentCategory = button.dataset.category;
            renderTools();
          });
        });

        // Mobile menu toggle
        mobileMenuButton.addEventListener('click', () => {
          mobileMenu.classList.toggle('open');
        });

        // Uncomment if using admin buttons
        const editJsonBtn = document.getElementById('editJsonBtn');
        const editJsonBtnMobile = document.getElementById('editJsonBtnMobile');
        document
          .getElementById('editJsonBtnFooter')
          ?.addEventListener('click', openEditorHandler);

        if (editJsonBtn)
          editJsonBtn.addEventListener('click', openEditorHandler);
        if (editJsonBtnMobile)
          editJsonBtnMobile.addEventListener('click', openEditorHandler);

        closeModalBtn.addEventListener('click', () =>
          jsonEditorModal.classList.add('hidden')
        );
        cancelEditBtn.addEventListener('click', () =>
          jsonEditorModal.classList.add('hidden')
        );

        // JSON Editor Save Button -> Saves ONLY to localStorage for the current session
        saveJsonBtn.addEventListener('click', () => {
          try {
            const rawData = JSON.parse(jsonEditor.value);
            if (!Array.isArray(rawData))
              throw new Error('Data must be an array.');
            if (showToolsBtn.classList.contains('bg-blue-600')) {
              // Update in-memory data and sort
              toolsData.tools = rawData.map((tool) => ({
                /* add defaults */ ...tool,
                rating: tool.rating ?? 0,
                isNew: tool.isNew ?? false,
                category: tool.category ?? 'general',
                icon: tool.icon || 'fas fa-tools',
                url: tool.url || '#',
                description: tool.description || 'אין תיאור זמין.',
                name: tool.name || 'שם לא ידוע',
              }));
              sortTools(currentSort);
            } else {
              toolsData.videos = rawData.map((video) => ({
                /* add defaults */ ...video,
                url: video.url || '#',
                title: video.title || 'כותרת חסרה',
                description: video.description || 'אין תיאור זמין.',
                date: video.date ?? new Date().toISOString(),
              }));
            }
            // Save the edited data to localStorage (will be lost on next full load)
            saveData();
            // Re-render the UI with the edited data for the current session
            renderTools();
            renderVideos();
            updateStats();
            jsonEditorModal.classList.add('hidden');
            alert(
              'הנתונים נשמרו זמנית (באחסון המקומי). הם יתעדכנו מחדש מהשרת בטעינה הבאה של הדף.'
            );
          } catch (e) {
            alert('JSON לא תקין או שגיאה בשמירה:\n' + e.message);
            console.error('JSON Save Error:', e);
          }
        });

        showToolsBtn.addEventListener('click', () => {
          /* ... (unchanged editor tab logic) ... */
          showToolsBtn.classList.add('bg-blue-600', 'text-white');
          showToolsBtn.classList.remove('bg-gray-200', 'text-gray-700');
          showVideosBtn.classList.add('bg-gray-200', 'text-gray-700');
          showVideosBtn.classList.remove('bg-blue-600', 'text-white');
          jsonEditor.value = JSON.stringify(toolsData.tools, null, 2); // Show current in-memory tools data
        });
        showVideosBtn.addEventListener('click', () => {
          /* ... (unchanged editor tab logic) ... */
          showVideosBtn.classList.add('bg-blue-600', 'text-white');
          showVideosBtn.classList.remove('bg-gray-200', 'text-gray-700');
          showToolsBtn.classList.add('bg-gray-200', 'text-gray-700');
          showToolsBtn.classList.remove('bg-blue-600', 'text-white');
          jsonEditor.value = JSON.stringify(toolsData.videos, null, 2); // Show current in-memory videos data
        });

        // Sorting stat boxes (Unchanged)
        if (topRatedStatBox) {
          topRatedStatBox.addEventListener('click', () => {
            sortTools('rating');
            renderTools();
            scrollToTools(); // גלילה חלקה לתחילת רשימת הכלים
          });
        }

        if (newToolsStatBox) {
          newToolsStatBox.addEventListener('click', () => {
            sortTools('newest');
            renderTools();
            scrollToTools(); // גלילה חלקה לתחילת רשימת הכלים
          });
        }

        // Refresh buttons - Now primarily resets filters/sort/search and re-renders current data
        // It *could* re-fetch, but init() already does that on load.
        // Let's make it just reset the view state.
        const resetViewHandler = () => {
          console.log('Resetting view state (filters, sort, search)...');
          // Reset filters and search
          searchInput.value = '';
          currentSearchTerm = '';
          filterButtons.forEach((btn) => btn.classList.remove('active'));
          const allFilterBtn = document.querySelector(
            '.filter-btn[data-category="all"]'
          );
          if (allFilterBtn) allFilterBtn.classList.add('active');
          currentCategory = 'all';

          // Reset sort to newest and re-render
          sortTools('newest');
          renderTools();
          // No need to re-render videos unless their source changes, which this button doesn't do
          // No need to update stats as the underlying data hasn't changed
          alert('התצוגה אופסה (פילטרים, מיון וחיפוש נוקו).');
        };

        refreshBtn.addEventListener('click', resetViewHandler);
        refreshBtnMobile.addEventListener('click', resetViewHandler);
      }

      // --- Initialize the app ---
      document.addEventListener('DOMContentLoaded', init);

      // JSON Editor Modal Logic (If admin buttons are enabled)
      const openEditorHandler = () => {
        document.getElementById('suggestToolModal').classList.remove('hidden');
      };

      const closeSuggestModal = () => {
        document.getElementById('suggestToolModal').classList.add('hidden');
      };

      document
        .getElementById('suggestToolForm')
        .addEventListener('submit', async (e) => {
          e.preventDefault();
          const form = e.target;
          const rawPhone = form.userPhone.value;
          const cleanedPhone = rawPhone.replace(/\D/g, ''); // מסיר כל תו שאינו ספרה
          // alert(cleanedPhone)
          const data = {
            name: form.name.value,
            url: form.url.value,
            description: form.description.value,
            userName: form.userName.value,
            userPhone: cleanedPhone,
          };

          try {
            await fetch(
              'https://hook.eu2.make.com/lgo6nh36dk804dq1msfmwxo34nzf4o3y',
              {
                method: 'POST',
                headers: {
                  'Content-Type': 'application/json',
                },
                body: JSON.stringify(data),
              }
            );

            alert('הכלי נשלח בהצלחה!');
            closeSuggestModal();
            form.reset();
          } catch (err) {
            alert('שגיאה בשליחה 😢');
            console.error(err);
          }
        });
      function openVideoModal(url) {
        const modal = document.getElementById('videoModal');
        const iframe = document.getElementById('videoIframe');
        iframe.src = url;
        modal.classList.remove('hidden');
      }

      function closeVideoModal() {
        const modal = document.getElementById('videoModal');
        const iframe = document.getElementById('videoIframe');
        iframe.src = '';
        modal.classList.add('hidden');
      }
      fetch('tools.json')
        .then((res) => res.json())
        .then((tools) => {
          const count = tools.length;
          document.getElementById(
            'toolsCount'
          ).textContent = `${count} כלים זמינים`;
        })
        .catch((err) => {
          console.error('שגיאה בטעינת כמות הכלים:', err);
          document.getElementById('toolsCount').textContent = 'טעינה נכשלה';
        });
      function showNewToolBanner() {
        const tools = toolsData.tools;
        const lastSeenToolDate = localStorage.getItem('lastSeenToolDate');
        const newTools = tools.filter((tool) => tool.isNew);
        if (newTools.length === 0) return;

        const latestTool = newTools.reduce((latest, tool) => {
          return new Date(tool.dateAdded) > new Date(latest.dateAdded)
            ? tool
            : latest;
        }, newTools[0]);

        if (
          !lastSeenToolDate ||
          new Date(latestTool.dateAdded) > new Date(lastSeenToolDate)
        ) {
          const banner = document.getElementById('newToolBanner');
          const toolNameSpan = document.getElementById('newToolName');
          const closeBtn = document.getElementById('closeBanner');

          toolNameSpan.textContent = latestTool.name;
          banner.classList.remove('hidden');
          const viewNowLink = banner.querySelector('a');
          viewNowLink.addEventListener('click', (e) => {
            e.preventDefault();
            filteredStatView = 'newTools';
            currentCategory = 'all';
            currentSearchTerm = '';
            renderTools();
            scrollToTools();
          });

          closeBtn.addEventListener('click', () => {
            banner.classList.add('hidden');
            localStorage.setItem('lastSeenToolDate', latestTool.dateAdded);
          });
        }
      }

      if ('serviceWorker' in navigator) {
        navigator.serviceWorker
          .register('/service-worker.js')
          .then(() => console.log('Service Worker registered successfully.'))
          .catch((err) =>
            console.error('Service Worker registration failed:', err)
          );
      }

      let deferredPrompt;
      const installBtn = document.getElementById('installAppBtn');
      const container = document.getElementById('installAppContainer');

      window.addEventListener('beforeinstallprompt', (e) => {
        e.preventDefault();
        deferredPrompt = e;
        installBtn.style.display = 'inline-block';

        installBtn.addEventListener('click', () => {
          deferredPrompt.prompt();
          deferredPrompt.userChoice.then((choiceResult) => {
            if (choiceResult.outcome === 'accepted') {
              console.log('User accepted the A2HS prompt');
              installBtn.style.display = 'none';
            } else {
              console.log('User dismissed the A2HS prompt');
            }
            deferredPrompt = null;
          });
        });
      });
      // פונקציה להצגת כפתורי שיתוף
      function renderShareButtons(tool) {
        const encodedToolName = encodeURIComponent(tool.name);
        const encodedDesc = encodeURIComponent(
          `בדקו את הכלי ${tool.name} - ${tool.description}`
        );
        const encodedUrl = encodeURIComponent(tool.url);

        // וודא שיש URL תקין לשיתוף
        if (!tool.url || tool.url === '#') {
          return ''; // לא מציג כפתורי שיתוף אם אין URL תקין
        }

        return `
    <div class="flex justify-end mt-3 gap-2">
        <button class="share-btn text-blue-800 hover:bg-blue-50 p-1.5 rounded-full transition" 
                data-platform="facebook" 
                data-url="${tool.url}" 
                data-title="${tool.name}"
                title="שתף בפייסבוק"
                aria-label="שתף בפייסבוק">
            <i class="fab fa-facebook-f text-sm"></i>
        </button>
        <button class="share-btn text-green-700 hover:bg-green-50 p-1.5 rounded-full transition" 
                data-platform="whatsapp" 
                data-url="${tool.url}" 
                data-title="${tool.name}"
                title="שתף בוואטסאפ"
                aria-label="שתף בוואטסאפ">
            <i class="fab fa-whatsapp text-sm"></i>
        </button>
        <button class="share-btn text-blue-500 hover:bg-blue-50 p-1.5 rounded-full transition" 
                data-platform="twitter" 
                data-url="${tool.url}" 
                data-title="${tool.name}"
                title="שתף בטוויטר"
                aria-label="שתף בטוויטר">
            <i class="fab fa-twitter text-sm"></i>
        </button>
        <button class="share-btn text-gray-700 hover:bg-gray-50 p-1.5 rounded-full transition" 
                data-platform="copy" 
                data-url="${tool.url}"
                title="העתק קישור" 
                aria-label="העתק קישור">
            <i class="fas fa-link text-sm"></i>
        </button>
    </div>
    `;
      }
      // פונקציה לטיפול בלחיצה על כפתור המועדפים
      function setupFavorites() {
        // טעינת המועדפים מה-localStorage
        let favorites = JSON.parse(
          localStorage.getItem('aiToolsFavorites') || '[]'
        );

        // הוספת אירוע לחיצה לכפתורי המועדפים
        document.querySelectorAll('.favorite-btn').forEach((btn) => {
          const toolId = btn.dataset.id;

          // עדכון המראה הראשוני בהתאם למצב
          if (favorites.includes(toolId)) {
            btn.classList.add('active');
            btn.querySelector('i').classList.remove('far');
            btn.querySelector('i').classList.add('fas');
          }

          btn.addEventListener('click', (e) => {
            e.preventDefault();
            e.stopPropagation();

            const isFavorite = favorites.includes(toolId);

            if (isFavorite) {
              // הסרה מהמועדפים
              favorites = favorites.filter((id) => id !== toolId);
              btn.classList.remove('active');
              btn.querySelector('i').classList.remove('fas');
              btn.querySelector('i').classList.add('far');
            } else {
              // הוספה למועדפים
              favorites.push(toolId);
              btn.classList.add('active');
              btn.querySelector('i').classList.remove('far');
              btn.querySelector('i').classList.add('fas');
            }

            // שמירת המועדפים המעודכנים
            localStorage.setItem('aiToolsFavorites', JSON.stringify(favorites));
          });
        });
      }
      // עדכון של פונקציית filterTools הקיימת להוספת תמיכה במועדפים
      function filterTools() {
        if (!toolsData || !Array.isArray(toolsData.tools)) return [];

        // טעינת המועדפים מה-localStorage
        const favorites = JSON.parse(
          localStorage.getItem('aiToolsFavorites') || '[]'
        );

        let filtered = toolsData.tools;

        // סינון לפי מועדפים (אם מסומן)
        if (currentCategory === 'favorites') {
          filtered = filtered.filter((_, index) =>
            favorites.includes(index.toString())
          );
        }
        // סינון לפי קטגוריה (כפי שהיה קודם)
        else if (currentCategory === 'free') {
          filtered = filtered.filter((tool) => tool.free === true);
        } else if (currentCategory !== 'all') {
          filtered = filtered.filter(
            (tool) => tool.category === currentCategory
          );
        }

        // סינון לפי חיפוש (נשאר כפי שהיה)
        if (currentSearchTerm) {
          const searchLower = currentSearchTerm.toLowerCase();
          filtered = filtered.filter((tool) => {
            const nameMatch =
              tool.name && tool.name.toLowerCase().includes(searchLower);
            const descMatch =
              tool.description &&
              tool.description.toLowerCase().includes(searchLower);
            const categoryNameMatch = getCategoryName(tool.category)
              .toLowerCase()
              .includes(searchLower);
            return nameMatch || descMatch || categoryNameMatch;
          });
        }

        // בדיקה אם יש סינון לפי סטטוס נתונים (filteredStatView)
        if (filteredStatView === 'topRated') {
          filtered = filtered.filter((tool) => tool.rating >= 5);
        } else if (filteredStatView === 'newTools') {
          filtered = filtered.filter((tool) => tool.isNew);
        }

        return filtered;
      }

      // פונקציה לטיפול בכפתורי שיתוף
      function setupShareButtons() {
        document.querySelectorAll('.share-btn').forEach((btn) => {
          btn.addEventListener('click', (e) => {
            e.preventDefault();
            e.stopPropagation();

            const platform = btn.dataset.platform;
            const url = btn.dataset.url;
            const title = btn.dataset.title;
            const text = `בדקו את הכלי ${title} מארגז הכלים של שגיא בר און`;

            let shareUrl;

            switch (platform) {
              case 'facebook':
                shareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(
                  url
                )}&quote=${encodeURIComponent(text)}`;
                window.open(shareUrl, '_blank', 'width=600,height=400');
                break;
              case 'twitter':
                shareUrl = `https://twitter.com/intent/tweet?url=${encodeURIComponent(
                  url
                )}&text=${encodeURIComponent(text)}`;
                window.open(shareUrl, '_blank', 'width=600,height=400');
                break;
              case 'whatsapp':
                shareUrl = `https://api.whatsapp.com/send?text=${encodeURIComponent(
                  text + ' ' + url
                )}`;
                window.open(shareUrl, '_blank');
                break;
              case 'copy':
                navigator.clipboard.writeText(url).then(() => {
                  // הודעה זמנית על העתקה מוצלחת
                  const toast = document.createElement('div');
                  toast.className =
                    'fixed top-4 left-1/2 transform -translate-x-1/2 bg-green-500 text-white px-4 py-2 rounded shadow-lg z-50';
                  toast.textContent = 'הקישור הועתק בהצלחה!';
                  document.body.appendChild(toast);

                  setTimeout(() => {
                    toast.remove();
                  }, 2000);
                });
                break;
            }
          });
        });
      }

      // פונקציה להוספת כפתור המועדפים לאזור הקטגוריות
      function updateCategoryFilters() {
        const categoryFilterDiv = document.querySelector('.category-filter');

        // בודק אם כפתור המועדפים כבר קיים
        if (!document.querySelector('[data-category="favorites"]')) {
          const favoritesBtn = document.createElement('button');
          favoritesBtn.className =
            'filter-btn px-3 py-1 rounded-full border border-gray-300 text-sm hover:bg-gray-100 transition';
          favoritesBtn.dataset.category = 'favorites';
          favoritesBtn.innerHTML =
            '<i class="fas fa-star text-yellow-400 ml-1"></i> מועדפים';

          // הוספת הכפתור לאחר כפתור "הכל"
          const allBtn = document.querySelector('[data-category="all"]');
          if (allBtn && allBtn.parentNode) {
            allBtn.parentNode.insertBefore(favoritesBtn, allBtn.nextSibling);

            // הוספת אירוע לחיצה
            favoritesBtn.addEventListener('click', () => {
              document
                .querySelectorAll('.filter-btn')
                .forEach((btn) => btn.classList.remove('active'));
              favoritesBtn.classList.add('active');
              currentCategory = 'favorites';
              renderTools();
            });
          }
        }
      }
    </script>

    <!-- /* --------------------------------- */
    /* ------- END OF JAVASCRIPT ------- */
    /* --------------------------------- */ -->
  </body>
</html>