File size: 60,815 Bytes
08cbe4b
 
 
 
 
 
 
 
5bcbb30
 
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
 
 
 
 
 
 
 
 
 
 
 
08cbe4b
 
 
5bcbb30
 
 
 
08cbe4b
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
08cbe4b
 
 
 
 
 
5bcbb30
08cbe4b
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
08cbe4b
 
 
 
 
 
 
5bcbb30
 
 
 
 
 
 
 
 
 
 
 
 
 
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
08cbe4b
 
5bcbb30
 
 
08cbe4b
5bcbb30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
 
 
 
 
 
 
 
 
 
 
 
08cbe4b
 
5bcbb30
 
 
 
 
 
 
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
 
 
 
 
 
08cbe4b
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
 
 
 
08cbe4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcbb30
 
 
 
 
 
 
 
 
08cbe4b
5bcbb30
 
 
 
 
 
08cbe4b
5bcbb30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SEO AutoBlog AI - Create SEO-Optimized Content in Minutes</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">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.4.0/mammoth.browser.min.js"></script>
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .hero-gradient {
            background: linear-gradient(135deg, rgba(110, 142, 251, 0.9) 0%, rgba(167, 119, 227, 0.9) 100%);
        }
        .card-hover: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);
        }
        .loading-dots:after {
            content: '.';
            animation: dots 1.5s steps(5, end) infinite;
        }
        @keyframes dots {
            0%, 20% { content: '.'; }
            40% { content: '..'; }
            60% { content: '...'; }
            80%, 100% { content: ''; }
        }
        .fade-in {
            animation: fadeIn 0.5s ease-in-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .sidebar {
            transition: all 0.3s ease;
        }
        .sidebar-closed {
            transform: translateX(-100%);
        }
        .sidebar-open {
            transform: translateX(0);
        }
        .social-share-btn {
            transition: all 0.3s ease;
        }
        .social-share-btn:hover {
            transform: scale(1.05);
        }
        .copy-btn {
            transition: all 0.2s ease;
        }
        .copy-btn:active {
            transform: scale(0.95);
        }
        .export-dropdown {
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: all 0.2s ease;
        }
        .export-dropdown.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
    </style>
</head>
<body class="bg-gray-50 font-sans">
    <!-- Mobile Sidebar Toggle -->
    <div class="md:hidden fixed top-4 left-4 z-50">
        <button id="sidebarToggle" class="p-2 rounded-lg bg-white shadow-md text-purple-600">
            <i class="fas fa-bars"></i>
        </button>
    </div>

    <!-- Sidebar -->
    <div id="sidebar" class="sidebar sidebar-closed md:sidebar-open fixed inset-y-0 left-0 w-64 bg-white shadow-lg z-40 md:translate-x-0">
        <div class="p-4 flex items-center justify-between border-b">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 rounded-full gradient-bg flex items-center justify-center text-white font-bold">SA</div>
                <span class="font-bold text-gray-800">SEO AutoBlog</span>
            </div>
            <button id="closeSidebar" class="md:hidden p-1 rounded-full hover:bg-gray-100">
                <i class="fas fa-times text-gray-500"></i>
            </button>
        </div>
        <nav class="p-4">
            <ul class="space-y-2">
                <li>
                    <a href="#" class="flex items-center space-x-3 p-2 rounded-lg bg-purple-50 text-purple-600">
                        <i class="fas fa-home"></i>
                        <span>Dashboard</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-file-alt"></i>
                        <span>My Articles</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-chart-line"></i>
                        <span>Analytics</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-key"></i>
                        <span>Keywords</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-cog"></i>
                        <span>Settings</span>
                    </a>
                </li>
            </ul>
        </nav>
        <div class="absolute bottom-0 left-0 right-0 p-4 border-t">
            <div class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700 cursor-pointer">
                <div class="w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center">
                    <i class="fas fa-user text-gray-600"></i>
                </div>
                <span>Account</span>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="md:ml-64 min-h-screen">
        <!-- Header -->
        <header class="bg-white shadow-sm">
            <div class="max-w-7xl mx-auto px-4 py-4 sm:px-6 lg:px-8 flex justify-between items-center">
                <h1 class="text-2xl font-bold text-gray-900">Create New Article</h1>
                <div class="flex items-center space-x-4">
                    <div class="flex items-center space-x-2 bg-gray-100 px-3 py-1 rounded-full">
                        <div class="w-2 h-2 rounded-full bg-green-500"></div>
                        <span class="text-sm font-medium">5 credits left</span>
                    </div>
                    <button class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg text-sm font-medium">
                        Upgrade Plan
                    </button>
                </div>
            </div>
        </header>

        <!-- Main Content Area -->
        <main class="max-w-7xl mx-auto px-4 py-6 sm:px-6 lg:px-8">
            <!-- Step Progress -->
            <div class="mb-8">
                <div class="flex justify-between mb-2">
                    <div class="flex-1 text-center">
                        <div class="w-8 h-8 mx-auto rounded-full bg-purple-600 text-white flex items-center justify-center">1</div>
                        <p class="mt-2 text-sm font-medium text-purple-600">Topic & Keywords</p>
                    </div>
                    <div class="flex-1 text-center">
                        <div class="w-8 h-8 mx-auto rounded-full bg-gray-200 text-gray-600 flex items-center justify-center">2</div>
                        <p class="mt-2 text-sm font-medium text-gray-600">Title & Outline</p>
                    </div>
                    <div class="flex-1 text-center">
                        <div class="w-8 h-8 mx-auto rounded-full bg-gray-200 text-gray-600 flex items-center justify-center">3</div>
                        <p class="mt-2 text-sm font-medium text-gray-600">Generate Content</p>
                    </div>
                    <div class="flex-1 text-center">
                        <div class="w-8 h-8 mx-auto rounded-full bg-gray-200 text-gray-600 flex items-center justify-center">4</div>
                        <p class="mt-2 text-sm font-medium text-gray-600">Review & Publish</p>
                    </div>
                </div>
                <div class="w-full bg-gray-200 rounded-full h-1.5">
                    <div class="bg-purple-600 h-1.5 rounded-full" style="width: 25%"></div>
                </div>
            </div>

            <!-- Step 1: Topic & Keywords -->
            <div id="step1" class="fade-in">
                <div class="bg-white rounded-xl shadow-md overflow-hidden mb-6">
                    <div class="p-6">
                        <h2 class="text-xl font-bold text-gray-800 mb-4">What's your article about?</h2>
                        <p class="text-gray-600 mb-6">Enter your topic or idea below. Our AI will analyze it and suggest the best SEO keywords to help your content rank higher.</p>
                        
                        <div class="mb-6">
                            <label for="topic" class="block text-sm font-medium text-gray-700 mb-2">Article Topic</label>
                            <textarea id="topic" rows="3" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-600 focus:border-purple-600" placeholder="Example: How to start a successful blog in 2024"></textarea>
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                            <div>
                                <label for="tone" class="block text-sm font-medium text-gray-700 mb-2">Tone</label>
                                <select id="tone" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-600 focus:border-purple-600">
                                    <option value="professional">Professional</option>
                                    <option value="friendly">Friendly</option>
                                    <option value="casual">Casual</option>
                                    <option value="authoritative">Authoritative</option>
                                    <option value="humorous">Humorous</option>
                                </select>
                            </div>
                            <div>
                                <label for="length" class="block text-sm font-medium text-gray-700 mb-2">Article Length</label>
                                <select id="length" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-600 focus:border-purple-600">
                                    <option value="short">Short (300-500 words)</option>
                                    <option value="medium" selected>Medium (650-1500 words)</option>
                                    <option value="long">Long (2000+ words)</option>
                                </select>
                            </div>
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                            <div>
                                <label for="language" class="block text-sm font-medium text-gray-700 mb-2">Language</label>
                                <select id="language" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-600 focus:border-purple-600">
                                    <option value="english" selected>English</option>
                                    <option value="spanish">Spanish</option>
                                    <option value="french">French</option>
                                    <option value="german">German</option>
                                </select>
                            </div>
                            <div>
                                <label for="aiModel" class="block text-sm font-medium text-gray-700 mb-2">AI Model</label>
                                <select id="aiModel" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-600 focus:border-purple-600">
                                    <option value="gemini" selected>Gemini Pro</option>
                                    <option value="deepseek">Deepseek</option>
                                </select>
                            </div>
                        </div>
                        
                        <div class="flex justify-end">
                            <button id="generateKeywordsBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-3 rounded-lg font-medium flex items-center space-x-2">
                                <span>Generate Keywords</span>
                                <i class="fas fa-arrow-right"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Step 2: Keywords Suggestions (Hidden Initially) -->
            <div id="step2" class="hidden fade-in">
                <div class="bg-white rounded-xl shadow-md overflow-hidden mb-6">
                    <div class="p-6">
                        <h2 class="text-xl font-bold text-gray-800 mb-4">Keyword Suggestions</h2>
                        <p class="text-gray-600 mb-6">Our AI analyzed your topic and found these high-potential keywords. Select the ones you want to target in your article.</p>
                        
                        <div class="mb-6">
                            <h3 class="font-medium text-gray-700 mb-3">Primary Keyword</h3>
                            <div class="flex flex-wrap gap-3 mb-6">
                                <div class="keyword-chip bg-purple-100 text-purple-800 px-4 py-2 rounded-full flex items-center">
                                    <span>how to start a blog</span>
                                    <div class="ml-2 text-xs bg-purple-600 text-white px-2 py-1 rounded-full">High Volume</div>
                                </div>
                            </div>
                            
                            <h3 class="font-medium text-gray-700 mb-3">Secondary Keywords</h3>
                            <div class="flex flex-wrap gap-3 mb-6">
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>blogging for beginners</span>
                                    <div class="ml-2 text-xs bg-green-600 text-white px-2 py-1 rounded-full">Low Comp</div>
                                </div>
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>how to create a blog</span>
                                    <div class="ml-2 text-xs bg-green-600 text-white px-2 py-1 rounded-full">Low Comp</div>
                                </div>
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>blog setup guide</span>
                                    <div class="ml-2 text-xs bg-yellow-600 text-white px-2 py-1 rounded-full">Med Comp</div>
                                </div>
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>best blogging platforms</span>
                                    <div class="ml-2 text-xs bg-green-600 text-white px-2 py-1 rounded-full">Low Comp</div>
                                </div>
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>blog niche ideas</span>
                                    <div class="ml-2 text-xs bg-green-600 text-white px-2 py-1 rounded-full">Low Comp</div>
                                </div>
                            </div>
                            
                            <h3 class="font-medium text-gray-700 mb-3">Related Keyphrases</h3>
                            <div class="flex flex-wrap gap-3">
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>how to make money blogging</span>
                                    <div class="ml-2 text-xs bg-yellow-600 text-white px-2 py-1 rounded-full">Med Comp</div>
                                </div>
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>blog content ideas</span>
                                    <div class="ml-2 text-xs bg-green-600 text-white px-2 py-1 rounded-full">Low Comp</div>
                                </div>
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>blog promotion strategies</span>
                                    <div class="ml-2 text-xs bg-green-600 text-white px-2 py-1 rounded-full">Low Comp</div>
                                </div>
                                <div class="keyword-chip bg-gray-100 text-gray-800 px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-gray-200">
                                    <span>wordpress vs blogger</span>
                                    <div class="ml-2 text-xs bg-yellow-600 text-white px-2 py-1 rounded-full">Med Comp</div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="flex justify-between">
                            <button id="backToStep1" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
                                <i class="fas fa-arrow-left mr-2"></i>
                                Back
                            </button>
                            <button id="generateTitlesBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-3 rounded-lg font-medium flex items-center space-x-2">
                                <span>Generate Titles & Outline</span>
                                <i class="fas fa-arrow-right"></i>
                            </button>
                            </div>
                    </div>
                </div>
            </div>

            <!-- Step 3: Title & Outline (Hidden Initially) -->
            <div id="step3" class="hidden fade-in">
                <div class="bg-white rounded-xl shadow-md overflow-hidden mb-6">
                    <div class="p-6">
                        <h2 class="text-xl font-bold text-gray-800 mb-4">Title Suggestions</h2>
                        <p class="text-gray-600 mb-6">Choose the title that best fits your article. Our AI will create an outline based on your selection.</p>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-8">
                            <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
                                <div class="flex items-start">
                                    <div class="mr-3 mt-1">
                                        <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners">
                                    </div>
                                    <div>
                                        <h3 class="font-medium text-gray-800">The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners</h3>
                                        <p class="text-sm text-gray-500 mt-1">SEO Score: 92/100</p>
                                    </div>
                                </div>
                            </div>
                            <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
                                <div class="flex items-start">
                                    <div class="mr-3 mt-1">
                                        <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="How to Start a Successful Blog: A Complete Beginner's Guide">
                                    </div>
                                    <div>
                                        <h3 class="font-medium text-gray-800">How to Start a Successful Blog: A Complete Beginner's Guide</h3>
                                        <p class="text-sm text-gray-500 mt-1">SEO Score: 89/100</p>
                                    </div>
                                </div>
                            </div>
                            <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
                                <div class="flex items-start">
                                    <div class="mr-3 mt-1">
                                        <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="Blogging 101: Everything You Need to Know to Start Your First Blog">
                                    </div>
                                    <div>
                                        <h3 class="font-medium text-gray-800">Blogging 101: Everything You Need to Know to Start Your First Blog</h3>
                                        <p class="text-sm text-gray-500 mt-1">SEO Score: 87/100</p>
                                    </div>
                                </div>
                            </div>
                            <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
                                <div class="flex items-start">
                                    <div class="mr-3 mt-1">
                                        <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="From Idea to Launch: The Step-by-Step Process to Start a Blog That Grows">
                                    </div>
                                    <div>
                                        <h3 class="font-medium text-gray-800">From Idea to Launch: The Step-by-Step Process to Start a Blog That Grows</h3>
                                        <p class="text-sm text-gray-500 mt-1">SEO Score: 85/100</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mb-6">
                            <h2 class="text-xl font-bold text-gray-800 mb-4">Article Outline</h2>
                            <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
                                <div class="outline-section mb-4">
                                    <h3 class="font-medium text-gray-800 mb-2 flex items-center">
                                        <i class="fas fa-circle text-purple-500 mr-2 text-xs"></i>
                                        Introduction
                                    </h3>
                                    <ul class="ml-6 text-gray-600 space-y-1">
                                        <li>• Why starting a blog is still relevant in 2024</li>
                                        <li>• Benefits of blogging for personal and business growth</li>
                                        <li>• Overview of what the guide will cover</li>
                                    </ul>
                                </div>
                                <div class="outline-section mb-4">
                                    <h3 class="font-medium text-gray-800 mb-2 flex items-center">
                                        <i class="fas fa-circle text-purple-500 mr-2 text-xs"></i>
                                        Choosing Your Blog Niche
                                    </h3>
                                    <ul class="ml-6 text-gray-600 space-y-1">
                                        <li>• How to identify profitable blog niches</li>
                                        <li>• Passion vs. profitability: finding the balance</li>
                                        <li>• Research tools to validate your niche idea</li>
                                    </ul>
                                </div>
                                <div class="outline-section mb-4">
                                    <h3 class="font-medium text-gray-800 mb-2 flex items-center">
                                        <i class="fas fa-circle text-purple-500 mr-2 text-xs"></i>
                                        Selecting a Blogging Platform
                                    </h3>
                                    <ul class="ml-6 text-gray-600 space-y-1">
                                        <li>• Comparison of popular platforms (WordPress, Blogger, Wix, etc.)</li>
                                        <li>• Pros and cons of self-hosted vs. free platforms</li>
                                        <li>• Step-by-step setup guide for WordPress</li>
                                    </ul>
                                </div>
                                <div class="outline-section mb-4">
                                    <h3 class="font-medium text-gray-800 mb-2 flex items-center">
                                        <i class="fas fa-circle text-purple-500 mr-2 text-xs"></i>
                                        Creating Your First Content
                                    </h3>
                                    <ul class="ml-6 text-gray-600 space-y-1">
                                        <li>• How to structure blog posts for maximum engagement</li>
                                        <li>• SEO best practices for beginners</li>
                                        <li>• Tools to help with writing and editing</li>
                                    </ul>
                                </div>
                                <div class="outline-section">
                                    <h3 class="font-medium text-gray-800 mb-2 flex items-center">
                                        <i class="fas fa-circle text-purple-500 mr-2 text-xs"></i>
                                        Promoting Your Blog
                                    </h3>
                                    <ul class="ml-6 text-gray-600 space-y-1">
                                        <li>• Social media strategies for new bloggers</li>
                                        <li>• Basic SEO techniques to get started</li>
                                        <li>• Building an email list from day one</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        
                        <div class="flex justify-between">
                            <button id="backToStep2" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
                                <i class="fas fa-arrow-left mr-2"></i>
                                Back
                            </button>
                            <button id="generateContentBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-3 rounded-lg font-medium flex items-center space-x-2">
                                <span>Generate Full Article</span>
                                <i class="fas fa-magic"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Step 4: Generated Content (Hidden Initially) -->
            <div id="step4" class="hidden fade-in">
                <div class="bg-white rounded-xl shadow-md overflow-hidden mb-6">
                    <div class="p-6">
                        <div class="flex justify-between items-center mb-6">
                            <h2 class="text-xl font-bold text-gray-800">Generated Article</h2>
                            <div class="flex space-x-3">
                                <div class="relative">
                                    <button id="exportBtn" class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center">
                                        <i class="fas fa-download mr-2"></i>
                                        Export
                                    </button>
                                    <div id="exportDropdown" class="export-dropdown absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-10 py-1">
                                        <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="pdf"><i class="fas fa-file-pdf mr-2 text-red-500"></i> PDF</a>
                                        <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="docx"><i class="fas fa-file-word mr-2 text-blue-500"></i> Word</a>
                                        <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="txt"><i class="fas fa-file-alt mr-2 text-gray-500"></i> Text</a>
                                        <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="md"><i class="fab fa-markdown mr-2 text-purple-500"></i> Markdown</a>
                                    </div>
                                </div>
                                <button id="editBtn" class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center">
                                    <i class="fas fa-edit mr-2"></i>
                                    Edit
                                </button>
                                <button id="copyBtn" class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center copy-btn">
                                    <i class="fas fa-copy mr-2"></i>
                                    Copy
                                </button>
                            </div>
                        </div>
                        
                        <div id="articleContent" class="mb-6">
                            <h1 class="text-3xl font-bold text-gray-900 mb-4">The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners</h1>
                            <div class="flex items-center text-sm text-gray-500 space-x-4 mb-6">
                                <span><i class="fas fa-clock mr-1"></i> 12 min read</span>
                                <span><i class="fas fa-chart-line mr-1"></i> SEO Score: 92/100</span>
                                <span><i class="fas fa-ruler-combined mr-1"></i> 1,450 words</span>
                            </div>
                            
                            <div class="mb-8">
                                <img src="https://images.pexels.com/photos/267350/pexels-photo-267350.jpeg" alt="Person typing on laptop" class="w-full h-auto rounded-lg">
                                <p class="text-sm text-gray-500 mt-2 text-center">Credit: Pexels</p>
                            </div>
                            
                            <div class="prose max-w-none">
                                <h2>Introduction</h2>
                                <p>Starting a blog in 2024 might seem daunting with all the competition out there, but the truth is, there's never been a better time to share your voice online. Whether you're looking to build a personal brand, share your expertise, or even create an additional income stream, blogging remains one of the most effective ways to establish your online presence.</p>
                                
                                <p>In this comprehensive guide, we'll walk you through every step of the process—from choosing your niche to publishing your first post and promoting it effectively. By the end, you'll have all the tools and knowledge needed to launch a successful blog that stands out in today's crowded digital landscape.</p>
                                
                                <h2>Choosing Your Blog Niche</h2>
                                <p>One of the most critical decisions you'll make is selecting your blog's focus. Your niche should be:</p>
                                <ul>
                                    <li>Something you're passionate about (you'll be writing a lot about it!)</li>
                                    <li>Specific enough to stand out but broad enough to have an audience</li>
                                    <li>Potentially profitable if monetization is a goal</li>
                                </ul>
                                
                                <p>Popular niche categories include:</p>
                                <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
                                    <div class="bg-gray-50 p-3 rounded-lg">
                                        <h3 class="font-medium mb-2">Lifestyle</h3>
                                        <p class="text-sm text-gray-600">Travel, food, parenting, personal finance</p>
                                    </div>
                                    <div class="bg-gray-50 p-3 rounded-lg">
                                        <h3 class="font-medium mb-2">Business</h3>
                                        <p class="text-sm text-gray-600">Marketing, entrepreneurship, remote work</p>
                                    </div>
                                    <div class="bg-gray-50 p-3 rounded-lg">
                                        <h3 class="font-medium mb-2">Hobbies</h3>
                                        <p class="text-sm text-gray-600">Photography, gaming, DIY crafts</p>
                                    </div>
                                </div>
                                
                                <h2>Selecting a Blogging Platform</h2>
                                <p>For most beginners, we recommend starting with WordPress.org (not to be confused with WordPress.com). Here's why:</p>
                                <ul>
                                    <li>Complete control over your site</li>
                                    <li>Access to thousands of themes and plugins</li>
                                    <li>Better monetization options</li>
                                    <li>Strong SEO capabilities</li>
                                </ul>
                                
                                <div class="bg-blue-50 p-4 rounded-lg my-4">
                                    <h3 class="font-medium text-blue-800 mb-2">Pro Tip:</h3>
                                    <p class="text-blue-700">While WordPress has a steeper learning curve than platforms like Wix or Squarespace, the long-term benefits far outweigh the initial setup complexity. Invest time in learning it—you won't regret it!</p>
                                </div>
                                
                                <h2>Creating Your First Content</h2>
                                <p>Quality content is the backbone of any successful blog. Follow these guidelines for your first posts:</p>
                                <ol>
                                    <li>Solve a specific problem for your readers</li>
                                    <li>Use headings and subheadings to improve readability</li>
                                    <li>Include images and multimedia where appropriate</li>
                                    <li>Write in a conversational, engaging tone</li>
                                    <li>Optimize for SEO (but write for humans first)</li>
                                </ol>
                                
                                <div class="my-6">
                                    <div class="aspect-w-16 aspect-h-9">
                                        <iframe class="w-full h-96 rounded-lg" src="https://www.youtube.com/embed/dQw4w9WgXcQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                                    </div>
                                    <p class="text-sm text-gray-500 mt-2 text-center">Video Tutorial: Blog Setup Walkthrough</p>
                                </div>
                                
                                <h2>FAQs</h2>
                                <div class="space-y-4 mb-6">
                                    <div class="border-b pb-4">
                                        <h3 class="font-medium text-lg">How much does it cost to start a blog?</h3>
                                        <p class="text-gray-600 mt-1">You can start a basic blog for under $100/year (domain + hosting). Premium themes and plugins may add to this cost, but they're not necessary when starting.</p>
                                    </div>
                                    <div class="border-b pb-4">
                                        <h3 class="font-medium text-lg">How often should I publish new posts?</h3>
                                        <p class="text-gray-600 mt-1">Consistency matters more than frequency. Start with 1-2 quality posts per month rather than daily posts that lack depth.</p>
                                    </div>
                                    <div>
                                        <h3 class="font-medium text-lg">How long before my blog makes money?</h3>
                                        <p class="text-gray-600 mt-1">Most blogs take 6-12 months to generate meaningful income. Focus on building an audience first—monetization will follow.</p>
                                    </div>
                                </div>
                                
                                <h2>Conclusion</h2>
                                <p>Starting a blog in 2024 is an exciting journey that combines creativity with technical skills. While the process may seem overwhelming at first, breaking it down into manageable steps (as we've done in this guide) makes it approachable for anyone.</p>
                                
                                <p>Remember, every successful blogger started exactly where you are now. The key is to begin, stay consistent, and continuously learn and adapt. Your future self will thank you for taking that first step today!</p>
                                
                                <div class="bg-purple-50 p-4 rounded-lg mt-6">
                                    <h3 class="font-medium text-purple-800 mb-2">Next Steps:</h3>
                                    <ul class="list-disc pl-5 text-purple-700 space-y-1">
                                        <li>Register your domain name</li>
                                        <li>Set up hosting and install WordPress</li>
                                        <li>Write and publish your first post</li>
                                        <li>Start promoting on social media</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        
                        <!-- Social Media Sharing -->
                        <div class="bg-gray-50 p-6 rounded-lg mb-6">
                            <h3 class="text-lg font-medium text-gray-800 mb-4">Share Your Article</h3>
                            <p class="text-gray-600 mb-4">Generate social media posts for your article with one click:</p>
                            
                            <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
                                <button class="social-share-btn bg-blue-500 hover:bg-blue-600 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="twitter">
                                    <i class="fab fa-twitter mr-2"></i>
                                    Generate Twitter Post
                                </button>
                                <button class="social-share-btn bg-blue-700 hover:bg-blue-800 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="facebook">
                                    <i class="fab fa-facebook-f mr-2"></i>
                                    Generate Facebook Post
                                </button>
                                <button class="social-share-btn bg-pink-600 hover:bg-pink-700 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="instagram">
                                    <i class="fab fa-instagram mr-2"></i>
                                    Generate Instagram Post
                                </button>
                            </div>
                            
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                <button class="social-share-btn bg-blue-400 hover:bg-blue-500 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="linkedin">
                                    <i class="fab fa-linkedin-in mr-2"></i>
                                    Generate LinkedIn Post
                                </button>
                                <button class="social-share-btn bg-red-500 hover:bg-red-600 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="pinterest">
                                    <i class="fab fa-pinterest-p mr-2"></i>
                                    Generate Pinterest Post
                                </button>
                            </div>
                        </div>
                        
                        <!-- Generated Social Media Posts (Hidden Initially) -->
                        <div id="socialPostsContainer" class="hidden">
                            <div class="bg-white border border-gray-200 rounded-lg p-6 mb-6">
                                <div class="flex justify-between items-center mb-4">
                                    <h3 class="text-lg font-medium text-gray-800" id="socialPlatformName">Twitter Post</h3>
                                    <div class="flex space-x-2">
                                        <button class="copy-social-btn bg-gray-100 hover:bg-gray-200 text-gray-800 px-3 py-1 rounded text-sm">
                                            <i class="fas fa-copy mr-1"></i> Copy
                                        </button>
                                        <button class="close-social-btn bg-gray-100 hover:bg-gray-200 text-gray-800 px-3 py-1 rounded text-sm">
                                            <i class="fas fa-times mr-1"></i> Close
                                        </button>
                                    </div>
                                </div>
                                <div id="socialPostContent" class="bg-gray-50 p-4 rounded">
                                    <p class="text-gray-800" id="socialPostText"></p>
                                    <div id="socialPostMedia" class="mt-3"></div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="flex justify-between">
                            <button id="backToStep3" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
                                <i class="fas fa-arrow-left mr-2"></i>
                                Back
                            </button>
                            <div class="flex space-x-3">
                                <button id="regenerateBtn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
                                    <i class="fas fa-redo mr-2"></i>
                                    Regenerate
                                </button>
                                <button id="publishBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-3 rounded-lg font-medium">
                                    <i class="fas fa-save mr-2"></i>
                                    Save & Publish
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <!-- Loading Modal -->
    <div id="loadingModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
        <div class="bg-white rounded-xl p-8 max-w-md w-full text-center">
            <div class="w-16 h-16 mx-auto mb-4 rounded-full bg-purple-100 flex items-center justify-center">
                <i class="fas fa-spinner fa-spin text-purple-600 text-2xl"></i>
            </div>
            <h3 class="text-xl font-medium text-gray-800 mb-2" id="loadingTitle">Generating Content</h3>
            <p class="text-gray-600 mb-4" id="loadingMessage">Our AI is crafting your perfect article. This may take a minute...</p>
            <div class="w-full bg-gray-200 rounded-full h-1.5">
                <div id="progressBar" class="bg-purple-600 h-1.5 rounded-full" style="width: 0%"></div>
            </div>
            <p id="progressText" class="text-sm text-gray-500 mt-2">Initializing AI models...</p>
        </div>
    </div>

    <!-- Success Modal -->
    <div id="successModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
        <div class="bg-white rounded-xl p-8 max-w-md w-full text-center">
            <div class="w-16 h-16 mx-auto mb-4 rounded-full bg-green-100 flex items-center justify-center">
                <i class="fas fa-check text-green-600 text-2xl"></i>
            </div>
            <h3 class="text-xl font-medium text-gray-800 mb-2">Success!</h3>
            <p class="text-gray-600 mb-6" id="successMessage">Your article has been generated successfully.</p>
            <button id="successModalClose" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-2 rounded-lg font-medium">
                Continue
            </button>
        </div>
    </div>

    <script>
        // DOM Elements
        const sidebar = document.getElementById('sidebar');
        const sidebarToggle = document.getElementById('sidebarToggle');
        const closeSidebar = document.getElementById('closeSidebar');
        const generateKeywordsBtn = document.getElementById('generateKeywordsBtn');
        const generateTitlesBtn = document.getElementById('generateTitlesBtn');
        const generateContentBtn = document.getElementById('generateContentBtn');
        const backToStep1 = document.getElementById('backToStep1');
        const backToStep2 = document.getElementById('backToStep2');
        const backToStep3 = document.getElementById('backToStep3');
        const step1 = document.getElementById('step1');
        const step2 = document.getElementById('step2');
        const step3 = document.getElementById('step3');
        const step4 = document.getElementById('step4');
        const loadingModal = document.getElementById('loadingModal');
        const loadingTitle = document.getElementById('loadingTitle');
        const loadingMessage = document.getElementById('loadingMessage');
        const progressBar = document.getElementById('progressBar');
        const progressText = document.getElementById('progressText');
        const successModal = document.getElementById('successModal');
        const successMessage = document.getElementById('successMessage');
        const successModalClose = document.getElementById('successModalClose');
        const titleOptions = document.querySelectorAll('.title-option');
        const exportBtn = document.getElementById('exportBtn');
        const exportDropdown = document.getElementById('exportDropdown');
        const exportOptions = document.querySelectorAll('.export-option');
        const articleContent = document.getElementById('articleContent');
        const editBtn = document.getElementById('editBtn');
        const copyBtn = document.getElementById('copyBtn');
        const regenerateBtn = document.getElementById('regenerateBtn');
        const publishBtn = document.getElementById('publishBtn');
        const socialShareBtns = document.querySelectorAll('.social-share-btn');
        const socialPostsContainer = document.getElementById('socialPostsContainer');
        const socialPlatformName = document.getElementById('socialPlatformName');
        const socialPostText = document.getElementById('socialPostText');
        const socialPostMedia = document.getElementById('socialPostMedia');
        const copySocialBtn = document.querySelector('.copy-social-btn');
        const closeSocialBtn = document.querySelector('.close-social-btn');
        
        // Toggle sidebar on mobile
        sidebarToggle.addEventListener('click', () => {
            sidebar.classList.toggle('sidebar-closed');
            sidebar.classList.toggle('sidebar-open');
        });
        
        closeSidebar.addEventListener('click', () => {
            sidebar.classList.add('sidebar-closed');
            sidebar.classList.remove('sidebar-open');
        });
        
        // Export dropdown toggle
        exportBtn.addEventListener('click', (e) => {
            e.stopPropagation();
            exportDropdown.classList.toggle('show');
        });
        
        // Close export dropdown when clicking outside
        document.addEventListener('click', (e) => {
            if (!exportBtn.contains(e.target) && !exportDropdown.contains(e.target)) {
                exportDropdown.classList.remove('show');
            }
        });
        
        // Navigation between steps
        generateKeywordsBtn.addEventListener('click', () => {
            const topic = document.getElementById('topic').value.trim();
            if (!topic) {
                alert('Please enter a topic for your article');
                return;
            }
            
            showLoadingModal('Analyzing Topic', 'Our AI is analyzing your topic and finding the best keywords...');
            setTimeout(() => {
                hideLoadingModal();
                step1.classList.add('hidden');
                step2.classList.remove('hidden');
                // Update progress bar
                document.querySelector('.h-1.5.bg-purple-600').style.width = '50%';
                document.querySelectorAll('.flex-1.text-center div')[1].classList.remove('bg-gray-200');
                document.querySelectorAll('.flex-1.text-center div')[1].classList.add('bg-purple-600', 'text-white');
                document.querySelectorAll('.flex-1.text-center p')[1].classList.remove('text-gray-600');
                document.querySelectorAll('.flex-1.text-center p')[1].classList.add('text-purple-600');
            }, 2500);
        });
        
        generateTitlesBtn.addEventListener('click', () => {
            showLoadingModal('Generating Titles', 'Our AI is creating compelling title options for your article...');
            setTimeout(() => {
                hideLoadingModal();
                step2.classList.add('hidden');
                step3.classList.remove('hidden');
                // Update progress bar
                document.querySelector('.h-1.5.bg-purple-600').style.width = '75%';
                document.querySelectorAll('.flex-1.text-center div')[2].classList.remove('bg-gray-200');
                document.querySelectorAll('.flex-1.text-center div')[2].classList.add('bg-purple-600', 'text-white');
                document.querySelectorAll('.flex-1.text-center p')[2].classList.remove('text-gray-600');
                document.querySelectorAll('.flex-1.text-center p')[2].classList.add('text-purple-600');
            }, 2500);
        });
        
        generateContentBtn.addEventListener('click', () => {
            const selectedTitle = document.querySelector('input[name="titleOption"]:checked');
            if (!selectedTitle) {
                alert('Please select a title for your article');
                return;
            }
            
            showLoadingModal('Writing Article', 'Our AI is writing your complete article based on your selected title and outline...');
            simulateProgress();
            setTimeout(() => {
                hideLoadingModal();
                step3.classList.add('hidden');
                step4.classList.remove('hidden');
                // Update progress bar
                document.querySelector('.h-1.5.bg-purple-600').style.width = '100%';
                document.querySelectorAll('.flex-1.text-center div')[3].classList.remove('bg-gray-200');
                document.querySelectorAll('.flex-1.text-center div')[3].classList.add('bg-purple-600', 'text-white');
                document.querySelectorAll('.flex-1.text-center p')[3].classList.remove('text-gray-600');
                document.querySelectorAll('.flex-1.text-center p')[3].classList.add('text-purple-600');
                
                // Update article title with selected title
                document.querySelector('#articleContent h1').textContent = selectedTitle.value;
                
                showSuccessModal('Your article has been generated successfully! You can now export, share, or publish it.');
            }, 8000);
        });
        
        backToStep1.addEventListener('click', () => {
            step2.classList.add('hidden');
            step1.classList.remove('hidden');
            // Update progress bar
            document.querySelector('.h-1.5.bg-purple-600').style.width = '25%';
            document.querySelectorAll('.flex-1.text-center div')[1].classList.remove('bg-purple-600', 'text-white');
            document.querySelectorAll('.flex-1.text-center div')[1].classList.add('bg-gray-200');
            document.querySelectorAll('.flex-1.text-center p')[1].classList.remove('text-purple-600');
            document.querySelectorAll('.flex-1.text-center p')[1].classList.add('text-gray-600');
        });
        
        backToStep2.addEventListener('click', () => {
            step3.classList.add('hidden');
            step2.classList.remove('hidden');
            // Update progress bar
            document.querySelector('.h-1.5.bg-purple-600').style.width = '50%';
            document.querySelectorAll('.flex-1.text-center div')[2].classList.remove('bg-purple-600', 'text-white');
            document.querySelectorAll('.flex-1.text-center div')[2].classList.add('bg-gray-200');
            document.querySelectorAll('.flex-1.text-center p')[2].classList.remove('text-purple-600');
            document.querySelectorAll('.flex-1.text-center p')[2].classList.add('text-gray-600');
        });
        
        backToStep3.addEventListener('click', () => {
            step4.classList.add('hidden');
            step3.classList.remove('hidden');
            // Update progress bar
            document.querySelector('.h-1.5.bg-purple-600').style.width = '75%';
            document.querySelectorAll('.flex-1.text-center div')[3].classList.remove('bg-purple-600', 'text-white');
            document.querySelectorAll('.flex-1.text-center div')[3].classList.add('bg-gray-200');
            document.querySelectorAll('.flex-1.text-center p')[3].classList.remove('text-purple-600');
            document.querySelectorAll('.flex-1.text-center p')[3].classList.add('text-gray-600');
        });
        
        // Title selection
        titleOptions.forEach(option => {
            option.addEventListener('click', function() {
                // Remove selected class from all options
                titleOptions.forEach(opt => {
                    opt.classList.remove('border-purple-600', 'bg-purple-50');
                    opt.querySelector('input[type="radio"]').checked = false;
                });
                
                // Add selected class to clicked option
                this.classList.add('border-purple-600', 'bg-purple-50');
                this.querySelector('input[type="radio"]').checked = true;
            });
        });
        
        // Keyword chip selection
        document.querySelectorAll('.keyword-chip').forEach(chip => {
            chip.addEventListener('click', function() {
                if (this.classList.contains('bg-gray-100')) {
                    this.classList.remove('bg-gray-100', 'hover:bg-gray-200');
                    this.classList.add('bg-purple-100', 'text-purple-800');
                } else {
                    this.classList.remove('bg-purple-100', 'text-purple-800');
                    this.classList.add('bg-gray-100', 'hover:bg-gray-200');
                }
            });
        });
        
        // Export functionality
        exportOptions.forEach(option => {
            option.addEventListener('click', function(e) {
                e.preventDefault();
                const type = this.getAttribute('data-type');
                exportArticle(type);
                exportDropdown.classList.remove('show');
            });
        });
        
        function exportArticle(type) {
            showLoadingModal('Exporting Article', `Preparing your article for export as ${type.toUpperCase()}...`);
            
            setTimeout(() => {
                const element = document.getElementById('articleContent');
                const articleTitle = document.querySelector('#articleContent h1').textContent;
                
                switch(type) {
                    case 'pdf':
                        const pdfOpts = {
                            margin: 10,
                            filename: `${articleTitle}.pdf`,
                            image: { type: 'jpeg', quality: 0.98 },
                            html2canvas: { scale: 2 },
                            jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
                        };
                        
                        html2pdf().set(pdfOpts).from(element).save();
                        break;
                        
                    case 'docx':
                        // For DOCX export, we'll create a simple HTML version that can be saved as Word
                        const htmlContent = `
                            <!DOCTYPE html>
                            <html>
                            <head>
                                <meta charset="UTF-8">
                                <title>${articleTitle}</title>
                                <style>
                                    body { font-family: Arial, sans-serif; line-height: 1.6; }
                                    h1 { color: #2d3748; }
                                    h2 { color: #4a5568; margin-top: 24px; }
                                    p { margin-bottom: 16px; }
                                    ul, ol { margin-left: 24px; }
                                    .pro-tip { background: #ebf8ff; padding: 12px; border-left: 4px solid #4299e1; margin: 16px 0; }
                                </style>
                            </head>
                            <body>
                                ${element.innerHTML}
                            <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=yeiayel/contentforge" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
                            </html>