File size: 52,827 Bytes
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
 
 
 
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
31305b9
a77d4e7
 
 
 
 
 
 
 
31305b9
 
 
 
 
 
 
 
 
 
 
a77d4e7
 
 
 
 
 
 
 
 
 
 
31305b9
 
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
31305b9
 
a77d4e7
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
a77d4e7
 
31305b9
a77d4e7
 
 
 
 
 
 
 
31305b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
 
 
091cf0a
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
31305b9
091cf0a
 
 
31305b9
091cf0a
 
 
31305b9
091cf0a
31305b9
091cf0a
 
 
 
 
31305b9
091cf0a
31305b9
091cf0a
 
31305b9
091cf0a
 
 
 
31305b9
091cf0a
 
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
a77d4e7
091cf0a
 
 
 
 
a77d4e7
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
a77d4e7
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
a77d4e7
091cf0a
a77d4e7
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31305b9
091cf0a
 
 
 
31305b9
091cf0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a77d4e7
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AItoolslab - Discover Powerful AI Tools</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .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-chip:hover {
            background-color: #6e8efb;
            color: white;
        }
        .tool-modal {
            transition: all 0.3s ease;
        }
        .backdrop {
            background-color: rgba(0, 0, 0, 0.5);
        }
        .button-press {
            transform: scale(0.95);
            transition: transform 0.1s ease;
        }
        /* AI Agent Styles */
        .ai-agent-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1000;
            transition: all 0.3s ease;
        }
        .ai-agent-chat {
            width: 350px;
            height: 500px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            display: none;
            flex-direction: column;
        }
        .ai-agent-header {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
            color: white;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .ai-agent-messages {
            flex-grow: 1;
            padding: 16px;
            overflow-y: auto;
            background: #f9fafb;
        }
        .ai-agent-input-container {
            padding: 12px;
            border-top: 1px solid #e5e7eb;
            background: white;
        }
        .ai-agent-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            outline: none;
            transition: border-color 0.2s;
        }
        .ai-agent-input:focus {
            border-color: #a777e3;
        }
        .ai-agent-toggle {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }
        .message {
            margin-bottom: 12px;
            max-width: 80%;
            padding: 10px 14px;
            border-radius: 12px;
            line-height: 1.4;
            font-size: 14px;
        }
        .user-message {
            background: #6e8efb;
            color: white;
            margin-left: auto;
            border-bottom-right-radius: 4px;
        }
        .agent-message {
            background: #e5e7eb;
            color: #1f2937;
            margin-right: auto;
            border-bottom-left-radius: 4px;
        }
        .typing-indicator {
            display: flex;
            padding: 10px 14px;
        }
        .typing-dot {
            width: 8px;
            height: 8px;
            background-color: #9ca3af;
            border-radius: 50%;
            margin-right: 4px;
            animation: typingAnimation 1.4s infinite ease-in-out;
        }
        .typing-dot:nth-child(1) {
            animation-delay: 0s;
        }
        .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }
        .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }
        @keyframes typingAnimation {
            0%, 60%, 100% {
                transform: translateY(0);
            }
            30% {
                transform: translateY(-5px);
            }
        }
        .quick-reply {
            display: inline-block;
            background: #f3f4f6;
            color: #4b5563;
            padding: 6px 12px;
            border-radius: 20px;
            margin: 4px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .quick-reply:hover {
            background: #e5e7eb;
        }
        .tool-suggestion {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 10px;
            margin-top: 8px;
            background: white;
            cursor: pointer;
            transition: all 0.2s;
        }
        .tool-suggestion:hover {
            background: #f9fafb;
            border-color: #a777e3;
        }
    </style>
</head>
<body class="font-sans antialiased text-gray-800">
    <!-- Navigation -->
    <nav class="bg-white shadow-sm sticky top-0 z-50">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex items-center">
                    <div class="flex-shrink-0 flex items-center">
                        <i class="fas fa-robot text-2xl text-purple-600 mr-2"></i>
                        <span class="text-xl font-bold text-gray-900">AItoolslab</span>
                    </div>
                    <div class="hidden sm:ml-6 sm:flex sm:space-x-8">
                        <a href="#" class="border-purple-500 text-gray-900 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Home</a>
                        <a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Categories</a>
                        <a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">New Tools</a>
                        <a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">About</a>
                    </div>
                </div>
                <div class="hidden sm:ml-6 sm:flex sm:items-center">
                    <button id="submitToolBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-md text-sm font-medium transition duration-300">Submit Tool</button>
                </div>
                <div class="-mr-2 flex items-center sm:hidden">
                    <button id="mobileMenuBtn" type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-purple-500" aria-controls="mobile-menu" aria-expanded="false">
                        <span class="sr-only">Open main menu</span>
                        <i class="fas fa-bars"></i>
                    </button>
                </div>
            </div>
        </div>
    </nav>

    <!-- Mobile Menu (hidden by default) -->
    <div id="mobileMenu" class="hidden sm:hidden bg-white shadow-lg">
        <div class="px-2 pt-2 pb-3 space-y-1">
            <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-900 hover:bg-gray-100">Home</a>
            <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-900">Categories</a>
            <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-900">New Tools</a>
            <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-900">About</a>
            <button id="mobileSubmitBtn" class="block w-full text-left px-3 py-2 rounded-md text-base font-medium text-purple-600 hover:bg-purple-50">Submit Tool</button>
        </div>
    </div>

    <!-- Hero Section -->
    <div class="gradient-bg text-white">
        <div class="max-w-7xl mx-auto py-16 px-4 sm:py-24 sm:px-6 lg:px-8 text-center">
            <h1 class="text-4xl font-extrabold tracking-tight sm:text-5xl lg:text-6xl">
                Discover the Best AI Tools
            </h1>
            <p class="mt-6 max-w-lg mx-auto text-xl">
                Curated collection of powerful AI-powered tools to boost your productivity and creativity.
            </p>
            <div class="mt-10 flex justify-center">
                <div class="relative w-full max-w-md">
                    <input id="searchInput" type="text" class="block w-full rounded-md border-transparent py-3 px-5 pr-12 text-gray-900 focus:ring-2 focus:ring-purple-600 focus:border-transparent" placeholder="Search for AI tools...">
                    <button id="searchBtn" class="absolute inset-y-0 right-0 flex items-center pr-3">
                        <i class="fas fa-search text-gray-400"></i>
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- Featured Tools -->
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="flex justify-between items-center mb-8">
            <h2 class="text-2xl font-bold">Featured AI Tools</h2>
            <a href="#" class="text-purple-600 hover:text-purple-800 font-medium">View all</a>
        </div>
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
            <!-- Tool Card 1 -->
            <div class="bg-white rounded-lg shadow-md overflow-hidden tool-card transition duration-300 ease-in-out">
                <div class="p-5">
                    <div class="flex items-center mb-4">
                        <div class="bg-purple-100 p-3 rounded-lg">
                            <i class="fas fa-pen-fancy text-purple-600 text-xl"></i>
                        </div>
                        <div class="ml-4">
                            <h3 class="font-bold text-lg">CopyGenius</h3>
                            <p class="text-gray-500 text-sm">AI Writing Assistant</p>
                        </div>
                    </div>
                    <p class="text-gray-600 mb-4">Generate high-quality marketing copy, blog posts, and product descriptions in seconds.</p>
                    <div class="flex flex-wrap gap-2 mb-4">
                        <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Content Creation</span>
                        <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Marketing</span>
                    </div>
                    <button data-tool="copygenius" class="learn-more-btn w-full bg-purple-600 hover:bg-purple-700 text-white py-2 rounded-md font-medium transition duration-300">
                        Learn More
                    </button>
                </div>
            </div>
            
            <!-- Tool Card 2 -->
            <div class="bg-white rounded-lg shadow-md overflow-hidden tool-card transition duration-300 ease-in-out">
                <div class="p-5">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-lg">
                            <i class="fas fa-image text-blue-600 text-xl"></i>
                        </div>
                        <div class="ml-4">
                            <h3 class="font-bold text-lg">ArtisanAI</h3>
                            <p class="text-gray-500 text-sm">Image Generator</p>
                        </div>
                    </div>
                    <p class="text-gray-600 mb-4">Create stunning artwork, logos, and designs with simple text prompts.</p>
                    <div class="flex flex-wrap gap-2 mb-4">
                        <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Design</span>
                        <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Art</span>
                    </div>
                    <button data-tool="artisanai" class="learn-more-btn w-full bg-blue-600 hover:bg-blue-700 text-white py-2 rounded-md font-medium transition duration-300">
                        Learn More
                    </button>
                </div>
            </div>
            
            <!-- Tool Card 3 -->
            <div class="bg-white rounded-lg shadow-md overflow-hidden tool-card transition duration-300 ease-in-out">
                <div class="p-5">
                    <div class="flex items-center mb-4">
                        <div class="bg-green-100 p-3 rounded-lg">
                            <i class="fas fa-chart-line text-green-600 text-xl"></i>
                        </div>
                        <div class="ml-4">
                            <h3 class="font-bold text-lg">DataMind</h3>
                            <p class="text-gray-500 text-sm">Analytics Platform</p>
                        </div>
                    </div>
                    <p class="text-gray-600 mb-4">Transform raw data into actionable insights with AI-powered analytics.</p>
                    <div class="flex flex-wrap gap-2 mb-4">
                        <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Data Science</span>
                        <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Business</span>
                    </div>
                    <button data-tool="datamind" class="learn-more-btn w-full bg-green-600 hover:bg-green-700 text-white py-2 rounded-md font-medium transition duration-300">
                        Learn More
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- Categories Section -->
    <div class="bg-gray-50 py-12">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-2xl font-bold text-center mb-12">Browse by Category</h2>
            <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4">
                <a href="#" class="category-chip bg-white rounded-lg shadow-sm p-6 text-center hover:shadow-md transition duration-300">
                    <div class="bg-purple-100 w-12 h-12 mx-auto rounded-full flex items-center justify-center mb-3">
                        <i class="fas fa-pen-fancy text-purple-600 text-xl"></i>
                    </div>
                    <h3 class="font-medium">Writing</h3>
                    <p class="text-gray-500 text-sm mt-1">42 tools</p>
                </a>
                <a href="#" class="category-chip bg-white rounded-lg shadow-sm p-6 text-center hover:shadow-md transition duration-300">
                    <div class="bg-blue-100 w-12 h-12 mx-auto rounded-full flex items-center justify-center mb-3">
                        <i class="fas fa-image text-blue-600 text-xl"></i>
                    </div>
                    <h3 class="font-medium">Design</h3>
                    <p class="text-gray-500 text-sm mt-1">36 tools</p>
                </a>
                <a href="#" class="category-chip bg-white rounded-lg shadow-sm p-6 text-center hover:shadow-md transition duration-300">
                    <div class="bg-green-100 w-12 h-12 mx-auto rounded-full flex items-center justify-center mb-3">
                        <i class="fas fa-chart-line text-green-600 text-xl"></i>
                    </div>
                    <h3 class="font-medium">Analytics</h3>
                    <p class="text-gray-500 text-sm mt-1">28 tools</p>
                </a>
                <a href="#" class="category-chip bg-white rounded-lg shadow-sm p-6 text-center hover:shadow-md transition duration-300">
                    <div class="bg-red-100 w-12 h-12 mx-auto rounded-full flex items-center justify-center mb-3">
                        <i class="fas fa-code text-red-600 text-xl"></i>
                    </div>
                    <h3 class="font-medium">Development</h3>
                    <p class="text-gray-500 text-sm mt-1">31 tools</p>
                </a>
                <a href="#" class="category-chip bg-white rounded-lg shadow-sm p-6 text-center hover:shadow-md transition duration-300">
                    <div class="bg-yellow-100 w-12 h-12 mx-auto rounded-full flex items-center justify-center mb-3">
                        <i class="fas fa-video text-yellow-600 text-xl"></i>
                    </div>
                    <h3 class="font-medium">Video</h3>
                    <p class="text-gray-500 text-sm mt-1">19 tools</p>
                </a>
                <a href="#" class="category-chip bg-white rounded-lg shadow-sm p-6 text-center hover:shadow-md transition duration-300">
                    <div class="bg-indigo-100 w-12 h-12 mx-auto rounded-full flex items-center justify-center mb-3">
                        <i class="fas fa-robot text-indigo-600 text-xl"></i>
                    </div>
                    <h3 class="font-medium">Chatbots</h3>
                    <p class="text-gray-500 text-sm mt-1">27 tools</p>
                </a>
            </div>
        </div>
    </div>

    <!-- New Tools Section -->
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="flex justify-between items-center mb-8">
            <h2 class="text-2xl font-bold">Recently Added Tools</h2>
            <a href="#" class="text-purple-600 hover:text-purple-800 font-medium">View all</a>
        </div>
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
            <!-- New Tool 1 -->
            <div class="bg-white rounded-lg shadow-sm p-5 hover:shadow-md transition duration-300">
                <div class="bg-pink-100 w-10 h-10 rounded-lg flex items-center justify-center mb-3">
                    <i class="fas fa-music text-pink-600"></i>
                </div>
                <h3 class="font-medium mb-1">MelodyAI</h3>
                <p class="text-gray-500 text-sm mb-3">AI Music Generator</p>
                <div class="flex justify-between items-center">
                    <span class="text-xs bg-gray-100 px-2 py-1 rounded">Free</span>
                    <button data-tool="melodyai" class="details-btn text-xs text-purple-600 hover:text-purple-800 font-medium">Details →</button>
                </div>
            </div>
            
            <!-- New Tool 2 -->
            <div class="bg-white rounded-lg shadow-sm p-5 hover:shadow-md transition duration-300">
                <div class="bg-orange-100 w-10 h-10 rounded-lg flex items-center justify-center mb-3">
                    <i class="fas fa-language text-orange-600"></i>
                </div>
                <h3 class="font-medium mb-1">LinguaPro</h3>
                <p class="text-gray-500 text-sm mb-3">AI Translator</p>
                <div class="flex justify-between items-center">
                    <span class="text-xs bg-gray-100 px-2 py-1 rounded">Freemium</span>
                    <button data-tool="linguapro" class="details-btn text-xs text-purple-600 hover:text-purple-800 font-medium">Details →</button>
                </div>
            </div>
            
            <!-- New Tool 3 -->
            <div class="bg-white rounded-lg shadow-sm p-5 hover:shadow-md transition duration-300">
                <div class="bg-teal-100 w-10 h-10 rounded-lg flex items-center justify-center mb-3">
                    <i class="fas fa-brain text-teal-600"></i>
                </div>
                <h3 class="font-medium mb-1">MindMap AI</h3>
                <p class="text-gray-500 text-sm mb-3">Idea Generator</p>
                <div class="flex justify-between items-center">
                    <span class="text-xs bg-gray-100 px-2 py-1 rounded">Free Trial</span>
                    <button data-tool="mindmapai" class="details-btn text-xs text-purple-600 hover:text-purple-800 font-medium">Details →</button>
                </div>
            </div>
            
            <!-- New Tool 4 -->
            <div class="bg-white rounded-lg shadow-sm p-5 hover:shadow-md transition duration-300">
                <div class="bg-cyan-100 w-10 h-10 rounded-lg flex items-center justify-center mb-3">
                    <i class="fas fa-file-alt text-cyan-600"></i>
                </div>
                <h3 class="font-medium mb-1">ResumeGenie</h3>
                <p class="text-gray-500 text-sm mb-3">AI Resume Builder</p>
                <div class="flex justify-between items-center">
                    <span class="text-xs bg-gray-100 px-2 py-1 rounded">Freemium</span>
                    <button data-tool="resumegenie" class="details-btn text-xs text-purple-600 hover:text-purple-800 font-medium">Details →</button>
                </div>
            </div>
        </div>
    </div>

    <!-- Newsletter Section -->
    <div class="gradient-bg text-white py-16">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
            <h2 class="text-2xl font-bold mb-4">Stay Updated with AI Trends</h2>
            <p class="max-w-2xl mx-auto mb-8">Subscribe to our newsletter and get weekly updates on new AI tools, industry trends, and exclusive offers.</p>
            <div class="max-w-md mx-auto flex">
                <input id="newsletterEmail" type="email" class="flex-grow px-4 py-3 rounded-l-md focus:outline-none text-gray-900" placeholder="Your email address">
                <button id="subscribeBtn" class="bg-purple-800 hover:bg-purple-900 px-6 py-3 rounded-r-md font-medium transition duration-300">Subscribe</button>
            </div>
            <p id="subscribeMessage" class="mt-2 text-sm"></p>
        </div>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white">
        <div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8">
            <div class="grid grid-cols-2 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-lg font-medium mb-4">AItoolslab</h3>
                    <p class="text-gray-400 text-sm">Discover and explore the most powerful AI tools for your needs.</p>
                </div>
                <div>
                    <h3 class="text-lg font-medium mb-4">Categories</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">Writing</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">Design</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">Development</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">Video</a></li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-lg font-medium mb-4">Company</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">About Us</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">Contact</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">Submit a Tool</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white text-sm">Privacy Policy</a></li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-lg font-medium mb-4">Connect</h3>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-linkedin"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-github"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-discord"></i></a>
                    </div>
                    <p class="text-gray-400 text-sm mt-4">© 2023 AItoolslab. All rights reserved.</p>
                </div>
            </div>
        </div>
    </footer>

    <!-- Tool Modal -->
    <div id="toolModal" class="fixed inset-0 z-50 hidden">
        <div class="backdrop absolute inset-0"></div>
        <div class="flex items-center justify-center min-h-screen">
            <div class="tool-modal bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 relative z-10">
                <div class="p-6">
                    <div class="flex justify-between items-start mb-6">
                        <div>
                            <h2 id="modalToolName" class="text-2xl font-bold">CopyGenius</h2>
                            <p id="modalToolCategory" class="text-gray-500">AI Writing Assistant</p>
                        </div>
                        <button id="closeModalBtn" class="text-gray-400 hover:text-gray-500">
                            <i class="fas fa-times"></i>
                        </button>
                    </div>
                    
                    <div class="flex items-center mb-6">
                        <div id="modalToolIcon" class="bg-purple-100 p-4 rounded-lg mr-4">
                            <i class="fas fa-pen-fancy text-purple-600 text-2xl"></i>
                        </div>
                        <div>
                            <div class="flex items-center mb-2">
                                <span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded mr-2">Freemium</span>
                                <div class="flex items-center text-yellow-400">
                                    <i class="fas fa-star"></i>
                                    <i class="fas fa-star"></i>
                                    <i class="fas fa-star"></i>
                                    <i class="fas fa-star"></i>
                                    <i class="fas fa-star-half-alt"></i>
                                    <span class="text-gray-600 text-sm ml-1">4.7 (128 reviews)</span>
                                </div>
                            </div>
                            <div class="flex flex-wrap gap-2">
                                <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Content Creation</span>
                                <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">Marketing</span>
                                <span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">SEO</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="mb-6">
                        <h3 class="font-medium mb-2">Description</h3>
                        <p id="modalToolDescription" class="text-gray-700">
                            CopyGenius is an advanced AI writing assistant that helps you create high-quality content in seconds. 
                            Whether you need marketing copy, blog posts, product descriptions, or social media content, 
                            CopyGenius can generate compelling text that resonates with your audience. 
                            It uses state-of-the-art language models to understand your requirements and produce human-like content.
                        </p>
                    </div>
                    
                    <div class="grid grid-cols-2 gap-4 mb-6">
                        <div>
                            <h3 class="font-medium mb-2">Pricing</h3>
                            <ul class="text-gray-700 space-y-1">
                                <li>• Free: 10,000 words/month</li>
                                <li>• Pro: $29/month - 100,000 words</li>
                                <li>• Business: $99/month - Unlimited</li>
                            </ul>
                        </div>
                        <div>
                            <h3 class="font-medium mb-2">Key Features</h3>
                            <ul class="text-gray-700 space-y-1">
                                <li>• 25+ content templates</li>
                                <li>• SEO optimization</li>
                                <li>• Tone adjustment</li>
                                <li>• Multi-language support</li>
                            </ul>
                        </div>
                    </div>
                    
                    <div class="flex justify-between items-center">
                        <a id="modalToolLink" href="#" target="_blank" class="visit-website-btn bg-purple-600 hover:bg-purple-700 text-white px-6 py-2 rounded-md font-medium transition duration-300">
                            Visit Website
                        </a>
                        <button id="saveToolBtn" class="text-gray-500 hover:text-gray-700">
                            <i class="far fa-bookmark mr-1"></i> Save
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Submit Tool Modal -->
    <div id="submitToolModal" class="fixed inset-0 z-50 hidden">
        <div class="backdrop absolute inset-0"></div>
        <div class="flex items-center justify-center min-h-screen">
            <div class="bg-white rounded-lg shadow-xl max-w-md w-full mx-4 relative z-10">
                <div class="p-6">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-xl font-bold">Submit Your AI Tool</h2>
                        <button id="closeSubmitModalBtn" class="text-gray-400 hover:text-gray-500">
                            <i class="fas fa-times"></i>
                        </button>
                    </div>
                    <form id="submitToolForm">
                        <div class="mb-4">
                            <label for="toolName" class="block text-sm font-medium text-gray-700 mb-1">Tool Name</label>
                            <input type="text" id="toolName" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500" required>
                        </div>
                        <div class="mb-4">
                            <label for="toolUrl" class="block text-sm font-medium text-gray-700 mb-1">Website URL</label>
                            <input type="url" id="toolUrl" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500" required>
                        </div>
        <div class="mb-4">
            <label for="toolCategory" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
            <select id="toolCategory" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500" required>
                <option value="">Select a category</option>
                <option value="writing">Writing</option>
                <option value="design">Design</option>
                <option value="analytics">Analytics</option>
                <option value="development">Development</option>
                <option value="video">Video</option>
                <option value="chatbots">Chatbots</option>
            </select>
        </div>
        <div class="mb-4">
            <label for="toolDescription" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
            <textarea id="toolDescription" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500" required></textarea>
        </div>
        <button type="submit" class="w-full bg-purple-600 hover:bg-purple-700 text-white py-2 rounded-md font-medium transition duration-300">
            Submit Tool
        </button>
    </form>
</div>
</div>
</div>
</div>

<!-- AI Agent Assistant -->
<div class="ai-agent-container">
    <div id="aiAgentChat" class="ai-agent-chat">
        <div class="ai-agent-header">
            <div class="flex items-center">
                <i class="fas fa-robot mr-2"></i>
                <span>AI Assistant</span>
            </div>
            <button id="closeChatBtn" class="text-white hover:text-gray-200">
                <i class="fas fa-times"></i>
            </button>
        </div>
        <div id="aiAgentMessages" class="ai-agent-messages">
            <div class="message agent-message">
                Hi there! I'm your AI assistant. How can I help you find the perfect AI tool today?
                <div class="mt-2">
                    <div class="quick-reply" onclick="sendQuickReply('Show me writing tools')">Writing tools</div>
                    <div class="quick-reply" onclick="sendQuickReply('Recommend design tools')">Design tools</div>
                    <div class="quick-reply" onclick="sendQuickReply('What\'s new?')">What's new?</div>
                </div>
            </div>
        </div>
        <div class="ai-agent-input-container">
            <div class="flex">
                <input id="aiAgentInput" type="text" class="ai-agent-input" placeholder="Ask me about AI tools...">
                <button id="sendMessageBtn" class="ml-2 bg-purple-600 text-white px-4 py-2 rounded-md">
                    <i class="fas fa-paper-plane"></i>
                </button>
            </div>
        </div>
    </div>
    <div id="aiAgentToggle" class="ai-agent-toggle">
        <i class="fas fa-robot text-xl"></i>
    </div>
</div>

<script>
    // Tool data for the modal
    const tools = {
        copygenius: {
            name: "CopyGenius",
            category: "AI Writing Assistant",
            description: "CopyGenius is an advanced AI writing assistant that helps you create high-quality content in seconds. Whether you need marketing copy, blog posts, product descriptions, or social media content, CopyGenius can generate compelling text that resonates with your audience. It uses state-of-the-art language models to understand your requirements and produce human-like content.",
            icon: "fas fa-pen-fancy",
            iconBg: "bg-purple-100",
            iconColor: "text-purple-600",
            link: "https://copygenius.example.com"
        },
        artisanai: {
            name: "ArtisanAI",
            category: "Image Generator",
            description: "ArtisanAI transforms your creative ideas into stunning visual artwork. With simple text prompts, you can generate unique images, logos, and designs in various styles. The platform offers advanced customization options and supports multiple art styles from photorealistic to abstract. Perfect for designers, marketers, and content creators who need high-quality visuals quickly.",
            icon: "fas fa-image",
            iconBg: "bg-blue-100",
            iconColor: "text-blue-600",
            link: "https://artisanai.example.com"
        },
        datamind: {
            name: "DataMind",
            category: "Analytics Platform",
            description: "DataMind leverages artificial intelligence to help businesses make sense of their data. It automatically analyzes complex datasets, identifies patterns, and presents actionable insights through intuitive dashboards. No coding required - just upload your data and let DataMind do the heavy lifting. Ideal for business analysts, marketers, and data-driven decision makers.",
            icon: "fas fa-chart-line",
            iconBg: "bg-green-100",
            iconColor: "text-green-600",
            link: "https://datamind.example.com"
        },
        melodyai: {
            name: "MelodyAI",
            category: "AI Music Generator",
            description: "Create original music tracks in any genre with MelodyAI. Whether you need background music for videos, jingles for ads, or full compositions, our AI understands musical theory and can compose royalty-free music tailored to your needs. Adjust tempo, mood, instruments, and length to get the perfect soundtrack for your project.",
            icon: "fas fa-music",
            iconBg: "bg-pink-100",
            iconColor: "text-pink-600",
            link: "https://melodyai.example.com"
        },
        linguapro: {
            name: "LinguaPro",
            category: "AI Translator",
            description: "LinguaPro goes beyond simple translation to deliver context-aware, natural-sounding translations in over 50 languages. It preserves nuance, tone, and cultural references while maintaining the original meaning. Perfect for businesses operating globally, content creators with international audiences, or anyone needing accurate translations quickly.",
            icon: "fas fa-language",
            iconBg: "bg-orange-100",
            iconColor: "text-orange-600",
            link: "https://linguapro.example.com"
        },
        mindmapai: {
            name: "MindMap AI",
            category: "Idea Generator",
            description: "MindMap AI helps you brainstorm, organize, and develop ideas visually. Describe your concept in a few words, and the AI will generate a structured mind map with related concepts, questions, and action items. Great for project planning, creative thinking, problem solving, and learning new topics. Export your mind maps to various formats for sharing and collaboration.",
            icon: "fas fa-brain",
            iconBg: "bg-teal-100",
            iconColor: "text-teal-600",
            link: "https://mindmapai.example.com"
        },
        resumegenie: {
            name: "ResumeGenie",
            category: "AI Resume Builder",
            description: "Create professional, ATS-friendly resumes in minutes with ResumeGenie. Our AI analyzes job descriptions and tailors your resume to highlight the most relevant skills and experiences. Get personalized suggestions for improvement, automatic formatting, and multiple design templates. Whether you're job hunting or just keeping your resume updated, ResumeGenie makes the process effortless.",
            icon: "fas fa-file-alt",
            iconBg: "bg-cyan-100",
            iconColor: "text-cyan-600",
            link: "https://resumegenie.example.com"
        }
    };

    // AI Agent Responses
    const aiResponses = {
        greetings: [
            "Hello! How can I assist you with AI tools today?",
            "Hi there! What kind of AI tools are you looking for?",
            "Welcome! I can help you discover the perfect AI tools for your needs."
        ],
        writingTools: [
            "Here are some excellent AI writing tools:",
            "For your writing needs, I recommend these tools:",
            "These AI writing assistants can help you create amazing content:"
        ],
        designTools: [
            "Check out these powerful AI design tools:",
            "For your design projects, consider these AI tools:",
            "These AI-powered design tools can enhance your creativity:"
        ],
        newTools: [
            "Here are some recently added AI tools you might like:",
            "These are the newest additions to our collection:",
            "Check out these fresh AI tools we've recently added:"
        ],
        default: [
            "I'm not sure I understand. Could you clarify what you're looking for?",
            "I didn't catch that. Could you try asking differently?",
            "I'm here to help you find AI tools. What specifically are you looking for?"
        ]
    };

    // DOM Elements
    const toolModal = document.getElementById('toolModal');
    const submitToolModal = document.getElementById('submitToolModal');
    const submitToolForm = document.getElementById('submitToolForm');
    const subscribeBtn = document.getElementById('subscribeBtn');
    const subscribeMessage = document.getElementById('subscribeMessage');
    const mobileMenuBtn = document.getElementById('mobileMenuBtn');
    const mobileMenu = document.getElementById('mobileMenu');
    const submitToolBtn = document.getElementById('submitToolBtn');
    const mobileSubmitBtn = document.getElementById('mobileSubmitBtn');
    
    // AI Agent Elements
    const aiAgentChat = document.getElementById('aiAgentChat');
    const aiAgentToggle = document.getElementById('aiAgentToggle');
    const aiAgentMessages = document.getElementById('aiAgentMessages');
    const aiAgentInput = document.getElementById('aiAgentInput');
    const sendMessageBtn = document.getElementById('sendMessageBtn');
    const closeChatBtn = document.getElementById('closeChatBtn');

    // Add button press effect to all buttons
    document.querySelectorAll('button').forEach(button => {
        button.addEventListener('mousedown', () => {
            button.classList.add('button-press');
        });
        
        button.addEventListener('mouseup', () => {
            button.classList.remove('button-press');
        });
        
        button.addEventListener('mouseleave', () => {
            button.classList.remove('button-press');
        });
    });

    // Learn More buttons
    document.querySelectorAll('.learn-more-btn, .details-btn').forEach(button => {
        button.addEventListener('click', function() {
            const toolId = this.getAttribute('data-tool');
            openToolModal(toolId);
        });
    });

    // Close modal button
    document.getElementById('closeModalBtn').addEventListener('click', closeToolModal);

    // Save tool button
    document.getElementById('saveToolBtn').addEventListener('click', function() {
        alert('Tool saved to your favorites!');
    });

    // Visit website button
    document.getElementById('modalToolLink').addEventListener('click', function() {
        // In a real app, you might want to track this click
        console.log('User visited tool website:', this.href);
    });

    // Search functionality
    document.getElementById('searchBtn').addEventListener('click', function() {
        const searchTerm = document.getElementById('searchInput').value.trim();
        if (searchTerm) {
            alert(`Searching for: ${searchTerm}`);
            // In a real app, you would filter tools or make an API call
        }
    });

    // Newsletter subscription
    subscribeBtn.addEventListener('click', function() {
        const email = document.getElementById('newsletterEmail').value.trim();
        if (email && validateEmail(email)) {
            subscribeMessage.textContent = 'Thank you for subscribing!';
            subscribeMessage.style.color = 'white';
            document.getElementById('newsletterEmail').value = '';
            
            // In a real app, you would send this to your backend
            console.log('New subscriber:', email);
        } else {
            subscribeMessage.textContent = 'Please enter a valid email address';
            subscribeMessage.style.color = '#fecaca';
        }
    });

    // Mobile menu toggle
    mobileMenuBtn.addEventListener('click', function() {
        mobileMenu.classList.toggle('hidden');
    });

    // Submit tool buttons
    submitToolBtn.addEventListener('click', openSubmitToolModal);
    mobileSubmitBtn.addEventListener('click', openSubmitToolModal);

    // Close submit modal button
    document.getElementById('closeSubmitModalBtn').addEventListener('click', closeSubmitToolModal);

    // Submit tool form
    submitToolForm.addEventListener('submit', function(e) {
        e.preventDefault();
        
        const toolName = document.getElementById('toolName').value;
        const toolUrl = document.getElementById('toolUrl').value;
        const toolCategory = document.getElementById('toolCategory').value;
        const toolDescription = document.getElementById('toolDescription').value;
        
        // In a real app, you would send this data to your backend
        console.log('Tool submitted:', {
            name: toolName,
            url: toolUrl,
            category: toolCategory,
            description: toolDescription
        });
        
        alert('Thank you for your submission! We will review your tool and add it to our collection if approved.');
        closeSubmitToolModal();
        this.reset();
    });

    // AI Agent Toggle
    aiAgentToggle.addEventListener('click', function() {
        aiAgentChat.style.display = aiAgentChat.style.display === 'flex' ? 'none' : 'flex';
    });

    // Close AI Chat
    closeChatBtn.addEventListener('click', function() {
        aiAgentChat.style.display = 'none';
    });

    // Send message when Enter is pressed
    aiAgentInput.addEventListener('keypress', function(e) {
        if (e.key === 'Enter') {
            sendMessage();
        }
    });

    // Send message when button is clicked
    sendMessageBtn.addEventListener('click', sendMessage);

    // Quick reply function
    function sendQuickReply(text) {
        addMessage(text, 'user');
        processUserMessage(text);
    }

    // Send message function
    function sendMessage() {
        const message = aiAgentInput.value.trim();
        if (message) {
            addMessage(message, 'user');
            aiAgentInput.value = '';
            processUserMessage(message);
        }
    }

    // Add message to chat
    function addMessage(text, sender) {
        const messageDiv = document.createElement('div');
        messageDiv.className = `message ${sender}-message`;
        messageDiv.textContent = text;
        aiAgentMessages.appendChild(messageDiv);
        aiAgentMessages.scrollTop = aiAgentMessages.scrollHeight;
        
        // Show typing indicator
        if (sender === 'user') {
            showTypingIndicator();
        }
    }

    // Show typing indicator
    function showTypingIndicator() {
        const typingDiv = document.createElement('div');
        typingDiv.className = 'typing-indicator';
        typingDiv.innerHTML = `
            <div class="typing-dot"></div>
            <div class="typing-dot"></div>
            <div class="typing-dot"></div>
        `;
        aiAgentMessages.appendChild(typingDiv);
        aiAgentMessages.scrollTop = aiAgentMessages.scrollHeight;
        
        // Remove typing indicator after delay
        setTimeout(() => {
            typingDiv.remove();
        }, 1000 + Math.random() * 1000);
    }

    // Process user message and generate response
    function processUserMessage(message) {
        setTimeout(() => {
            let response = '';
            let toolSuggestions = [];
            
            // Simple keyword matching for demo purposes
            if (message.toLowerCase().includes('writing') || message.toLowerCase().includes('write')) {
                response = getRandomResponse(aiResponses.writingTools);
                toolSuggestions = [
                    tools.copygenius,
                    tools.mindmapai,
                    tools.resumegenie
                ];
            } 
            else if (message.toLowerCase().includes('design') || message.toLowerCase().includes('image')) {
                response = getRandomResponse(aiResponses.designTools);
                toolSuggestions = [
                    tools.artisanai
                ];
            }
            else if (message.toLowerCase().includes('new') || message.toLowerCase().includes('recent')) {
                response = getRandomResponse(aiResponses.newTools);
                toolSuggestions = [
                    tools.melodyai,
                    tools.linguapro,
                    tools.mindmapai,
                    tools.resumegenie
                ];
            }
            else if (message.toLowerCase().includes('hi') || message.toLowerCase().includes('hello')) {
                response = getRandomResponse(aiResponses.greetings);
            }
            else {
                response = getRandomResponse(aiResponses.default);
            }
            
            // Add agent response
            const responseDiv = document.createElement('div');
            responseDiv.className = 'message agent-message';
            responseDiv.textContent = response;
            aiAgentMessages.appendChild(responseDiv);
            
            // Add tool suggestions if any
            if (toolSuggestions.length > 0) {
                toolSuggestions.forEach(tool => {
                    const toolDiv = document.createElement('div');
                    toolDiv.className = 'tool-suggestion';
                    toolDiv.innerHTML = `
                        <div class="font-medium">${tool.name}</div>
                        <div class="text-sm text-gray-500">${tool.category}</div>
                        <div class="text-xs mt-1">${tool.description.substring(0, 80)}...</div>
                    `;
                    toolDiv.addEventListener('click', () => {
                        openToolModal(Object.keys(tools).find(key => tools[key].name === tool.name));
                        aiAgentChat.style.display = 'none';
                    });
                    aiAgentMessages.appendChild(toolDiv);
                });
                
                // Add quick replies
                const quickRepliesDiv = document.createElement('div');
                quickRepliesDiv.className = 'mt-2';
                quickRepliesDiv.innerHTML = `
                    <div class="quick-reply" onclick="sendQuickReply('Show me more writing tools')">More writing tools</div>
                    <div class="quick-reply" onclick="sendQuickReply('Recommend design tools')">Design tools</div>
                    <div class="quick-reply" onclick="sendQuickReply('What\'s new?')">New tools</div>
                `;
                aiAgentMessages.appendChild(quickRepliesDiv);
            }
            
            aiAgentMessages.scrollTop = aiAgentMessages.scrollHeight;
        }, 1000 + Math.random() * 1000);
    }

    // Get random response from array
    function getRandomResponse(responses) {
        return responses[Math.floor(Math.random() * responses.length)];
    }

    // Modal functions
    function openToolModal(toolId) {
        const tool = tools[toolId];
        document.getElementById('modalToolName').textContent = tool.name;
        document.getElementById('modalToolCategory').textContent = tool.category;
        document.getElementById('modalToolDescription').textContent = tool.description;
        document.getElementById('modalToolLink').href = tool.link;
        
        const iconElement = document.getElementById('modalToolIcon');
        iconElement.className = `${tool.iconBg} p-4 rounded-lg mr-4`;
        iconElement.innerHTML = `<i class="${tool.icon} ${tool.iconColor} text-2xl"></i>`;
        
        toolModal.classList.remove('hidden');
        document.body.style.overflow = 'hidden';
    }

    function closeToolModal() {
        toolModal.classList.add('hidden');
        document.body.style.overflow = 'auto';
    }

    function openSubmitToolModal() {
        submitToolModal.classList.remove('hidden');
        document.body.style.overflow = 'hidden';
        mobileMenu.classList.add('hidden'); // Close mobile menu if open
    }

    function closeSubmitToolModal() {
        submitToolModal.classList.add('hidden');
        document.body.style.overflow = 'auto';
    }

    // Close modals when clicking outside
    toolModal.addEventListener('click', function(e) {
        if (e.target === this) {
            closeToolModal();
        }
    });

    submitToolModal.addEventListener('click', function(e) {
        if (e.target === this) {
            closeSubmitToolModal();
        }
    });

    // Helper function to validate email
    function validateEmail(email) {
        const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
        return re.test(email);
    }

    // Initialize AI Agent with welcome message
    window.addEventListener('DOMContentLoaded', () => {
        setTimeout(() => {
            addMessage(getRandomResponse(aiResponses.greetings), 'agent');
        }, 1000);
    });
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Sfiso47/toolslab" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>