File size: 66,533 Bytes
fa5e8e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lua Mastery - Learn Lua Programming</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .code-block {
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 0.5rem;
            padding: 1rem;
            font-family: 'Courier New', monospace;
            overflow-x: auto;
        }
        .keyword { color: #f92672; }
        .string { color: #e6db74; }
        .comment { color: #75715e; }
        .number { color: #ae81ff; }
        .function { color: #66d9ef; }
        .hljs-built_in { color: #a6e22e; }
        
        .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        .lesson-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }
        
        .syntax-highlight {
            background-color: rgba(255, 255, 255, 0.05);
            padding: 0.2rem 0.4rem;
            border-radius: 0.25rem;
            font-family: 'Courier New', monospace;
        }
    </style>
</head>
<body class="bg-gray-900 text-gray-100 min-h-screen">
    <!-- Navigation -->
    <nav class="bg-gray-800 shadow-lg">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex items-center justify-between h-16">
                <div class="flex items-center">
                    <div class="flex-shrink-0">
                        <span class="text-green-400 font-bold text-xl">Lua Mastery</span>
                    </div>
                    <div class="hidden md:block">
                        <div class="ml-10 flex items-baseline space-x-4">
                            <a href="#home" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-white bg-gray-900">Home</a>
                            <a href="#tutorials" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Tutorials</a>
                            <a href="#examples" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Examples</a>
                            <a href="#resources" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Resources</a>
                            <a href="#community" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Community</a>
                        </div>
                    </div>
                </div>
                <div class="hidden md:block">
                    <div class="ml-4 flex items-center md:ml-6">
                        <button class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
                            Try Lua Online
                        </button>
                    </div>
                </div>
                <div class="-mr-2 flex md:hidden">
                    <button type="button" class="mobile-menu-button bg-gray-800 inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-700 focus:outline-none">
                        <i class="fas fa-bars"></i>
                    </button>
                </div>
            </div>
        </div>
        
        <!-- Mobile menu -->
        <div class="mobile-menu hidden md:hidden">
            <div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
                <a href="#home" class="block px-3 py-2 rounded-md text-base font-medium text-white bg-gray-900">Home</a>
                <a href="#tutorials" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Tutorials</a>
                <a href="#examples" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Examples</a>
                <a href="#resources" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Resources</a>
                <a href="#community" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Community</a>
                <button class="block w-full text-left px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">
                    Try Lua Online
                </button>
            </div>
        </div>
    </nav>

    <!-- Hero Section -->
    <section id="home" class="bg-gradient-to-r from-gray-800 to-gray-900 py-20">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="lg:flex lg:items-center lg:justify-between">
                <div class="lg:w-1/2">
                    <h1 class="text-4xl font-extrabold tracking-tight text-white sm:text-5xl lg:text-6xl">
                        Learn <span class="text-green-400">Lua</span> from Scratch
                    </h1>
                    <p class="mt-5 text-xl text-gray-300">
                        Master the powerful, efficient, and embeddable scripting language used in games like World of Warcraft, Roblox, and more.
                    </p>
                    <div class="mt-8 flex flex-col sm:flex-row gap-4">
                        <a href="#getting-started" class="bg-green-600 hover:bg-green-700 text-white px-8 py-3 rounded-md text-lg font-medium">
                            Start Learning
                        </a>
                        <a href="#why-lua" class="bg-gray-700 hover:bg-gray-600 text-white px-8 py-3 rounded-md text-lg font-medium">
                            Why Learn Lua?
                        </a>
                    </div>
                </div>
                <div class="mt-10 lg:mt-0 lg:w-1/2">
                    <div class="code-block">
                        <pre><code><span class="comment">-- Simple Lua example</span>
<span class="keyword">function</span> <span class="function">greet</span>(name)
    <span class="keyword">return</span> <span class="string">"Hello, "</span> .. name .. <span class="string">"!"</span>
<span class="keyword">end</span>

<span class="comment">-- Table with metatable example</span>
<span class="keyword">local</span> person = {
    name = <span class="string">"Lua Learner"</span>,
    age = <span class="number">25</span>
}

<span class="keyword">local</span> mt = {
    __tostring = <span class="keyword">function</span>(self)
        <span class="keyword">return</span> self.name .. <span class="string">", age "</span> .. self.age
    <span class="keyword">end</span>
}

setmetatable(person, mt)

<span class="hljs-built_in">print</span>(greet(person.name))  <span class="comment">-- Hello, Lua Learner!</span>
<span class="hljs-built_in">print</span>(person)             <span class="comment">-- Lua Learner, age 25</span></code></pre>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Why Learn Lua Section -->
    <section id="why-lua" class="py-16 bg-gray-800">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white text-center mb-12">
                Why Learn <span class="text-green-400">Lua</span>?
            </h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <div class="bg-gray-700 p-6 rounded-lg shadow-lg">
                    <div class="text-green-400 text-4xl mb-4">
                        <i class="fas fa-gamepad"></i>
                    </div>
                    <h3 class="text-xl font-bold text-white mb-2">Game Development</h3>
                    <p class="text-gray-300">
                        Lua is widely used in game development (World of Warcraft, Roblox, Garry's Mod) for scripting game logic and modding.
                    </p>
                </div>
                <div class="bg-gray-700 p-6 rounded-lg shadow-lg">
                    <div class="text-green-400 text-4xl mb-4">
                        <i class="fas fa-bolt"></i>
                    </div>
                    <h3 class="text-xl font-bold text-white mb-2">Lightweight & Fast</h3>
                    <p class="text-gray-300">
                        Lua is designed to be lightweight and efficient, making it perfect for embedded systems and performance-critical applications.
                    </p>
                </div>
                <div class="bg-gray-700 p-6 rounded-lg shadow-lg">
                    <div class="text-green-400 text-4xl mb-4">
                        <i class="fas fa-puzzle-piece"></i>
                    </div>
                    <h3 class="text-xl font-bold text-white mb-2">Easy to Embed</h3>
                    <p class="text-gray-300">
                        Lua's C API makes it simple to integrate with existing applications, which is why it's used in software like Redis, Nginx, and Wireshark.
                    </p>
                </div>
            </div>
        </div>
    </section>

    <!-- Getting Started Section -->
    <section id="getting-started" class="py-16 bg-gray-900">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white text-center mb-12">
                Getting Started with <span class="text-green-400">Lua</span>
            </h2>
            
            <div class="bg-gray-800 rounded-lg p-6 mb-8">
                <h3 class="text-2xl font-bold text-white mb-4">Installation</h3>
                <p class="text-gray-300 mb-4">To start coding in Lua, you'll need to install the Lua interpreter:</p>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <h4 class="text-lg font-semibold text-white mb-2">Windows</h4>
                        <div class="code-block">
                            <pre><code><span class="comment"># Using Chocolatey (recommended)</span>
choco install lua

<span class="comment"># Or download from lua.org</span></code></pre>
                        </div>
                    </div>
                    <div>
                        <h4 class="text-lg font-semibold text-white mb-2">MacOS/Linux</h4>
                        <div class="code-block">
                            <pre><code><span class="comment"># MacOS using Homebrew</span>
brew install lua

<span class="comment"># Linux (Debian/Ubuntu)</span>
sudo apt-get install lua5.3</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="mt-6">
                    <h4 class="text-lg font-semibold text-white mb-2">Verify Installation</h4>
                    <div class="code-block">
                        <pre><code>lua -v
<span class="comment"># Should output something like: Lua 5.4.3</span></code></pre>
                    </div>
                </div>
            </div>
            
            <div class="bg-gray-800 rounded-lg p-6">
                <h3 class="text-2xl font-bold text-white mb-4">Your First Lua Script</h3>
                <p class="text-gray-300 mb-4">Create a file named <span class="syntax-highlight">hello.lua</span> with the following content:</p>
                
                <div class="code-block mb-6">
                    <pre><code><span class="comment">-- This is a comment in Lua</span>
<span class="hljs-built_in">print</span>(<span class="string">"Hello, Lua World!"</span>)

<span class="comment">-- Variables</span>
<span class="keyword">local</span> name = <span class="string">"Lua Learner"</span>
<span class="keyword">local</span> age = <span class="number">25</span>

<span class="hljs-built_in">print</span>(<span class="string">"Name:"</span>, name)
<span class="hljs-built_in">print</span>(<span class="string">"Age:"</span>, age)</code></pre>
                </div>
                
                <p class="text-gray-300 mb-4">Run your script with:</p>
                <div class="code-block mb-6">
                    <pre><code>lua hello.lua</code></pre>
                </div>
                
                <p class="text-gray-300">Congratulations! You've written and executed your first Lua program.</p>
            </div>
        </div>
    </section>

    <!-- Tutorials Section -->
    <section id="tutorials" class="py-16 bg-gray-800">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white text-center mb-12">
                Lua <span class="text-green-400">Tutorials</span>
            </h2>
            
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <!-- Beginner Card -->
                <div class="lesson-card bg-gray-700 rounded-lg overflow-hidden shadow-lg transition duration-300">
                    <div class="bg-green-600 p-4">
                        <h3 class="text-xl font-bold text-white text-center">Beginner</h3>
                    </div>
                    <div class="p-6">
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-400 mt-1 mr-2"></i>
                                <span>Variables & Data Types</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-400 mt-1 mr-2"></i>
                                <span>Control Structures</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-400 mt-1 mr-2"></i>
                                <span>Functions & Scope</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-400 mt-1 mr-2"></i>
                                <span>Basic Tables</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-400 mt-1 mr-2"></i>
                                <span>Standard Libraries</span>
                            </li>
                        </ul>
                        <a href="#beginner-lessons" class="mt-6 inline-block bg-green-600 hover:bg-green-700 text-white px-6 py-2 rounded-md font-medium">
                            Start Learning
                        </a>
                    </div>
                </div>
                
                <!-- Intermediate Card -->
                <div class="lesson-card bg-gray-700 rounded-lg overflow-hidden shadow-lg transition duration-300">
                    <div class="bg-blue-500 p-4">
                        <h3 class="text-xl font-bold text-white text-center">Intermediate</h3>
                    </div>
                    <div class="p-6">
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
                                <span>Advanced Table Usage</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
                                <span>Metatables & Metamethods</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
                                <span>Coroutines</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
                                <span>Error Handling</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
                                <span>Modules & Packages</span>
                            </li>
                        </ul>
                        <a href="#intermediate-lessons" class="mt-6 inline-block bg-blue-500 hover:bg-blue-600 text-white px-6 py-2 rounded-md font-medium">
                            Continue Learning
                        </a>
                    </div>
                </div>
                
                <!-- Advanced Card -->
                <div class="lesson-card bg-gray-700 rounded-lg overflow-hidden shadow-lg transition duration-300">
                    <div class="bg-purple-600 p-4">
                        <h3 class="text-xl font-bold text-white text-center">Advanced</h3>
                    </div>
                    <div class="p-6">
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
                                <span>Lua C API</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
                                <span>Embedding Lua</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
                                <span>Performance Optimization</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
                                <span>Garbage Collection</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
                                <span>Creating DSLs</span>
                            </li>
                        </ul>
                        <a href="#advanced-lessons" class="mt-6 inline-block bg-purple-600 hover:bg-purple-700 text-white px-6 py-2 rounded-md font-medium">
                            Master Lua
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Beginner Lessons -->
    <section id="beginner-lessons" class="py-16 bg-gray-900">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white mb-8">
                <span class="text-green-400">Beginner</span> Lua Tutorials
            </h2>
            
            <div class="space-y-8">
                <!-- Lesson 1 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">1. Variables and Data Types</h3>
                        <p class="text-gray-300 mb-4">Lua is a dynamically typed language with basic types: nil, boolean, number, string, function, userdata, thread, and table.</p>
                        
                        <div class="code-block mb-6">
                            <pre><code><span class="comment">-- Variable declaration</span>
<span class="keyword">local</span> name = <span class="string">"Lua"</span>        <span class="comment">-- string</span>
<span class="keyword">local</span> version = <span class="number">5.4</span>      <span class="comment">-- number</span>
<span class="keyword">local</span> isAwesome = <span class="keyword">true</span>   <span class="comment">-- boolean</span>
<span class="keyword">local</span> nothing = <span class="keyword">nil</span>     <span class="comment">-- nil</span>

<span class="comment">-- Multiple assignment</span>
<span class="keyword">local</span> a, b, c = <span class="number">1</span>, <span class="number">2</span>, <span class="string">"three"</span>

<span class="comment">-- Type checking</span>
<span class="hljs-built_in">print</span>(<span class="hljs-built_in">type</span>(name))      <span class="comment">-- "string"</span>
<span class="hljs-built_in">print</span>(<span class="hljs-built_in">type</span>(version))  <span class="comment">-- "number"</span>
<span class="hljs-built_in">print</span>(<span class="hljs-built_in">type</span>(nothing))  <span class="comment">-- "nil"</span></code></pre>
                        </div>
                        
                        <div class="bg-gray-700 p-4 rounded-lg">
                            <h4 class="text-lg font-semibold text-white mb-2">Key Points:</h4>
                            <ul class="list-disc list-inside text-gray-300 space-y-1">
                                <li>Always use <span class="syntax-highlight">local</span> to declare variables to avoid global scope</li>
                                <li>Lua automatically converts between numbers and strings in many contexts</li>
                                <li><span class="syntax-highlight">nil</span> represents the absence of a value</li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <!-- Lesson 2 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">2. Control Structures</h3>
                        <p class="text-gray-300 mb-4">Lua provides standard control structures with a simple syntax.</p>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-white mb-2">If-Else</h4>
                                <div class="code-block">
                                    <pre><code><span class="keyword">local</span> age = <span class="number">18</span>

<span class="keyword">if</span> age < <span class="number">13</span> <span class="keyword">then</span>
    <span class="hljs-built_in">print</span>(<span class="string">"Child"</span>)
<span class="keyword">elseif</span> age < <span class="number">18</span> <span class="keyword">then</span>
    <span class="hljs-built_in">print</span>(<span class="string">"Teenager"</span>)
<span class="keyword">else</span>
    <span class="hljs-built_in">print</span>(<span class="string">"Adult"</span>)
<span class="keyword">end</span></code></pre>
                                </div>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-white mb-2">Loops</h4>
                                <div class="code-block">
                                    <pre><code><span class="comment">-- While loop</span>
<span class="keyword">local</span> i = <span class="number">1</span>
<span class="keyword">while</span> i <= <span class="number">5</span> <span class="keyword">do</span>
    <span class="hljs-built_in">print</span>(i)
    i = i + <span class="number">1</span>
<span class="keyword">end</span>

<span class="comment">-- For loop</span>
<span class="keyword">for</span> j = <span class="number">1</span>, <span class="number">5</span> <span class="keyword">do</span>
    <span class="hljs-built_in">print</span>(j)
<span class="keyword">end</span></code></pre>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Lesson 3 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">3. Functions</h3>
                        <p class="text-gray-300 mb-4">Functions are first-class citizens in Lua and can be assigned to variables, passed as arguments, and returned from other functions.</p>
                        
                        <div class="code-block mb-6">
                            <pre><code><span class="comment">-- Basic function</span>
<span class="keyword">function</span> <span class="function">greet</span>(name)
    <span class="keyword">return</span> <span class="string">"Hello, "</span> .. name
<span class="keyword">end</span>

<span class="hljs-built_in">print</span>(greet(<span class="string">"Lua"</span>))  <span class="comment">-- Hello, Lua</span>

<span class="comment">-- Function as variable</span>
<span class="keyword">local</span> add = <span class="keyword">function</span>(a, b)
    <span class="keyword">return</span> a + b
<span class="keyword">end</span>

<span class="hljs-built_in">print</span>(add(<span class="number">2</span>, <span class="number">3</span>))    <span class="comment">-- 5</span>

<span class="comment">-- Variable number of arguments</span>
<span class="keyword">function</span> <span class="function">sum</span>(...)
    <span class="keyword">local</span> total = <span class="number">0</span>
    <span class="keyword">for</span> i, num <span class="keyword">in</span> <span class="hljs-built_in">ipairs</span>({...}) <span class="keyword">do</span>
        total = total + num
    <span class="keyword">end</span>
    <span class="keyword">return</span> total
<span class="keyword">end</span>

<span class="hljs-built_in">print</span>(sum(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>))  <span class="comment">-- 10</span></code></pre>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="mt-8 text-center">
                <a href="#intermediate-lessons" class="inline-block bg-green-600 hover:bg-green-700 text-white px-8 py-3 rounded-md text-lg font-medium">
                    Continue to Intermediate Lessons →
                </a>
            </div>
        </div>
    </section>

    <!-- Intermediate Lessons -->
    <section id="intermediate-lessons" class="py-16 bg-gray-800">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white mb-8">
                <span class="text-blue-400">Intermediate</span> Lua Tutorials
            </h2>
            
            <div class="space-y-8">
                <!-- Lesson 1 -->
                <div class="bg-gray-700 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">1. Tables - Lua's Only Data Structure</h3>
                        <p class="text-gray-300 mb-4">Tables in Lua are associative arrays that can be used as arrays, dictionaries, objects, and more.</p>
                        
                        <div class="code-block mb-6">
                            <pre><code><span class="comment">-- Array-like table</span>
<span class="keyword">local</span> fruits = {<span class="string">"apple"</span>, <span class="string">"banana"</span>, <span class="string">"cherry"</span>}
<span class="hljs-built_in">print</span>(fruits[<span class="number">1</span>])  <span class="comment">-- "apple" (Lua arrays are 1-indexed)</span>

<span class="comment">-- Dictionary-like table</span>
<span class="keyword">local</span> person = {
    name = <span class="string">"Alice"</span>,
    age = <span class="number">30</span>,
    profession = <span class="string">"Developer"</span>
}

<span class="hljs-built_in">print</span>(person.name)  <span class="comment">-- "Alice"</span>
<span class="hljs-built_in">print</span>(person[<span class="string">"age"</span>]) <span class="comment">-- 30</span>

<span class="comment">-- Mixed table</span>
<span class="keyword">local</span> mixed = {
    <span class="string">"first"</span>,          <span class="comment">-- index 1</span>
    <span class="string">"second"</span>,         <span class="comment">-- index 2</span>
    name = <span class="string">"Lua"</span>,
    version = <span class="number">5.4</span>
}

<span class="comment">-- Iterating through tables</span>
<span class="keyword">for</span> k, v <span class="keyword">in</span> <span class="hljs-built_in">pairs</span>(person) <span class="keyword">do</span>
    <span class="hljs-built_in">print</span>(k, v)
<span class="keyword">end</span></code></pre>
                        </div>
                    </div>
                </div>
                
                <!-- Lesson 2 -->
                <div class="bg-gray-700 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">2. Metatables and Metamethods</h3>
                        <p class="text-gray-300 mb-4">Metatables allow you to define the behavior of tables under specific operations, enabling operator overloading and more.</p>
                        
                        <div class="code-block mb-6">
                            <pre><code><span class="comment">-- Vector addition example</span>
<span class="keyword">local</span> Vector = {}
Vector.__index = Vector

<span class="keyword">function</span> <span class="function">Vector.new</span>(x, y)
    <span class="keyword">return</span> <span class="hljs-built_in">setmetatable</span>({x = x, y = y}, Vector)
<span class="keyword">end</span>

<span class="comment">-- Define addition for vectors</span>
<span class="keyword">function</span> Vector.__add(a, b)
    <span class="keyword">return</span> Vector.new(a.x + b.x, a.y + b.y)
<span class="keyword">end</span>

<span class="comment">-- Define string representation</span>
<span class="keyword">function</span> Vector.__tostring(v)
    <span class="keyword">return</span> <span class="string">"Vector("</span> .. v.x .. <span class="string">", "</span> .. v.y .. <span class="string">")"</span>
<span class="keyword">end</span>

<span class="keyword">local</span> v1 = Vector.new(<span class="number">1</span>, <span class="number">2</span>)
<span class="keyword">local</span> v2 = Vector.new(<span class="number">3</span>, <span class="number">4</span>)
<span class="keyword">local</span> v3 = v1 + v2

<span class="hljs-built_in">print</span>(v3)  <span class="comment">-- Vector(4, 6)</span></code></pre>
                        </div>
                        
                        <div class="bg-gray-600 p-4 rounded-lg">
                            <h4 class="text-lg font-semibold text-white mb-2">Common Metamethods:</h4>
                            <ul class="grid grid-cols-1 md:grid-cols-2 gap-2 text-gray-300">
                                <li><span class="syntax-highlight">__add</span>: + operator</li>
                                <li><span class="syntax-highlight">__sub</span>: - operator</li>
                                <li><span class="syntax-highlight">__mul</span>: * operator</li>
                                <li><span class="syntax-highlight">__div</span>: / operator</li>
                                <li><span class="syntax-highlight">__tostring</span>: string representation</li>
                                <li><span class="syntax-highlight">__index</span>: table access</li>
                                <li><span class="syntax-highlight">__newindex</span>: table assignment</li>
                                <li><span class="syntax-highlight">__call</span>: makes table callable</li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <!-- Lesson 3 -->
                <div class="bg-gray-700 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">3. Coroutines</h3>
                        <p class="text-gray-300 mb-4">Coroutines in Lua allow cooperative multitasking, enabling the creation of iterators and non-preemptive threads.</p>
                        
                        <div class="code-block mb-6">
                            <pre><code><span class="comment">-- Simple coroutine example</span>
<span class="keyword">local</span> co = <span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">create</span>(<span class="keyword">function</span>()
    <span class="keyword">for</span> i = <span class="number">1</span>, <span class="number">3</span> <span class="keyword">do</span>
        <span class="hljs-built_in">print</span>(<span class="string">"Coroutine"</span>, i)
        <span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">yield</span>()
    <span class="keyword">end</span>
<span class="keyword">end</span>)

<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">resume</span>(co)  <span class="comment">-- Coroutine 1</span>
<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">resume</span>(co)  <span class="comment">-- Coroutine 2</span>
<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">resume</span>(co)  <span class="comment">-- Coroutine 3</span>

<span class="comment">-- Coroutine-based iterator</span>
<span class="keyword">function</span> <span class="function">countdown</span>(from)
    <span class="keyword">return</span> <span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">wrap</span>(<span class="keyword">function</span>()
        <span class="keyword">for</span> i = from, <span class="number">1</span>, -<span class="number">1</span> <span class="keyword">do</span>
            <span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">yield</span>(i)
        <span class="keyword">end</span>
    <span class="keyword">end</span>)
<span class="keyword">end</span>

<span class="keyword">for</span> num <span class="keyword">in</span> countdown(<span class="number">5</span>) <span class="keyword">do</span>
    <span class="hljs-built_in">print</span>(num)  <span class="comment">-- 5, 4, 3, 2, 1</span>
<span class="keyword">end</span></code></pre>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="mt-8 text-center">
                <a href="#advanced-lessons" class="inline-block bg-blue-500 hover:bg-blue-600 text-white px-8 py-3 rounded-md text-lg font-medium">
                    Continue to Advanced Lessons →
                </a>
            </div>
        </div>
    </section>

    <!-- Advanced Lessons -->
    <section id="advanced-lessons" class="py-16 bg-gray-900">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white mb-8">
                <span class="text-purple-400">Advanced</span> Lua Topics
            </h2>
            
            <div class="space-y-8">
                <!-- Lesson 1 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">1. Lua C API</h3>
                        <p class="text-gray-300 mb-4">Lua's C API allows you to embed Lua in C/C++ applications and extend Lua with C functions.</p>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-white mb-2">Embedding Lua in C</h4>
                                <div class="code-block">
                                    <pre><code><span class="comment">/* simple.c - embedding Lua in C */</span>
<span class="comment">#include &lt;lua.h&gt;</span>
<span class="comment">#include &lt;lauxlib.h&gt;</span>
<span class="comment">#include &lt;lualib.h&gt;</span>

<span class="keyword">int</span> main(<span class="keyword">void</span>) {
    <span class="comment">/* create Lua state */</span>
    lua_State *L = luaL_newstate();
    
    <span class="comment">/* load Lua libraries */</span>
    luaL_openlibs(L);
    
    <span class="comment">/* run Lua code */</span>
    luaL_dostring(L, <span class="string">"print('Hello from Lua!')"</span>);
    
    <span class="comment">/* cleanup */</span>
    lua_close(L);
    <span class="keyword">return</span> <span class="number">0</span>;
}</code></pre>
                                </div>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-white mb-2">Calling C from Lua</h4>
                                <div class="code-block">
                                    <pre><code><span class="comment">// Register a C function to be called from Lua</span>
<span class="keyword">static</span> <span class="keyword">int</span> l_add(lua_State *L) {
    <span class="keyword">int</span> a = lua_tonumber(L, <span class="number">1</span>);
    <span class="keyword">int</span> b = lua_tonumber(L, <span class="number">2</span>);
    lua_pushnumber(L, a + b);
    <span class="keyword">return</span> <span class="number">1</span>;  <span class="comment">// number of return values</span>
}

<span class="keyword">int</span> main(<span class="keyword">void</span>) {
    lua_State *L = luaL_newstate();
    luaL_openlibs(L);
    
    <span class="comment">// Register our function</span>
    lua_register(L, <span class="string">"add"</span>, l_add);
    
    <span class="comment">// Call it from Lua</span>
    luaL_dostring(L, <span class="string">"print(add(2, 3))"</span>);  <span class="comment">// prints 5</span>
    
    lua_close(L);
    <span class="keyword">return</span> <span class="number">0</span>;
}</code></pre>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Lesson 2 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">2. Performance Optimization</h3>
                        <p class="text-gray-300 mb-4">Lua is fast, but these techniques can help squeeze out even more performance.</p>
                        
                        <div class="bg-gray-700 p-4 rounded-lg mb-6">
                            <h4 class="text-lg font-semibold text-white mb-2">Optimization Tips:</h4>
                            <ul class="list-disc list-inside text-gray-300 space-y-1">
                                <li>Use <span class="syntax-highlight">local</span> variables instead of globals</li>
                                <li>Avoid table creation in tight loops</li>
                                <li>Reuse tables when possible</li>
                                <li>Use the most specific loop possible (<span class="syntax-highlight">for</span> is faster than <span class="syntax-highlight">while</span>)</li>
                                <li>Prefer <span class="syntax-highlight">ipairs</span> for array iteration</li>
                                <li>Cache frequently accessed table fields in locals</li>
                            </ul>
                        </div>
                        
                        <div class="code-block">
                            <pre><code><span class="comment">-- Before optimization</span>
<span class="keyword">for</span> i = <span class="number">1</span>, <span class="number">1000000</span> <span class="keyword">do</span>
    <span class="keyword">local</span> t = {x = <span class="number">1</span>, y = <span class="number">2</span>, z = <span class="number">3</span>}
    <span class="hljs-built_in">math</span>.<span class="hljs-built_in">sqrt</span>(t.x * t.x + t.y * t.y + t.z * t.z)
<span class="keyword">end</span>

<span class="comment">-- After optimization</span>
<span class="keyword">local</span> sqrt = <span class="hljs-built_in">math</span>.<span class="hljs-built_in">sqrt</span>  <span class="comment">-- Cache function</span>
<span class="keyword">local</span> t = {x = <span class="number">1</span>, y = <span class="number">2</span>, z = <span class="number">3</span>}  <span class="comment">-- Reuse table</span>
<span class="keyword">local</span> x, y, z = t.x, t.y, t.z  <span class="comment">-- Cache fields</span>

<span class="keyword">for</span> i = <span class="number">1</span>, <span class="number">1000000</span> <span class="keyword">do</span>
    sqrt(x * x + y * y + z * z)
<span class="keyword">end</span></code></pre>
                        </div>
                    </div>
                </div>
                
                <!-- Lesson 3 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden">
                    <div class="p-6">
                        <h3 class="text-2xl font-bold text-white mb-4">3. Creating Domain-Specific Languages (DSLs)</h3>
                        <p class="text-gray-300 mb-4">Lua's flexible syntax makes it ideal for creating embedded DSLs.</p>
                        
                        <div class="code-block mb-6">
                            <pre><code><span class="comment">-- Example: Creating a simple HTML DSL</span>
<span class="keyword">function</span> <span class="function">tag</span>(name, attrs, ...)
    <span class="keyword">local</span> attrStr = <span class="string">""</span>
    <span class="keyword">if</span> attrs <span class="keyword">then</span>
        <span class="keyword">for</span> k, v <span class="keyword">in</span> <span class="hljs-built_in">pairs</span>(attrs) <span class="keyword">do</span>
            attrStr = attrStr .. <span class="string">' '</span> .. k .. <span class="string">'="'</span> .. v .. <span class="string">'"'</span>
        <span class="keyword">end</span>
    <span class="keyword">end</span>
    
    <span class="keyword">local</span> content = <span class="hljs-built_in">table</span>.<span class="hljs-built_in">concat</span>({...}, <span class="string">""</span>)
    <span class="keyword">return</span> <span class="string">"&lt;"</span> .. name .. attrStr .. <span class="string">"&gt;"</span> .. content .. <span class="string">"&lt;/"</span> .. name .. <span class="string">"&gt;"</span>
<span class="keyword">end</span>

<span class="keyword">function</span> <span class="function">div</span>(attrs, ...) <span class="keyword">return</span> tag(<span class="string">"div"</span>, attrs, ...) <span class="keyword">end</span>
<span class="keyword">function</span> <span class="function">p</span>(attrs, ...) <span class="keyword">return</span> tag(<span class="string">"p"</span>, attrs, ...) <span class="keyword">end</span>

<span class="comment">-- Usage</span>
<span class="keyword">local</span> html = div({class=<span class="string">"container"</span>},
    p({}, <span class="string">"Hello, "</span>, <span class="string">"Lua DSL!"</span>),
    div({id=<span class="string">"content"</span>}, <span class="string">"This is a test"</span>)
)

<span class="hljs-built_in">print</span>(html)
<span class="comment">-- Outputs: &lt;div class="container"&gt;&lt;p&gt;Hello, Lua DSL!&lt;/p&gt;&lt;div id="content"&gt;This is a test&lt;/div&gt;&lt;/div&gt;</span></code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Examples Section -->
    <section id="examples" class="py-16 bg-gray-800">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white text-center mb-12">
                Lua <span class="text-green-400">Examples</span>
            </h2>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <!-- Example 1 -->
                <div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <h3 class="text-xl font-bold text-white mb-4">1. Fibonacci Sequence</h3>
                        <div class="code-block mb-4">
                            <pre><code><span class="comment">-- Memoized Fibonacci function</span>
<span class="keyword">local</span> fib_cache = {[<span class="number">0</span>] = <span class="number">0</span>, [<span class="number">1</span>] = <span class="number">1</span>}

<span class="keyword">function</span> <span class="function">fib</span>(n)
    <span class="keyword">if</span> <span class="keyword">not</span> fib_cache[n] <span class="keyword">then</span>
        fib_cache[n] = fib(n-<span class="number">1</span>) + fib(n-<span class="number">2</span>)
    <span class="keyword">end</span>
    <span class="keyword">return</span> fib_cache[n]
<span class="keyword">end</span>

<span class="comment">-- Print first 10 Fibonacci numbers</span>
<span class="keyword">for</span> i = <span class="number">0</span>, <span class="number">10</span> <span class="keyword">do</span>
    <span class="hljs-built_in">print</span>(<span class="string">"fib("</span>..i..<span class="string">") ="</span>, fib(i))
<span class="keyword">end</span></code></pre>
                        </div>
                        <button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
                            Run Example
                        </button>
                    </div>
                </div>
                
                <!-- Example 2 -->
                <div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <h3 class="text-xl font-bold text-white mb-4">2. Object-Oriented Programming</h3>
                        <div class="code-block mb-4">
                            <pre><code><span class="comment">-- Simple OOP implementation</span>
<span class="keyword">local</span> Animal = {
    sound = <span class="string">"..."</span>
}

<span class="keyword">function</span> Animal:new(o)
    o = o <span class="keyword">or</span> {}
    <span class="hljs-built_in">setmetatable</span>(o, self)
    self.__index = self
    <span class="keyword">return</span> o
<span class="keyword">end</span>

<span class="keyword">function</span> Animal:speak()
    <span class="hljs-built_in">print</span>(self.sound)
<span class="keyword">end</span>

<span class="comment">-- Create a Dog class</span>
<span class="keyword">local</span> Dog = Animal:new({sound = <span class="string">"woof!"</span>})

<span class="keyword">function</span> Dog:wag()
    <span class="hljs-built_in">print</span>(<span class="string">"Tail wagging!"</span>)
<span class="keyword">end</span>

<span class="comment">-- Create instances</span>
<span class="keyword">local</span> spot = Dog:new()
spot:speak()  <span class="comment">-- woof!</span>
spot:wag()    <span class="comment">-- Tail wagging!</span></code></pre>
                        </div>
                        <button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
                            Run Example
                        </button>
                    </div>
                </div>
                
                <!-- Example 3 -->
                <div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <h3 class="text-xl font-bold text-white mb-4">3. Simple HTTP Server</h3>
                        <div class="code-block mb-4">
                            <pre><code><span class="comment">-- Requires LuaSocket library</span>
<span class="keyword">local</span> socket = <span class="hljs-built_in">require</span> <span class="string">"socket"</span>

<span class="keyword">local</span> host = <span class="string">"localhost"</span>
<span class="keyword">local</span> port = <span class="number">8080</span>

<span class="keyword">local</span> server = <span class="hljs-built_in">assert</span>(socket.bind(host, port))
<span class="hljs-built_in">print</span>(<span class="string">"Server running on http://"</span>..host..<span class="string">":"</span>..port)

<span class="keyword">while</span> <span class="keyword">true</span> <span class="keyword">do</span>
    <span class="keyword">local</span> client = server:accept()
    client:settimeout(<span class="number">10</span>)
    
    <span class="keyword">local</span> request = client:receive()
    <span class="hljs-built_in">print</span>(<span class="string">"Request: "</span>..request)
    
    <span class="keyword">local</span> response = {
        <span class="string">"HTTP/1.1 200 OK\r\n"</span>,
        <span class="string">"Content-Type: text/html\r\n\r\n"</span>,
        <span class="string">"&lt;html&gt;&lt;body&gt;"</span>,
        <span class="string">"&lt;h1&gt;Hello from Lua Server!&lt;/h1&gt;"</span>,
        <span class="string">"&lt;p&gt;Request: "</span>..request..<span class="string">"&lt;/p&gt;"</span>,
        <span class="string">"&lt;/body&gt;&lt;/html&gt;"</span>
    }
    
    client:send(<span class="hljs-built_in">table</span>.<span class="hljs-built_in">concat</span>(response))
    client:close()
<span class="keyword">end</span></code></pre>
                        </div>
                        <button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
                            Run Example
                        </button>
                    </div>
                </div>
                
                <!-- Example 4 -->
                <div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <h3 class="text-xl font-bold text-white mb-4">4. Game Loop Example</h3>
                        <div class="code-block mb-4">
                            <pre><code><span class="comment">-- Simple game loop structure</span>
<span class="keyword">local</span> Game = {
    running = <span class="keyword">true</span>,
    entities = {}
}

<span class="keyword">function</span> <span class="function">Game:addEntity</span>(entity)
    <span class="hljs-built_in">table</span>.<span class="hljs-built_in">insert</span>(self.entities, entity)
<span class="keyword">end</span>

<span class="keyword">function</span> <span class="function">Game:update</span>(dt)
    <span class="keyword">for</span> i, entity <span class="keyword">in</span> <span class="hljs-built_in">ipairs</span>(self.entities) <span class="keyword">do</span>
        <span class="keyword">if</span> entity.update <span class="keyword">then</span>
            entity:update(dt)
        <span class="keyword">end</span>
    <span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">function</span> <span class="function">Game:draw</span>()
    <span class="keyword">for</span> i, entity <span class="keyword">in</span> <span class="hljs-built_in">ipairs</span>(self.entities) <span class="keyword">do</span>
        <span class="keyword">if</span> entity.draw <span class="keyword">then</span>
            entity:draw()
        <span class="keyword">end</span>
    <span class="keyword">end</span>
<span class="keyword">end</span>

<span class="comment">-- Main game loop</span>
<span class="keyword">local</span> lastTime = socket.gettime()
<span class="keyword">while</span> Game.running <span class="keyword">do</span>
    <span class="keyword">local</span> currentTime = socket.gettime()
    <span class="keyword">local</span> dt = currentTime - lastTime
    lastTime = currentTime
    
    Game:update(dt)
    Game:draw()
    
    <span class="comment">-- Simple delay to simulate frame rate</span>
    socket.sleep(<span class="number">0.016</span>)  <span class="comment">-- ~60 FPS</span>
<span class="keyword">end</span></code></pre>
                        </div>
                        <button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
                            Run Example
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Resources Section -->
    <section id="resources" class="py-16 bg-gray-900">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white text-center mb-12">
                Lua <span class="text-green-400">Resources</span>
            </h2>
            
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
                <!-- Resource 1 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <div class="text-blue-400 text-3xl mb-4">
                            <i class="fas fa-book"></i>
                        </div>
                        <h3 class="text-xl font-bold text-white mb-2">Official Documentation</h3>
                        <p class="text-gray-300 mb-4">
                            The official Lua documentation and reference manuals.
                        </p>
                        <a href="https://www.lua.org/docs.html" target="_blank" class="text-blue-400 hover:text-blue-300 font-medium">
                            Visit Site →
                        </a>
                    </div>
                </div>
                
                <!-- Resource 2 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <div class="text-green-400 text-3xl mb-4">
                            <i class="fas fa-graduation-cap"></i>
                        </div>
                        <h3 class="text-xl font-bold text-white mb-2">Lua Tutorial</h3>
                        <p class="text-gray-300 mb-4">
                            A comprehensive tutorial covering Lua from basics to advanced topics.
                        </p>
                        <a href="https://www.tutorialspoint.com/lua/" target="_blank" class="text-green-400 hover:text-green-300 font-medium">
                            Visit Site →
                        </a>
                    </div>
                </div>
                
                <!-- Resource 3 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <div class="text-purple-400 text-3xl mb-4">
                            <i class="fas fa-code"></i>
                        </div>
                        <h3 class="text-xl font-bold text-white mb-2">Lua Users Wiki</h3>
                        <p class="text-gray-300 mb-4">
                            Community-driven wiki with code samples, libraries, and tips.
                        </p>
                        <a href="https://lua-users.org/wiki/" target="_blank" class="text-purple-400 hover:text-purple-300 font-medium">
                            Visit Site →
                        </a>
                    </div>
                </div>
                
                <!-- Resource 4 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <div class="text-yellow-400 text-3xl mb-4">
                            <i class="fas fa-gamepad"></i>
                        </div>
                        <h3 class="text-xl font-bold text-white mb-2">LÖVE Framework</h3>
                        <p class="text-gray-300 mb-4">
                            A framework for making 2D games in Lua.
                        </p>
                        <a href="https://love2d.org/" target="_blank" class="text-yellow-400 hover:text-yellow-300 font-medium">
                            Visit Site →
                        </a>
                    </div>
                </div>
                
                <!-- Resource 5 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <div class="text-red-400 text-3xl mb-4">
                            <i class="fas fa-cubes"></i>
                        </div>
                        <h3 class="text-xl font-bold text-white mb-2">LuaRocks</h3>
                        <p class="text-gray-300 mb-4">
                            Package manager for Lua modules.
                        </p>
                        <a href="https://luarocks.org/" target="_blank" class="text-red-400 hover:text-red-300 font-medium">
                            Visit Site →
                        </a>
                    </div>
                </div>
                
                <!-- Resource 6 -->
                <div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
                    <div class="p-6">
                        <div class="text-pink-400 text-3xl mb-4">
                            <i class="fas fa-comments"></i>
                        </div>
                        <h3 class="text-xl font-bold text-white mb-2">Lua Forum</h3>
                        <p class="text-gray-300 mb-4">
                            Official forum for Lua discussions and questions.
                        </p>
                        <a href="https://www.lua.org/lua-l.html" target="_blank" class="text-pink-400 hover:text-pink-300 font-medium">
                            Visit Site →
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Community Section -->
    <section id="community" class="py-16 bg-gray-800">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <h2 class="text-3xl font-extrabold text-white text-center mb-12">
                Join the <span class="text-green-400">Community</span>
            </h2>
            
            <div class="bg-gray-700 rounded-lg p-8">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-2xl font-bold text-white mb-4">Get Involved</h3>
                        <p class="text-gray-300 mb-6">
                            Lua has a vibrant community of developers, from game modders to embedded systems engineers. Join discussions, ask questions, and share your projects.
                        </p>
                        
                        <div class="space-y-4">
                            <div class="flex items-start">
                                <div class="flex-shrink-0 text-green-400 mt-1 mr-3">
                                    <i class="fab fa-discord fa-lg"></i>
                                </div>
                                <div>
                                    <h4 class="text-lg font-semibold text-white">Discord Server</h4>
                                    <p class="text-gray-300">Join our Discord community for real-time discussions and support.</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 text-blue-400 mt-1 mr-3">
                                    <i class="fab fa-github fa-lg"></i>
                                </div>
                                <div>
                                    <h4 class="text-lg font-semibold text-white">GitHub</h4>
                                    <p class="text-gray-300">Contribute to open-source Lua projects and libraries.</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 text-red-400 mt-1 mr-3">
                                    <i class="fab fa-youtube fa-lg"></i>
                                </div>
                                <div>
                                    <h4 class="text-lg font-semibold text-white">YouTube</h4>
                                    <p class="text-gray-300">Watch tutorials and live coding sessions.</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-2xl font-bold text-white mb-4">Newsletter</h3>
                        <p class="text-gray-300 mb-6">
                            Subscribe to our newsletter for Lua tips, tutorials, and community news.
                        </p>
                        
                        <form class="space-y-4">
                            <div>
                                <label for="name" class="block text-sm font-medium text-gray-300">Name</label>
                                <input type="text" id="name" class="mt-1 block w-full bg-gray-600 border border-gray-500 rounded-md shadow-sm py-2 px-3 text-white focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                            
                            <div>
                                <label for="email" class="block text-sm font-medium text-gray-300">Email</label>
                                <input type="email" id="email" class="mt-1 block w-full bg-gray-600 border border-gray-500 rounded-md shadow-sm py-2 px-3 text-white focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                            
                            <div class="flex items-center">
                                <input id="subscribe" name="subscribe" type="checkbox" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                <label for="subscribe" class="ml-2 block text-sm text-gray-300">
                                    I agree to receive emails about Lua programming
                                </label>
                            </div>
                            
                            <button type="submit" class="w-full bg-green-600 hover:bg-green-700 text-white py-2 px-4 rounded-md font-medium">
                                Subscribe
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 py-12">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-lg font-semibold text-white mb-4">Lua Mastery</h3>
                    <p class="text-gray-400">
                        Your complete guide to learning Lua programming from beginner to advanced.
                    </p>
                </div>
                
                <div>
                    <h3 class="text-lg font-semibold text-white mb-4">Quick Links</h3>
                    <ul class="space-y-2">
                        <li><a href="#home" class="text-gray-400 hover:text-white">Home</a></li>
                        <li><a href="#tutorials" class="text-gray-400 hover:text-white">Tutorials</a></li>
                        <li><a href="#examples" class="text-gray-400 hover:text-white">Examples</a></li>
                        <li><a href="#resources" class="text-gray-400 hover:text-white">Resources</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-semibold text-white mb-4">Legal</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white">Privacy Policy</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white">Terms of Service</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white">Cookie Policy</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-semibold text-white mb-4">Connect</h3>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white">
                            <i class="fab fa-twitter fa-lg"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white">
                            <i class="fab fa-github fa-lg"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white">
                            <i class="fab fa-discord fa-lg"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white">
                            <i class="fab fa-youtube fa-lg"></i>
                        </a>
                    </div>
                </div>
            </div>
            
            <div class="mt-12 pt-8 border-t border-gray-800">
                <p class="text-gray-400 text-center">
                    &copy; 2023
<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=seannyboy/learn-lua" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>