Repository navigation
Expand file tree
/
Copy pathtest.html
More file actions
1019 lines (934 loc) · 79.6 KB
/
Copy pathtest.html
File metadata and controls
1019 lines (934 loc) · 79.6 KB
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
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<title>Beacon: Emergency Tools, Training & Strategy</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, interactive-widget=resizes-content">
<meta name="description" content="Beacon combines emergency survival tools with skill-building and resource management. Quickly access life-saving features like an SOS signal, compass, pedometer, Morse code translator, and signal mirror, while also tracking your survival training, managing resources, and completing essential checklists. Whether you're in an emergency or sharpening your survival knowledge, Beacon keeps you prepared.">
<meta name="author" content="Michael Schwartz">
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="Beacon: Emergency Tools, Training & Strategy">
<meta name="theme-color" content="#13171f">
<meta name="apple-mobile-web-app-title" content="Beacon: Emergency Tools, Training & Strategy">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="msapplication-starturl" content="./index.html">
<meta name="msapplication-navbutton-color" content="#13171f">
<meta property="og:url" content="https://michaelsboost.com/Beacon" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Beacon: Emergency Tools, Training & Strategy" />
<meta property="og:description" content="Beacon combines emergency survival tools with skill-building and resource management. Quickly access life-saving features like an SOS signal, compass, pedometer, Morse code translator, and signal mirror, while also tracking your survival training, managing resources, and completing essential checklists. Whether you're in an emergency or sharpening your survival knowledge, Beacon keeps you prepared." />
<link rel="shortcut icon" type="image/x-icon" href="imgs/logo.svg">
<link rel="icon" type="image/svg+xml" href="imgs/logo.svg" />
<link rel="apple-touch-icon" href="imgs/logo.svg">
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js" defer></script>
<link rel="stylesheet" href="src/style.css">
</head>
<body>
<div class="bg-gray-900 text-gray-100 font-sans min-h-screen">
<div class="min-h-screen bg-gradient-to-br from-gray-900 to-gray-800" x-data="app">
<!-- Header -->
<header class="bg-gray-800/50 backdrop-blur-sm border-b border-gray-700/50 sticky top-0 z-10">
<div class="container mx-auto px-4 py-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="flex items-center space-x-4 mb-4 md:mb-0">
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-blue-500 to-blue-700 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"></path>
</svg>
</div>
<div>
<h1 class="text-2xl font-bold bg-gradient-to-r from-blue-400 to-green-400 bg-clip-text text-transparent" x-text="appData.appName">Beacon</h1>
<p class="text-gray-400 text-sm" x-text="appData.appDescription">Your survival preparedness companion</p>
</div>
</div>
<div class="flex items-center space-x-4">
<div class="hidden md:flex items-center space-x-2 bg-gray-800/70 rounded-lg px-3 py-2">
<div class="status-indicator status-active"></div>
<span class="text-sm">Ready</span>
</div>
<!-- Github -->
<a href="https://github.com/michaelsboost/Beacon" target="_blank" class="bg-gray-800/70 hover:bg-gray-700/70 rounded-lg p-2 transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
</svg>
</a>
<!-- Share icon -->
<a href="#" @click="shareApp" aria-label="share app" class="text-current rounded-lg p-2 transition-colors">
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.5 12a2.5 2.5 0 1 1-5 0a2.5 2.5 0 0 1 5 0m5-5.5l-5 3.5m5 7.5l-5-3.5m10 4.5a2.5 2.5 0 1 1-5 0a2.5 2.5 0 0 1 5 0m0-13a2.5 2.5 0 1 1-5 0a2.5 2.5 0 0 1 5 0"/></svg>
</a>
<!-- Donate Heart Icon -->
<a href="https://michaelsboost.com/donate/" target="_blank"
class="bg-gradient-to-br from-pink-500 to-red-600 hover:from-pink-600 hover:to-red-700 rounded-lg p-2 transition-all duration-300 transform hover:scale-110 hover:shadow-lg group"
aria-label="Donate to support Beacon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-white" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
</svg>
</a>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="container mx-auto px-4 py-6">
<!-- Tabs Navigation -->
<div class="flex overflow-x-auto mb-8 pb-2 hide-scrollbar">
<div class="flex space-x-2 mx-auto bg-gray-800/50 rounded-xl p-1">
<button @click="setActiveTab('training')" :class="{ 'tab-active': activeTab === 'training' }" class="px-4 py-2 rounded-lg font-medium transition-all flex items-center space-x-2" aria-label="Training Tab">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"></path>
</svg>
<span>Training</span>
</button>
<button @click="setActiveTab('scenarios')" :class="{ 'tab-active': activeTab === 'scenarios' }" class="px-4 py-2 rounded-lg font-medium transition-all flex items-center space-x-2" aria-label="Scenarios Tab">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path>
</svg>
<span>Scenarios</span>
</button>
<button @click="setActiveTab('checklist')" :class="{ 'tab-active': activeTab === 'checklist' }" class="px-4 py-2 rounded-lg font-medium transition-all flex items-center space-x-2" aria-label="Checklist Tab">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
</svg>
<span>Checklist</span>
</button>
<button @click="setActiveTab('tools')" :class="{ 'tab-active': activeTab === 'tools' }" class="px-4 py-2 rounded-lg font-medium transition-all flex items-center space-x-2" aria-label="Tools Tab">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
<span>Tools</span>
</button>
<button @click="setActiveTab('library')" :class="{ 'tab-active': activeTab === 'library' }" class="px-4 py-2 rounded-lg font-medium transition-all flex items-center space-x-2" aria-label="Guides Tab">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"></path>
</svg>
<span>Guides</span>
</button>
<button @click="setActiveTab('plan')" :class="{ 'tab-active': activeTab === 'plan' }" class="px-4 py-2 rounded-lg font-medium transition-all flex items-center space-x-2" aria-label="Plan Tab">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
<span>Plan</span>
</button>
</div>
</div>
<!-- Training Tab -->
<div x-show="activeTab === 'training'" x-data="training" class="space-y-6">
<!-- Overall Progress -->
<div class="card p-6">
<div class="section-header">
<div class="section-icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</div>
<div>
<h2 class="text-xl font-semibold">Overall Progress</h2>
<p class="text-gray-400 text-sm">Track your survival skill development</p>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Skill Level</span>
<span class="font-bold text-white" x-text="overallSkillLevel">Beginner</span>
</div>
<div class="progress-bar">
<div class="progress-fill" :style="`width: ${globalProgress}%`"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0%</span>
<span class="text-xs text-gray-400" x-text="`${globalProgress}%`">45%</span>
<span class="text-xs text-gray-400">100%</span>
</div>
</div>
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Skills Learned</span>
<span class="font-bold text-white">5/12</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: 42%"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0</span>
<span class="text-xs text-gray-400">5</span>
<span class="text-xs text-gray-400">12</span>
</div>
</div>
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Challenges Completed</span>
<span class="font-bold text-white">8/24</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: 33%"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0</span>
<span class="text-xs text-gray-400">8</span>
<span class="text-xs text-gray-400">24</span>
</div>
</div>
</div>
</div>
<!-- Skills Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<template x-for="skill in skills" :key="skill.name">
<div class="card p-6">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center space-x-4">
<div class="skill-icon" x-text="skill.icon">🔥</div>
<div>
<h3 class="font-semibold text-lg" x-text="skill.name">Fire Making</h3>
<div class="flex items-center mt-1">
<span class="text-sm text-gray-400">Level:</span>
<span class="ml-1 font-medium text-white" x-text="skill.level">Intermediate</span>
</div>
</div>
</div>
<button @click="toggleSkill(skill)" class="text-gray-400 hover:text-white transition-colors" :aria-expanded="skill.expanded">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</button>
</div>
<div class="mb-4">
<div class="flex justify-between items-center mb-2">
<span class="text-sm text-gray-400">Progress</span>
<span class="text-sm text-gray-400" x-text="`${getSkillProgress(skill)}%`">65%</span>
</div>
<div class="progress-bar">
<div class="progress-fill" :style="`width: ${getSkillProgress(skill)}%`"></div>
</div>
</div>
<div x-show="skill.expanded" class="mt-4 pt-4 border-t border-gray-700/50">
<p class="text-gray-400 mb-4" x-text="skill.challenge ? skill.challenge.text : 'No challenge available'">
Create a sustainable fire using only natural materials in under 10 minutes.
</p>
<div class="flex space-x-3">
<button @click="startChallenge(skill)" class="btn-primary flex-1" aria-label="Start Challenge">
Start Challenge
</button>
</div>
<div x-show="skill.challengeActive" class="mt-4 p-4 bg-gray-800/50 rounded-lg">
<div class="flex justify-between items-center mb-3">
<span class="text-gray-400">Time Remaining:</span>
<span class="font-medium text-white" x-text="skill.timeRemaining">08:32</span>
</div>
<div class="flex space-x-2">
<button @click="completeChallenge(skill, true)" class="btn-secondary flex-1" aria-label="Complete Challenge">
Completed
</button>
<button @click="completeChallenge(skill, false)" class="btn-danger flex-1" aria-label="Fail Challenge">
Failed
</button>
</div>
</div>
</div>
</div>
</template>
</div>
</div>
<!-- Scenarios Tab -->
<div x-show="activeTab === 'scenarios'" x-data="scenarioSimulator" class="space-y-6">
<div class="card p-6">
<div class="section-header">
<div class="section-icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path>
</svg>
</div>
<div>
<h2 class="text-xl font-semibold">Survival Scenarios</h2>
<p class="text-gray-400 text-sm">Test your skills in simulated emergency situations</p>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<template x-for="scenario in scenarios" :key="scenario.title">
<div class="card p-6">
<div class="flex justify-between items-start mb-4">
<h3 class="font-semibold text-lg" x-text="scenario.title">Wilderness Survival</h3>
<span class="px-2 py-1 bg-yellow-500/20 text-yellow-400 text-xs rounded-full" x-text="scenario.difficulty">Medium</span>
</div>
<p class="text-gray-400 mb-4" x-text="scenario.description">
You're lost in the wilderness with limited supplies. Find shelter, water, and signal for rescue.
</p>
<div class="flex justify-between text-sm mb-4">
<div>
<span class="text-gray-400">Time:</span>
<span class="ml-1 font-medium text-white" x-text="scenario.timeRemaining">45 min</span>
</div>
<div>
<span class="text-gray-400">Challenges:</span>
<span class="ml-1 font-medium text-white" x-text="scenario.challenges.length">5</span>
</div>
</div>
<button @click="toggleScenario(scenario)" class="w-full btn-primary mb-4" :aria-expanded="scenario.expanded">
<span x-text="scenario.expanded ? 'Hide Details' : 'View Scenario'">View Scenario</span>
</button>
<div x-show="scenario.expanded" class="pt-4 border-t border-gray-700/50">
<div class="mb-4">
<span class="text-gray-400 text-sm">Current Challenge:</span>
<p class="font-medium text-white mt-1" x-text="scenario.challenges[scenario.challengeIndex]">
Find a suitable location for shelter before nightfall.
</p>
</div>
<div class="flex space-x-2">
<button x-show="!scenario.started" @click="startScenario(scenario)" class="btn-primary flex-1" aria-label="Start Scenario">
Start Scenario
</button>
<button x-show="scenario.started" @click="completeChallenge(scenario)" class="btn-secondary flex-1" aria-label="Complete Challenge">
Complete Challenge
</button>
</div>
<p class="mt-3 font-medium text-green-400 text-center" x-text="scenario.outcome"></p>
</div>
</div>
</template>
</div>
</div>
<!-- Checklist Tab -->
<div x-show="activeTab === 'checklist'" x-data="emergencyChecklist" class="space-y-6">
<div class="card p-6">
<div class="section-header">
<div class="section-icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
</svg>
</div>
<div>
<h2 class="text-xl font-semibold">Emergency Preparedness Checklist</h2>
<p class="text-gray-400 text-sm">Ensure you're ready for any emergency situation</p>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Readiness Level</span>
<span class="font-bold text-white" x-text="globalReadinessLevel">Prepared</span>
</div>
<div class="progress-bar">
<div class="progress-fill" :style="`width: ${globalReadinessPercentage}%`"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0%</span>
<span class="text-xs text-gray-400" x-text="`${globalReadinessPercentage}%`">75%</span>
<span class="text-xs text-gray-400">100%</span>
</div>
</div>
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Items Checked</span>
<span class="font-bold text-white">24/32</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: 75%"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0</span>
<span class="text-xs text-gray-400">24</span>
<span class="text-xs text-gray-400">32</span>
</div>
</div>
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Categories Complete</span>
<span class="font-bold text-white">3/6</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: 50%"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0</span>
<span class="text-xs text-gray-400">3</span>
<span class="text-xs text-gray-400">6</span>
</div>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<template x-for="category in categories" :key="category.name">
<div class="card p-6">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center space-x-4">
<div class="skill-icon" x-text="category.icon">🛡️</div>
<div>
<h3 class="font-semibold text-lg" x-text="category.name">First Aid</h3>
<div class="flex items-center mt-1">
<span class="text-sm text-gray-400">Level:</span>
<span class="ml-1 font-medium text-white" x-text="getCategoryReadinessLevel(category.name)">Advanced</span>
</div>
</div>
</div>
<button @click="toggleCategory(category)" class="text-gray-400 hover:text-white transition-colors" :aria-expanded="category.expanded">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</button>
</div>
<div class="mb-4">
<div class="flex justify-between items-center mb-2">
<span class="text-sm text-gray-400">Progress</span>
<span class="text-sm text-gray-400" x-text="`${getCategoryPercentage(category.name)}%`">80%</span>
</div>
<div class="progress-bar">
<div class="progress-fill" :style="`width: ${getCategoryPercentage(category.name)}%`"></div>
</div>
</div>
<div x-show="category.expanded" class="mt-4 pt-4 border-t border-gray-700/50">
<template x-for="(item, index) in category.items" :key="item.name">
<label class="flex items-center justify-between py-2 border-b border-gray-700/30 last:border-0">
<div class="flex items-center space-x-3">
<div class="relative">
<input type="checkbox" class="hidden" :id="`${category.name}-${index}`" x-model="item.checked" @change="toggleItem(item)" :aria-label="item.name">
<div class="w-5 h-5 border-2 border-gray-500 rounded flex items-center justify-center transition-all" :class="{'bg-blue-500 border-blue-500': item.checked}">
<svg x-show="item.checked" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 text-white" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path>
</svg>
</div>
</div>
<span class="text-white" x-text="item.name">Bandages</span>
</div>
<span x-show="item.important" class="px-2 py-1 bg-red-500/20 text-red-400 text-xs rounded-full">Essential</span>
</label>
</template>
</div>
</div>
</template>
</div>
</div>
<!-- Tools Tab -->
<div x-show="activeTab === 'tools'" x-data="survivalTools" class="space-y-6">
<div class="card p-6">
<div class="section-header">
<div class="section-icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
</div>
<div>
<h2 class="text-xl font-semibold">Survival Tools</h2>
<p class="text-gray-400 text-sm">Essential tools for emergency situations</p>
</div>
</div>
</div>
<!-- App Status Card -->
<div class="card p-6">
<div class="flex flex-col md:flex-row items-center justify-between">
<div class="flex items-center space-x-4 mb-4 md:mb-0">
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-blue-500 to-blue-700 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"></path>
</svg>
</div>
<div>
<h3 class="font-semibold">Beacon v<span x-text="status.currentVersion">2.1.0</span></h3>
<p class="text-gray-400 text-sm">Your survival preparedness companion</p>
</div>
</div>
<div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-3 w-full md:w-auto">
<button x-show="status.updateAvailable" @click="status.updatePWA()" class="btn-danger flex items-center justify-center space-x-2" aria-label="Update Beacon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
</svg>
<span>Update Available</span>
</button>
<button @click="status.exportAppData()" class="btn-secondary flex items-center justify-center space-x-2" aria-label="Export Data">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"></path>
</svg>
<span>Export Data</span>
</button>
<label class="btn-primary flex items-center justify-center space-x-2 cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path>
</svg>
<span>Import Data</span>
<input type="file" accept=".json" class="hidden" @change="status.importAppData(event)" aria-label="Import Data">
</label>
</div>
</div>
</div>
<!-- Tools Grid -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- SOS Signal -->
<div class="tool-card" x-data="{ playing: false }">
<div class="w-12 h-12 rounded-xl bg-red-500/20 text-red-400 flex items-center justify-center mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
</svg>
</div>
<h3 class="font-semibold text-lg mb-2">SOS Signal</h3>
<p class="text-gray-400 text-sm text-center mb-4">Audible distress signal</p>
<button class="w-full btn-primary flex items-center justify-center space-x-2 pulse" @click="playing = !playing; playing ? $refs.sos.play() : ($refs.sos.pause(), $refs.sos.currentTime = 0)" x-text="playing ? 'STOP SOS' : 'SOS'" aria-label="Toggle SOS Signal">
<audio x-ref="sos">
<source src="audios/audio_dfb929b28d.mp3" type="audio/mpeg">
</audio>
</button>
</div>
<!-- Signal Mirror -->
<div class="tool-card">
<div class="w-12 h-12 rounded-xl bg-yellow-500/20 text-yellow-400 flex items-center justify-center mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path>
</svg>
</div>
<h3 class="font-semibold text-lg mb-2">Signal Mirror</h3>
<p class="text-gray-400 text-sm text-center mb-4">Visual distress signal</p>
<button class="w-full btn-primary flex items-center justify-center space-x-2" @click="signalMirror.flashing = !signalMirror.flashing; signalMirror.flashScreen()" x-text="signalMirror.flashing ? 'STOP Flash' : 'Signal Mirror'" aria-label="Toggle Signal Mirror">
</button>
</div>
<!-- Compass -->
<div class="tool-card" x-data="compass" x-init="initCompass()">
<div class="w-12 h-12 rounded-xl bg-blue-500/20 text-blue-400 flex items-center justify-center mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
<h3 class="font-semibold text-lg mb-2">Digital Compass</h3>
<p class="text-gray-400 text-sm text-center mb-4">Find your direction</p>
<div class="compass my-4">
<div class="compass-needle" :style="`transform: translate(-50%, -50%) rotate(${compass.heading}deg); transform-origin: center center;`">
<svg class="w-full h-full" viewBox="0 0 512 512">
<g x-ref="compassArrow" style="transform-origin: center;">
<path d=" M 248.445 67.683 C 248.279 67.978 248.129 68.282 247.997 68.594 C 247.526 69.592 247.22 70.66 247.092 71.756 L 210.24 254.254 C 210.013 255.45 210.013 256.677 210.24 257.872 L 246.875 440.559 C 247.687 445.167 251.69 448.526 256.369 448.526 C 261.048 448.526 265.051 445.166 265.862 440.559 L 302.498 257.858 C 302.724 256.663 302.724 255.435 302.498 254.24 L 265.638 71.749 C 264.964 68.179 262.335 65.294 258.844 64.29 C 255.352 63.287 251.593 64.336 249.126 67.002 L 248.453 67.675 L 248.445 67.683 Z M 229.683 256.056 L 283.048 256.049 L 256.362 389.465 L 229.683 256.056 Z " fill="#000"></path>
</g>
</svg>
</div>
<div class="compass-center"></div>
</div>
<div class="text-center">
<span class="text-xl font-bold" x-text="compass.heading + '°'">0°</span>
<p class="text-gray-400 text-sm mt-1" x-text="compass.direction">N</p>
</div>
</div>
<!-- Pedometer -->
<div class="tool-card" x-data="pedometer" x-init="init()">
<div class="w-12 h-12 rounded-xl bg-green-500/20 text-green-400 flex items-center justify-center mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"></path>
</svg>
</div>
<h3 class="font-semibold text-lg mb-2">Pedometer</h3>
<p class="text-gray-400 text-sm text-center mb-4">Track your movement</p>
<div class="w-full bg-gray-800/50 rounded-xl p-4 mb-4">
<div class="flex justify-between mb-2">
<span class="text-gray-400">Steps:</span>
<span class="font-medium text-white" x-text="steps">1,245</span>
</div>
<div class="flex justify-between">
<span class="text-gray-400">Distance:</span>
<span class="font-medium text-white" x-text="(steps * stepLength).toFixed(2) + ' m'">996.0 m</span>
</div>
</div>
<button @click="reset()" class="w-full btn-primary" aria-label="Reset Pedometer">
Reset
</button>
</div>
<!-- Morse Code -->
<div class="tool-card col-span-1 sm:col-span-2 lg:col-span-1">
<div class="w-12 h-12 rounded-xl bg-purple-500/20 text-purple-400 flex items-center justify-center mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"></path>
</svg>
</div>
<h3 class="font-semibold text-lg mb-2">Morse Code</h3>
<p class="text-gray-400 text-sm text-center mb-4">Encode and decode messages</p>
<div class="w-full mb-4">
<input x-model="morseCode.textInput" @input="morseCode.updateMorse()" type="text" placeholder="Enter text..." class="input-field w-full mb-3" aria-label="Morse Code Input">
<button @click="morseCode.playMorseCode()" class="w-full btn-primary flex items-center justify-center space-x-2" x-text="morseCode.playing ? 'Stop' : 'Play'" aria-label="Play Morse Code">
</button>
</div>
<div class="w-full bg-gray-800/50 rounded-xl p-4">
<p class="text-gray-400 text-sm mb-1">Morse Code:</p>
<p class="font-mono text-white break-all" x-text="morseCode.morseOutput">.... . .-.. .-.. ---</p>
</div>
</div>
<!-- Level Tool -->
<div class="tool-card col-span-1 sm:col-span-2 lg:col-span-1" x-data="levelTool">
<div class="w-12 h-12 rounded-xl bg-indigo-500/20 text-indigo-400 flex items-center justify-center mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"></path>
</svg>
</div>
<h3 class="font-semibold text-lg mb-2">Level Tool</h3>
<p class="text-gray-400 text-sm text-center mb-4">Check surface levelness</p>
<div class="relative w-full h-40 border-2 border-gray-700 rounded-xl flex justify-center items-center overflow-hidden bg-gray-800/50 mb-4" style="transform: rotate(180deg);">
<div class="absolute w-8 h-8 bg-green-500 rounded-full transition-transform" :style="'transform: ' + bubbleX() + ' ' + bubbleY()"></div>
<div class="absolute w-full h-0.5 bg-gray-600"></div>
<div class="absolute h-full w-0.5 bg-gray-600"></div>
</div>
<p class="text-gray-400 text-sm text-center">Tilt your device to see the bubble move.</p>
</div>
</div>
</div>
<!-- Guides Tab -->
<div x-show="activeTab === 'library'" x-data="library" class="space-y-6">
<div class="card p-6">
<div class="section-header">
<div class="section-icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"></path>
</svg>
</div>
<div>
<h2 class="text-xl font-semibold">Survival Guides</h2>
<p class="text-gray-400 text-sm">Learn essential survival skills and techniques</p>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Guides Completed</span>
<span class="font-bold text-white" x-text="completedGuides + '/' + totalGuides">8/24</span>
</div>
<div class="progress-bar">
<div class="progress-fill" :style="`width: ${libraryProgress}%`"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0%</span>
<span class="text-xs text-gray-400" x-text="`${libraryProgress}%`">33%</span>
<span class="text-xs text-gray-400">100%</span>
</div>
</div>
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Readiness Level</span>
<span class="font-bold text-white" x-text="globalReadinessLevel">Intermediate</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: 60%"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">Beginner</span>
<span class="text-xs text-gray-400">Intermediate</span>
<span class="text-xs text-gray-400">Expert</span>
</div>
</div>
<div class="bg-gray-800/50 rounded-xl p-4">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-400 text-sm">Skills Mastered</span>
<span class="font-bold text-white">5/12</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: 42%"></div>
</div>
<div class="flex justify-between mt-1">
<span class="text-xs text-gray-400">0</span>
<span class="text-xs text-gray-400">5</span>
<span class="text-xs text-gray-400">12</span>
</div>
</div>
</div>
</div>
<!-- Search and Filter -->
<div class="card p-6">
<div class="flex flex-col space-y-4 ">
<div class="flex-1">
<input x-model="searchQuery" type="search" placeholder="Search guides..." class="input-field w-full rounded-full pr-10 search-input-with-icon" aria-label="Search Guides">
</div>
<div class="flex flex-row overflow-x-auto pb-2 hide-scrollbar">
<div class="flex space-x-2">
<template x-for="category in categories" :key="category.key">
<button @click="activeCategory = category.key" :class="{ 'bg-blue-500 text-white': activeCategory === category.key }" class="px-4 py-2 rounded-lg transition whitespace-nowrap bg-gray-800 hover:bg-gray-700" :aria-label="`Filter by ${category.name}`">
<span x-text="category.name">All</span>
<span class="ml-2 text-xs text-gray-300" x-text="`(${getCategoryPercentage(category.key)}%)`">(33%)</span>
</button>
</template>
</div>
</div>
</div>
</div>
<!-- Guides Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<template x-for="guide in filteredGuides" :key="guide.title">
<div class="guide-card">
<div class="flex justify-between items-start mb-4">
<h3 class="font-semibold text-lg" x-text="guide.title">Fire Making</h3>
<span class="px-2 py-1 bg-blue-500/20 text-blue-400 text-xs rounded-full" x-text="guide.difficulty">Intermediate</span>
</div>
<p class="text-gray-400 mb-4" x-text="guide.description">
Learn how to create fire using various methods in survival situations.
</p>
<div class="flex justify-between items-center mb-4">
<button @click="toggleGuide(guide)" class="btn-primary text-sm" :aria-expanded="guide.expanded" :aria-label="`Toggle ${guide.title} Details`">
<span x-text="guide.expanded ? 'Hide Details' : 'View Guide'">View Guide</span>
</button>
<label class="flex items-center cursor-pointer">
<input type="checkbox" class="hidden" @change="toggleGuideCompletion(guide)" :checked="guide.completed" :aria-label="`Mark ${guide.title} as Completed`">
<div class="relative w-10 h-5 rounded-full transition-all" :class="guide.completed ? 'bg-green-500' : 'bg-gray-500'">
<div class="absolute left-1 top-1 w-3 h-3 bg-white rounded-full transition-all" :class="{'translate-x-5': guide.completed}"></div>
</div>
<span class="ml-2 text-sm" :class="guide.completed ? 'text-green-400' : 'text-gray-300'" x-text="guide.completed ? 'Completed' : 'Incomplete'">Incomplete</span>
</label>
</div>
<div x-show="guide.expanded" class="mt-4 p-4 bg-gray-800/50 rounded-lg">
<h4 class="text-md font-semibold text-white mb-2">Materials Needed:</h4>
<ul class="list-disc list-inside text-gray-300 space-y-1 mb-4">
<template x-for="material in guide.materials">
<li x-text="material">Dry tinder</li>
</template>
</ul>
<h4 class="text-md font-semibold text-white mb-2">Steps:</h4>
<div class="list-decimal list-inside text-gray-300 space-y-2 mb-4">
<template x-for="step in guide.steps">
<div x-html="markdownToHTML(step)">Gather dry tinder, kindling, and fuelwood.</div>
</template>
</div>
<h4 class="text-md font-semibold text-white mb-2">Tips:</h4>
<ul class="list-disc list-inside text-gray-300 space-y-1">
<template x-for="tip in guide.tips">
<li x-html="markdownToHTML(tip)">Always have multiple fire-starting methods available.</li>
</template>
</ul>
</div>
</div>
</template>
</div>
</div>
<!-- Emergency Plan Tab -->
<div x-show="activeTab === 'plan'" x-data="emergencyPlan" class="space-y-6">
<div class="card p-6">
<div class="section-header">
<div class="section-icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
</div>
<div>
<h2 class="text-xl font-semibold">Emergency Preparedness Plan</h2>
<p class="text-gray-400 text-sm">Build a detailed emergency plan for you and your family</p>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="bg-gray-800/50 rounded-xl p-4 text-center">
<div class="w-12 h-12 rounded-xl bg-blue-500/20 text-blue-400 flex items-center justify-center mx-auto mb-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
</svg>
</div>
<h3 class="font-semibold mb-1">Family Members</h3>
<p class="text-gray-400 text-sm" x-text="plan.coreIdentity.familyMembers.length">4</p>
</div>
<div class="bg-gray-800/50 rounded-xl p-4 text-center">
<div class="w-12 h-12 rounded-xl bg-green-500/20 text-green-400 flex items-center justify-center mx-auto mb-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"></path>
</svg>
</div>
<h3 class="font-semibold mb-1">Emergency Contacts</h3>
<p class="text-gray-400 text-sm" x-text="plan.coreIdentity.contacts.length">6</p>
</div>
<div class="bg-gray-800/50 rounded-xl p-4 text-center">
<div class="w-12 h-12 rounded-xl bg-yellow-500/20 text-yellow-400 flex items-center justify-center mx-auto mb-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"></path>
</svg>
</div>
<h3 class="font-semibold mb-1">Go Bag Items</h3>
<p class="text-gray-400 text-sm" x-text="plan.goBag.length">12</p>
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-3 gap-6">
<button @click="savePlan()" class="btn-primary flex items-center justify-center space-x-2" aria-label="Save Plan">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
</svg>
<span>Save Plan</span>
</button>
<button @click="exportPlan()" class="btn-secondary flex items-center justify-center space-x-2" x-tooltip="'Exports plan as JSON'" aria-label="Export Plan as JSON">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"></path>
</svg>
<span>Export JSON</span>
</button>
<button @click="exportPlanPDF()" class="btn-primary flex items-center justify-center space-x-2" x-tooltip="'Exports plan as PDF'" aria-label="Export Plan as PDF">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
<span>Export PDF</span>
</button>
</div>
</div>
<!-- Plan Sections -->
<div class="space-y-6">
<!-- Core Identity and Safety -->
<div class="card p-6">
<div class="flex items-center justify-between mb-4 cursor-pointer" @click="sections.coreIdentity = !sections.coreIdentity" role="button" :aria-expanded="sections.coreIdentity">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-xl bg-blue-500/20 text-blue-400 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path>
</svg>
</div>
<div>
<h3 class="font-semibold">Core Identity and Safety</h3>
<p class="text-gray-400 text-sm">Essential family information and contacts</p>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400 transition-transform" :class="{'rotate-180': sections.coreIdentity}" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
<div x-show="sections.coreIdentity" class="mt-6 space-y-6">
<!-- Safe Word and Meetup Locations -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div>
<label class="block text-sm font-medium mb-2" for="safeWord">Family Safe Word</label>
<input x-model="plan.coreIdentity.safeWord" type="text" id="safeWord" placeholder="Safe word" class="input-field w-full" aria-label="Safe Word">
</div>
<div>
<label class="block text-sm font-medium mb-2" for="primaryMeetup">Primary Meet-up</label>
<input x-model="plan.coreIdentity.primaryMeetup" type="text" id="primaryMeetup" placeholder="e.g., Neighbor's house" class="input-field w-full" aria-label="Primary Meet-up Location">
</div>
<div>
<label class="block text-sm font-medium mb-2" for="backupMeetup">Backup Meet-up</label>
<input x-model="plan.coreIdentity.backupMeetup" type="text" id="backupMeetup" placeholder="e.g., City hall" class="input-field w-full" aria-label="Backup Meet-up Location">
</div>
</div>
<!-- Emergency Contacts -->
<div>
<h4 class="font-semibold mb-4 flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2 text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"></path>
</svg>
Emergency Contacts
</h4>
<div class="space-y-4">
<template x-for="(contact, index) in plan.coreIdentity.contacts" :key="index">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 items-end">
<div>
<label class="block text-sm font-medium mb-2" :for="'contact-name-' + index">Name</label>
<input x-model="contact.name" type="text" :id="'contact-name-' + index" placeholder="Name" class="input-field w-full" :aria-label="'Contact Name ' + index">
</div>
<div>
<label class="block text-sm font-medium mb-2" :for="'contact-phone-' + index">Phone</label>
<input x-model="contact.phone" type="tel" :id="'contact-phone-' + index" placeholder="Phone" class="input-field w-full" :aria-label="'Contact Phone ' + index">
</div>
<div>
<label class="block text-sm font-medium mb-2" :for="'contact-role-' + index">Role</label>
<input x-model="contact.role" type="text" :id="'contact-role-' + index" placeholder="Role" class="input-field w-full" :aria-label="'Contact Role ' + index">
</div>
<div>
<button @click="removeContact(index)" class="btn-danger w-full" :disabled="plan.coreIdentity.contacts.length <= 1" :aria-label="'Remove Contact ' + index">Remove</button>
</div>
</div>
</template>
<button @click="addContact()" class="btn-primary flex items-center justify-center space-x-2 w-full md:w-auto" aria-label="Add Contact">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
</svg>
<span>Add Contact</span>
</button>
</div>
</div>
<!-- Family Members -->
<div>
<h4 class="font-semibold mb-4 flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2 text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
</svg>
Family Members
</h4>
<div class="space-y-4">
<template x-for="(member, index) in plan.coreIdentity.familyMembers" :key="index">
<div class="grid grid-cols-1 md:grid-cols-6 gap-4 items-end">
<div class="md:col-span-2">
<label class="block text-sm font-medium mb-2" :for="'member-name-' + index">Name</label>
<input x-model="member.name" type="text" :id="'member-name-' + index" placeholder="Name" class="input-field w-full" :aria-label="'Family Member Name ' + index">
</div>
<div>
<label class="block text-sm font-medium mb-2" :for="'member-birthday-' + index">Birthday</label>
<input x-model="member.birthday" type="text" :id="'member-birthday-' + index" placeholder="Birthday" class="input-field w-full" :aria-label="'Family Member Birthday ' + index">
</div>
<div>
<label class="block text-sm font-medium mb-2" :for="'member-allergies-' + index">Allergies</label>
<input x-model="member.allergies" type="text" :id="'member-allergies-' + index" placeholder="Allergies" class="input-field w-full" :aria-label="'Family Member Allergies ' + index">
</div>
<div>
<label class="block text-sm font-medium mb-2" :for="'member-medications-' + index">Medications</label>
<input x-model="member.medications" type="text" :id="'member-medications-' + index" placeholder="Medications" class="input-field w-full" :aria-label="'Family Member Medications ' + index">
</div>
<div>
<label class="block text-sm font-medium mb-2" :for="'member-bloodType-' + index">Blood Type</label>
<input x-model="member.bloodType" type="text" :id="'member-bloodType-' + index" placeholder="Blood Type" class="input-field w-full" :aria-label="'Family Member Blood Type ' + index">
</div>
<div>
<button @click="removeFamilyMember(index)" class="btn-danger w-full" :disabled="plan.coreIdentity.familyMembers.length <= 1" :aria-label="'Remove Family Member ' + index">Remove</button>
</div>
</div>
</template>
<button @click="addFamilyMember()" class="btn-primary flex items-center justify-center space-x-2 w-full md:w-auto" aria-label="Add Family Member">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
</svg>
<span>Add Family Member</span>
</button>
</div>
</div>
</div>
</div>
<!-- Additional sections would follow the same pattern -->
<!-- For brevity, I'm showing just the first section in this example -->
<!-- Go Bag Checklist -->
<div class="card p-6">
<div class="flex items-center justify-between mb-4 cursor-pointer" @click="sections.goBag = !sections.goBag" role="button" :aria-expanded="sections.goBag">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-xl bg-green-500/20 text-green-400 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
</svg>
</div>
<div>
<h3 class="font-semibold">Go Bag Checklist</h3>
<p class="text-gray-400 text-sm">Essential items for emergency evacuation</p>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400 transition-transform" :class="{'rotate-180': sections.goBag}" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
<div x-show="sections.goBag" class="mt-6">
<div class="space-y-4">
<template x-for="(item, index) in plan.goBag" :key="index">
<div class="grid grid-cols-1 md:grid-cols-5 gap-4 items-end">
<div class="md:col-span-3">
<label class="block text-sm font-medium mb-2" :for="'gobag-item-' + index">Item Name</label>
<input x-model="item.name" type="text" :id="'gobag-item-' + index" placeholder="Item Name" class="input-field w-full" :aria-label="'Go Bag Item Name ' + index">
</div>
<div>
<label class="block text-sm font-medium mb-2" :for="'gobag-quantity-' + index">Quantity</label>
<input x-model.number="item.quantity" type="number" :id="'gobag-quantity-' + index" placeholder="Qty" min="1" class="input-field w-full" :aria-label="'Go Bag Item Quantity ' + index">
</div>
<div>
<button @click="removeGoBagItem(index)" class="btn-danger w-full" :disabled="plan.goBag.length <= 1" :aria-label="'Remove Go Bag Item ' + index">Remove</button>
</div>
</div>
</template>
<button @click="addGoBagItem()" class="btn-primary flex items-center justify-center space-x-2 w-full md:w-auto" aria-label="Add Go Bag Item">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
</svg>
<span>Add Go Bag Item</span>
</button>
</div>
</div>