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

    <!-- Sidebar -->
    <div id="sidebar" class="sidebar bg-gradient-to-b from-purple-700 to-blue-600 text-white w-64 p-4 fixed h-full">
        <div class="flex items-center mb-8">
            <i class="fas fa-brain text-3xl mr-2"></i>
            <h1 class="text-2xl font-bold">DeepSeek HW</h1>
        </div>
        
        <div class="mb-8">
            <h2 class="text-lg font-semibold mb-2">Quick Actions</h2>
            <button id="newTaskBtn" class="w-full bg-white text-purple-600 py-2 px-4 rounded-lg mb-2 font-medium hover:bg-gray-100 transition flex items-center justify-center">
                <i class="fas fa-plus mr-2"></i> New Task
            </button>
            <button id="aiAssistBtn" class="w-full bg-purple-800 text-white py-2 px-4 rounded-lg font-medium hover:bg-purple-900 transition flex items-center justify-center">
                <i class="fas fa-robot mr-2"></i> AI Assist
            </button>
        </div>
        
        <div class="mb-8">
            <h2 class="text-lg font-semibold mb-2">Subjects</h2>
            <ul>
                <li class="mb-2">
                    <a href="#" class="subject-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-subject="math">
                        <i class="fas fa-square-root-alt mr-2"></i> Mathematics
                    </a>
                </li>
                <li class="mb-2">
                    <a href="#" class="subject-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-subject="science">
                        <i class="fas fa-flask mr-2"></i> Science
                    </a>
                </li>
                <li class="mb-2">
                    <a href="#" class="subject-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-subject="history">
                        <i class="fas fa-landmark mr-2"></i> History
                    </a>
                </li>
                <li class="mb-2">
                    <a href="#" class="subject-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-subject="english">
                        <i class="fas fa-book mr-2"></i> English
                    </a>
                </li>
                <li class="mb-2">
                    <a href="#" class="subject-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-subject="coding">
                        <i class="fas fa-code mr-2"></i> Coding
                    </a>
                </li>
                <li>
                    <a href="#" class="subject-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-subject="other">
                        <i class="fas fa-ellipsis-h mr-2"></i> Other
                    </a>
                </li>
            </ul>
        </div>
        
        <div class="mb-8">
            <h2 class="text-lg font-semibold mb-2">Filters</h2>
            <ul>
                <li class="mb-2">
                    <a href="#" class="status-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-status="all">
                        <i class="fas fa-tasks mr-2"></i> All Tasks
                    </a>
                </li>
                <li class="mb-2">
                    <a href="#" class="status-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-status="pending">
                        <i class="fas fa-clock mr-2"></i> Pending
                    </a>
                </li>
                <li class="mb-2">
                    <a href="#" class="status-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-status="completed">
                        <i class="fas fa-check-circle mr-2"></i> Completed
                    </a>
                </li>
                <li>
                    <a href="#" class="status-filter flex items-center p-2 rounded hover:bg-purple-800 transition" data-status="overdue">
                        <i class="fas fa-exclamation-circle mr-2"></i> Overdue
                    </a>
                </li>
            </ul>
        </div>
        
        <div class="absolute bottom-4 left-0 right-0 px-4">
            <div class="bg-purple-800 p-3 rounded-lg hover:bg-purple-900 transition cursor-pointer">
                <div class="flex items-center">
                    <div class="w-10 h-10 rounded-full bg-purple-600 flex items-center justify-center mr-3">
                        <i class="fas fa-user"></i>
                    </div>
                    <div>
                        <p class="font-medium">Student Profile</p>
                        <p class="text-xs text-purple-200">View your progress</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="ml-0 md:ml-64 transition-all duration-300">
        <!-- Header -->
        <header class="gradient-bg text-white p-4 shadow-lg">
            <div class="container mx-auto flex justify-between items-center">
                <h1 class="text-2xl font-bold">Homework Dashboard</h1>
                <div class="relative">
                    <input type="text" placeholder="Search tasks..." class="bg-white bg-opacity-20 placeholder-white text-white rounded-full py-2 px-4 pl-10 focus:outline-none focus:ring-2 focus:ring-white w-48 md:w-64 transition-all duration-300">
                    <i class="fas fa-search absolute left-3 top-3 text-white"></i>
                </div>
            </div>
        </header>

        <!-- Stats Overview -->
        <div class="container mx-auto p-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
                <div class="bg-white rounded-lg shadow p-4 flex items-center hover:shadow-md transition">
                    <div class="bg-blue-100 p-3 rounded-full mr-4">
                        <i class="fas fa-tasks text-blue-600 text-xl"></i>
                    </div>
                    <div>
                        <p class="text-gray-500">Total Tasks</p>
                        <p class="text-2xl font-bold" id="totalTasks">0</p>
                    </div>
                </div>
                <div class="bg-white rounded-lg shadow p-4 flex items-center hover:shadow-md transition">
                    <div class="bg-green-100 p-3 rounded-full mr-4">
                        <i class="fas fa-check-circle text-green-600 text-xl"></i>
                    </div>
                    <div>
                        <p class="text-gray-500">Completed</p>
                        <p class="text-2xl font-bold" id="completedTasks">0</p>
                    </div>
                </div>
                <div class="bg-white rounded-lg shadow p-4 flex items-center hover:shadow-md transition">
                    <div class="bg-yellow-100 p-3 rounded-full mr-4">
                        <i class="fas fa-clock text-yellow-600 text-xl"></i>
                    </div>
                    <div>
                        <p class="text-gray-500">Pending</p>
                        <p class="text-2xl font-bold" id="pendingTasks">0</p>
                    </div>
                </div>
                <div class="bg-white rounded-lg shadow p-4 flex items-center hover:shadow-md transition">
                    <div class="bg-red-100 p-3 rounded-full mr-4">
                        <i class="fas fa-exclamation-circle text-red-600 text-xl"></i>
                    </div>
                    <div>
                        <p class="text-gray-500">Overdue</p>
                        <p class="text-2xl font-bold" id="overdueTasks">0</p>
                    </div>
                </div>
            </div>

            <!-- Progress Bar -->
            <div class="bg-white rounded-lg shadow p-4 mb-6">
                <div class="flex justify-between items-center mb-2">
                    <h2 class="text-lg font-semibold">Your Progress</h2>
                    <span class="text-sm font-medium text-purple-600" id="progressPercentage">0%</span>
                </div>
                <div class="progress-bar">
                    <div class="progress-fill" id="progressFill" style="width: 0%"></div>
                </div>
            </div>

            <!-- Task List -->
            <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
                <div class="p-4 border-b flex justify-between items-center">
                    <h2 class="text-xl font-semibold">Your Tasks</h2>
                    <div class="flex space-x-2">
                        <button id="sortDateBtn" class="bg-gray-100 hover:bg-gray-200 px-3 py-1 rounded text-sm flex items-center">
                            <i class="fas fa-calendar-alt mr-1"></i> Sort by Date
                        </button>
                        <button id="sortPriorityBtn" class="bg-gray-100 hover:bg-gray-200 px-3 py-1 rounded text-sm flex items-center">
                            <i class="fas fa-flag mr-1"></i> Sort by Priority
                        </button>
                    </div>
                </div>
                <div id="taskList" class="divide-y">
                    <!-- Tasks will be loaded here -->
                </div>
            </div>

            <!-- DeepSeek Integration -->
            <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
                <div class="p-4 border-b">
                    <h2 class="text-xl font-semibold">DeepSeek AI Assistant</h2>
                    <p class="text-gray-600">Get help with your homework using AI</p>
                </div>
                <div class="p-4">
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
                        <div>
                            <label class="block text-gray-700 mb-2">Subject</label>
                            <select id="aiSubject" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500">
                                <option value="math">Mathematics</option>
                                <option value="science">Science</option>
                                <option value="history">History</option>
                                <option value="english">English</option>
                                <option value="coding">Coding</option>
                                <option value="other">Other</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-gray-700 mb-2">Topic</label>
                            <input type="text" id="aiTopic" placeholder="Enter topic or question" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500">
                        </div>
                    </div>
                    <div class="mb-4">
                        <label class="block text-gray-700 mb-2">Your Question</label>
                        <textarea id="aiQuestion" rows="3" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Describe what you need help with..."></textarea>
                    </div>
                    <div class="flex justify-end">
                        <button id="askAIBtn" class="gradient-bg text-white py-2 px-6 rounded-lg hover:opacity-90 transition flex items-center">
                            <i class="fas fa-paper-plane mr-2"></i> Ask DeepSeek
                        </button>
                    </div>
                    <div id="aiResponse" class="mt-4 p-4 bg-gray-50 rounded-lg hidden">
                        <div class="flex justify-between items-center mb-2">
                            <h3 class="font-semibold">AI Response</h3>
                            <button id="copyResponseBtn" class="text-gray-500 hover:text-purple-600">
                                <i class="fas fa-copy"></i>
                            </button>
                        </div>
                        <div id="aiResponseContent" class="markdown-content"></div>
                    </div>
                </div>
            </div>

            <!-- Coding Workspace -->
            <div class="bg-white rounded-lg shadow overflow-hidden">
                <div class="p-4 border-b">
                    <h2 class="text-xl font-semibold">Coding Workspace</h2>
                    <p class="text-gray-600">Practice coding and get AI assistance</p>
                </div>
                <div class="p-4">
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
                        <div>
                            <label class="block text-gray-700 mb-2">Language</label>
                            <select id="codeLanguage" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500">
                                <option value="javascript">JavaScript</option>
                                <option value="python">Python</option>
                                <option value="java">Java</option>
                                <option value="csharp">C#</option>
                                <option value="cpp">C++</option>
                                <option value="html">HTML</option>
                                <option value="css">CSS</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-gray-700 mb-2">Theme</label>
                            <select id="codeTheme" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500">
                                <option value="light">Light</option>
                                <option value="dark" selected>Dark</option>
                                <option value="solarized">Solarized</option>
                            </select>
                        </div>
                    </div>
                    <div class="code-editor mb-4">
                        <div class="flex justify-between items-center bg-gray-800 text-white p-2 rounded-t-lg">
                            <div class="flex items-center">
                                <div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <div id="fileNameDisplay" class="text-sm">script.js</div>
                        </div>
                        <textarea id="codeEditor" class="w-full h-64 p-4 text-white font-mono focus:outline-none" spellcheck="false">// Write your code here
