File size: 71,892 Bytes
735f0be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vision Quest - AI Goal Generator</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/jspdf/2.5.1/jspdf.umd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.28/jspdf.plugin.autotable.min.js"></script>
    <style>
        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }
        .floating {
            animation: float 3s ease-in-out infinite;
        }
        .progress-ring__circle {
            transition: stroke-dashoffset 0.5s;
            transform: rotate(-90deg);
            transform-origin: 50% 50%;
        }
        .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);
        }
        .fade-in {
            animation: fadeIn 0.5s ease-in;
        }
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .loading-dots:after {
            content: '.';
            animation: dots 1.5s steps(5, end) infinite;
        }
        @keyframes dots {
            0%, 20% { content: '.'; }
            40% { content: '..'; }
            60% { content: '...'; }
            80%, 100% { content: ''; }
        }
        @keyframes gradientFlow {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .gradient-flow {
            background-size: 200% 200%;
            animation: gradientFlow 8s ease infinite;
        }
        @keyframes shimmer {
            0% { background-position: -1000px 0; }
            100% { background-position: 1000px 0; }
        }
        .shimmer {
            background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
            background-size: 1000px 100%;
            animation: shimmer 2s infinite linear;
        }
        .goal-card {
            transition: all 0.3s ease;
            transform-style: preserve-3d;
        }
        .goal-card:hover {
            transform: perspective(1000px) rotateY(10deg) scale(1.02);
        }
        .goal-timeline {
            position: relative;
        }
        .goal-timeline::before {
            content: '';
            position: absolute;
            top: 0;
            left: 24px;
            height: 100%;
            width: 2px;
            background: linear-gradient(to bottom, #8b5cf6, #3b82f6, #10b981);
        }
        .goal-timeline-item {
            position: relative;
            padding-left: 56px;
            margin-bottom: 30px;
        }
        .goal-timeline-item::before {
            content: '';
            position: absolute;
            left: 20px;
            top: 0;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #8b5cf6;
            z-index: 1;
        }
        .goal-timeline-item:nth-child(2)::before {
            background: #3b82f6;
        }
        .goal-timeline-item:nth-child(3)::before {
            background: #10b981;
        }
    </style>
</head>
<body class="bg-gradient-to-br from-indigo-50 to-purple-50 min-h-screen">
    <div class="container mx-auto px-4 py-8">
        <!-- Header -->
        <header class="text-center mb-12">
            <div class="flex justify-center mb-4">
                <div class="bg-gradient-to-r from-purple-500 to-indigo-600 p-3 rounded-full floating">
                    <i class="fas fa-bullseye text-white text-3xl"></i>
                </div>
            </div>
            <h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-2">Vision Quest</h1>
            <p class="text-xl text-gray-600">Your AI-powered goal generation engine</p>
        </header>

        <!-- Main App Container -->
        <div class="bg-white rounded-2xl shadow-xl overflow-hidden">
            <!-- Progress Tracker -->
            <div class="bg-indigo-600 text-white px-6 py-4 flex items-center justify-between">
                <div class="flex items-center space-x-2">
                    <div class="w-8 h-8 rounded-full bg-white text-indigo-600 flex items-center justify-center font-bold">1</div>
                    <span>Input Your Vision</span>
                </div>
                <div class="flex items-center space-x-2 opacity-50">
                    <div class="w-8 h-8 rounded-full bg-indigo-500 text-white flex items-center justify-center font-bold">2</div>
                    <span>Generate Goals</span>
                </div>
                <div class="flex items-center space-x-2 opacity-50">
                    <div class="w-8 h-8 rounded-full bg-indigo-500 text-white flex items-center justify-center font-bold">3</div>
                    <span>Action Plan</span>
                </div>
            </div>

            <!-- Input Section -->
            <div class="p-6 md:p-8">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                    <!-- Vision Input -->
                    <div class="bg-gradient-to-br from-purple-50 to-indigo-50 p-6 rounded-xl">
                        <h2 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-eye mr-3 text-purple-500"></i> Your Vision/Why
                        </h2>
                        <textarea id="visionInput" class="w-full h-32 p-4 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" placeholder="What is your ultimate vision? Why does this matter to you?"></textarea>
                        <div class="mt-2 text-sm text-gray-500">Example: "To build a sustainable business that empowers creative professionals while maintaining work-life harmony."</div>
                    </div>

                    <!-- Values Input -->
                    <div class="bg-gradient-to-br from-blue-50 to-cyan-50 p-6 rounded-xl">
                        <h2 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-heart mr-3 text-blue-500"></i> Core Values (3-5)
                        </h2>
                        <div id="valuesContainer">
                            <div class="flex mb-2">
                                <input type="text" class="value-input flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" placeholder="Value 1">
                                <button class="remove-value bg-blue-500 text-white px-4 rounded-r-lg hover:bg-blue-600 transition"><i class="fas fa-check"></i></button>
                            </div>
                        </div>
                        <button id="addValueBtn" class="mt-2 bg-blue-100 text-blue-600 px-4 py-2 rounded-lg hover:bg-blue-200 transition flex items-center">
                            <i class="fas fa-plus mr-2"></i> Add Value
                        </button>
                    </div>
                </div>

                <!-- Income Planning -->
                <div class="mt-8 bg-gradient-to-br from-amber-50 to-orange-50 p-6 rounded-xl">
                    <h2 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-money-bill-wave mr-3 text-amber-500"></i> Income Strategy
                    </h2>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <h3 class="text-lg font-semibold text-gray-700 mb-3">Current Income Streams</h3>
                            <div id="currentIncomeContainer">
                                <div class="flex mb-2">
                                    <input type="text" class="income-input flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-amber-500 focus:border-transparent" placeholder="Income source">
                                    <button class="remove-income bg-amber-500 text-white px-4 rounded-r-lg hover:bg-amber-600 transition"><i class="fas fa-check"></i></button>
                                </div>
                            </div>
                            <button id="addCurrentIncomeBtn" class="mt-2 bg-amber-100 text-amber-600 px-4 py-2 rounded-lg hover:bg-amber-200 transition flex items-center">
                                <i class="fas fa-plus mr-2"></i> Add Income Source
                            </button>
                        </div>
                        
                        <div>
                            <h3 class="text-lg font-semibold text-gray-700 mb-3">Planned Income Streams</h3>
                            <div id="plannedIncomeContainer">
                                <div class="flex mb-2">
                                    <input type="text" class="planned-input flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-amber-500 focus:border-transparent" placeholder="Planned income">
                                    <button class="remove-planned bg-amber-500 text-white px-4 rounded-r-lg hover:bg-amber-600 transition"><i class="fas fa-check"></i></button>
                                </div>
                            </div>
                            <button id="addPlannedIncomeBtn" class="mt-2 bg-amber-100 text-amber-600 px-4 py-2 rounded-lg hover:bg-amber-200 transition flex items-center">
                                <i class="fas fa-plus mr-2"></i> Add Planned Income
                            </button>
                        </div>
                    </div>
                </div>

                <!-- Long-term Goals -->
                <div class="mt-8 bg-gradient-to-br from-green-50 to-teal-50 p-6 rounded-xl">
                    <h2 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-mountain mr-3 text-green-500"></i> Long-term Goals
                    </h2>
                    
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <h3 class="text-lg font-semibold text-gray-700 mb-3">10-Year Goals</h3>
                            <div id="tenYearGoals">
                                <div class="flex mb-2">
                                    <input type="text" class="goal-10y flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-green-500 focus:border-transparent" placeholder="Big audacious goal">
                                    <button class="remove-10y bg-green-500 text-white px-4 rounded-r-lg hover:bg-green-600 transition"><i class="fas fa-check"></i></button>
                                </div>
                            </div>
                            <button id="addTenYearGoalBtn" class="mt-2 bg-green-100 text-green-600 px-4 py-2 rounded-lg hover:bg-green-200 transition flex items-center">
                                <i class="fas fa-plus mr-2"></i> Add Goal
                            </button>
                        </div>
                        
                        <div>
                            <h3 class="text-lg font-semibold text-gray-700 mb-3">3-Year Goals</h3>
                            <div id="threeYearGoals">
                                <div class="flex mb-2">
                                    <input type="text" class="goal-3y flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-green-500 focus:border-transparent" placeholder="Milestone goal">
                                    <button class="remove-3y bg-green-500 text-white px-4 rounded-r-lg hover:bg-green-600 transition"><i class="fas fa-check"></i></button>
                                </div>
                            </div>
                            <button id="addThreeYearGoalBtn" class="mt-2 bg-green-100 text-green-600 px-4 py-2 rounded-lg hover:bg-green-200 transition flex items-center">
                                <i class="fas fa-plus mr-2"></i> Add Goal
                            </button>
                        </div>
                    </div>
                </div>

                <!-- Generate Button -->
                <div class="mt-10 text-center">
                    <button id="generateBtn" class="bg-gradient-to-r from-purple-500 to-indigo-600 text-white px-8 py-4 rounded-full text-lg font-bold shadow-lg hover:shadow-xl transition-all transform hover:scale-105">
                        <i class="fas fa-magic mr-2"></i> Generate My Action Plan
                    </button>
                </div>
            </div>
        </div>

        <!-- Loading Screen (Initially Hidden) -->
        <div id="loadingScreen" class="hidden fixed inset-0 bg-black bg-opacity-70 z-50 flex flex-col items-center justify-center p-4">
            <div class="w-full max-w-2xl bg-white rounded-2xl shadow-2xl overflow-hidden">
                <div class="gradient-flow bg-gradient-to-r from-purple-500 via-indigo-500 to-blue-500 p-6 text-center">
                    <h2 class="text-3xl font-bold text-white mb-2">Crafting Your Vision</h2>
                    <p class="text-white opacity-90">Your personalized roadmap is being generated with AI</p>
                </div>
                
                <div class="p-8">
                    <div class="flex justify-center mb-8">
                        <div class="relative w-32 h-32">
                            <svg class="w-full h-full" viewBox="0 0 100 100">
                                <circle class="text-gray-200" stroke-width="8" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
                                <circle class="text-indigo-600 progress-ring__circle" stroke-width="8" stroke-linecap="round" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
                            </svg>
                            <div class="absolute inset-0 flex items-center justify-center">
                                <span id="progressPercent" class="text-2xl font-bold text-indigo-600">0%</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="space-y-6">
                        <div class="flex items-center">
                            <div class="flex-shrink-0 h-10 w-10 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-4">
                                <i class="fas fa-lightbulb"></i>
                            </div>
                            <div class="flex-1">
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">Analyzing your vision</span>
                                    <span id="visionProgress" class="text-sm font-medium text-indigo-600">0%</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div id="visionProgressBar" class="bg-indigo-600 h-2 rounded-full" style="width: 0%"></div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="flex items-center">
                            <div class="flex-shrink-0 h-10 w-10 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center mr-4">
                                <i class="fas fa-bullseye"></i>
                            </div>
                            <div class="flex-1">
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">Generating goals</span>
                                    <span id="goalsProgress" class="text-sm font-medium text-blue-600">0%</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div id="goalsProgressBar" class="bg-blue-600 h-2 rounded-full" style="width: 0%"></div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="flex items-center">
                            <div class="flex-shrink-0 h-10 w-10 rounded-full bg-green-100 text-green-600 flex items-center justify-center mr-4">
                                <i class="fas fa-tasks"></i>
                            </div>
                            <div class="flex-1">
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">Creating action plan</span>
                                    <span id="actionProgress" class="text-sm font-medium text-green-600">0%</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div id="actionProgressBar" class="bg-green-600 h-2 rounded-full" style="width: 0%"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="mt-8 text-center">
                        <p id="loadingMessage" class="text-gray-600 italic">"Great things are done by a series of small things brought together." - Vincent Van Gogh</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- Results Section (Initially Hidden) -->
        <div id="resultsSection" class="hidden mt-12 bg-white rounded-2xl shadow-xl overflow-hidden fade-in">
            <div class="bg-indigo-600 text-white px-6 py-4 flex items-center justify-between">
                <div class="flex items-center space-x-2">
                    <div class="w-8 h-8 rounded-full bg-white text-indigo-600 flex items-center justify-center font-bold">1</div>
                    <span>Input Your Vision</span>
                </div>
                <div class="flex items-center space-x-2">
                    <div class="w-8 h-8 rounded-full bg-white text-indigo-600 flex items-center justify-center font-bold">2</div>
                    <span>Generate Goals</span>
                </div>
                <div class="flex items-center space-x-2 opacity-50">
                    <div class="w-8 h-8 rounded-full bg-indigo-500 text-white flex items-center justify-center font-bold">3</div>
                    <span>Action Plan</span>
                </div>
            </div>

            <div class="p-6 md:p-8">
                <h2 class="text-3xl font-bold text-gray-800 mb-6 text-center">Your Custom Goal Roadmap</h2>
                
                <!-- Identity Section -->
                <div class="mb-10 bg-gradient-to-br from-yellow-50 to-orange-50 p-6 rounded-xl">
                    <h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-user-shield mr-3 text-yellow-500"></i> Identity Statement
                    </h3>
                    <div id="identityOutput" class="text-lg text-gray-700 italic">"I am a Visionary Executor who consistently takes aligned action toward meaningful goals."</div>
                </div>

                <!-- Goals Showcase -->
                <div class="mb-10">
                    <h3 class="text-2xl font-bold text-gray-800 mb-6 text-center">Your Goal Timeline</h3>
                    
                    <div class="goal-timeline">
                        <!-- 1-Year Goal -->
                        <div class="goal-timeline-item">
                            <div class="goal-card bg-gradient-to-br from-purple-50 to-indigo-50 p-6 rounded-xl shadow-md">
                                <div class="flex justify-between items-start mb-3">
                                    <div>
                                        <div class="text-xs font-semibold text-purple-600 mb-1">YEARLY MILESTONE</div>
                                        <h4 class="text-xl font-bold text-gray-800">1-Year Goal</h4>
                                    </div>
                                    <div class="flex items-center justify-center w-12 h-12 rounded-full bg-purple-100 text-purple-600">
                                        <i class="fas fa-calendar-star text-xl"></i>
                                    </div>
                                </div>
                                <div id="oneYearGoal" class="text-gray-700 mb-4 text-lg">Launch MVP of the product and acquire first 100 paying customers.</div>
                                <div class="flex justify-between items-center">
                                    <div class="w-full bg-gray-200 rounded-full h-2">
                                        <div class="bg-purple-600 h-2 rounded-full" style="width: 15%"></div>
                                    </div>
                                    <span class="ml-3 text-sm font-medium text-purple-600">15%</span>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 90-Day Goal -->
                        <div class="goal-timeline-item">
                            <div class="goal-card bg-gradient-to-br from-blue-50 to-cyan-50 p-6 rounded-xl shadow-md">
                                <div class="flex justify-between items-start mb-3">
                                    <div>
                                        <div class="text-xs font-semibold text-blue-600 mb-1">QUARTERLY TARGET</div>
                                        <h4 class="text-xl font-bold text-gray-800">90-Day Goal</h4>
                                    </div>
                                    <div class="flex items-center justify-center w-12 h-12 rounded-full bg-blue-100 text-blue-600">
                                        <i class="fas fa-calendar-check text-xl"></i>
                                    </div>
                                </div>
                                <div id="ninetyDayGoal" class="text-gray-700 mb-4 text-lg">Complete product prototype and run first beta test with 20 users.</div>
                                <div class="flex justify-between items-center">
                                    <div class="w-full bg-gray-200 rounded-full h-2">
                                        <div class="bg-blue-600 h-2 rounded-full" style="width: 5%"></div>
                                    </div>
                                    <span class="ml-3 text-sm font-medium text-blue-600">5%</span>
                                </div>
                            </div>
                        </div>
                        
                        <!-- Monthly Goals -->
                        <div class="goal-timeline-item">
                            <div class="goal-card bg-gradient-to-br from-green-50 to-teal-50 p-6 rounded-xl shadow-md">
                                <div class="flex justify-between items-start mb-3">
                                    <div>
                                        <div class="text-xs font-semibold text-green-600 mb-1">MONTHLY ACTIONS</div>
                                        <h4 class="text-xl font-bold text-gray-800">Monthly Goals</h4>
                                    </div>
                                    <div class="flex items-center justify-center w-12 h-12 rounded-full bg-green-100 text-green-600">
                                        <i class="fas fa-calendar-alt text-xl"></i>
                                    </div>
                                </div>
                                <div id="monthlyGoals" class="text-gray-700 mb-4">
                                    <ul class="space-y-3">
                                        <li class="flex items-start">
                                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-green-100 text-green-600 flex items-center justify-center mr-3 mt-1">
                                                <span class="text-xs font-bold">1</span>
                                            </div>
                                            <div class="text-lg">Month 1: Finalize product specifications</div>
                                        </li>
                                        <li class="flex items-start">
                                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-green-100 text-green-600 flex items-center justify-center mr-3 mt-1">
                                                <span class="text-xs font-bold">2</span>
                                            </div>
                                            <div class="text-lg">Month 2: Develop core features</div>
                                        </li>
                                        <li class="flex items-start">
                                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-green-100 text-green-600 flex items-center justify-center mr-3 mt-1">
                                                <span class="text-xs font-bold">3</span>
                                            </div>
                                            <div class="text-lg">Month 3: Conduct initial user testing</div>
                                        </li>
                                    </ul>
                                </div>
                                <div class="flex justify-between items-center">
                                    <div class="w-full bg-gray-200 rounded-full h-2">
                                        <div class="bg-green-600 h-2 rounded-full" style="width: 2%"></div>
                                    </div>
                                    <span class="ml-3 text-sm font-medium text-green-600">2%</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Income Strategy Display -->
                <div class="mb-10 bg-gradient-to-br from-amber-50 to-orange-50 p-6 rounded-xl">
                    <h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-money-bill-trend-up mr-3 text-amber-500"></i> Income Strategy
                    </h3>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <h4 class="font-semibold text-gray-700 mb-2">Current Income Streams</h4>
                            <ul id="currentIncomeDisplay" class="space-y-2">
                                <li class="flex items-center">
                                    <div class="flex-shrink-0 h-5 w-5 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-3">
                                        <i class="fas fa-circle text-xs"></i>
                                    </div>
                                    <div class="text-gray-700">Freelance design work</div>
                                </li>
                                <li class="flex items-center">
                                    <div class="flex-shrink-0 h-5 w-5 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-3">
                                        <i class="fas fa-circle text-xs"></i>
                                    </div>
                                    <div class="text-gray-700">Online course sales</div>
                                </li>
                            </ul>
                        </div>
                        <div>
                            <h4 class="font-semibold text-gray-700 mb-2">Planned Income Streams</h4>
                            <ul id="plannedIncomeDisplay" class="space-y-2">
                                <li class="flex items-center">
                                    <div class="flex-shrink-0 h-5 w-5 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-3">
                                        <i class="fas fa-bolt text-xs"></i>
                                    </div>
                                    <div class="text-gray-700">SaaS product subscriptions</div>
                                </li>
                                <li class="flex items-center">
                                    <div class="flex-shrink-0 h-5 w-5 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-3">
                                        <i class="fas fa-bolt text-xs"></i>
                                    </div>
                                    <div class="text-gray-700">Consulting services</div>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="mt-4">
                        <h4 class="font-semibold text-gray-700 mb-2">Revenue Growth Strategy</h4>
                        <div id="revenueStrategy" class="text-gray-700 bg-white p-4 rounded-lg border border-amber-100">
                            Focus on productizing services and building scalable income streams through digital products and automation. Prioritize recurring revenue models while maintaining service-based income during transition.
                        </div>
                    </div>
                </div>

                <!-- Habits & Systems -->
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-10">
                    <!-- Habits -->
                    <div class="bg-gradient-to-br from-pink-50 to-rose-50 p-6 rounded-xl">
                        <h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-sync-alt mr-3 text-pink-500"></i> Key Habits
                        </h3>
                        <div id="habitsOutput" class="space-y-4">
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-pink-100 text-pink-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-sun"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">Morning Deep Work</h4>
                                    <p class="text-gray-600 text-sm">Daily 90-minute focused session on product development</p>
                                </div>
                            </div>
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-pink-100 text-pink-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-users"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">Customer Development</h4>
                                    <p class="text-gray-600 text-sm">Weekly interviews with potential customers</p>
                                </div>
                            </div>
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-pink-100 text-pink-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-brain"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">Mindful Planning</h4>
                                    <p class="text-gray-600 text-sm">Morning routine with meditation and daily planning</p>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Systems -->
                    <div class="bg-gradient-to-br from-amber-50 to-orange-50 p-6 rounded-xl">
                        <h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-cogs mr-3 text-amber-500"></i> Value Creation Systems
                        </h3>
                        <div id="systemsOutput" class="space-y-4">
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-rocket"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">Development Sprints</h4>
                                    <p class="text-gray-600 text-sm">2-week product development cycles with clear deliverables</p>
                                </div>
                            </div>
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-comments"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">Feedback Loop</h4>
                                    <p class="text-gray-600 text-sm">Structured process for collecting and analyzing user feedback</p>
                                </div>
                            </div>
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-battery-three-quarters"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">Energy Management</h4>
                                    <p class="text-gray-600 text-sm">Tracking system for personal productivity and energy levels</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Gamification -->
                <div class="bg-gradient-to-br from-indigo-50 to-purple-50 p-6 rounded-xl">
                    <h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-trophy mr-3 text-indigo-500"></i> Your Quest Progress
                    </h3>
                    <div class="flex items-center mb-4">
                        <div class="w-full bg-gray-200 rounded-full h-4">
                            <div class="bg-gradient-to-r from-purple-400 to-indigo-500 h-4 rounded-full" style="width: 15%"></div>
                        </div>
                        <span class="ml-4 text-gray-700 font-medium">15%</span>
                    </div>
                    <div class="grid grid-cols-3 gap-4 text-center">
                        <div>
                            <div class="bg-white p-3 rounded-lg shadow">
                                <div class="text-2xl font-bold text-indigo-600">3</div>
                                <div class="text-sm text-gray-500">Goals Set</div>
                            </div>
                        </div>
                        <div>
                            <div class="bg-white p-3 rounded-lg shadow">
                                <div class="text-2xl font-bold text-indigo-600">0</div>
                                <div class="text-sm text-gray-500">Goals Completed</div>
                            </div>
                        </div>
                        <div>
                            <div class="bg-white p-3 rounded-lg shadow">
                                <div class="text-2xl font-bold text-indigo-600">1</div>
                                <div class="text-sm text-gray-500">Badges Earned</div>
                            </div>
                        </div>
                    </div>
                    <div class="mt-6">
                        <h4 class="font-semibold text-gray-700 mb-2">Next Badge: <span class="text-indigo-600">Vision Setter</span></h4>
                        <p class="text-sm text-gray-600">Complete your first 90-day goal to unlock this badge!</p>
                    </div>
                </div>

                <!-- Action Buttons -->
                <div class="mt-10 flex flex-col md:flex-row justify-center space-y-4 md:space-y-0 md:space-x-6">
                    <button id="exportPdfBtn" class="bg-indigo-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-indigo-700 transition flex items-center justify-center">
                        <i class="fas fa-download mr-2"></i> Export PDF
                    </button>
                    <button id="exportCsvBtn" class="bg-white border border-indigo-600 text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-indigo-50 transition flex items-center justify-center">
                        <i class="fas fa-file-csv mr-2"></i> Export CSV
                    </button>
                    <button id="regenerateBtn" class="bg-white border border-gray-300 text-gray-700 px-6 py-3 rounded-lg font-medium hover:bg-gray-50 transition flex items-center justify-center">
                        <i class="fas fa-redo mr-2"></i> Regenerate
                    </button>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Initialize jsPDF
        const { jsPDF } = window.jspdf;
        
        document.addEventListener('DOMContentLoaded', function() {
            // API Key
            const DEEPSEEK_API_KEY = 'sk-0cce68e321854d11b01ee9227147a12d';
            
            // Track all inputs
            let userInputs = {
                vision: '',
                values: [],
                currentIncome: [],
                plannedIncome: [],
                tenYearGoals: [],
                threeYearGoals: []
            };
            
            // Add Value Field
            let valueCount = 1;
            document.getElementById('addValueBtn').addEventListener('click', function() {
                if (valueCount < 5) {
                    valueCount++;
                    const newValueField = document.createElement('div');
                    newValueField.className = 'flex mb-2';
                    newValueField.innerHTML = `
                        <input type="text" class="value-input flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" placeholder="Value ${valueCount}">
                        <button class="remove-value bg-blue-500 text-white px-4 rounded-r-lg hover:bg-blue-600 transition"><i class="fas fa-times"></i></button>
                    `;
                    document.getElementById('valuesContainer').appendChild(newValueField);
                    
                    // Add remove functionality
                    newValueField.querySelector('.remove-value').addEventListener('click', function() {
                        newValueField.remove();
                        valueCount--;
                    });
                } else {
                    alert('Maximum of 5 values allowed');
                }
            });
            
            // Add Current Income Field
            let currentIncomeCount = 1;
            document.getElementById('addCurrentIncomeBtn').addEventListener('click', function() {
                const newIncomeField = document.createElement('div');
                newIncomeField.className = 'flex mb-2';
                newIncomeField.innerHTML = `
                    <input type="text" class="income-input flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-amber-500 focus:border-transparent" placeholder="Income source ${currentIncomeCount}">
                    <button class="remove-income bg-amber-500 text-white px-4 rounded-r-lg hover:bg-amber-600 transition"><i class="fas fa-times"></i></button>
                `;
                document.getElementById('currentIncomeContainer').appendChild(newIncomeField);
                currentIncomeCount++;
                
                // Add remove functionality
                newIncomeField.querySelector('.remove-income').addEventListener('click', function() {
                    newIncomeField.remove();
                });
            });
            
            // Add Planned Income Field
            let plannedIncomeCount = 1;
            document.getElementById('addPlannedIncomeBtn').addEventListener('click', function() {
                const newPlannedField = document.createElement('div');
                newPlannedField.className = 'flex mb-2';
                newPlannedField.innerHTML = `
                    <input type="text" class="planned-input flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-amber-500 focus:border-transparent" placeholder="Planned income ${plannedIncomeCount}">
                    <button class="remove-planned bg-amber-500 text-white px-4 rounded-r-lg hover:bg-amber-600 transition"><i class="fas fa-times"></i></button>
                `;
                document.getElementById('plannedIncomeContainer').appendChild(newPlannedField);
                plannedIncomeCount++;
                
                // Add remove functionality
                newPlannedField.querySelector('.remove-planned').addEventListener('click', function() {
                    newPlannedField.remove();
                });
            });

            // Add 10-Year Goal Field
            let tenYearGoalCount = 1;
            document.getElementById('addTenYearGoalBtn').addEventListener('click', function() {
                if (tenYearGoalCount < 3) {
                    tenYearGoalCount++;
                    const newGoalField = document.createElement('div');
                    newGoalField.className = 'flex mb-2';
                    newGoalField.innerHTML = `
                        <input type="text" class="goal-10y flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-green-500 focus:border-transparent" placeholder="10-Year Goal ${tenYearGoalCount}">
                        <button class="remove-10y bg-green-500 text-white px-4 rounded-r-lg hover:bg-green-600 transition"><i class="fas fa-times"></i></button>
                    `;
                    document.getElementById('tenYearGoals').appendChild(newGoalField);
                    
                    // Add remove functionality
                    newGoalField.querySelector('.remove-10y').addEventListener('click', function() {
                        newGoalField.remove();
                        tenYearGoalCount--;
                    });
                } else {
                    alert('Maximum of 3 10-year goals allowed');
                }
            });

            // Add 3-Year Goal Field
            let threeYearGoalCount = 1;
            document.getElementById('addThreeYearGoalBtn').addEventListener('click', function() {
                if (threeYearGoalCount < 5) {
                    threeYearGoalCount++;
                    const newGoalField = document.createElement('div');
                    newGoalField.className = 'flex mb-2';
                    newGoalField.innerHTML = `
                        <input type="text" class="goal-3y flex-grow p-3 border border-gray-300 rounded-l-lg focus:ring-2 focus:ring-green-500 focus:border-transparent" placeholder="3-Year Goal ${threeYearGoalCount}">
                        <button class="remove-3y bg-green-500 text-white px-4 rounded-r-lg hover:bg-green-600 transition"><i class="fas fa-times"></i></button>
                    `;
                    document.getElementById('threeYearGoals').appendChild(newGoalField);
                    
                    // Add remove functionality
                    newGoalField.querySelector('.remove-3y').addEventListener('click', function() {
                        newGoalField.remove();
                        threeYearGoalCount--;
                    });
                } else {
                    alert('Maximum of 5 3-year goals allowed');
                }
            });

            // Generate Action Plan with AI
            document.getElementById('generateBtn').addEventListener('click', async function() {
                // Collect all user inputs
                userInputs.vision = document.getElementById('visionInput').value;
                
                // Collect values
                userInputs.values = [];
                document.querySelectorAll('.value-input').forEach(input => {
                    if (input.value.trim() !== '') {
                        userInputs.values.push(input.value.trim());
                    }
                });
                
                // Collect current income
                userInputs.currentIncome = [];
                document.querySelectorAll('.income-input').forEach(input => {
                    if (input.value.trim() !== '') {
                        userInputs.currentIncome.push(input.value.trim());
                    }
                });
                
                // Collect planned income
                userInputs.plannedIncome = [];
                document.querySelectorAll('.planned-input').forEach(input => {
                    if (input.value.trim() !== '') {
                        userInputs.plannedIncome.push(input.value.trim());
                    }
                });
                
                // Collect 10-year goals
                userInputs.tenYearGoals = [];
                document.querySelectorAll('.goal-10y').forEach(input => {
                    if (input.value.trim() !== '') {
                        userInputs.tenYearGoals.push(input.value.trim());
                    }
                });
                
                // Collect 3-year goals
                userInputs.threeYearGoals = [];
                document.querySelectorAll('.goal-3y').forEach(input => {
                    if (input.value.trim() !== '') {
                        userInputs.threeYearGoals.push(input.value.trim());
                    }
                });
                
                // Validate inputs
                if (!userInputs.vision || userInputs.values.length === 0) {
                    alert('Please enter your vision and at least one core value to continue');
                    return;
                }
                
                // Show loading screen
                const loadingScreen = document.getElementById('loadingScreen');
                loadingScreen.classList.remove('hidden');
                
                // Start progress animation
                simulateProgress();
                
                try {
                    // Call DeepSeek API to generate the identity statement
                    const identityPrompt = `Create an "I am" identity statement based on this vision: "${userInputs.vision}" and these values: ${userInputs.values.join(', ')}. The statement should be in first person starting with "I am" and reflect the core identity needed to achieve these goals.`;
                    const identityResponse = await callDeepSeekAPI(identityPrompt);
                    
                    // Update identity
                    document.getElementById('identityOutput').textContent = identityResponse;
                    
                    // Generate goals
                    const goalsPrompt = `Based on this vision: "${userInputs.vision}", these values: ${userInputs.values.join(', ')}, and these long-term goals (10-year: ${userInputs.tenYearGoals.join('; ')}, 3-year: ${userInputs.threeYearGoals.join('; ')}), create specific, measurable goals for:
                    1. 1-year goal (single most important goal)
                    2. 90-day goal (critical milestone)
                    3. 3 monthly goals (as bullet points)
                    Format as JSON with keys: oneYearGoal, ninetyDayGoal, monthlyGoals (array).`;
                    const goalsResponse = await callDeepSeekAPI(goalsPrompt);
                    const goals = parseJSONResponse(goalsResponse);
                    
                    // Update goals
                    if (goals.oneYearGoal) document.getElementById('oneYearGoal').textContent = goals.oneYearGoal;
                    if (goals.ninetyDayGoal) document.getElementById('ninetyDayGoal').textContent = goals.ninetyDayGoal;
                    if (goals.monthlyGoals) {
                        const monthlyList = goals.monthlyGoals.map((goal, i) => `
                            <li class="flex items-start">
                                <div class="flex-shrink-0 h-6 w-6 rounded-full bg-green-100 text-green-600 flex items-center justify-center mr-3 mt-1">
                                    <span class="text-xs font-bold">${i+1}</span>
                                </div>
                                <div class="text-lg">${goal}</div>
                            </li>
                        `).join('');
                        document.getElementById('monthlyGoals').innerHTML = `<ul class="space-y-3">${monthlyList}</ul>`;
                    }
                    
                    // Generate habits and systems
                    const habitsPrompt = `Suggest 3 key daily/weekly habits that would help achieve these goals: ${goals.oneYearGoal}, ${goals.ninetyDayGoal}. For each habit, provide a title and short description. Format as JSON with array of objects with keys: title, description.`;
                    const habitsResponse = await callDeepSeekAPI(habitsPrompt);
                    const habits = parseJSONResponse(habitsResponse);
                    
                    if (habits && Array.isArray(habits)) {
                        const habitsHTML = habits.map(habit => `
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-pink-100 text-pink-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-${getRandomHabitIcon()}"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">${habit.title}</h4>
                                    <p class="text-gray-600 text-sm">${habit.description}</p>
                                </div>
                            </div>
                        `).join('');
                        document.getElementById('habitsOutput').innerHTML = habitsHTML;
                    }
                    
                    // Generate systems
                    const systemsPrompt = `Suggest 3 systems or processes that would help achieve these goals: ${goals.oneYearGoal}, ${goals.ninetyDayGoal}. For each system, provide a title and short description. Format as JSON with array of objects with keys: title, description.`;
                    const systemsResponse = await callDeepSeekAPI(systemsPrompt);
                    const systems = parseJSONResponse(systemsResponse);
                    
                    if (systems && Array.isArray(systems)) {
                        const systemsHTML = systems.map(system => `
                            <div class="flex items-start bg-white p-4 rounded-lg shadow-sm">
                                <div class="flex-shrink-0 h-8 w-8 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-4">
                                    <i class="fas fa-${getRandomSystemIcon()}"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">${system.title}</h4>
                                    <p class="text-gray-600 text-sm">${system.description}</p>
                                </div>
                            </div>
                        `).join('');
                        document.getElementById('systemsOutput').innerHTML = systemsHTML;
                    }
                    
                    // Generate revenue strategy
                    const revenuePrompt = `Create a revenue growth strategy based on current income streams: ${userInputs.currentIncome.join(', ')}, and planned income streams: ${userInputs.plannedIncome.join(', ')}. Provide a concise paragraph.`;
                    const revenueResponse = await callDeepSeekAPI(revenuePrompt);
                    document.getElementById('revenueStrategy').textContent = revenueResponse;
                    
                    // Update income displays
                    document.getElementById('currentIncomeDisplay').innerHTML = userInputs.currentIncome.map(i => `
                        <li class="flex items-center">
                            <div class="flex-shrink-0 h-5 w-5 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-3">
                                <i class="fas fa-circle text-xs"></i>
                            </div>
                            <div class="text-gray-700">${i}</div>
                        </li>
                    `).join('');
                    
                    document.getElementById('plannedIncomeDisplay').innerHTML = userInputs.plannedIncome.map(i => `
                        <li class="flex items-center">
                            <div class="flex-shrink-0 h-5 w-5 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center mr-3">
                                <i class="fas fa-bolt text-xs"></i>
                            </div>
                            <div class="text-gray-700">${i}</div>
                        </li>
                    `).join('');
                    
                    // Hide loading screen and show results
                    setTimeout(() => {
                        loadingScreen.classList.add('hidden');
                        document.getElementById('resultsSection').classList.remove('hidden');
                        
                        // Scroll to results
                        document.getElementById('resultsSection').scrollIntoView({ behavior: 'smooth' });
                    }, 500);
                    
                } catch (error) {
                    console.error('Error generating plan:', error);
                    loadingScreen.classList.add('hidden');
                    alert('There was an error generating your plan. Please try again.');
                }
            });
            
            // Regenerate button
            document.getElementById('regenerateBtn').addEventListener('click', function() {
                document.getElementById('resultsSection').classList.add('hidden');
                document.getElementById('generateBtn').click();
            });
            
            // Export to PDF
            document.getElementById('exportPdfBtn').addEventListener('click', function() {
                const doc = new jsPDF();
                
                // Title
                doc.setFontSize(22);
                doc.setTextColor(55, 65, 81); // gray-800
                doc.text('Vision Quest - Your Goal Roadmap', 105, 20, { align: 'center' });
                
                // Identity Section
                doc.setFontSize(16);
                doc.setTextColor(17, 24, 39); // gray-900
                doc.text('Identity Statement', 15, 40);
                doc.setFontSize(12);
                doc.setTextColor(55, 65, 81); // gray-700
                doc.text(document.getElementById('identityOutput').textContent, 15, 50, { maxWidth: 180 });
                
                // Goals
                doc.setFontSize(16);
                doc.setTextColor(17, 24, 39);
                doc.text('Your Goals', 15, 70);
                
                doc.setFontSize(12);
                doc.setTextColor(55, 65, 81);
                doc.text('1-Year Goal:', 15, 80);
                doc.text(document.getElementById('oneYearGoal').textContent, 25, 85, { maxWidth: 170 });
                
                doc.text('90-Day Goal:', 15, 100);
                doc.text(document.getElementById('ninetyDayGoal').textContent, 25, 105, { maxWidth: 170 });
                
                doc.text('Monthly Goals:', 15, 120);
                const monthlyGoals = Array.from(document.getElementById('monthlyGoals').querySelectorAll('li')).map(li => li.textContent.trim());
                monthlyGoals.forEach((goal, i) => {
                    doc.text(goal, 25, 125 + (i * 5), { maxWidth: 170 });
                });
                
                // Income Strategy
                doc.setFontSize(16);
                doc.setTextColor(17, 24, 39);
                doc.text('Income Strategy', 15, 150);
                
                doc.setFontSize(12);
                doc.setTextColor(55, 65, 81);
                doc.text('Current Income Streams:', 15, 160);
                userInputs.currentIncome.forEach((income, i) => {
                    doc.text(`• ${income}`, 20, 165 + (i * 5), { maxWidth: 170 });
                });
                
                doc.text('Planned Income Streams:', 15, 180);
                userInputs.plannedIncome.forEach((income, i) => {
                    doc.text(`• ${income}`, 20, 185 + (i * 5), { maxWidth: 170 });
                });
                
                doc.text('Revenue Growth Strategy:', 15, 200);
                doc.text(document.getElementById('revenueStrategy').textContent, 20, 205, { maxWidth: 170 });
                
                // Habits & Systems
                doc.setFontSize(16);
                doc.setTextColor(17, 24, 39);
                doc.text('Habits & Systems', 15, 230);
                
                doc.setFontSize(12);
                doc.setTextColor(55, 65, 81);
                doc.text('Key Habits:', 15, 240);
                const habits = Array.from(document.getElementById('habitsOutput').querySelectorAll('div')).map(div => {
                    const title = div.querySelector('h4').textContent;
                    const desc = div.querySelector('p').textContent;
                    return `${title}: ${desc}`;
                });
                habits.forEach((habit, i) => {
                    doc.text(`• ${habit}`, 20, 245 + (i * 5), { maxWidth: 170 });
                });
                
                doc.text('Value Creation Systems:', 15, 260);
                const systems = Array.from(document.getElementById('systemsOutput').querySelectorAll('div')).map(div => {
                    const title = div.querySelector('h4').textContent;
                    const desc = div.querySelector('p').textContent;
                    return `${title}: ${desc}`;
                });
                systems.forEach((system, i) => {
                    doc.text(`• ${system}`, 20, 265 + (i * 5), { maxWidth: 170 });
                });
                
                // Save the PDF
                doc.save('VisionQuest-Plan.pdf');
            });
            
            // Export to CSV
            document.getElementById('exportCsvBtn').addEventListener('click', function() {
                // Prepare CSV content
                let csvContent = "Category,Item\n";
                
                // Add identity
                csvContent += `Identity,"${document.getElementById('identityOutput').textContent}"\n`;
                
                // Add goals
                csvContent += `1-Year Goal,"${document.getElementById('oneYearGoal').textContent}"\n`;
                csvContent += `90-Day Goal,"${document.getElementById('ninetyDayGoal').textContent}"\n`;
                
                const monthlyGoals = Array.from(document.getElementById('monthlyGoals').querySelectorAll('li')).map(li => li.textContent.trim());
                monthlyGoals.forEach(goal => {
                    csvContent += `Monthly Goal,"${goal}"\n`;
                });
                
                // Add income
                userInputs.currentIncome.forEach(income => {
                    csvContent += `Current Income,"${income}"\n`;
                });
                
                userInputs.plannedIncome.forEach(income => {
                    csvContent += `Planned Income,"${income}"\n`;
                });
                
                csvContent += `Revenue Strategy,"${document.getElementById('revenueStrategy').textContent}"\n`;
                
                // Add habits
                const habits = Array.from(document.getElementById('habitsOutput').querySelectorAll('div')).map(div => {
                    const title = div.querySelector('h4').textContent;
                    const desc = div.querySelector('p').textContent;
                    return `${title}: ${desc}`;
                });
                habits.forEach(habit => {
                    csvContent += `Key Habit,"${habit}"\n`;
                });
                
                // Add systems
                const systems = Array.from(document.getElementById('systemsOutput').querySelectorAll('div')).map(div => {
                    const title = div.querySelector('h4').textContent;
                    const desc = div.querySelector('p').textContent;
                    return `${title}: ${desc}`;
                });
                systems.forEach(system => {
                    csvContent += `Value System,"${system}"\n`;
                });
                
                // Create download link
                const encodedUri = encodeURI("data:text/csv;charset=utf-8," + csvContent);
                const link = document.createElement("a");
                link.setAttribute("href", encodedUri);
                link.setAttribute("download", "VisionQuest-Plan.csv");
                document.body.appendChild(link);
                link.click();
                document.body.removeChild(link);
            });
            
            // Helper function to call DeepSeek API
            async function callDeepSeekAPI(prompt) {
                const response = await fetch('https://api.deepseek.com/v1/chat/completions', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                        'Authorization': `Bearer ${DEEPSEEK_API_KEY}`
                    },
                    body: JSON.stringify({
                        model: "deepseek-chat",
                        messages: [
                            {
                                role: "system",
                                content: "You are a helpful goal-setting assistant that helps people create clear, actionable plans to achieve their vision. Provide concise, practical advice."
                            },
                            {
                                role: "user",
                                content: prompt
                            }
                        ],
                        temperature: 0.7,
                        max_tokens: 1000
                    })
                });
                
                if (!response.ok) {
                    throw new Error(`API request failed with status ${response.status}`);
                }
                
                const data = await response.json();
                return data.choices[0].message.content.trim();
            }
            
            // Helper function to parse JSON responses from AI
            function parseJSONResponse(response) {
                try {
                    // Try to find JSON in the response
                    const jsonStart = response.indexOf('{');
                    const jsonEnd = response.lastIndexOf('}') + 1;
                    const jsonString = response.slice(jsonStart, jsonEnd);
                    return JSON.parse(jsonString);
                } catch (e) {
                    console.error('Error parsing JSON response:', e);
                    // Fallback to manual parsing if JSON is malformed
                    const result = {};
                    
                    // Extract 1-year goal
                    const oneYearMatch = response.match(/1-year goal[:\-]?\s*(.+)/i);
                    if (oneYearMatch) result.oneYearGoal = oneYearMatch[1].trim();
                    
                    // Extract 90-day goal
                    const ninetyDayMatch = response.match(/90-day goal[:\-]?\s*(.+)/i);
                    if (ninetyDayMatch) result.ninetyDayGoal = ninetyDayMatch[1].trim();
                    
                    // Extract monthly goals
                    const monthlyMatches = response.match(/monthly goals?[:\-]?\s*([\s\S]+?)(?=\n\n|\n$|$)/i);
                    if (monthlyMatches) {
                        const monthlyLines = monthlyMatches[1].split('\n').filter(line => line.trim() !== '');
                        result.monthlyGoals = monthlyLines.map(line => line.replace(/^\s*[\-•]\s*/, '').trim());
                    }
                    
                    return result;
                }
            }
            
            // Simulate progress for loading screen
            function simulateProgress() {
                const progressCircle = document.querySelector('.progress-ring__circle');
                const progressPercent = document.getElementById('progressPercent');
                const visionProgress = document.getElementById('visionProgress');
                const visionProgressBar = document.getElementById('visionProgressBar');
                const goalsProgress = document.getElementById('goalsProgress');
                const goalsProgressBar = document.getElementById('goalsProgressBar');
                const actionProgress = document.getElementById('actionProgress');
                const actionProgressBar = document.getElementById('actionProgressBar');
                const loadingMessages = [
                    '"The secret of getting ahead is getting started." - Mark Twain',
                    '"What you get by achieving your goals is not as important as what you become by achieving your goals." - Zig Ziglar',
                    '"Setting goals is the first step in turning the invisible into the visible." - Tony Robbins',
                    '"A goal properly set is halfway reached." - Abraham Lincoln',
                    '"You are never too old to set another goal or to dream a new dream." - C.S. Lewis'
                ];
                
                let progress = 0;
                const radius = 40;
                const circumference = 2 * Math.PI * radius;
                const totalDuration = 60000; // 60 seconds in milliseconds
                const steps = 100; // 100% to complete
                const intervalDuration = totalDuration / steps; // 600ms per step
                
                progressCircle.style.strokeDasharray = circumference;
                progressCircle.style.strokeDashoffset = circumference;
                
                const interval = setInterval(() => {
                    progress += 1;
                    const offset = circumference - (progress / 100) * circumference;
                    progressCircle.style.strokeDashoffset = offset;
                    progressPercent.textContent = `${progress}%`;
                    
                    // Update individual progress bars
                    if (progress <= 40) {
                        const visionPct = Math.min(100, (progress / 40) * 100);
                        visionProgress.textContent = `${Math.round(visionPct)}%`;
                        visionProgressBar.style.width = `${visionPct}%`;
                    } else if (progress <= 80) {
                        visionProgress.textContent = '100%';
                        visionProgressBar.style.width = '100%';
                        
                        const goalsPct = Math.min(100, ((progress - 40) / 40) * 100);
                        goalsProgress.textContent = `${Math.round(goalsPct)}%`;
                        goalsProgressBar.style.width = `${goalsPct}%`;
                    } else {
                        visionProgress.textContent = '100%';
                        visionProgressBar.style.width = '100%';
                        goalsProgress.textContent = '100%';
                        goalsProgressBar.style.width = '100%';
                        
                        const actionPct = Math.min(100, ((progress - 80) / 20) * 100);
                        actionProgress.textContent = `${Math.round(actionPct)}%`;
                        actionProgressBar.style.width = `${actionPct}%`;
                    }
                    
                    // Change loading message every 10%
                    if (progress % 10 === 0) {
                        const randomMessage = loadingMessages[Math.floor(Math.random() * loadingMessages.length)];
                        document.getElementById('loadingMessage').textContent = randomMessage;
                    }
                    
                    if (progress >= 100) {
                        clearInterval(interval);
                    }
                }, intervalDuration);
            }
            
            // Helper function to get random habit icons
            function getRandomHabitIcon() {
                const icons = ['sun', 'moon', 'running', 'meditation', 'brain', 'book', 'pencil-alt', 'dumbbell', 'water', 'apple-alt'];
                return icons[Math.floor(Math.random() * icons.length)];
            }
            
            // Helper function to get random system icons
            function getRandomSystemIcon() {
                const icons = ['rocket', 'cogs', 'project-diagram', 'chart-line', 'clock', 'calendar-check', 'sync', 'random', 'network-wired', 'microchip'];
                return icons[Math.floor(Math.random() * icons.length)];
            }
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=JayStormX8/vision-v3-with-loading-correct" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>