Spaces:
Running

File size: 72,715 Bytes
b66781c
 
 
 
 
76b296e
b66781c
 
76b296e
b66781c
 
 
 
 
76b296e
 
 
 
 
b66781c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76b296e
 
 
 
 
 
 
 
 
 
 
8bda857
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
 
 
 
 
 
 
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bda857
 
 
 
 
 
 
 
 
b66781c
 
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
 
 
76b296e
 
b66781c
 
76b296e
 
 
 
 
 
 
 
 
 
 
b66781c
 
 
 
 
 
 
 
 
 
 
76b296e
 
 
 
 
8bda857
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
8bda857
 
 
b66781c
76b296e
 
 
 
 
 
 
 
 
 
 
b66781c
 
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bda857
 
76b296e
 
 
 
 
 
 
 
 
b66781c
76b296e
8bda857
 
76b296e
 
 
 
 
 
 
 
 
 
 
b66781c
76b296e
 
 
 
 
 
 
 
 
 
 
b66781c
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
 
76b296e
b66781c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bda857
b66781c
76b296e
8bda857
76b296e
 
8bda857
76b296e
 
 
8bda857
76b296e
 
 
 
 
 
 
 
 
 
8bda857
76b296e
 
b66781c
76b296e
 
 
b66781c
 
 
 
 
 
76b296e
b66781c
 
 
 
8bda857
76b296e
 
b66781c
76b296e
 
 
b66781c
 
 
 
 
 
76b296e
b66781c
 
 
 
8bda857
76b296e
 
b66781c
76b296e
 
 
b66781c
 
 
 
 
 
76b296e
b66781c
 
 
 
8bda857
 
76b296e
b66781c
76b296e
 
 
b66781c
 
 
 
 
 
76b296e
b66781c
 
 
 
8bda857
 
76b296e
b66781c
76b296e
 
 
b66781c
 
 
 
 
 
76b296e
b66781c
 
 
 
8bda857
 
76b296e
b66781c
76b296e
 
 
b66781c
 
 
 
 
 
76b296e
b66781c
 
 
 
8bda857
 
76b296e
 
 
 
 
b66781c
76b296e
 
 
 
 
 
 
b66781c
76b296e
 
8bda857
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
 
76b296e
8bda857
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
76b296e
8bda857
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bda857
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bda857
 
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
 
 
8bda857
 
 
 
 
b66781c
76b296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bda857
b66781c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bda857
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
8bda857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
8bda857
b66781c
8bda857
 
b66781c
8bda857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76b296e
8bda857
 
 
 
 
76b296e
8bda857
 
 
 
 
76b296e
8bda857
 
76b296e
8bda857
 
 
 
 
 
 
 
 
76b296e
8bda857
76b296e
8bda857
 
 
 
b66781c
8bda857
 