// You can get AI assistance by clicking the button below

function greet(name) {
    return `Hello, ${name}!`;
}

console.log(greet("DeepSeek User"));</textarea>
                    </div>
                    <div class="flex justify-between">
                        <div>
                            <button id="runCodeBtn" class="bg-green-600 text-white py-2 px-4 rounded-lg mr-2 hover:bg-green-700 transition flex items-center">
                                <i class="fas fa-play mr-2"></i> Run Code
                            </button>
                            <button id="debugCodeBtn" class="bg-blue-600 text-white py-2 px-4 rounded-lg hover:bg-blue-700 transition flex items-center">
                                <i class="fas fa-bug mr-2"></i> Debug
                            </button>
                        </div>
                        <button id="codeHelpBtn" class="gradient-bg text-white py-2 px-6 rounded-lg hover:opacity-90 transition flex items-center">
                            <i class="fas fa-robot mr-2"></i> Get AI Help
                        </button>
                    </div>
                    <div id="codeOutput" class="mt-4 p-4 bg-gray-800 text-white rounded-lg font-mono hidden">
                        <div class="flex justify-between items-center mb-2">
                            <h3 class="font-semibold">Output</h3>
                            <button id="clearOutputBtn" class="text-gray-400 hover:text-white">
                                <i class="fas fa-trash-alt"></i>
                            </button>
                        </div>
                        <pre id="outputContent"></pre>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Task Modal -->
    <div id="taskModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-xl w-full max-w-md">
            <div class="p-4 border-b flex justify-between items-center">
                <h3 class="text-lg font-semibold" id="modalTitle">Add New Task</h3>
                <button id="closeModalBtn" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="p-4">
                <div class="mb-4">
                    <label class="block text-gray-700 mb-2">Task Title</label>
                    <input type="text" id="taskTitle" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Enter task title">
                </div>
                <div class="mb-4">
                    <label class="block text-gray-700 mb-2">Subject</label>
                    <select id="taskSubject" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500">
                        <option value="math">Mathematics</option>
                        <option value="science">Science</option>
                        <option value="history">History</option>
                        <option value="english">English</option>
                        <option value="coding">Coding</option>
                        <option value="other">Other</option>
                    </select>
                </div>
                <div class="grid grid-cols-2 gap-4 mb-4">
                    <div>
                        <label class="block text-gray-700 mb-2">Due Date</label>
                        <input type="date" id="taskDueDate" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500">
                    </div>
                    <div>
                        <label class="block text-gray-700 mb-2">Priority</label>
                        <select id="taskPriority" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500">
                            <option value="low">Low</option>
                            <option value="medium" selected>Medium</option>
                            <option value="high">High</option>
                        </select>
                    </div>
                </div>
                <div class="mb-4">
                    <label class="block text-gray-700 mb-2">Description</label>
                    <textarea id="taskDescription" rows="3" class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Enter task details..."></textarea>
                </div>
            </div>
            <div class="p-4 border-t flex justify-end">
                <button id="cancelTaskBtn" class="bg-gray-200 text-gray-800 py-2 px-4 rounded-lg mr-2 hover:bg-gray-300 transition">
                    Cancel
                </button>
                <button id="saveTaskBtn" class="gradient-bg text-white py-2 px-6 rounded-lg hover:opacity-90 transition">
                    Save Task
                </button>
            </div>
        </div>
    </div>

    <!-- Floating Action Button -->
    <div class="fixed bottom-6 right-6 z-20">
        <button id="quickAddBtn" class="gradient-bg text-white w-14 h-14 rounded-full flex items-center justify-center shadow-lg floating-btn pulse-animation">
            <i class="fas fa-plus text-xl"></i>
        </button>
    </div>

    <script>
        // Sample tasks data
        let tasks = [
            {
                id: 1,
                title: "Math homework - Algebra",
                subject: "math",
                dueDate: "2023-06-15",
                priority: "high",
                description: "Complete exercises 1-20 on page 45",
                status: "pending",
                createdAt: new Date("2023-06-10")
            },
            {
                id: 2,
                title: "Science project research",
                subject: "science",
                dueDate: "2023-06-20",
                priority: "medium",
                description: "Research on renewable energy sources",
                status: "pending",
                createdAt: new Date("2023-06-05")
            },
            {
                id: 3,
                title: "History essay",
                subject: "history",
                dueDate: "2023-06-12",
                priority: "high",
                description: "Write 1000-word essay on World War II",
                status: "completed",
                createdAt: new Date("2023-05-30")
            },
            {
                id: 4,
                title: "English reading",
                subject: "english",
                dueDate: "2023-06-08",
                priority: "low",
                description: "Read chapters 5-7 of To Kill a Mockingbird",
                status: "overdue",
                createdAt: new Date("2023-05-25")
            },
            {
                id: 5,
                title: "JavaScript practice",
                subject: "coding",
                dueDate: "2023-06-18",
                priority: "medium",
                description: "Complete coding challenges on functions",
                status: "pending",
                createdAt: new Date("2023-06-01")
            }
        ];

        // DOM Elements
        const taskList = document.getElementById('taskList');
        const taskModal = document.getElementById('taskModal');
        const newTaskBtn = document.getElementById('newTaskBtn');
        const quickAddBtn = document.getElementById('quickAddBtn');
        const closeModalBtn = document.getElementById('closeModalBtn');
        const cancelTaskBtn = document.getElementById('cancelTaskBtn');
        const saveTaskBtn = document.getElementById('saveTaskBtn');
        const subjectFilters = document.querySelectorAll('.subject-filter');
        const statusFilters = document.querySelectorAll('.status-filter');
        const sortDateBtn = document.getElementById('sortDateBtn');
        const sortPriorityBtn = document.getElementById('sortPriorityBtn');
        const totalTasksEl = document.getElementById('totalTasks');
        const completedTasksEl = document.getElementById('completedTasks');
        const pendingTasksEl = document.getElementById('pendingTasks');
        const overdueTasksEl = document.getElementById('overdueTasks');
        const progressPercentage = document.getElementById('progressPercentage');
        const progressFill = document.getElementById('progressFill');
        const menuToggle = document.getElementById('menuToggle');
        const sidebar = document.getElementById('sidebar');
        const aiAssistBtn = document.getElementById('aiAssistBtn');
        const askAIBtn = document.getElementById('askAIBtn');
        const aiResponse = document.getElementById('aiResponse');
        const aiResponseContent = document.getElementById('aiResponseContent');
        const copyResponseBtn = document.getElementById('copyResponseBtn');
        const runCodeBtn = document.getElementById('runCodeBtn');
        const debugCodeBtn = document.getElementById('debugCodeBtn');
        const codeHelpBtn = document.getElementById('codeHelpBtn');
        const codeOutput = document.getElementById('codeOutput');
        const outputContent = document.getElementById('outputContent');
        const clearOutputBtn = document.getElementById('clearOutputBtn');
        const codeEditor = document.getElementById('codeEditor');
        const codeLanguage = document.getElementById('codeLanguage');
        const fileNameDisplay = document.getElementById('fileNameDisplay');

        // Current filter and sort states
        let currentFilter = { subject: 'all', status: 'all' };
        let currentSort = 'date';

        // Initialize the app
        function init() {
            renderTasks();
            updateStats();
            updateProgress();
            setupEventListeners();
        }

        // Set up event listeners
        function setupEventListeners() {
            // Task management
            newTaskBtn.addEventListener('click', openTaskModal);
            quickAddBtn.addEventListener('click', openTaskModal);
            closeModalBtn.addEventListener('click', closeTaskModal);
            cancelTaskBtn.addEventListener('click', closeTaskModal);
            saveTaskBtn.addEventListener('click', saveTask);
            
            // Filtering
            subjectFilters.forEach(filter => {
                filter.addEventListener('click', (e) => {
                    e.preventDefault();
                    currentFilter.subject = filter.dataset.subject;
                    updateActiveFilters();
                    renderTasks();
                });
            });
            
            statusFilters.forEach(filter => {
                filter.addEventListener('click', (e) => {
                    e.preventDefault();
                    currentFilter.status = filter.dataset.status;
                    updateActiveFilters();
                    renderTasks();
                });
            });
            
            // Sorting
            sortDateBtn.addEventListener('click', () => {
                currentSort = 'date';
                updateActiveSort();
                renderTasks();
            });
            
            sortPriorityBtn.addEventListener('click', () => {
                currentSort = 'priority';
                updateActiveSort();
                renderTasks();
            });
            
            // Mobile menu
            menuToggle.addEventListener('click', toggleSidebar);
            
            // AI Assistance
            aiAssistBtn.addEventListener('click', scrollToAI);
            askAIBtn.addEventListener('click', askAIQuestion);
            copyResponseBtn.addEventListener('click', copyAIResponse);
            
            // Coding workspace
            runCodeBtn.addEventListener('click', runCode);
            debugCodeBtn.addEventListener('click', debugCode);
            codeHelpBtn.addEventListener('click', getCodeHelp);
            clearOutputBtn.addEventListener('click', clearOutput);
            codeLanguage.addEventListener('change', updateFileName);
            
            // Initialize code editor
            updateFileName();
        }

        // Render tasks based on current filters and sort
        function renderTasks() {
            // Filter tasks
            let filteredTasks = tasks.filter(task => {
                let subjectMatch = currentFilter.subject === 'all' || task.subject === currentFilter.subject;
                let statusMatch = currentFilter.status === 'all' || task.status === currentFilter.status;
                return subjectMatch && statusMatch;
            });
            
            // Sort tasks
            if (currentSort === 'date') {
                filteredTasks.sort((a, b) => new Date(a.dueDate) - new Date(b.dueDate));
            } else {
                const priorityOrder = { high: 3, medium: 2, low: 1 };
                filteredTasks.sort((a, b) => priorityOrder[b.priority] - priorityOrder[a.priority]);
            }
            
            // Clear task list
            taskList.innerHTML = '';
            
            // Render each task
            if (filteredTasks.length === 0) {
                taskList.innerHTML = `
                    <div class="p-8 text-center text-gray-500">
                        <i class="fas fa-tasks text-4xl mb-2"></i>
                        <p>No tasks found matching your criteria</p>
                    </div>
                `;
                return;
            }
            
            filteredTasks.forEach(task => {
                const taskElement = createTaskElement(task);
                taskList.appendChild(taskElement);
            });
        }

        // Create a task element
        function createTaskElement(task) {
            const taskElement = document.createElement('div');
            taskElement.className = `task-item p-4 hover:bg-gray-50 transition cursor-pointer task-priority-${task.priority}`;
            taskElement.dataset.id = task.id;
            
            // Determine status color
            let statusColor = '';
            if (task.status === 'completed') {
                statusColor = 'bg-green-100 text-green-800';
            } else if (task.status === 'overdue') {
                statusColor = 'bg-red-100 text-red-800';
            } else {
                statusColor = 'bg-yellow-100 text-yellow-800';
            }
            
            // Determine priority icon
            let priorityIcon = '';
            if (task.priority === 'high') {
                priorityIcon = '<i class="fas fa-flag text-red-500 mr-1"></i>';
            } else if (task.priority === 'medium') {
                priorityIcon = '<i class="fas fa-flag text-yellow-500 mr-1"></i>';
            } else {
                priorityIcon = '<i class="fas fa-flag text-gray-500 mr-1"></i>';
            }
            
            // Determine subject icon
            let subjectIcon = '';
            switch(task.subject) {
                case 'math':
                    subjectIcon = '<i class="fas fa-square-root-alt text-purple-600"></i>';
                    break;
                case 'science':
                    subjectIcon = '<i class="fas fa-flask text-blue-600"></i>';
                    break;
                case 'history':
                    subjectIcon = '<i class="fas fa-landmark text-amber-600"></i>';
                    break;
                case 'english':
                    subjectIcon = '<i class="fas fa-book text-green-600"></i>';
                    break;
                case 'coding':
                    subjectIcon = '<i class="fas fa-code text-indigo-600"></i>';
                    break;
                default:
                    subjectIcon = '<i class="fas fa-ellipsis-h text-gray-600"></i>';
            }
            
            // Format due date
            const dueDate = new Date(task.dueDate);
            const today = new Date();
            today.setHours(0, 0, 0, 0);
            const tomorrow = new Date(today);
            tomorrow.setDate(tomorrow.getDate() + 1);
            
            let dateDisplay = '';
            if (dueDate.toDateString() === today.toDateString()) {
                dateDisplay = 'Today';
            } else if (dueDate.toDateString() === tomorrow.toDateString()) {
                dateDisplay = 'Tomorrow';
            } else {
                dateDisplay = dueDate.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
            }
            
            // Check if overdue
            const isOverdue = task.status !== 'completed' && dueDate < today;
            
            taskElement.innerHTML = `
                <div class="flex justify-between items-start">
                    <div class="flex items-start">
                        <div class="mr-3 mt-1">
                            <button class="complete-btn w-6 h-6 rounded-full border-2 ${task.status === 'completed' ? 'bg-green-500 border-green-500' : 'border-gray-300'} flex items-center justify-center">
                                ${task.status === 'completed' ? '<i class="fas fa-check text-white text-xs"></i>' : ''}
                            </button>
                        </div>
                        <div>
                            <h3 class="font-medium ${task.status === 'completed' ? 'line-through text-gray-500' : ''}">${priorityIcon} ${task.title}</h3>
                            <p class="text-sm text-gray-600 mt-1">${task.description}</p>
                            <div class="flex items-center mt-2 space-x-3">
                                <span class="text-xs px-2 py-1 rounded-full ${statusColor}">${task.status}</span>
                                <span class="text-xs text-gray-500 flex items-center">${subjectIcon} <span class="ml-1">${task.subject.charAt(0).toUpperCase() + task.subject.slice(1)}</span></span>
                                <span class="text-xs text-gray-500">Due: ${dateDisplay} ${isOverdue ? '⚠️' : ''}</span>
                            </div>
                        </div>
                    </div>
                    <div class="flex space-x-2">
                        <button class="edit-btn p-1 text-gray-500 hover:text-purple-600">
                            <i class="fas fa-edit"></i>
                        </button>
                        <button class="delete-btn p-1 text-gray-500 hover:text-red-600">
                            <i class="fas fa-trash-alt"></i>
                        </button>
                    </div>
                </div>
            `;
            
            // Add event listeners to buttons
            const completeBtn = taskElement.querySelector('.complete-btn');
            const editBtn = taskElement.querySelector('.edit-btn');
            const deleteBtn = taskElement.querySelector('.delete-btn');
            
            completeBtn.addEventListener('click', (e) => {
                e.stopPropagation();
                toggleTaskComplete(task.id);
            });
            
            editBtn.addEventListener('click', (e) => {
                e.stopPropagation();
                editTask(task.id);
            });
            
            deleteBtn.addEventListener('click', (e) => {
                e.stopPropagation();
                deleteTask(task.id);
            });
            
            taskElement.addEventListener('click', () => {
                viewTaskDetails(task.id);
            });
            
            return taskElement;
        }

        // Update statistics
        function updateStats() {
            totalTasksEl.textContent = tasks.length;
            completedTasksEl.textContent = tasks.filter(task => task.status === 'completed').length;
            pendingTasksEl.textContent = tasks.filter(task => task.status === 'pending').length;
            
            // Calculate overdue tasks
            const today = new Date();
            today.setHours(0, 0, 0, 0);
            overdueTasksEl.textContent = tasks.filter(task => {
                return task.status !== 'completed' && new Date(task.dueDate) < today;
            }).length;
        }

        // Update progress bar
        function updateProgress() {
            const totalTasks = tasks.length;
            const completedTasks = tasks.filter(task => task.status === 'completed').length;
            const percentage = totalTasks > 0 ? Math.round((completedTasks / totalTasks) * 100) : 0;
            
            progressPercentage.textContent = `${percentage}%`;
            progressFill.style.width = `${percentage}%`;
        }

        // Update active filter buttons
        function updateActiveFilters() {
            // Update subject filters
            subjectFilters.forEach(filter => {
                if (filter.dataset.subject === currentFilter.subject) {
                    filter.classList.add('bg-purple-800');
                } else {
                    filter.classList.remove('bg-purple-800');
                }
            });
            
            // Update status filters
            statusFilters.forEach(filter => {
                if (filter.dataset.status === currentFilter.status) {
                    filter.classList.add('bg-purple-800');
                } else {
                    filter.classList.remove('bg-purple-800');
                }
            });
        }

        // Update active sort button
        function updateActiveSort() {
            if (currentSort === 'date') {
                sortDateBtn.classList.add('bg-purple-100', 'text-purple-800');
                sortPriorityBtn.classList.remove('bg-purple-100', 'text-purple-800');
            } else {
                sortPriorityBtn.classList.add('bg-purple-100', 'text-purple-800');
                sortDateBtn.classList.remove('bg-purple-100', 'text-purple-800');
            }
        }

        // Task modal functions
        function openTaskModal() {
            document.getElementById('modalTitle').textContent = 'Add New Task';
            document.getElementById('taskTitle').value = '';
            document.getElementById('taskSubject').value = 'math';
            
            // Set default due date to tomorrow
            const tomorrow = new Date();
            tomorrow.setDate(tomorrow.getDate() + 1);
            const tomorrowStr = tomorrow.toISOString().split('T')[0];
            document.getElementById('taskDueDate').value = tomorrowStr;
            
            document.getElementById('taskPriority').value = 'medium';
            document.getElementById('taskDescription').value = '';
            document.getElementById('saveTaskBtn').dataset.mode = 'add';
            taskModal.classList.remove('hidden');
        }

        function closeTaskModal() {
            taskModal.classList.add('hidden');
        }

        function saveTask() {
            const title = document.getElementById('taskTitle').value.trim();
            const subject = document.getElementById('taskSubject').value;
            const dueDate = document.getElementById('taskDueDate').value;
            const priority = document.getElementById('taskPriority').value;
            const description = document.getElementById('taskDescription').value.trim();
            const mode = document.getElementById('saveTaskBtn').dataset.mode;
            
            // Validate inputs
            if (!title) {
                alert('Please enter a task title');
                return;
            }
            
            if (!dueDate) {
                alert('Please select a due date');
                return;
            }
            
            // Create or update task
            if (mode === 'add') {
                const newTask = {
                    id: tasks.length > 0 ? Math.max(...tasks.map(t => t.id)) + 1 : 1,
                    title,
                    subject,
                    dueDate,
                    priority,
                    description,
                    status: 'pending',
                    createdAt: new Date()
                };
                tasks.push(newTask);
            } else {
                const taskId = parseInt(document.getElementById('saveTaskBtn').dataset.taskId);
                const taskIndex = tasks.findIndex(t => t.id === taskId);
                if (taskIndex !== -1) {
                    tasks[taskIndex] = {
                        ...tasks[taskIndex],
                        title,
                        subject,
                        dueDate,
                        priority,
                        description
                    };
                }
            }
            
            // Update UI
            renderTasks();
            updateStats();
            updateProgress();
            closeTaskModal();
        }

        // Task actions
        function toggleTaskComplete(taskId) {
            const taskIndex = tasks.findIndex(t => t.id === taskId);
            if (taskIndex !== -1) {
                tasks[taskIndex].status = tasks[taskIndex].status === 'completed' ? 'pending' : 'completed';
                renderTasks();
                updateStats();
                updateProgress();
            }
        }

        function editTask(taskId) {
            const task = tasks.find(t => t.id === taskId);
            if (task) {
                document.getElementById('modalTitle').textContent = 'Edit Task';
                document.getElementById('taskTitle').value = task.title;
                document.getElementById('taskSubject').value = task.subject;
                document.getElementById('taskDueDate').value = task.dueDate;
                document.getElementById('taskPriority').value = task.priority;
                document.getElementById('taskDescription').value = task.description;
                document.getElementById('saveTaskBtn').dataset.mode = 'edit';
                document.getElementById('saveTaskBtn').dataset.taskId = taskId;
                taskModal.classList.remove('hidden');
            }
        }

        function deleteTask(taskId) {
            if (confirm('Are you sure you want to delete this task?')) {
                tasks = tasks.filter(t => t.id !== taskId);
                renderTasks();
                updateStats();
                updateProgress();
            }
        }

        function viewTaskDetails(taskId) {
            const task = tasks.find(t => t.id === taskId);
            if (task) {
                // In a real app, you might show a detailed view modal
                alert(`Task Details:\n\nTitle: ${task.title}\nSubject: ${task.subject}\nDue Date: ${task.dueDate}\nPriority: ${task.priority}\nStatus: ${task.status}\nDescription: ${task.description}`);
            }
        }

        // Mobile menu
        function toggleSidebar() {
            sidebar.classList.toggle('open');
        }

        // AI Assistance
        function scrollToAI() {
            document.querySelector('.gradient-bg').scrollIntoView({ behavior: 'smooth' });
        }

        function askAIQuestion() {
            const subject = document.getElementById('aiSubject').value;
            const topic = document.getElementById('aiTopic').value.trim();
            const question = document.getElementById('aiQuestion').value.trim();
            
            if (!question) {
                alert('Please enter your question');
                return;
            }
            
            // Show loading state
            askAIBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Thinking...';
            askAIBtn.disabled = true;
            
            // Simulate API call with timeout
            setTimeout(() => {
                // Generate a mock response based on subject
                let response = generateAIResponse(subject, topic, question);
                
                // Display response
                aiResponseContent.innerHTML = response;
                aiResponse.classList.remove('hidden');
                
                // Reset button
                askAIBtn.innerHTML = '<i class="fas fa-paper-plane mr-2"></i> Ask DeepSeek';
                askAIBtn.disabled = false;
                
                // Scroll to response
                aiResponse.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
            }, 1500);
        }

        function generateAIResponse(subject, topic, question) {
            const today = new Date();
            const dateStr = today.toLocaleDateString();
            
            // Base response
            let response = `
                <h2>DeepSeek AI Response</h2>
                <p><strong>Subject:</strong> ${subject.charAt(0).toUpperCase() + subject.slice(1)}</p>
                ${topic ? `<p><strong>Topic:</strong> ${topic}</p>` : ''}
                <p><strong>Date:</strong> ${dateStr}</p>
                <hr class="my-2 border-gray-300">
            `;
            
            // Subject-specific responses
            switch(subject) {
                case 'math':
                    response += `
                        <p>Based on your question about "${question}", here's a mathematical explanation:</p>
                        <p>Let's consider the problem step by step:</p>
                        <ol class="list-decimal pl-5">
                            <li>Identify the variables and constants</li>
                            <li>Apply the appropriate mathematical principles</li>
                            <li>Solve the equation systematically</li>
                            <li>Verify your solution</li>
                        </ol>
                        <p>For example, if you're working with algebra:</p>
                        <pre>Let x be the unknown value\n\nGiven equation: 2x + 5 = 15\n\nStep 1: Subtract 5 from both sides\n2x = 10\n\nStep 2: Divide both sides by 2\nx = 5</pre>
                        <p>Would you like me to elaborate on any specific part?</p>
                    `;
                    break;
                                    
                case 'science':
                    response += `
                        <p>Your science question about "${question}" is interesting. Here's a scientific perspective:</p>
                        <p>The scientific method would approach this as follows:</p>
                        <ul class="list-disc pl-5">
                            <li>Observation: Identify the phenomenon</li>
                            <li>Hypothesis: Formulate a testable explanation</li>
                            <li>Experiment: Design a way to test the hypothesis</li>
                            <li>Analysis: Interpret the results</li>
                            <li>Conclusion: Determine if the hypothesis is supported</li>
                        </ul>
                        <p>For example, in a biology context:</p>
                        <p>If you're studying plant growth, you might hypothesize that plants grow taller with more sunlight. You could test this by growing identical plants with different amounts of light and measuring their growth over time.</p>
                    `;
                    break;
                                    
                case 'history':
                    response += `
                        <p>Regarding your history question about "${question}", here's some historical context:</p>
                        <p>Historical analysis involves:</p>
                        <ul class="list-disc pl-5">
                            <li>Examining primary sources (documents, artifacts from the time)</li>
                            <li>Considering secondary sources (historians' interpretations)</li>
                            <li>Understanding the historical context</li>
                            <li>Recognizing different perspectives</li>
                        </ul>
                        <p>For example, when studying World War II:</p>
                        <p>You might analyze the Treaty of Versailles as a contributing factor to the war, examining both the terms of the treaty and how different nations reacted to it. The economic pressures on Germany after WWI created conditions that Hitler was able to exploit.</p>
                    `;
                    break;
                                    
                case 'english':
                    response += `
                        <p>For your English question about "${question}", here's a literary analysis approach:</p>
                        <p>When analyzing literature, consider:</p>
                        <ul class="list-disc pl-5">
                            <li>Theme: The central ideas or messages</li>
                            <li>Characterization: How characters are developed</li>
                            <li>Plot structure: The organization of events</li>
                            <li>Literary devices: Metaphors, symbolism, etc.</li>
                            <li>Historical/cultural context</li>
                        </ul>
                        <p>For example, in "To Kill a Mockingbird":</p>
                        <p>The theme of racial injustice is explored through the trial of Tom Robinson. Scout's coming-of-age story parallels the moral development of the community. The mockingbird symbolizes innocence, as seen in characters like Tom Robinson and Boo Radley.</p>
                    `;
                    break;
                                    
                case 'coding':
                    response += `
                        <p>Your coding question about "${question}" is a great opportunity to learn. Here's a technical approach:</p>
                        <p>When solving coding problems:</p>
                        <ol class="list-decimal pl-5">
                            <li>Understand the problem requirements</li>
                            <li>Break it down into smaller steps</li>
                            <li>Write pseudocode to plan your solution</li>
                            <li>Implement the solution in code</li>
                            <li>Test with different inputs</li>
                            <li>Debug and refine</li>
                        </ol>
                        <p>For example, if you're working with JavaScript functions:</p>
                        <pre>// Problem: Write a function that reverses a string\n\nfunction reverseString(str) {\n    // Step 1: Split into array of characters\n    const chars = str.split('');\n    \n    // Step 2: Reverse the array\n    const reversedChars = chars.reverse();\n    \n    // Step 3: Join back into string\n    return reversedChars.join('');\n}\n\n// Test cases\nconsole.log(reverseString('hello')); // 'olleh'\nconsole.log(reverseString('DeepSeek')); // 'keeSpeed'</pre>
                        <p>Would you like me to explain any part in more detail?</p>
                    `;
                    break;
                                    
                default:
                    response += `
                        <p>Thank you for your question: "${question}". Here's how I can help:</p>
                        <p>1. Clarify the key concepts involved</p>
                        <p>2. Provide relevant examples</p>
                        <p>3. Suggest resources for further learning</p>
                        <p>4. Help break down complex ideas</p>
                        <p>Could you provide more details about what specifically you'd like to know?</p>
                    `;
            }
            
            return response;
        }

        function copyAIResponse() {
            const range = document.createRange();
            range.selectNode(aiResponseContent);
            window.getSelection().removeAllRanges();
            window.getSelection().addRange(range);
            document.execCommand('copy');
            window.getSelection().removeAllRanges();
            
            // Show feedback
            const originalText = copyResponseBtn.innerHTML;
            copyResponseBtn.innerHTML = '<i class="fas fa-check"></i>';
            setTimeout(() => {
                copyResponseBtn.innerHTML = originalText;
            }, 2000);
        }

        // Coding workspace functions
        function runCode() {
            const code = codeEditor.value;
            const language = codeLanguage.value;
            
            // Show loading state
            runCodeBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Running...';
            
            // Simulate code execution with timeout
            setTimeout(() => {
                // Mock output based on language
                let output = '';
                
                if (language === 'javascript') {
                    try {
                        // In a real app, you'd use a safe eval or WebAssembly
                        output = '// Mock JavaScript output\nHello, DeepSeek User!\nundefined';
                    } catch (e) {
                        output = `Error: ${e.message}`;
                    }
                } else if (language === 'python') {
                    output = '# Mock Python output\nHello, DeepSeek User!';
                } else if (language === 'java') {
                    output = '// Mock Java output\nHello, DeepSeek User!';
                } else {
                    output = `// ${language} code executed\n(Simulated output - actual execution would require a ${language} environment)`;
                }
                
                outputContent.textContent = output;
                codeOutput.classList.remove('hidden');
                
                // Reset button
                runCodeBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Run Code';
                
                // Scroll to output
                codeOutput.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
            }, 1000);
        }

        function debugCode() {
            const code = codeEditor.value;
            const language = codeLanguage.value;
            
            // Show loading state
            debugCodeBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Analyzing...';
            
            // Simulate debugging with timeout
            setTimeout(() => {
                // Mock debug output
                let output = `DeepSeek Debugger - ${language} code analysis:\n\n`;
                
                // Simple mock analysis
                if (code.includes('console.log') || code.includes('print') || code.includes('System.out.println')) {
                    output += '✅ Found debug statements - good for troubleshooting\n';
                } else {
                    output += '⚠️ No debug statements found - consider adding some for troubleshooting\n';
                }
                
                if (code.includes('for') || code.includes('while')) {
                    output += '✅ Found loops - check for proper termination conditions\n';
                }
                
                if (code.includes('if') || code.includes('else')) {
                    output += '✅ Found conditional logic - check all branches\n';
                }
                
                if (code.includes('function') || code.includes('def') || code.includes('void')) {
                    output += '✅ Found functions/methods - check parameters and return values\n';
                }
                
                output += '\nPotential issues to check:\n';
                output += '1. Variable naming consistency\n';
                output += '2. Proper indentation\n';
                output += '3. Edge case handling\n';
                output += '4. Error handling\n';
                
                outputContent.textContent = output;
                codeOutput.classList.remove('hidden');
                
                // Reset button
                debugCodeBtn.innerHTML = '<i class="fas fa-bug mr-2"></i> Debug';
                
                // Scroll to output
                codeOutput.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
            }, 1500);
        }

        function getCodeHelp() {
            const code = codeEditor.value;
            const language = codeLanguage.value;
            
            // Show loading state
            codeHelpBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Thinking...';
            codeHelpBtn.disabled = true;
            
            // Simulate AI code help with timeout
            setTimeout(() => {
                // Generate mock AI response
                let response = `# DeepSeek Code Assistant - ${language} Help\n\n`;
                
                response += 'Here are some suggestions for your code:\n\n';
                
                // Basic code analysis
                if (code.length < 50) {
                    response += '⚠️ Your code seems quite short. Are you working on a specific problem? I can help you break it down.\n\n';
                } else {
                    response += '✅ Your code has good length - let me analyze the structure.\n\n';
                }
                
                // Language-specific tips
                if (language === 'javascript') {
                    response += 'JavaScript Tips:\n';
                    response += '- Consider using modern ES6 features like arrow functions and template literals\n';
                    response += '- Remember to handle asynchronous operations properly with async/await\n';
                    response += '- Use console.log() for debugging but remove it in production code\n\n';
                    
                    response += 'Example improvement:\n';
                    response += '```javascript\n';
                    response += '// Instead of:\n';
                    response += 'function greet(name) {\n';
                    response += '    return "Hello, " + name + "!";\n';
                    response += '}\n\n';
                    response += '// Consider:\n';
                    response += 'const greet = name => `Hello, ${name}!`;\n';
                    response += '```\n';
                } else if (language === 'python') {
                    response += 'Python Tips:\n';
                    response += '- Follow PEP 8 style guidelines for consistent formatting\n';
                    response += '- Use list comprehensions for concise iterations\n';
                    response += '- Consider type hints for better code documentation\n\n';
                    
                    response += 'Example improvement:\n';
                    response += '```python\n';
                    response += '# Instead of:\n';
                    response += 'result = []\n';
                    response += 'for x in range(10):\n';
                    response += '    result.append(x*2)\n\n';
                    response += '# Consider:\n';
                    response += 'result = [x*2 for x in range(10)]\n';
                    response += '```\n';
                }
                
                response += '\nWould you like me to explain any specific part in more detail?';
                
                aiResponseContent.innerHTML = response;
                aiResponse.classList.remove('hidden');
                
                // Reset button
                codeHelpBtn.innerHTML = '<i class="fas fa-robot mr-2"></i> Get AI Help';
                codeHelpBtn.disabled = false;
                
                // Scroll to response
                aiResponse.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
            }, 2000);
        }

        function clearOutput() {
            outputContent.textContent = '';
            codeOutput.classList.add('hidden');
        }

        function updateFileName() {
            const language = codeLanguage.value;
            let extension = '';
            
            switch(language) {
                case 'javascript': extension = 'js'; break;
                case 'python': extension = 'py'; break;
                case 'java': extension = 'java'; break;
                case 'csharp': extension = 'cs'; break;
                case 'cpp': extension = 'cpp'; break;
                case 'html': extension = 'html'; break;
                case 'css': extension = 'css'; break;
                default: extension = 'txt';
            }
            
            fileNameDisplay.textContent = `script.${extension}`;
        }

        // Initialize the app
        document.addEventListener('DOMContentLoaded', init);
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=JazerAI/like-him" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>