File size: 51,371 Bytes
a415edd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en" dir="auto">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Resume Builder | ResumeRocket</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
    <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"></script>
    <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-firestore.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        .rtl { direction: rtl; }
        .language-switch { transition: all 0.3s ease; }
        .gradient-bg { background: linear-gradient(135deg, #00c6fb 0%, #005bea 100%); }
        .card-hover { transition: transform 0.3s ease, box-shadow 0.3s ease; }
        .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); }
        .progress-bar { transition: width 0.5s ease-in-out; }
        .template-selector input:checked + div { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); }
        .skill-tag { transition: all 0.2s ease; }
        .skill-tag:hover { transform: scale(1.05); }
        .arabic-font { font-family: 'Tahoma', sans-serif; }
        .resume-preview { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
        .section-collapse { transition: all 0.3s ease; }
        .section-collapse-content { overflow: hidden; transition: max-height 0.3s ease; }
    </style>
</head>
<body class="font-sans antialiased bg-gray-100">
    <!-- Language Switch -->
    <div class="fixed top-4 right-4 z-50">
        <button id="languageSwitch" class="language-switch flex items-center gap-2 bg-white px-3 py-2 rounded-full shadow-md text-sm font-medium text-blue-600 hover:bg-blue-50">
            <span id="currentLang">EN</span>
            <i data-feather="globe" class="w-4 h-4"></i>
        </button>
    </div>

    <!-- Navigation -->
    <nav class="bg-white shadow-sm">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16 items-center">
                <div class="flex items-center">
                    <div class="flex-shrink-0 flex items-center">
                        <i data-feather="zap" class="w-6 h-6 text-blue-600"></i>
                        <span class="ml-2 font-bold text-gray-900">ResumeRocket</span>
                    </div>
                </div>
                <div class="flex items-center space-x-4">
                    <button id="premiumBtn" class="bg-yellow-100 text-yellow-800 px-4 py-2 rounded-md text-sm font-medium flex items-center gap-2">
                        <i data-feather="star" class="w-4 h-4"></i>
                        <span>Upgrade</span>
                    </button>
                    <button id="logoutBtn" class="text-gray-500 hover:text-gray-700">
                        <i data-feather="log-out" class="w-5 h-5"></i>
                    </button>
                </div>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
        <div class="flex flex-col lg:flex-row gap-8">
            <!-- Resume Builder Form -->
            <div class="lg:w-2/3">
                <div class="bg-white rounded-xl shadow-sm p-6 mb-6">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-2xl font-bold text-gray-900" id="builderTitle">Build Your Resume</h2>
                        <div class="flex items-center gap-2">
                            <div class="relative">
                                <button id="jobRoleDropdownBtn" class="flex items-center gap-2 bg-gray-100 px-3 py-2 rounded-md text-sm font-medium text-gray-700">
                                    <span id="selectedJobRole">Select Job Role</span>
                                    <i data-feather="chevron-down" class="w-4 h-4"></i>
                                </button>
                                <div id="jobRoleDropdown" class="absolute right-0 mt-2 w-56 bg-white rounded-md shadow-lg z-50 hidden">
                                    <div class="py-1">
                                        <button class="job-role-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left" data-role="Software Developer">Software Developer</button>
                                        <button class="job-role-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left" data-role="Marketing Manager">Marketing Manager</button>
                                        <button class="job-role-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left" data-role="Teacher/Educator">Teacher/Educator</button>
                                        <button class="job-role-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left" data-role="Finance Professional">Finance Professional</button>
                                        <button class="job-role-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left" data-role="Healthcare Professional">Healthcare Professional</button>
                                    </div>
                                </div>
                            </div>
                            <button id="aiOptimizeBtn" class="flex items-center gap-2 bg-blue-600 text-white px-3 py-2 rounded-md text-sm font-medium">
                                <i data-feather="zap" class="w-4 h-4"></i>
                                <span>AI Optimize</span>
                            </button>
                        </div>
                    </div>

                    <div class="mb-8">
                        <div class="w-full bg-gray-200 rounded-full h-2.5">
                            <div id="progressBar" class="bg-blue-600 h-2.5 rounded-full progress-bar" style="width: 25%"></div>
                        </div>
                        <div class="flex justify-between mt-2 text-sm text-gray-600">
                            <span>25% Complete</span>
                            <span>Step 1 of 4</span>
                        </div>
                    </div>

                    <!-- Personal Info Section -->
                    <div class="mb-8">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="text-lg font-semibold text-gray-900 flex items-center gap-2">
                                <i data-feather="user" class="w-5 h-5 text-blue-600"></i>
                                <span id="personalInfoTitle">Personal Information</span>
                            </h3>
                            <button class="text-blue-600 text-sm font-medium flex items-center gap-1">
                                <i data-feather="upload" class="w-4 h-4"></i>
                                <span>Upload Photo</span>
                            </button>
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="fullName" class="block text-sm font-medium text-gray-700 mb-1" id="fullNameLabel">Full Name</label>
                                <input type="text" id="fullName" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                            </div>
                            <div>
                                <label for="jobTitle" class="block text-sm font-medium text-gray-700 mb-1" id="jobTitleLabel">Job Title</label>
                                <input type="text" id="jobTitle" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                            </div>
                            <div>
                                <label for="email" class="block text-sm font-medium text-gray-700 mb-1" id="emailLabel">Email</label>
                                <input type="email" id="email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                            </div>
                            <div>
                                <label for="phone" class="block text-sm font-medium text-gray-700 mb-1" id="phoneLabel">Phone</label>
                                <input type="tel" id="phone" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                            </div>
                            <div>
                                <label for="linkedin" class="block text-sm font-medium text-gray-700 mb-1">LinkedIn</label>
                                <input type="url" id="linkedin" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="https://linkedin.com/in/yourprofile">
                            </div>
                            <div>
                                <label for="portfolio" class="block text-sm font-medium text-gray-700 mb-1">Portfolio</label>
                                <input type="url" id="portfolio" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="https://yourwebsite.com">
                            </div>
                        </div>
                    </div>

                    <!-- Summary Section -->
                    <div class="mb-8">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="text-lg font-semibold text-gray-900 flex items-center gap-2">
                                <i data-feather="file-text" class="w-5 h-5 text-blue-600"></i>
                                <span id="summaryTitle">Professional Summary</span>
                            </h3>
                            <div class="flex gap-2">
                                <button id="aiGenerateSummaryBtn" class="flex items-center gap-1 text-sm font-medium text-blue-600">
                                    <i data-feather="zap" class="w-4 h-4"></i>
                                    <span>AI Generate</span>
                                </button>
                                <button id="toneDropdownBtn" class="flex items-center gap-1 text-sm font-medium text-gray-600">
                                    <span id="selectedTone">Formal</span>
                                    <i data-feather="chevron-down" class="w-4 h-4"></i>
                                </button>
                            </div>
                        </div>
                        <textarea id="professionalSummary" rows="4" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Briefly describe your professional background, skills, and career goals"></textarea>
                    </div>

                    <!-- Experience Section -->
                    <div class="mb-8">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="text-lg font-semibold text-gray-900 flex items-center gap-2">
                                <i data-feather="briefcase" class="w-5 h-5 text-blue-600"></i>
                                <span id="experienceTitle">Work Experience</span>
                            </h3>
                            <button id="addExperienceBtn" class="text-blue-600 text-sm font-medium flex items-center gap-1">
                                <i data-feather="plus" class="w-4 h-4"></i>
                                <span>Add Experience</span>
                            </button>
                        </div>

                        <div id="experienceContainer">
                            <!-- Experience items will be added here -->
                            <div class="experience-item bg-gray-50 p-4 rounded-lg mb-4">
                                <div class="flex justify-between">
                                    <div>
                                        <input type="text" class="font-medium text-gray-900 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none mb-1" placeholder="Job Title">
                                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm" placeholder="Company Name">
                                    </div>
                                    <div class="flex items-center gap-2">
                                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="Start">
                                        <span>-</span>
                                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="End">
                                    </div>
                                </div>
                                <div class="mt-3">
                                    <textarea rows="3" class="w-full px-2 py-1 border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 text-sm" placeholder="Describe your responsibilities and achievements"></textarea>
                                    <button class="text-blue-600 text-xs font-medium flex items-center gap-1 mt-1">
                                        <i data-feather="zap" class="w-3 h-3"></i>
                                        <span>AI Enhance</span>
                                    </button>
                                </div>
                                <button class="text-red-500 text-xs font-medium flex items-center gap-1 mt-2">
                                    <i data-feather="trash-2" class="w-3 h-3"></i>
                                    <span>Remove</span>
                                </button>
                            </div>
                        </div>
                    </div>

                    <!-- Education Section -->
                    <div class="mb-8">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="text-lg font-semibold text-gray-900 flex items-center gap-2">
                                <i data-feather="book" class="w-5 h-5 text-blue-600"></i>
                                <span id="educationTitle">Education</span>
                            </h3>
                            <button id="addEducationBtn" class="text-blue-600 text-sm font-medium flex items-center gap-1">
                                <i data-feather="plus" class="w-4 h-4"></i>
                                <span>Add Education</span>
                            </button>
                        </div>

                        <div id="educationContainer">
                            <!-- Education items will be added here -->
                            <div class="education-item bg-gray-50 p-4 rounded-lg mb-4">
                                <div class="flex justify-between">
                                    <div>
                                        <input type="text" class="font-medium text-gray-900 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none mb-1" placeholder="Degree">
                                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm" placeholder="Institution">
                                    </div>
                                    <div class="flex items-center gap-2">
                                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="Start">
                                        <span>-</span>
                                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="End">
                                    </div>
                                </div>
                                <button class="text-red-500 text-xs font-medium flex items-center gap-1 mt-2">
                                    <i data-feather="trash-2" class="w-3 h-3"></i>
                                    <span>Remove</span>
                                </button>
                            </div>
                        </div>
                    </div>

                    <!-- Skills Section -->
                    <div class="mb-8">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="text-lg font-semibold text-gray-900 flex items-center gap-2">
                                <i data-feather="award" class="w-5 h-5 text-blue-600"></i>
                                <span id="skillsTitle">Skills</span>
                            </h3>
                            <button id="aiSuggestSkillsBtn" class="text-blue-600 text-sm font-medium flex items-center gap-1">
                                <i data-feather="zap" class="w-4 h-4"></i>
                                <span>AI Suggest</span>
                            </button>
                        </div>

                        <div class="flex flex-wrap gap-2 mb-4" id="skillsContainer">
                            <!-- Skills will be added here -->
                            <div class="skill-tag bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center gap-1">
                                <span>JavaScript</span>
                                <button class="text-blue-600 hover:text-blue-800">
                                    <i data-feather="x" class="w-3 h-3"></i>
                                </button>
                            </div>
                            <div class="skill-tag bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center gap-1">
                                <span>React</span>
                                <button class="text-blue-600 hover:text-blue-800">
                                    <i data-feather="x" class="w-3 h-3"></i>
                                </button>
                            </div>
                            <button id="addSkillBtn" class="skill-tag bg-gray-200 text-gray-700 px-3 py-1 rounded-full text-sm flex items-center gap-1 hover:bg-gray-300">
                                <i data-feather="plus" class="w-3 h-3"></i>
                                <span>Add Skill</span>
                            </button>
                        </div>

                        <div id="addSkillInput" class="hidden">
                            <div class="flex gap-2">
                                <input type="text" id="newSkillInput" class="flex-1 px-3 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 text-sm" placeholder="Type a skill">
                                <button id="saveSkillBtn" class="bg-blue-600 text-white px-3 py-1 rounded-md text-sm">Add</button>
                                <button id="cancelSkillBtn" class="bg-gray-200 text-gray-700 px-3 py-1 rounded-md text-sm">Cancel</button>
                            </div>
                        </div>
                    </div>

                    <!-- Action Buttons -->
                    <div class="flex justify-between pt-4 border-t border-gray-200">
                        <button id="prevStepBtn" class="bg-gray-200 text-gray-700 px-6 py-2 rounded-md font-medium hover:bg-gray-300">
                            <i data-feather="arrow-left" class="w-4 h-4 mr-2"></i>
                            <span id="backBtnText">Back</span>
                        </button>
                        <button id="nextStepBtn" class="bg-blue-600 text-white px-6 py-2 rounded-md font-medium hover:bg-blue-700">
                            <span id="nextBtnText">Next: Choose Template</span>
                            <i data-feather="arrow-right" class="w-4 h-4 ml-2"></i>
                        </button>
                    </div>
                </div>
            </div>

            <!-- Resume Preview -->
            <div class="lg:w-1/3">
                <div class="sticky top-4">
                    <div class="bg-white rounded-xl shadow-sm p-6 mb-6">
                        <h3 class="text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2">
                            <i data-feather="eye" class="w-5 h-5 text-blue-600"></i>
                            <span id="previewTitle">Resume Preview</span>
                        </h3>
                        
                        <div class="resume-preview bg-white p-6 rounded-lg border border-gray-200">
                            <!-- Preview content will be dynamically updated -->
                            <div class="text-center mb-6">
                                <div class="w-24 h-24 bg-gray-200 rounded-full mx-auto mb-4 overflow-hidden">
                                    <img src="http://static.photos/office/200x200/1" alt="Profile" class="w-full h-full object-cover">
                                </div>
                                <h2 class="text-2xl font-bold text-gray-900" id="previewName">Your Name</h2>
                                <p class="text-gray-600" id="previewTitle">Job Title</p>
                            </div>
                            
                            <div class="mb-6">
                                <h3 class="text-lg font-semibold text-gray-900 border-b border-gray-200 pb-1 mb-3">Contact</h3>
                                <div class="grid grid-cols-1 gap-2 text-sm">
                                    <p id="previewEmail">your.email@example.com</p>
                                    <p id="previewPhone">+1234567890</p>
                                    <p id="previewLinkedIn">linkedin.com/in/yourprofile</p>
                                    <p id="previewPortfolio">yourwebsite.com</p>
                                </div>
                            </div>
                            
                            <div class="mb-6">
                                <h3 class="text-lg font-semibold text-gray-900 border-b border-gray-200 pb-1 mb-3">Summary</h3>
                                <p class="text-sm text-gray-700" id="previewSummary">Professional summary will appear here...</p>
                            </div>
                            
                            <div class="mb-6">
                                <h3 class="text-lg font-semibold text-gray-900 border-b border-gray-200 pb-1 mb-3">Experience</h3>
                                <div class="space-y-4">
                                    <div>
                                        <div class="flex justify-between">
                                            <p class="font-medium text-gray-900">Job Title</p>
                                            <p class="text-sm text-gray-600">2020 - Present</p>
                                        </div>
                                        <p class="text-sm text-gray-600 mb-1">Company Name</p>
                                        <p class="text-sm text-gray-700">Job description and achievements will appear here...</p>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="mb-6">
                                <h3 class="text-lg font-semibold text-gray-900 border-b border-gray-200 pb-1 mb-3">Education</h3>
                                <div class="space-y-4">
                                    <div>
                                        <div class="flex justify-between">
                                            <p class="font-medium text-gray-900">Degree</p>
                                            <p class="text-sm text-gray-600">2016 - 2020</p>
                                        </div>
                                        <p class="text-sm text-gray-600">Institution</p>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h3 class="text-lg font-semibold text-gray-900 border-b border-gray-200 pb-1 mb-3">Skills</h3>
                                <div class="flex flex-wrap gap-2">
                                    <span class="bg-gray-100 text-gray-800 px-2 py-1 rounded text-xs">Skill 1</span>
                                    <span class="bg-gray-100 text-gray-800 px-2 py-1 rounded text-xs">Skill 2</span>
                                    <span class="bg-gray-100 text-gray-800 px-2 py-1 rounded text-xs">Skill 3</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-white rounded-xl shadow-sm p-6">
                        <h3 class="text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2">
                            <i data-feather="bar-chart-2" class="w-5 h-5 text-blue-600"></i>
                            <span id="insightsTitle">Market Insights</span>
                        </h3>
                        
                        <div class="space-y-4">
                            <div>
                                <h4 class="font-medium text-gray-900 mb-2">Software Developer Salaries (UAE)</h4>
                                <div class="bg-gray-100 rounded-lg p-3">
                                    <div class="flex justify-between text-sm mb-1">
                                        <span>Entry Level</span>
                                        <span>12,000 - 18,000 AED/mo</span>
                                    </div>
                                    <div class="flex justify-between text-sm mb-1">
                                        <span>Mid-Level</span>
                                        <span>18,000 - 30,000 AED/mo</span>
                                    </div>
                                    <div class="flex justify-between text-sm">
                                        <span>Senior</span>
                                        <span>30,000 - 45,000 AED/mo</span>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="font-medium text-gray-900 mb-2">Top In-Demand Skills</h4>
                                <div class="flex flex-wrap gap-2">
                                    <span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">JavaScript</span>
                                    <span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">React</span>
                                    <span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">Node.js</span>
                                    <span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">AWS</span>
                                    <span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">Python</span>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="font-medium text-gray-900 mb-2">ATS Optimization Score</h4>
                                <div class="bg-gray-100 rounded-lg p-3">
                                    <div class="flex items-center gap-3">
                                        <div class="w-full bg-gray-200 rounded-full h-2.5">
                                            <div class="bg-green-600 h-2.5 rounded-full" style="width: 65%"></div>
                                        </div>
                                        <span class="text-sm font-medium">65%</span>
                                    </div>
                                    <p class="text-xs text-gray-600 mt-2" id="atsFeedback">Add more measurable achievements and industry keywords to improve your score.</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Payment Modal -->
    <div id="paymentModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-xl p-8 w-full max-w-md mx-4">
            <div class="flex justify-between items-center mb-6">
                <h3 class="text-2xl font-bold text-gray-800">Upgrade to Premium</h3>
                <button id="closePaymentModal" class="text-gray-500 hover:text-gray-700">
                    <i data-feather="x"></i>
                </button>
            </div>
            
            <div class="bg-blue-50 p-4 rounded-lg mb-6">
                <div class="flex items-start gap-3">
                    <div class="bg-blue-100 p-2 rounded-full">
                        <i data-feather="star" class="w-5 h-5 text-blue-600"></i>
                    </div>
                    <div>
                        <h4 class="font-medium text-gray-900 mb-1">Premium Benefits</h4>
                        <ul class="text-sm text-gray-700 space-y-1">
                            <li class="flex items-center gap-2"><i data-feather="check" class="w-4 h-4 text-green-500"></i> Unlimited resume downloads</li>
                            <li class="flex items-center gap-2"><i data-feather="check" class="w-4 h-4 text-green-500"></i> Advanced AI optimization</li>
                            <li class="flex items-center gap-2"><i data-feather="check" class="w-4 h-4 text-green-500"></i> Priority support</li>
                            <li class="flex items-center gap-2"><i data-feather="check" class="w-4 h-4 text-green-500"></i> Cover letter generator</li>
                        </ul>
                    </div>
                </div>
            </div>
            
            <div class="space-y-4 mb-6">
                <div class="flex items-center justify-between p-4 border border-gray-200 rounded-lg">
                    <div>
                        <h4 class="font-medium text-gray-900">Monthly Plan</h4>
                        <p class="text-sm text-gray-600">Billed monthly, cancel anytime</p>
                    </div>
                    <div class="text-right">
                        <p class="font-bold text-gray-900">19 AED</p>
                        <p class="text-sm text-gray-600">per month</p>
                    </div>
                </div>
            </div>
            
            <button id="proceedToPayment" class="w-full bg-blue-600 text-white py-3 px-4 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 font-medium">
                Proceed to Payment
            </button>
            
            <p class="text-center text-sm text-gray-500 mt-4">Secure payment powered by Stripe</p>
        </div>
    </div>

    <script>
        // Firebase Configuration
        const firebaseConfig = {
            apiKey: "AIzaSyDEXAMPLE1234567890abcdefghijklmnopq",
            authDomain: "resumerocket-12345.firebaseapp.com",
            projectId: "resumerocket-12345",
            storageBucket: "resumerocket-12345.appspot.com",
            messagingSenderId: "123456789012",
            appId: "1:123456789012:web:abcdefghijklmnopqrstuv"
        };
        
        // Initialize Firebase
        firebase.initializeApp(firebaseConfig);
        const db = firebase.firestore();
        
        // Language Toggle
        let currentLanguage = 'en';
        const languageSwitch = document.getElementById('languageSwitch');
        const currentLangDisplay = document.getElementById('currentLang');
        
        languageSwitch.addEventListener('click', () => {
            currentLanguage = currentLanguage === 'en' ? 'ar' : 'en';
            currentLangDisplay.textContent = currentLanguage === 'en' ? 'EN' : 'AR';
            document.documentElement.lang = currentLanguage;
            document.documentElement.dir = currentLanguage === 'ar' ? 'rtl' : 'ltr';
            
            // Update all translatable elements
            updateLanguage();
        });
        
        function updateLanguage() {
            const translations = {
                en: {
                    builderTitle: "Build Your Resume",
                    personalInfoTitle: "Personal Information",
                    fullNameLabel: "Full Name",
                    jobTitleLabel: "Job Title",
                    emailLabel: "Email",
                    phoneLabel: "Phone",
                    summaryTitle: "Professional Summary",
                    experienceTitle: "Work Experience",
                    educationTitle: "Education",
                    skillsTitle: "Skills",
                    previewTitle: "Resume Preview",
                    insightsTitle: "Market Insights",
                    backBtnText: "Back",
                    nextBtnText: "Next: Choose Template",
                    atsFeedback: "Add more measurable achievements and industry keywords to improve your score."
                },
                ar: {
                    builderTitle: "أنشئ سيرتك الذاتية",
                    personalInfoTitle: "المعلومات الشخصية",
                    fullNameLabel: "الاسم الكامل",
                    jobTitleLabel: "المسمى الوظيفي",
                    emailLabel: "البريد الإلكتروني",
                    phoneLabel: "الهاتف",
                    summaryTitle: "ملخص مهني",
                    experienceTitle: "الخبرة العملية",
                    educationTitle: "التعليم",
                    skillsTitle: "المهارات",
                    previewTitle: "معاينة السيرة الذاتية",
                    insightsTitle: "رؤى السوق",
                    backBtnText: "السابق",
                    nextBtnText: "التالي: اختر نموذجًا",
                    atsFeedback: "أضف المزيد من الإنجازات القابلة للقياس والكلمات الرئيسية في المجال لتحسين درجتك."
                }
            };
            
            const currentTranslations = translations[currentLanguage];
            for (const [key, value] of Object.entries(currentTranslations)) {
                const element = document.getElementById(key);
                if (element) {
                    element.textContent = value;
                    if (currentLanguage === 'ar' && !element.classList.contains('arabic-font')) {
                        element.classList.add('arabic-font');
                    } else if (currentLanguage === 'en' && element.classList.contains('arabic-font')) {
                        element.classList.remove('arabic-font');
                    }
                }
            }
        }
        
        // Experience Section
        const addExperienceBtn = document.getElementById('addExperienceBtn');
        const experienceContainer = document.getElementById('experienceContainer');
        
        addExperienceBtn.addEventListener('click', () => {
            const newExperience = document.createElement('div');
            newExperience.className = 'experience-item bg-gray-50 p-4 rounded-lg mb-4';
            newExperience.innerHTML = `
                <div class="flex justify-between">
                    <div>
                        <input type="text" class="font-medium text-gray-900 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none mb-1" placeholder="Job Title">
                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm" placeholder="Company Name">
                    </div>
                    <div class="flex items-center gap-2">
                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="Start">
                        <span>-</span>
                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="End">
                    </div>
                </div>
                <div class="mt-3">
                    <textarea rows="3" class="w-full px-2 py-1 border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 text-sm" placeholder="Describe your responsibilities and achievements"></textarea>
                    <button class="ai-enhance-btn text-blue-600 text-xs font-medium flex items-center gap-1 mt-1">
                        <i data-feather="zap" class="w-3 h-3"></i>
                        <span>AI Enhance</span>
                    </button>
                </div>
                <button class="remove-experience text-red-500 text-xs font-medium flex items-center gap-1 mt-2">
                    <i data-feather="trash-2" class="w-3 h-3"></i>
                    <span>Remove</span>
                </button>
            `;
            experienceContainer.appendChild(newExperience);
            feather.replace();
            
            // Add event listener to the new remove button
            const removeBtn = newExperience.querySelector('.remove-experience');
            removeBtn.addEventListener('click', () => {
                experienceContainer.removeChild(newExperience);
            });
            
            // Add event listener to AI enhance button
            const aiEnhanceBtn = newExperience.querySelector('.ai-enhance-btn');
            aiEnhanceBtn.addEventListener('click', () => {
                const textarea = newExperience.querySelector('textarea');
                textarea.value = "AI-enhanced description with measurable achievements and industry-specific keywords...";
            });
        });
        
        // Education Section
        const addEducationBtn = document.getElementById('addEducationBtn');
        const educationContainer = document.getElementById('educationContainer');
        
        addEducationBtn.addEventListener('click', () => {
            const newEducation = document.createElement('div');
            newEducation.className = 'education-item bg-gray-50 p-4 rounded-lg mb-4';
            newEducation.innerHTML = `
                <div class="flex justify-between">
                    <div>
                        <input type="text" class="font-medium text-gray-900 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none mb-1" placeholder="Degree">
                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm" placeholder="Institution">
                    </div>
                    <div class="flex items-center gap-2">
                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="Start">
                        <span>-</span>
                        <input type="text" class="text-gray-600 bg-transparent border-b border-transparent focus:border-gray-300 focus:outline-none text-sm w-20" placeholder="End">
                    </div>
                </div>
                <button class="remove-education text-red-500 text-xs font-medium flex items-center gap-1 mt-2">
                    <i data-feather="trash-2" class="w-3 h-3"></i>
                    <span>Remove</span>
                </button>
            `;
            educationContainer.appendChild(newEducation);
            feather.replace();
            
            // Add event listener to the new remove button
            const removeBtn = newEducation.querySelector('.remove-education');
            removeBtn.addEventListener('click', () => {
                educationContainer.removeChild(newEducation);
            });
        });
        
        // Skills Section
        const addSkillBtn = document.getElementById('addSkillBtn');
        const skillsContainer = document.getElementById('skillsContainer');
        const addSkillInput = document.getElementById('addSkillInput');
        const newSkillInput = document.getElementById('newSkillInput');
        const saveSkillBtn = document.getElementById('saveSkillBtn');
        const cancelSkillBtn = document.getElementById('cancelSkillBtn');
        const aiSuggestSkillsBtn = document.getElementById('aiSuggestSkillsBtn');
        
        addSkillBtn.addEventListener('click', () => {
            addSkillBtn.classList.add('hidden');
            addSkillInput.classList.remove('hidden');
            newSkillInput.focus();
        });
        
        cancelSkillBtn.addEventListener('click', () => {
            addSkillInput.classList.add('hidden');
            addSkillBtn.classList.remove('hidden');
            newSkillInput.value = '';
        });
        
        saveSkillBtn.addEventListener('click', () => {
            const skill = newSkillInput.value.trim();
            if (skill) {
                const skillTag = document.createElement('div');
                skillTag.className = 'skill-tag bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center gap-1';
                skillTag.innerHTML = `
                    <span>${skill}</span>
                    <button class="remove-skill text-blue-600 hover:text-blue-800">
                        <i data-feather="x" class="w-3 h-3"></i>
                    </button>
                `;
                skillsContainer.insertBefore(skillTag, addSkillBtn);
                feather.replace();
                
                // Add event listener to remove button
                const removeBtn = skillTag.querySelector('.remove-skill');
                removeBtn.addEventListener('click', () => {
                    skillsContainer.removeChild(skillTag);
                });
                
                newSkillInput.value = '';
            }
            addSkillInput.classList.add('hidden');
            addSkillBtn.classList.remove('hidden');
        });
        
        aiSuggestSkillsBtn.addEventListener('click', () => {
            const suggestedSkills = ['JavaScript', 'React', 'Node.js', 'Python', 'CSS', 'HTML', 'Git', 'AWS'];
            suggestedSkills.forEach(skill => {
                if (!Array.from(skillsContainer.querySelectorAll('.skill-tag span')).some(el => el.textContent === skill)) {
                    const skillTag = document.createElement('div');
                    skillTag.className = 'skill-tag bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center gap-1';
                    skillTag.innerHTML = `
                        <span>${skill}</span>
                        <button class="remove-skill text-blue-600 hover:text-blue-800">
                            <i data-feather="x" class="w-3 h-3"></i>
                        </button>
                    `;
                    skillsContainer.insertBefore(skillTag, addSkillBtn);
                    
                    // Add event listener to remove button
                    const removeBtn = skillTag.querySelector('.remove-skill');
                    removeBtn.addEventListener('click', () => {
                        skillsContainer.removeChild(skillTag);
                    });
                }
            });
            feather.replace();
        });
        
        // Job Role Dropdown
        const jobRoleDropdownBtn = document.getElementById('jobRoleDropdownBtn');
        const jobRoleDropdown = document.getElementById('jobRoleDropdown');
        const selectedJobRole = document.getElementById('selectedJobRole');
        
        jobRoleDropdownBtn.addEventListener('click', () => {
            jobRoleDropdown.classList.toggle('hidden');
        });
        
        document.querySelectorAll('.job-role-option').forEach(option => {
            option.addEventListener('click', () => {
                selectedJobRole.textContent = option.getAttribute('data-role');
                jobRoleDropdown.classList.add('hidden');
            });
        });
        
        // Tone Dropdown
        const toneDropdownBtn = document.getElementById('toneDropdownBtn');
        const selectedTone = document.getElementById('selectedTone');
        const aiGenerateSummaryBtn = document.getElementById('aiGenerateSummaryBtn');
        const professionalSummary = document.getElementById('professionalSummary');
        
        aiGenerateSummaryBtn.addEventListener('click', () => {
            const tones = {
                'Formal': "Results-driven professional with extensive experience in [field]. Adept at [key skills]. Seeking to leverage expertise in [specific area] to contribute to [company goals].",
                'Confident': "Seasoned [profession] with a proven track record in [achievements]. Passionate about [industry aspects]. Ready to bring [specific skills] to drive success at [company].",
                'Creative': "Innovative [profession] with a flair for [creative aspects]. Specializing in [unique skills]. Excited to collaborate with like-minded teams to create [impactful results]."
            };
            
            professionalSummary.value = tones[selectedTone.textContent] || tones['Formal'];
        });
        
        // Template Selection
        document.querySelectorAll('.template-selector input').forEach(radio => {
            radio.addEventListener('change', () => {
                if (radio.checked) {
                    // Update preview styling based on selected template
                    const preview = document.querySelector('.resume-preview');
                    preview.className = 'resume-preview bg-white p-6 rounded-lg border border-gray-200';
                    
                    if (radio.id === 'template1') {
                        // Executive template styling
                    } else if (radio.id === 'template2') {
                        // Creative template styling
                        preview.classList.add('bg-gray-50');
                    } else if (radio.id === 'template3') {
                        // Technical template styling
                        preview.classList.add('bg-gray-100');
                    }
                }
            });
        });
        
        // Form Input Updates to Preview
        document.getElementById('fullName').addEventListener('input', (e) => {
            document.getElementById('previewName').textContent = e.target.value || 'Your Name';
        });
        
        document.getElementById('jobTitle').addEventListener('input', (e) => {
            document.getElementById('previewTitle').textContent = e.target.value || 'Job Title';
        });
        
        document.getElementById('email').addEventListener('input', (e) => {
            document.getElementById('previewEmail').textContent = e.target.value || 'your.email@example.com';
        });
        
        document.getElementById('phone').addEventListener('input', (e) => {
            document.getElementById('previewPhone').textContent = e.target.value || '+1234567890';
        });
        
        document.getElementById('linkedin').addEventListener('input', (e) => {
            document.getElementById('previewLinkedIn').textContent = e.target.value ? e.target.value.replace('https://', '') : 'linkedin.com/in/yourprofile';
        });
        
        document.getElementById('portfolio').addEventListener('input', (e) => {
            document.getElementById('previewPortfolio').textContent = e.target.value ? e.target.value.replace('https://', '') : 'yourwebsite.com';
        });
        
        document.getElementById('professionalSummary').addEventListener('input', (e) => {
            document.getElementById('previewSummary').textContent = e.target.value || 'Professional summary will appear here...';
        });
        
        // Payment Modal
        const premiumBtn = document.getElementById('premiumBtn');
        const paymentModal = document.getElementById('paymentModal');
        const closePaymentModal = document.getElementById('closePaymentModal');
        
        premiumBtn.addEventListener('click', () => {
            paymentModal.classList.remove('hidden');
            document.body.style.overflow = 'hidden';
        });
        
        closePaymentModal.addEventListener('click', () => {
            paymentModal.classList.add('hidden');
            document.body.style.overflow = 'auto';
        });
        
        document.getElementById('proceedToPayment').addEventListener('click', () => {
            alert('Payment processing would be implemented here with Stripe integration');
            paymentModal.classList.add('hidden');
            document.body.style.overflow = 'auto';
        });
        
        // Logout
        document.getElementById('logoutBtn').addEventListener('click', () => {
            firebase.auth().signOut().then(() => {
                window.location.href = 'index.html';
            });
        });
        
        // Initialize Feather Icons
        document.addEventListener('DOMContentLoaded', () => {
            feather.replace();
            
            // Check auth state
            firebase.auth().onAuthStateChanged((user) => {
                if (!user) {
                    window.location.href = 'index.html';
                } else {
                    // Set user's name if available
                    if (user.displayName) {
                        document.getElementById('fullName').value = user.displayName;
                        document.getElementById('previewName').textContent = user.displayName;
                    }
                    if (user.email) {
                        document.getElementById('email').value = user.email;
                        document.getElementById('previewEmail').textContent = user.email;
                    }
                }
            });
        });
    </script>
</body>
</html>