b66781c
8bda857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76b296e
8bda857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
8bda857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b66781c
 
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
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Desk Refresh</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#10b981',
                        secondary: '#059669',
                        accent: '#6ee7b7',
                        light: '#ecfdf5',
                        dark: '#064e3b',
                    }
                }
            }
        }
    </script>
    <style>
        .exercise-card {
            transition: all 0.3s ease;
        }
        .exercise-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }
        .progress-ring__circle {
            transition: stroke-dashoffset 0.35s;
            transform: rotate(-90deg);
            transform-origin: 50% 50%;
        }
        .animate-pulse-slow {
            animation: pulse 3s infinite;
        }
        .routine-item {
            cursor: grab;
            transition: all 0.2s ease;
            flex: 0 0 auto;
            width: 180px;
        }
        .routine-item:active {
            cursor: grabbing;
        }
        .routine-item.dragging {
            opacity: 0.5;
            background-color: '#d1fae5';
        }
        .routine-scroll-container {
            display: flex;
            overflow-x: auto;
            padding-bottom: 10px;
            gap: 12px;
        }
        .routine-scroll-container::-webkit-scrollbar {
            height: 6px;
        }
        .routine-scroll-container::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 10px;
        }
        .routine-scroll-container::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 10px;
        }
        .routine-scroll-container::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }
        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.7;
            }
        }
        .favorite-btn.active {
            color: #f59e0b;
        }
        .activity-icon {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background-color: #d1fae5;
            color: #059669;
        }
        .auth-modal {
            background-color: rgba(0,0,0,0.7);
        }
        .auth-content {
            animation: fadeIn 0.3s ease-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .timer-adjust-btn {
            transition: all 0.2s ease;
        }
        .timer-adjust-btn:active {
            transform: scale(0.95);
        }
        .hidden-row {
            display: none;
        }
    </style>
</head>
<body class="font-sans bg-gray-50">
    <!-- Auth Modal -->
    <div id="auth-modal" class="fixed inset-0 auth-modal flex items-center justify-center z-50 hidden">
        <div class="auth-content bg-white rounded-xl shadow-2xl w-full max-w-md p-8">
            <div class="flex justify-between items-center mb-6">
                <h2 class="text-2xl font-bold text-gray-800">Welcome to Desk Refresh</h2>
                <button id="close-auth" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times text-xl"></i>
                </button>
            </div>
            
            <div id="login-form">
                <div class="mb-6">
                    <label class="block text-gray-700 font-medium mb-2">Email</label>
                    <input type="email" id="login-email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="your@email.com">
                </div>
                <div class="mb-6">
                    <label class="block text-gray-700 font-medium mb-2">Password</label>
                    <input type="password" id="login-password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••">
                </div>
                <button id="login-btn" class="w-full bg-primary hover:bg-secondary text-white px-6 py-3 rounded-lg font-medium mb-4">
                    Log In
                </button>
                <p class="text-center text-gray-600 mb-4">Don't have an account? <button id="show-signup" class="text-primary font-medium">Sign up</button></p>
                <div class="text-center">
                    <button class="text-sm text-gray-500 hover:text-gray-700">Forgot password?</button>
                </div>
            </div>
            
            <div id="signup-form" class="hidden">
                <div class="mb-6">
                    <label class="block text-gray-700 font-medium mb-2">Name</label>
                    <input type="text" id="signup-name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Your Name">
                </div>
                <div class="mb-6">
                    <label class="block text-gray-700 font-medium mb-2">Email</label>
                    <input type="email" id="signup-email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="your@email.com">
                </div>
                <div class="mb-6">
                    <label class="block text-gray-700 font-medium mb-2">Password</label>
                    <input type="password" id="signup-password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••">
                </div>
                <div class="mb-6">
                    <label class="block text-gray-700 font-medium mb-2">Confirm Password</label>
                    <input type="password" id="signup-confirm-password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••">
                </div>
                <button id="signup-btn" class="w-full bg-primary hover:bg-secondary text-white px-6 py-3 rounded-lg font-medium mb-4">
                    Create Account
                </button>
                <p class="text-center text-gray-600">Already have an account? <button id="show-login" class="text-primary font-medium">Log in</button></p>
            </div>
        </div>
    </div>

    <div class="container mx-auto px-4 py-8 max-w-6xl" id="main-content" class="hidden">
        <!-- Header -->
        <header class="flex flex-col md:flex-row justify-between items-center mb-12">
            <div class="flex items-center mb-6 md:mb-0">
                <i class="fas fa-leaf text-3xl text-primary mr-3"></i>
                <h1 class="text-3xl font-bold text-gray-800">Desk Refresh</h1>
            </div>
            <div class="flex items-center space-x-4">
                <div class="relative group">
                    <button id="profile-btn" class="flex items-center space-x-2">
                        <div class="w-10 h-10 rounded-full bg-primary flex items-center justify-center text-white font-semibold" id="avatar">U</div>
                        <span class="hidden md:inline" id="username">User</span>
                    </button>
                    <div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 hidden group-hover:block">
                        <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Profile</a>
                        <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Settings</a>
                        <a href="#" id="logout-btn" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Log out</a>
                    </div>
                </div>
                <button id="stats-btn" class="bg-primary hover:bg-secondary text-white px-4 py-2 rounded-lg flex items-center">
                    <i class="fas fa-chart-line mr-2"></i> Stats
                </button>
            </div>
        </header>

        <!-- Main Dashboard -->
        <main>
            <!-- Current Activity -->
            <div class="bg-white rounded-xl shadow-md p-6 mb-8">
                <div class="flex flex-col md:flex-row items-center">
                    <div class="md:w-1/3 mb-6 md:mb-0 flex flex-col items-center">
                        <div class="mb-4 text-center">
                            <span id="next-activity" class="text-xl font-semibold text-gray-700">Next: Stretch</span>
                            <p id="current-activity" class="text-gray-600 text-sm">You're currently working. Your next break is scheduled soon.</p>
                        </div>
                        <div class="flex items-center">
                            <button id="decrease-time" class="timer-adjust-btn bg-gray-100 hover:bg-gray-200 text-gray-800 p-3 rounded-lg mr-4">
                                <i class="fas fa-minus"></i>
                            </button>
                            <div class="relative w-32 h-32">
                                <svg class="w-full h-full" viewBox="0 0 100 100">
                                    <!-- Background circle -->
                                    <circle class="text-gray-200" stroke-width="8" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
                                    <!-- Progress circle -->
                                    <circle id="progress-circle" class="text-primary" stroke-width="8" stroke-dasharray="251.2" stroke-dashoffset="125.6" stroke-linecap="round" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
                                </svg>
                                <div class="absolute inset-0 flex items-center justify-center">
                                    <span id="time-remaining" class="text-2xl font-bold text-primary">24:30</span>
                                </div>
                            </div>
                            <button id="increase-time" class="timer-adjust-btn bg-gray-100 hover:bg-gray-200 text-gray-800 p-3 rounded-lg ml-4">
                                <i class="fas fa-plus"></i>
                            </button>
                        </div>
                        <div class="flex space-x-4 mt-4">
                            <button id="skip-btn" class="bg-white hover:bg-gray-100 text-gray-800 p-3 rounded-lg border border-gray-300 flex items-center justify-center" title="Skip">
                                <i class="fas fa-forward"></i>
                            </button>
                            <button id="pause-btn" class="bg-primary hover:bg-secondary text-white p-3 rounded-lg flex items-center justify-center" title="Pause">
                                <i class="fas fa-pause"></i>
                            </button>
                            <button id="take-break-now" class="bg-white hover:bg-gray-100 text-gray-800 p-3 rounded-lg border border-gray-300 flex items-center justify-center" title="Take Break Now">
                                <i class="fas fa-coffee"></i>
                            </button>
                        </div>
                    </div>
                    <div class="md:w-2/3 md:pl-8">
                        <h2 class="text-2xl font-bold text-gray-800 mb-4">Current Activity</h2>
                        <div class="mb-6">
                            <div class="flex items-center mb-4">
                                <div class="w-12 h-12 rounded-full bg-light flex items-center justify-center mr-4">
                                    <i class="fas fa-desktop text-primary text-xl"></i>
                                </div>
                                <div>
                                    <h3 class="font-semibold text-gray-800">Focus Work</h3>
                                    <p class="text-sm text-gray-500">Deep work session</p>
                                </div>
                            </div>
                            <div class="flex items-center">
                                <div class="w-12 h-12 rounded-full bg-light flex items-center justify-center mr-4">
                                    <i class="fas fa-hands-helping text-primary text-xl"></i>
                                </div>
                                <div>
                                    <h3 class="font-semibold text-gray-800">Neck Stretches</h3>
                                    <p class="text-sm text-gray-500">Next in 24:30</p>
                                </div>
                            </div>
                        </div>
                        <div class="bg-light rounded-lg p-4">
                            <h4 class="font-medium text-gray-700 mb-2">Today's Progress</h4>
                            <div class="w-full bg-gray-200 rounded-full h-2.5 mb-2">
                                <div class="bg-primary h-2.5 rounded-full" style="width: 45%"></div>
                            </div>
                            <div class="flex justify-between text-sm text-gray-600">
                                <span>2/5 breaks completed</span>
                                <span>45%</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- My Routine Section -->
            <div class="bg-white rounded-xl shadow-md p-6 mb-8">
                <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-6">
                    <div class="mb-4 md:mb-0">
                        <h2 class="text-2xl font-bold text-gray-800">My Wellness Routine</h2>
                        <div class="flex items-center mt-2">
                            <select id="routine-selector" class="border border-gray-300 rounded-lg px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary">
                                <option value="morning">Morning Routine</option>
                                <option value="afternoon">Afternoon Routine</option>
                                <option value="evening">Evening Routine</option>
                                <option value="custom">Custom Routine</option>
                            </select>
                            <span class="ml-3 text-sm text-gray-600">Total time: <span id="routine-total-time">5</span> min</span>
                        </div>
                    </div>
                    <button id="save-routine" class="bg-primary hover:bg-secondary text-white px-4 py-2 rounded-lg text-sm flex items-center">
                        <i class="fas fa-save mr-2"></i> Save Routine
                    </button>
                </div>
                <div id="routine-container" class="routine-scroll-container">
                    <!-- Routine items will be added here -->
                    <div class="routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200">
                        <div class="flex items-center justify-between mb-2">
                            <div class="activity-icon">
                                <i class="fas fa-hands-helping text-xs"></i>
                            </div>
                            <button class="text-gray-400 hover:text-red-500 text-sm">
                                <i class="fas fa-times"></i>
                            </button>
                        </div>
                        <h3 class="font-semibold text-gray-800 text-sm mb-1">Neck Stretches</h3>
                        <p class="text-xs text-gray-500">2 min</p>
                    </div>
                    <div class="routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200">
                        <div class="flex items-center justify-between mb-2">
                            <div class="activity-icon">
                                <i class="fas fa-lungs text-xs"></i>
                            </div>
                            <button class="text-gray-400 hover:text-red-500 text-sm">
                                <i class="fas fa-times"></i>
                            </button>
                        </div>
                        <h3 class="font-semibold text-gray-800 text-sm mb-1">Deep Breathing</h3>
                        <p class="text-xs text-gray-500">1 min</p>
                    </div>
                    <div class="routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200">
                        <div class="flex items-center justify-between mb-2">
                            <div class="activity-icon">
                                <i class="fas fa-eye text-xs"></i>
                            </div>
                            <button class="text-gray-400 hover:text-red-500 text-sm">
                                <i class="fas fa-times"></i>
                            </button>
                        </div>
                        <h3 class="font-semibold text-gray-800 text-sm mb-1">Eye Exercises</h3>
                        <p class="text-xs text-gray-500">2 min</p>
                    </div>
                </div>
                <p id="empty-routine-message" class="text-center text-gray-500 py-6 hidden">Your routine is empty. Add exercises from the library below.</p>
            </div>

            <!-- Quick Actions -->
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
                <div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
                    <div class="bg-accent rounded-full p-3 mr-4">
                        <i class="fas fa-glass-whiskey text-white text-xl"></i>
                    </div>
                    <div>
                        <h3 class="font-semibold text-gray-800">Water Reminder</h3>
                        <p class="text-sm text-gray-600">Log water intake</p>
                    </div>
                </div>
                <div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
                    <div class="bg-accent rounded-full p-3 mr-4">
                        <i class="fas fa-walking text-white text-xl"></i>
                    </div>
                    <div>
                        <h3 class="font-semibold text-gray-800">Quick Stretch</h3>
                        <p class="text-sm text-gray-600">2 min routine</p>
                    </div>
                </div>
                <div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
                    <div class="bg-accent rounded-full p-3 mr-4">
                        <i class="fas fa-spa text-white text-xl"></i>
                    </div>
                    <div>
                        <h3 class="font-semibold text-gray-800">Breathe</h3>
                        <p class="text-sm text-gray-600">1 min meditation</p>
                    </div>
                </div>
                <div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
                    <div class="bg-accent rounded-full p-3 mr-4">
                        <i class="fas fa-eye text-white text-xl"></i>
                    </div>
                    <div>
                        <h3 class="font-semibold text-gray-800">Eye Rest</h3>
                        <p class="text-sm text-gray-600">20-20-20 rule</p>
                    </div>
                </div>
            </div>

            <!-- Activities Library -->
            <div class="bg-white rounded-xl shadow-md p-6 mb-8">
                <div class="flex flex-col md:flex-row md:items-center md:justify-between mb-6">
                    <h2 class="text-2xl font-bold text-gray-800 mb-4 md:mb-0">Activities</h2>
                    <div class="flex flex-col sm:flex-row gap-3">
                        <div class="relative">
                            <input type="text" id="exercise-search" placeholder="Search activities..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent w-full">
                            <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
                        </div>
                        <select id="exercise-filter" class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
                            <option value="all">All Activities</option>
                            <option value="favorites">Favorites</option>
                            <option value="stretching">Stretching</option>
                            <option value="breathing">Breathing</option>
                            <option value="yoga">Chair Yoga</option>
                            <option value="eye">Eye Care</option>
                            <option value="strength">Strength</option>
                        </select>
                    </div>
                </div>
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="exercise-container">
                    <!-- Activity Card 1 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden" data-category="stretching">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-hands-helping text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Neck Stretches</h3>
                            <p class="text-gray-600 mb-3">Gentle neck movements to relieve tension from prolonged sitting.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Activity Card 2 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden" data-category="breathing">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-lungs text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Deep Breathing</h3>
                            <p class="text-gray-600 mb-3">4-7-8 breathing technique to reduce stress and increase focus.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 1 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Activity Card 3 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden" data-category="stretching">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-hands text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Wrist & Finger</h3>
                            <p class="text-gray-600 mb-3">Exercises to prevent carpal tunnel and improve circulation.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 3 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Activity Card 4 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="yoga">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-chair text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Chair Yoga</h3>
                            <p class="text-gray-600 mb-3">Simple yoga poses you can do without leaving your desk.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 5 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Activity Card 5 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="eye">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-eye text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="fas fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Eye Exercises</h3>
                            <p class="text-gray-600 mb-3">Reduce eye strain with the 20-20-20 rule and other techniques.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Activity Card 6 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="hydration">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-water text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Hydration Reminder</h3>
                            <p class="text-gray-600 mb-3">Regular reminders to drink water throughout your workday.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> -</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>

                    <!-- Activity Card 7 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-arrows-alt-h text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Side Stretches</h3>
                            <p class="text-gray-600 mb-3">Lateral stretches to relieve tension in your torso and back.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>

                    <!-- Activity Card 8 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-undo text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Neck Rotations</h3>
                            <p class="text-gray-600 mb-3">Slow neck rotations to improve mobility and reduce stiffness.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 1 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>

                    <!-- Activity Card 9 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="strength">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-dumbbell text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Desk Push-ups</h3>
                            <p class="text-gray-600 mb-3">Modified push-ups using your desk to strengthen upper body.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 3 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>

                    <!-- Activity Card 10 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-running text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Leg Extensions</h3>
                            <p class="text-gray-600 mb-3">Seated leg extensions to improve circulation in your legs.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>

                    <!-- Activity Card 11 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-hands-praying text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Shoulder Rolls</h3>
                            <p class="text-gray-600 mb-3">Circular shoulder movements to release upper body tension.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 1 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>

                    <!-- Activity Card 12 -->
                    <div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="breathing">
                        <div class="h-40 bg-primary flex items-center justify-center relative">
                            <i class="fas fa-wind text-white text-5xl animate-pulse-slow"></i>
                            <button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
                                <i class="far fa-star"></i>
                            </button>
                        </div>
                        <div class="p-4">
                            <h3 class="font-bold text-lg text-gray-800 mb-2">Box Breathing</h3>
                            <p class="text-gray-600 mb-3">4-4-4-4 breathing pattern to calm the nervous system.</p>
                            <div class="flex justify-between items-center">
                                <span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
                                <button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="text-center mt-6">
                    <button id="load-more" class="bg-primary hover:bg-secondary text-white px-6 py-2 rounded-lg">
                        Load More Activities
                    </button>
                </div>
            </div>
        </main>
    </div>

    <!-- Add to Routine Modal -->
    <div id="add-to-routine-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
        <div class="bg-white rounded-xl shadow-2xl w-full max-w-md p-6">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-gray-800">Add to Routine</h3>
                <button id="close-add-to-routine" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times text-xl"></i>
                </button>
            </div>
            <div class="mb-6">
                <label class="block text-gray-700 font-medium mb-2">Select Routine</label>
                <select id="target-routine" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
                    <option value="morning">Morning Routine</option>
                    <option value="afternoon">Afternoon Routine</option>
                    <option value="evening">Evening Routine</option>
                    <option value="custom">Custom Routine</option>
                </select>
            </div>
            <div class="mb-6">
                <label class="block text-gray-700 font-medium mb-2">Duration (minutes)</label>
                <input type="number" id="exercise-duration" min="1" max="10" value="2" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
            </div>
            <div class="flex justify-end">
                <button id="confirm-add-to-routine" class="bg-primary hover:bg-secondary text-white px-6 py-2 rounded-lg font-medium">
                    Add to Routine
                </button>
            </div>
        </div>
    </div>

    <!-- Stats Modal -->
    <div id="stats-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
        <div class="bg-white rounded-xl shadow-2xl w-full max-w-2xl max-h-[90vh] overflow-y-auto">
            <div class="p-6 border-b border-gray-200 flex justify-between items-center">
                <h3 class="text-2xl font-bold text-gray-800">Your Wellness Stats</h3>
                <button id="close-stats" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times text-xl"></i>
                </button>
            </div>
            <div class="p-6">
                <!-- Weekly Overview -->
                <div class="mb-8">
                    <h4 class="text-xl font-semibold text-gray-800 mb-4">Weekly Overview</h4>
                    <div class="bg-light rounded-lg p-4">
                        <div class="grid grid-cols-7 gap-2 mb-4">
                            <div class="text-center">
                                <div class="text-xs text-gray-500 mb-1">Mon</div>
                                <div class="h-24 bg-primary rounded" style="height: 60%;"></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-500 mb-1">Tue</div>
                                <div class="h-24 bg-primary rounded" style="height: 80%;"></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-500 mb-1 Wed">Wed</div>
                                <div class="h-24 bg-primary rounded" style="height: 45%;"></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-500 mb-1">Thu</div>
                                <div class="h-24 bg-primary rounded" style="height: 70%;"></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-500 mb-1">Fri</div>
                                <div class="h-24 bg-primary rounded" style="height: 90%;"></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-500 mb-1">Sat</div>
                                <div class="h-24 bg-gray-200 rounded" style="height: 10%;"></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-500 mb-1">Sun</div>
                                <div class="h-24 bg-gray-200 rounded" style="height: 5%;"></div>
                            </div>
                        </div>
                        <div class="flex justify-between text-sm text-gray-600">
                            <span>0%</span>
                            <span>Wellness Goal Completion</span>
                            <span>100%</span>
                        </div>
                    </div>
                </div>
                
                <!-- Activity Breakdown -->
                <div class="mb-8">
                    <h4 class="text-xl font-semibold text-gray-800 mb-4">Activity Breakdown</h4>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div class="bg-light rounded-lg p-4">
                            <h5 class="font-medium text-gray-700 mb-2">Breaks Taken</h5>
                            <div class="text-3xl font-bold text-primary mb-2">24</div>
                            <div class="text-sm text-gray-500">+3 from last week</div>
                        </div>
                        <div class="bg-light rounded-lg p-4">
                            <h5 class="font-medium text-gray-700 mb-2">Water Intake</h5>
                            <div class="text-3xl font-bold text-primary mb-2">5.2L</div>
                            <div class="text-sm text-gray-500">-0.8L from last week</div>
                        </div>
                        <div class="bg-light rounded-lg p-4">
                            <h5 class="font-medium text-gray-700 mb-2">Stretching</h5>
                            <div class="text-3xl font-bold text-primary mb-2">18 min</div>
                            <div class="text-sm text-gray-500">+5 min from last week</div>
                        </div>
                        <div class="bg-light rounded-lg p-4">
                            <h5 class="font-medium text-gray-700 mb-2">Eye Exercises</h5>
            <div class="text-3xl font-bold text-primary mb-2">12</div>
            <div class="text-sm text-gray-500">+4 from last week</div>
          </div>
        </div>
      </div>
      
      <!-- Achievements -->
      <div>
        <h4 class="text-xl font-semibold text-gray-800 mb-4">Achievements</h4>
        <div class="grid grid-cols-2 sm:grid-cols-3 gap-4">
          <div class="bg-yellow-50 border border-yellow-100 rounded-lg p-3 text-center">
            <div class="text-yellow-500 mb-2">
              <i class="fas fa-trophy text-2xl"></i>
            </div>
            <h5 class="font-medium text-gray-700 mb-1">5-Day Streak</h5>
            <p class="text-xs text-gray-500">Completed all breaks for 5 days</p>
          </div>
          <div class="bg-blue-50 border border-blue-100 rounded-lg p-3 text-center">
            <div class="text-blue-500 mb-2">
              <i class="fas fa-check-circle text-2xl"></i>
            </div>
            <h5 class="font-medium text-gray-700 mb-1">Hydration Pro</h5>
            <p class="text-xs text-gray-500">Drank 2L+ for 3 days</p>
          </div>
          <div class="bg-purple-50 border border-purple-100 rounded-lg p-3 text-center">
            <div class="text-purple-500 mb-2">
              <i class="fas fa-star text-2xl"></i>
            </div>
            <h5 class="font-medium text-gray-700 mb-1">Stretch Master</h5>
            <p class="text-xs text-gray-500">Completed 20+ stretches</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- Save Routine Modal -->
<div id="save-routine-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
  <div class="bg-white rounded-xl shadow-2xl w-full max-w-md max-h-[90vh] overflow-y-auto">
    <div class="p-6 border-b border-gray-200 flex justify-between items-center">
      <h3 class="text-2xl font-bold text-gray-800">Save Your Routine</h3>
      <button id="close-save-routine" class="text-gray-500 hover:text-gray-700">
        <i class="fas fa-times text-xl"></i>
      </button>
    </div>
    <div class="p-6">
      <div class="mb-6">
        <label class="block text-gray-700 font-medium mb-2">Routine Name</label>
        <input type="text" id="routine-name" placeholder="e.g. Morning Refresh" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
      </div>
      <div class="mb-6">
        <label class="block text-gray-700 font-medium mb-2">Description</label>
        <textarea id="routine-description" placeholder="Brief description of your routine" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent h-24"></textarea>
      </div>
      
      <div class="mb-6">
        <h4 class="text-lg font-semibold text-gray-800 mb-3">Routine Summary</h4>
        <div class="bg-light rounded-lg p-4">
          <div class="flex justify-between items-center mb-3">
            <span class="font-medium text-gray-700">Total Time:</span>
            <span class="font-bold text-primary">5 minutes</span>
          </div>
          <div class="mb-3">
            <span class="font-medium text-gray-700">Activities Included:</span>
            <div class="flex flex-wrap gap-2 mt-2">
              <div class="flex items-center bg-white px-3 py-1 rounded-full text-sm">
                <div class="activity-icon mr-2">
                  <i class="fas fa-hands-helping text-xs"></i>
                </div>
                Stretching
              </div>
              <div class="flex items-center bg-white px-3 py-1 rounded-full text-sm">
                <div class="activity-icon mr-2">
                  <i class="fas fa-lungs text-xs"></i>
                </div>
                Breathing
              </div>
              <div class="flex items-center bg-white px-3 py-1 rounded-full text-sm">
                <div class="activity-icon mr-2">
                  <i class="fas fa-eye text-xs"></i>
                </div>
                Eye Care
              </div>
            </div>
          </div>
          <div>
            <span class="font-medium text-gray-700">Exercises:</span>
            <ul class="list-disc list-inside text-sm text-gray-600 mt-1 pl-2">
              <li>Neck Stretches (2 min)</li>
              <li>Deep Breathing (1 min)</li>
              <li>Eye Exercises (2 min)</li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <div class="p-6 border-t border-gray-200 flex justify-end">
      <button id="confirm-save-routine" class="bg-primary hover:bg-secondary text-white px-6 py-2 rounded-lg font-medium">
        Save Routine
      </button>
    </div>
  </div>
</div>

<!-- Break Notification -->
<div id="break-notification" class="fixed bottom-4 right-4 bg-white rounded-xl shadow-2xl p-6 max-w-sm hidden z-50">
  <div class="flex justify-between items-start mb-4">
    <h3 class="text-xl font-bold text-gray-800">Time for a Break!</h3>
    <button id="close-notification" class="text-gray-500 hover:text-gray-700">
      <i class="fas fa-times"></i>
    </button>
  </div>
  <p class="text-gray-600 mb-6">You've been working for 45 minutes. Let's do some neck stretches to relieve tension.</p>
  <div class="flex space-x-3">
    <button id="snooze-break" class="bg-white hover:bg-gray-100 text-gray-800 px-4 py-2 rounded-lg border border-gray-300">
      Snooze (5 min)
    </button>
    <button id="start-break" class="bg-primary hover:bg-secondary text-white px-4 py-2 rounded-lg">
      Start Break
    </button>
  </div>
</div>

<script>
  // Auth state
  let currentUser = null;
  let isAuthenticated = false;
  let isTimerPaused = false;
  
  // DOM Elements
  const authModal = document.getElementById('auth-modal');
  const closeAuth = document.getElementById('close-auth');
  const loginForm = document.getElementById('login-form');
  const signupForm = document.getElementById('signup-form');
  const showSignup = document.getElementById('show-signup');
  const showLogin = document.getElementById('show-login');
  const loginBtn = document.getElementById('login-btn');
  const signupBtn = document.getElementById('signup-btn');
  const logoutBtn = document.getElementById('logout-btn');
  const mainContent = document.getElementById('main-content');
  const profileBtn = document.getElementById('profile-btn');
  const avatar = document.getElementById('avatar');
  const usernameDisplay = document.getElementById('username');
  
  const settingsBtn = document.getElementById('settings-btn');
  const settingsModal = document.getElementById('settings-modal');
  const closeSettings = document.getElementById('close-settings');
  const saveSettings = document.getElementById('save-settings');
  
  const statsBtn = document.getElementById('stats-btn');
  const statsModal = document.getElementById('stats-modal');
  const closeStats = document.getElementById('close-stats');
  
  const breakNotification = document.getElementById('break-notification');
  const closeNotification = document.getElementById('close-notification');
  const snoozeBreak = document.getElementById('snooze-break');
  const startBreak = document.getElementById('start-break');
  
  const takeBreakNow = document.getElementById('take-break-now');
  const skipBtn = document.getElementById('skip-btn');
  const pauseBtn = document.getElementById('pause-btn');
  
  // Timer adjustment buttons
  const decreaseTimeBtn = document.getElementById('decrease-time');
  const increaseTimeBtn = document.getElementById('increase-time');
  
  // Routine elements
  const routineContainer = document.getElementById('routine-container');
  const emptyRoutineMessage = document.getElementById('empty-routine-message');
  const saveRoutineBtn = document.getElementById('save-routine');
  const routineSelector = document.getElementById('routine-selector');
  const routineTotalTime = document.getElementById('routine-total-time');
  
  // Add to routine modal elements
  const addToRoutineModal = document.getElementById('add-to-routine-modal');
  const closeAddToRoutine = document.getElementById('close-add-to-routine');
  const confirmAddToRoutine = document.getElementById('confirm-add-to-routine');
  const targetRoutine = document.getElementById('target-routine');
  const exerciseDuration = document.getElementById('exercise-duration');
  
  // Save routine modal elements
  const saveRoutineModal = document.getElementById('save-routine-modal');
  const closeSaveRoutine = document.getElementById('close-save-routine');
  const confirmSaveRoutine = document.getElementById('confirm-save-routine');
  
  // Activities library elements
  const exerciseSearch = document.getElementById('exercise-search');
  const exerciseFilter = document.getElementById('exercise-filter');
  const exerciseContainer = document.getElementById('exercise-container');
  const loadMoreBtn = document.getElementById('load-more');
  
  // Timer variables
  let workDuration = 45 * 60; // 45 minutes in seconds
  let breakDuration = 5 * 60; // 5 minutes in seconds
  let timeLeft = workDuration;
  let timer;
  let isWorking = true;
  
  // Timer adjustment variables
  let decreaseInterval;
  let increaseInterval;
  let holdTimeout;
  let isHolding = false;
  
  // Current exercise being added to routine
  let currentExerciseToAdd = null;
  
  // Sample routines data
  const routines = {
    morning: {
      name: "Morning Routine",
      description: "Start your day with energy and focus",
      exercises: [
        { title: "Neck Stretches", duration: "2 min", icon: "hands-helping" },
        { title: "Deep Breathing", duration: "1 min", icon: "lungs" },
        { title: "Eye Exercises", duration: "2 min", icon: "eye" }
      ]
    },
    afternoon: {
      name: "Afternoon Routine",
      description: "Recharge during your midday slump",
      exercises: [
        { title: "Chair Yoga", duration: "3 min", icon: "chair" },
        { title: "Wrist & Finger", duration: "2 min", icon: "hands" }
      ]
    },
    evening: {
      name: "Evening Routine",
      description: "Wind down after work",
      exercises: [
        { title: "Deep Breathing", duration: "2 min", icon: "lungs" },
        { title: "Shoulder Rolls", duration: "1 min", icon: "hands-praying" }
      ]
    },
    custom: {
      name: "Custom Routine",
      description: "Your personalized wellness routine",
      exercises: []
    }
  };
  
  // Initialize SortableJS for drag and drop routine items
  new Sortable(routineContainer, {
    animation: 150,
    handle: '.activity-icon',
    ghostClass: 'dragging',
    onEnd: function() {
      updateEmptyRoutineMessage();
      updateRoutineStats();
    }
  });
  
  // Show auth modal on page load
  window.addEventListener('load', () => {
    authModal.classList.remove('hidden');
  });
  
  // Auth modal handlers
  closeAuth.addEventListener('click', () => {
    if (!isAuthenticated) return; // Don't allow closing if not authenticated
    authModal.classList.add('hidden');
  });
  
  showSignup.addEventListener('click', () => {
    loginForm.classList.add('hidden');
    signupForm.classList.remove('hidden');
  });
  
  showLogin.addEventListener('click', () => {
    signupForm.classList.add('hidden');
    loginForm.classList.remove('hidden');
  });
  
  loginBtn.addEventListener('click', () => {
    const email = document.getElementById('login-email').value;
    const password = document.getElementById('login-password').value;
    
    if (!email || !password) {
      alert('Please enter both email and password');
      return;
    }
    
    // In a real app, you would validate credentials with a backend
    currentUser = {
      name: email.split('@')[0],
      email: email
    };
    isAuthenticated = true;
    
    // Update UI
    avatar.textContent = currentUser.name.charAt(0).toUpperCase();
    usernameDisplay.textContent = currentUser.name;
    
    // Hide auth modal and show main content
    authModal.classList.add('hidden');
    mainContent.classList.remove('hidden');
  });
  
  signupBtn.addEventListener('click', () => {
    const name = document.getElementById('signup-name').value;
    const email = document.getElementById('signup-email').value;
    const password = document.getElementById('signup-password').value;
    const confirmPassword = document.getElementById('signup-confirm-password').value;
    
    if (!name || !email || !password || !confirmPassword) {
      alert('Please fill in all fields');
      return;
    }
    
    if (password !== confirmPassword) {
      alert('Passwords do not match');
      return;
    }
    
    // In a real app, you would create the account with a backend
    currentUser = {
      name: name,
      email: email
    };
    isAuthenticated = true;
    
    // Update UI
    avatar.textContent = currentUser.name.charAt(0).toUpperCase();
    usernameDisplay.textContent = currentUser.name;
    
    // Hide auth modal and show main content
    authModal.classList.add('hidden');
    mainContent.classList.remove('hidden');
  });
  
  logoutBtn.addEventListener('click', () => {
    isAuthenticated = false;
    currentUser = null;
    mainContent.classList.add('hidden');
    authModal.classList.remove('hidden');
  });
  
  // Modal handlers
  statsBtn.addEventListener('click', () => {
    statsModal.classList.remove('hidden');
  });
  
  closeStats.addEventListener('click', () => {
    statsModal.classList.add('hidden');
  });
  
  // Routine selector handler
  routineSelector.addEventListener('change', function() {
    loadRoutine(this.value);
  });
  
  // Save routine handlers
  saveRoutineBtn.addEventListener('click', () => {
    saveRoutineModal.classList.remove('hidden');
    updateRoutineStats();
  });
  
  closeSaveRoutine.addEventListener('click', () => {
    saveRoutineModal.classList.add('hidden');
  });
  
  confirmSaveRoutine.addEventListener('click', () => {
    const routineName = document.getElementById('routine-name').value;
    const routineDescription = document.getElementById('routine-description').value;
    
    if (!routineName) {
      alert('Please enter a name for your routine');
      return;
    }
    
    // In a real app, you would save the routine to localStorage or a backend
    alert(`Routine "${routineName}" saved successfully!`);
    saveRoutineModal.classList.add('hidden');
    
    // Update the routine selector
    const newOption = document.createElement('option');
    newOption.value = routineName.toLowerCase().replace(/\s+/g, '-');
    newOption.textContent = routineName;
    routineSelector.appendChild(newOption);
    routineSelector.value = newOption.value;
  });
  
  // Add to routine modal handlers
  closeAddToRoutine.addEventListener('click', () => {
    addToRoutineModal.classList.add('hidden');
    currentExerciseToAdd = null;
  });
  
  confirmAddToRoutine.addEventListener('click', () => {
    if (!currentExerciseToAdd) return;
    
    const duration = exerciseDuration.value || '2';
    const routineId = targetRoutine.value;
    
    // Add to the selected routine
    const exerciseCard = currentExerciseToAdd.closest('.exercise-card');
    const title = exerciseCard.querySelector('h3').textContent;
    const icon = exerciseCard.querySelector('.fa-3x').classList[1].replace('fa-', '');
    
    // In a real app, you would add to the routine data structure
    addToRoutine(title, duration + ' min', icon);
    
    addToRoutineModal.classList.add('hidden');
    currentExerciseToAdd = null;
  });
  
  // Notification handlers
  closeNotification.addEventListener('click', () => {
    breakNotification.classList.add('hidden');
  });
  
  snoozeBreak.addEventListener('click', () => {
    breakNotification.classList.add('hidden');
    // Snooze for 5 minutes
    timeLeft = 5 * 60;
    startTimer();
  });
  
  startBreak.addEventListener('click', () => {
    breakNotification.classList.add('hidden');
    isWorking = false;
    timeLeft = breakDuration;
    updateActivityDisplay("Take a Break", "Time to stretch and relax!");
    startTimer();
  });
  
  // Dashboard button handlers
  takeBreakNow.addEventListener('click', () => {
    isWorking = false;
    timeLeft = breakDuration;
    updateActivityDisplay("Take a Break", "Time to stretch and relax!");
    startTimer();
  });
  
  skipBtn.addEventListener('click', () => {
    isWorking = true;
    timeLeft = workDuration;
    updateActivityDisplay("Focus Time", "You're currently working. Your next break is scheduled soon.");
    startTimer();
  });
  
  pauseBtn.addEventListener('click', () => {
    if (isTimerPaused) {
      // Resume timer
      isTimerPaused = false;
      pauseBtn.innerHTML = '<i class="fas fa-pause"></i>';
      pauseBtn.title = "Pause";
      startTimer();
    } else {
      // Pause timer
      isTimerPaused = true;
      clearInterval(timer);
      pauseBtn.innerHTML = '<i class="fas fa-play"></i>';
      pauseBtn.title = "Resume";
    }
  });
  
  // Timer adjustment handlers
  decreaseTimeBtn.addEventListener('mousedown', startDecreasingTime);
  decreaseTimeBtn.addEventListener('touchstart', startDecreasingTime);
  decreaseTimeBtn.addEventListener('mouseup', stopAdjustingTime);
  decreaseTimeBtn.addEventListener('mouseleave', stopAdjustingTime);
  decreaseTimeBtn.addEventListener('touchend', stopAdjustingTime);
  
  increaseTimeBtn.addEventListener('mousedown', startIncreasingTime);
  increaseTimeBtn.addEventListener('touchstart', startIncreasingTime);
  increaseTimeBtn.addEventListener('mouseup', stopAdjustingTime);
  increaseTimeBtn.addEventListener('mouseleave', stopAdjustingTime);
  increaseTimeBtn.addEventListener('touchend', stopAdjustingTime);
  
  function startDecreasingTime() {
    adjustTime(-1);
    
    holdTimeout = setTimeout(() => {
      isHolding = true;
      decreaseInterval = setInterval(() => {
        adjustTime(-5); // Faster decrease after holding for 2 seconds
      }, 100);
    }, 2000);
  }
  
  function startIncreasingTime() {
    adjustTime(1);
    
    holdTimeout = setTimeout(() => {
      isHolding = true;
      increaseInterval = setInterval(() => {
        adjustTime(5); // Faster increase after holding for 2 seconds
      }, 100);
    }, 2000);
  }
  
  function stopAdjustingTime() {
    clearTimeout(holdTimeout);
    clearInterval(decreaseInterval);
    clearInterval(increaseInterval);
    isHolding = false;
  }
  
  function adjustTime(seconds) {
    timeLeft = Math.max(0, timeLeft + seconds);
    updateTimerDisplay();
  }
  
  // Load more activities handler
  loadMoreBtn.addEventListener('click', () => {
    const hiddenCards = document.querySelectorAll('.exercise-card.hidden-row');
    const cardsToShow = Math.min(3, hiddenCards.length);
    
    for (let i = 0; i < cardsToShow; i++) {
      hiddenCards[i].classList.remove('hidden-row');
    }
    
    // Hide button if no more cards to show
    if (hiddenCards.length <= 3) {
      loadMoreBtn.classList.add('hidden');
    }
  });
  
  // Add event listeners to all "Add to Routine" buttons
  document.querySelectorAll('.add-to-routine').forEach(button => {
    button.addEventListener('click', function() {
      currentExerciseToAdd = this;
      addToRoutineModal.classList.remove('hidden');
      
      // Set default duration based on exercise
      const durationText = this.closest('.exercise-card').querySelector('.text-sm.text-gray-500').textContent;
      const defaultDuration = durationText.includes('min') ? durationText.split(' ')[0] : '2';
      exerciseDuration.value = defaultDuration;
    });
  });
  
  // Add event listeners to all favorite buttons
  document.querySelectorAll('.favorite-btn').forEach(button => {
    button.addEventListener('click', function() {
      this.classList.toggle('active');
      const icon = this.querySelector('i');
      if (icon.classList.contains('far')) {
        icon.classList.remove('far');
        icon.classList.add('fas');
      } else {
        icon.classList.remove('fas');
        icon.classList.add('far');
      }
      // In a real app, you would save the favorite status
    });
  });
  
  // Add event listeners to all remove buttons in routine items
  routineContainer.addEventListener('click', function(e) {
    if (e.target.closest('.routine-item') && e.target.closest('.fa-times')) {
      e.target.closest('.routine-item').remove();
      updateEmptyRoutineMessage();
      updateRoutineStats();
    }
  });
  
  function loadRoutine(routineId) {
    routineContainer.innerHTML = '';
    
    const routine = routines[routineId];
    if (!routine) return;
    
    routine.exercises.forEach(exercise => {
      addToRoutine(exercise.title, exercise.duration, exercise.icon);
    });
    
    updateEmptyRoutineMessage();
    updateRoutineStats();
  }
  
  function addToRoutine(title, duration, icon) {
    emptyRoutineMessage.classList.add('hidden');
    
    const routineItem = document.createElement('div');
    routineItem.className = 'routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200';
    routineItem.innerHTML = `
      <div class="flex items-center justify-between mb-2">
        <div class="activity-icon">
          <i class="fas fa-${icon} text-xs"></i>
        </div>
        <button class="text-gray-400 hover:text-red-500 text-sm">
          <i class="fas fa-times"></i>
        </button>
      </div>
      <h3 class="font-semibold text-gray-800 text-sm mb-1">${title}</h3>
      <p class="text-xs text-gray-500">${duration}</p>
    `;
    
    routineContainer.appendChild(routineItem);
    updateRoutineStats();
  }
  
  function updateEmptyRoutineMessage() {
    if (routineContainer.children.length === 0) {
      emptyRoutineMessage.classList.remove('hidden');
    } else {
      emptyRoutineMessage.classList.add('hidden');
    }
  }
  
  function updateRoutineStats() {
    let totalTime = 0;
    const exercises = [];
    const activityTypes = new Set();
    
    document.querySelectorAll('.routine-item').forEach(item => {
      const durationText = item.querySelector('.text-xs.text-gray-500').textContent;
      const duration = parseInt(durationText) || 0;
      totalTime += duration;
      
      const title = item.querySelector('h3').textContent;
      exercises.push(title + ' (' + durationText + ')');
      
      const iconClass = item.querySelector('.activity-icon i').classList[1];
      if (iconClass.includes('hands')) activityTypes.add('Stretching');
      if (iconClass.includes('lungs')) activityTypes.add('Breathing');
      if (iconClass.includes('eye')) activityTypes.add('Eye Care');
      if (iconClass.includes('chair')) activityTypes.add('Yoga');
      if (iconClass.includes('water')) activityTypes.add('Hydration');
    });
    
    // Update the total time display
    routineTotalTime.textContent = totalTime;
    
    // Update the summary in the save modal
    if (saveRoutineModal) {
      const totalTimeElement = saveRoutineModal.querySelector('.bg-light .font-bold.text-primary');
      if (totalTimeElement) {
        totalTimeElement.textContent = totalTime + ' minutes';
      }
      
      const activitiesContainer = saveRoutineModal.querySelector('.flex-wrap.gap-2');
      if (activitiesContainer) {
        activitiesContainer.innerHTML = '';
        activityTypes.forEach(type => {
          let icon = 'spa';
          if (type === 'Stretching') icon = 'hands-helping';
          if (type === 'Breathing') icon = 'lungs';
          if (type === 'Eye Care') icon = 'eye';
          if (type === 'Yoga') icon = 'chair';
          if (type === 'Hydration') icon = 'water';
          
          const activityPill = document.createElement('div');
          activityPill.className = 'flex items-center bg-white px-3 py-1 rounded-full text-sm';
          activityPill.innerHTML = `
            <div class="activity-icon mr-2">
              <i class="fas fa-${icon} text-xs"></i>
            </div>
            ${type}
          `;
          activitiesContainer.appendChild(activityPill);
        });
      }
      
      const exercisesList = saveRoutineModal.querySelector('.list-disc');
      if (exercisesList) {
        exercisesList.innerHTML = exercises.map(ex => `<li>${ex}</li>`).join('');
      }
    }
  }
  
  // Activities library search and filter
  exerciseSearch.addEventListener('input', filterExercises);
  exerciseFilter.addEventListener('change', filterExercises);
  
  function filterExercises() {
    const searchTerm = exerciseSearch.value.toLowerCase();
    const filterValue = exerciseFilter.value;
    
    document.querySelectorAll('.exercise-card').forEach(card => {
      const title = card.querySelector('h3').textContent.toLowerCase();
      const description = card.querySelector('p').textContent.toLowerCase();
      const category = card.dataset.category;
      const isFavorite = card.querySelector('.favorite-btn').classList.contains('active');
      
      const matchesSearch = title.includes(searchTerm) || description.includes(searchTerm);
      const matchesFilter = filterValue === 'all' || 
                          (filterValue === 'favorites' && isFavorite) ||
                          (filterValue !== 'favorites' && category === filterValue);
      
      if (matchesSearch && matchesFilter) {
        card.style.display = 'block';
      } else {
        card.style.display = 'none';
      }
    });
  }
  
  // Timer functions
  function startTimer() {
    if (isTimerPaused) return;
    
    clearInterval(timer);
    timer = setInterval(updateTimer, 1000);
  }
  
  function updateTimer() {
    if (isTimerPaused) return;
    
    timeLeft--;
    
    if (timeLeft <= 0) {
      clearInterval(timer);
      if (isWorking) {
        // Time for a break
        breakNotification.classList.remove('hidden');
      } else {
        // Break is over, back to work
        isWorking = true;
        timeLeft = workDuration;
        updateActivityDisplay("Focus Time", "You're currently working. Your next break is scheduled soon.");
        startTimer();
      }
    }
    
    updateTimerDisplay();
  }
  
  function updateTimerDisplay() {
    const minutes = Math.floor(timeLeft / 60);
    const seconds = timeLeft % 60;
    document.getElementById('time-remaining').textContent = 
      `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
    
    // Update progress circle
    const totalTime = isWorking ? workDuration : breakDuration;
    const progress = (totalTime - timeLeft) / totalTime;
    const circumference = 251.2; // 2 * π * r (where r=40)
    const offset = circumference - (progress * circumference);
    document.getElementById('progress-circle').style.strokeDashoffset = offset;
  }
  
  function updateActivityDisplay(nextActivity, currentActivity) {
    document.getElementById('next-activity').textContent = `Next: ${nextActivity}`;
    document.getElementById('current-activity').innerHTML = `<p class="text-gray-600">${currentActivity}</p>`;
  }
  
  // Initialize
  updateActivityDisplay("Stretch", "You're currently working. Your next break is scheduled soon.");
  startTimer();
  updateEmptyRoutineMessage();
  loadRoutine('morning');
  
  // Set one exercise as favorite by default for demo
  document.querySelector('.exercise-card[data-category="eye"] .favorite-btn').classList.add('active');
</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=tframe/deskrefresh" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>