File size: 30,458 Bytes
87b5d96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GrowBuddy - Cannabis Grow Assistant</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .sidebar {
            transition: all 0.3s ease;
        }
        .chart-container {
            position: relative;
            height: 300px;
            width: 100%;
        }
        .phase-card {
            transition: all 0.3s ease;
        }
        .phase-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                left: -100%;
                top: 0;
                z-index: 50;
                height: 100vh;
            }
            .sidebar.active {
                left: 0;
            }
            .overlay {
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background-color: rgba(0,0,0,0.5);
                z-index: 40;
            }
            .overlay.active {
                display: block;
            }
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Mobile Menu Button -->
    <div class="md:hidden fixed top-4 left-4 z-50">
        <button id="menuBtn" class="p-2 rounded-lg bg-green-600 text-white">
            <i class="fas fa-bars"></i>
        </button>
    </div>

    <!-- Overlay for mobile menu -->
    <div id="overlay" class="overlay"></div>

    <!-- Sidebar -->
    <div id="sidebar" class="sidebar bg-white w-64 p-4 shadow-lg fixed h-full">
        <div class="flex items-center justify-between mb-8">
            <h1 class="text-2xl font-bold text-green-700">GrowBuddy</h1>
            <button id="closeMenuBtn" class="md:hidden p-2 text-gray-500">
                <i class="fas fa-times"></i>
            </button>
        </div>

        <div class="mb-6">
            <div class="flex items-center space-x-2 mb-4">
                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                <span class="text-sm font-medium">Active Grow: <span id="currentGrowName">Blue Dream</span></span>
            </div>
            <div class="flex space-x-2">
                <button class="px-3 py-1 bg-green-100 text-green-700 rounded-full text-sm">Day 24</button>
                <button class="px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-sm">Vegetative</button>
            </div>
        </div>

        <nav>
            <ul class="space-y-2">
                <li>
                    <a href="#" class="flex items-center p-2 rounded-lg bg-green-100 text-green-700">
                        <i class="fas fa-home mr-3"></i>
                        <span>Dashboard</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-seedling mr-3"></i>
                        <span>Grow Cycle</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-chart-line mr-3"></i>
                        <span>Data Logging</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-tasks mr-3"></i>
                        <span>Tasks & Reminders</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-cog mr-3"></i>
                        <span>Setup Management</span>
                    </a>
                </li>
                <li>
                    <a href="#" class="flex items-center p-2 rounded-lg hover:bg-gray-100 text-gray-700">
                        <i class="fas fa-question-circle mr-3"></i>
                        <span>Troubleshooting</span>
                    </a>
                </li>
            </ul>
        </nav>

        <div class="mt-8 pt-4 border-t border-gray-200">
            <div class="flex items-center justify-between mb-2">
                <span class="text-sm font-medium">User Mode:</span>
                <div class="relative">
                    <select class="block appearance-none bg-gray-100 border border-gray-300 text-gray-700 py-1 px-2 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-green-500 text-sm">
                        <option>Beginner</option>
                        <option>Pro</option>
                    </select>
                    <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
                        <i class="fas fa-chevron-down text-xs"></i>
                    </div>
                </div>
            </div>
            <button class="w-full mt-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium">
                <i class="fas fa-plus mr-2"></i> New Grow
            </button>
        </div>
    </div>

    <!-- Main Content -->
    <div class="md:ml-64 p-4">
        <div class="max-w-7xl mx-auto">
            <!-- Header -->
            <div class="flex justify-between items-center mb-6">
                <h2 class="text-2xl font-bold text-gray-800">Grow Dashboard</h2>
                <div class="flex space-x-2">
                    <button class="p-2 rounded-lg bg-gray-100 hover:bg-gray-200 text-gray-700">
                        <i class="fas fa-bell"></i>
                    </button>
                    <button class="p-2 rounded-lg bg-gray-100 hover:bg-gray-200 text-gray-700">
                        <i class="fas fa-question-circle"></i>
                    </button>
                </div>
            </div>

            <!-- Grow Cycle Phases -->
            <div class="mb-8">
                <h3 class="text-lg font-semibold mb-4 text-gray-700">Grow Cycle Progress</h3>
                <div class="grid grid-cols-1 md:grid-cols-4 gap-4">
                    <div class="phase-card bg-white p-4 rounded-lg shadow border-l-4 border-blue-500">
                        <div class="flex justify-between items-start">
                            <div>
                                <h4 class="font-medium text-gray-800">Germination</h4>
                                <p class="text-sm text-gray-500">Completed</p>
                            </div>
                            <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center">
                                <i class="fas fa-check text-blue-500"></i>
                            </div>
                        </div>
                        <div class="mt-3 text-xs text-gray-500">
                            <span class="font-medium">Day 1-7</span>
                        </div>
                    </div>
                    <div class="phase-card bg-white p-4 rounded-lg shadow border-l-4 border-green-500">
                        <div class="flex justify-between items-start">
                            <div>
                                <h4 class="font-medium text-gray-800">Seedling</h4>
                                <p class="text-sm text-gray-500">Completed</p>
                            </div>
                            <div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center">
                                <i class="fas fa-check text-green-500"></i>
                            </div>
                        </div>
                        <div class="mt-3 text-xs text-gray-500">
                            <span class="font-medium">Day 8-14</span>
                        </div>
                    </div>
                    <div class="phase-card bg-white p-4 rounded-lg shadow border-l-4 border-yellow-500">
                        <div class="flex justify-between items-start">
                            <div>
                                <h4 class="font-medium text-gray-800">Vegetative</h4>
                                <p class="text-sm text-yellow-600">Current Phase</p>
                            </div>
                            <div class="w-8 h-8 rounded-full bg-yellow-100 flex items-center justify-center">
                                <i class="fas fa-leaf text-yellow-500"></i>
                            </div>
                        </div>
                        <div class="mt-3 text-xs text-gray-500">
                            <span class="font-medium">Day 15-42</span>
                        </div>
                    </div>
                    <div class="phase-card bg-white p-4 rounded-lg shadow border-l-4 border-purple-300">
                        <div class="flex justify-between items-start">
                            <div>
                                <h4 class="font-medium text-gray-800">Flowering</h4>
                                <p class="text-sm text-gray-500">Upcoming</p>
                            </div>
                            <div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center">
                                <i class="fas fa-spa text-purple-300"></i>
                            </div>
                        </div>
                        <div class="mt-3 text-xs text-gray-500">
                            <span class="font-medium">Day 43-100</span>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Current Phase Guide -->
            <div class="mb-8 bg-white rounded-lg shadow overflow-hidden">
                <div class="bg-yellow-50 p-4 border-b border-yellow-100">
                    <h3 class="text-lg font-semibold text-gray-800 flex items-center">
                        <i class="fas fa-info-circle text-yellow-500 mr-2"></i>
                        Vegetative Phase Guide (Day 24)
                    </h3>
                </div>
                <div class="p-4">
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                        <div>
                            <h4 class="font-medium text-gray-700 mb-2 flex items-center">
                                <i class="fas fa-lightbulb text-green-500 mr-2"></i>
                                Lighting
                            </h4>
                            <p class="text-sm text-gray-600 mb-2">18-24 hours of light per day</p>
                            <p class="text-sm text-gray-600">PPFD: 400-600 μmol/m²/s</p>
                        </div>
                        <div>
                            <h4 class="font-medium text-gray-700 mb-2 flex items-center">
                                <i class="fas fa-tint text-blue-500 mr-2"></i>
                                Water & Nutrients
                            </h4>
                            <p class="text-sm text-gray-600 mb-2">pH: 5.8-6.3 (adjust for medium)</p>
                            <p class="text-sm text-gray-600">EC: 1.2-1.8 mS/cm</p>
                        </div>
                        <div>
                            <h4 class="font-medium text-gray-700 mb-2 flex items-center">
                                <i class="fas fa-thermometer-half text-red-500 mr-2"></i>
                                Environment
                            </h4>
                            <p class="text-sm text-gray-600 mb-2">Temp: 22-28°C (day), 18-22°C (night)</p>
                            <p class="text-sm text-gray-600">RH: 50-70%</p>
                        </div>
                    </div>
                    <div class="mt-6">
                        <h4 class="font-medium text-gray-700 mb-2">Recommended Actions</h4>
                        <ul class="space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                                <span class="text-sm text-gray-700">Continue LST (Low Stress Training) to promote bushier growth</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                                <span class="text-sm text-gray-700">Monitor for pests - inspect undersides of leaves</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                                <span class="text-sm text-gray-700">Increase nitrogen slightly if leaves appear light green</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>

            <!-- Data Logging Section -->
            <div class="mb-8">
                <div class="flex justify-between items-center mb-4">
                    <h3 class="text-lg font-semibold text-gray-700">Grow Data Tracking</h3>
                    <button class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium">
                        <i class="fas fa-plus mr-2"></i> Add Data Point
                    </button>
                </div>

                <div class="bg-white rounded-lg shadow p-4 mb-6">
                    <div class="flex justify-between items-center mb-4">
                        <h4 class="font-medium text-gray-700">Environmental Conditions</h4>
                        <div class="flex space-x-2">
                            <button class="px-3 py-1 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-full text-xs">
                                7 Days
                            </button>
                            <button class="px-3 py-1 bg-green-100 text-green-700 rounded-full text-xs">
                                30 Days
                            </button>
                            <button class="px-3 py-1 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-full text-xs">
                                All
                            </button>
                        </div>
                    </div>
                    <div class="chart-container">
                        <canvas id="envChart"></canvas>
                    </div>
                </div>

                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div class="bg-white rounded-lg shadow p-4">
                        <h4 class="font-medium text-gray-700 mb-4">Nutrient Solution</h4>
                        <div class="chart-container">
                            <canvas id="nutrientChart"></canvas>
                        </div>
                    </div>
                    <div class="bg-white rounded-lg shadow p-4">
                        <h4 class="font-medium text-gray-700 mb-4">Water Consumption</h4>
                        <div class="chart-container">
                            <canvas id="waterChart"></canvas>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Tasks & Reminders -->
            <div class="mb-8 bg-white rounded-lg shadow overflow-hidden">
                <div class="bg-blue-50 p-4 border-b border-blue-100">
                    <h3 class="text-lg font-semibold text-gray-800 flex items-center justify-between">
                        <span><i class="fas fa-tasks text-blue-500 mr-2"></i> Upcoming Tasks</span>
                        <button class="text-blue-600 text-sm font-medium">View All</button>
                    </h3>
                </div>
                <div class="p-4">
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <div class="mr-3 mt-1">
                                <div class="w-8 h-8 rounded-full bg-red-100 flex items-center justify-center">
                                    <i class="fas fa-exclamation text-red-500"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="flex justify-between items-start">
                                    <h4 class="font-medium text-gray-800">Check pH & EC levels</h4>
                                    <span class="text-xs bg-red-100 text-red-700 px-2 py-1 rounded-full">Today</span>
                                </div>
                                <p class="text-sm text-gray-600 mt-1">Measure and adjust nutrient solution pH to 5.8-6.0</p>
                                <div class="flex items-center mt-2 text-xs text-gray-500">
                                    <i class="far fa-clock mr-1"></i>
                                    <span>Due: Today 6:00 PM</span>
                                </div>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="mr-3 mt-1">
                                <div class="w-8 h-8 rounded-full bg-yellow-100 flex items-center justify-center">
                                    <i class="fas fa-tint text-yellow-500"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="flex justify-between items-start">
                                    <h4 class="font-medium text-gray-800">Water plants</h4>
                                    <span class="text-xs bg-yellow-100 text-yellow-700 px-2 py-1 rounded-full">Tomorrow</span>
                                </div>
                                <p class="text-sm text-gray-600 mt-1">Water with 1L per plant, check runoff EC</p>
                                <div class="flex items-center mt-2 text-xs text-gray-500">
                                    <i class="far fa-clock mr-1"></i>
                                    <span>Due: Tomorrow 10:00 AM</span>
                                </div>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="mr-3 mt-1">
                                <div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center">
                                    <i class="fas fa-cut text-green-500"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="flex justify-between items-start">
                                    <h4 class="font-medium text-gray-800">LST (Low Stress Training)</h4>
                                    <span class="text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full">In 2 days</span>
                                </div>
                                <p class="text-sm text-gray-600 mt-1">Adjust ties to spread branches evenly</p>
                                <div class="flex items-center mt-2 text-xs text-gray-500">
                                    <i class="far fa-clock mr-1"></i>
                                    <span>Due: Friday 2:00 PM</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <button class="w-full mt-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium">
                        <i class="fas fa-plus mr-2"></i> Add New Task
                    </button>
                </div>
            </div>

            <!-- Quick Log Entry -->
            <div class="bg-white rounded-lg shadow p-4 mb-8">
                <h3 class="text-lg font-semibold text-gray-700 mb-4">Quick Log Entry</h3>
                <form>
                    <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-4">
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">pH</label>
                            <input type="number" step="0.1" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">EC (mS/cm)</label>
                            <input type="number" step="0.1" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">Temp (°C)</label>
                            <input type="number" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">RH (%)</label>
                            <input type="number" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
                        </div>
                    </div>
                    <div class="mb-4">
                        <label class="block text-sm font-medium text-gray-700 mb-1">Notes</label>
                        <textarea rows="2" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"></textarea>
                    </div>
                    <div class="flex justify-end">
                        <button type="button" class="px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-700 rounded-lg text-sm font-medium mr-2">
                            Cancel
                        </button>
                        <button type="submit" class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium">
                            Save Log
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script>
        // Mobile menu toggle
        const menuBtn = document.getElementById('menuBtn');
        const closeMenuBtn = document.getElementById('closeMenuBtn');
        const sidebar = document.getElementById('sidebar');
        const overlay = document.getElementById('overlay');

        menuBtn.addEventListener('click', () => {
            sidebar.classList.add('active');
            overlay.classList.add('active');
        });

        closeMenuBtn.addEventListener('click', () => {
            sidebar.classList.remove('active');
            overlay.classList.remove('active');
        });

        overlay.addEventListener('click', () => {
            sidebar.classList.remove('active');
            overlay.classList.remove('active');
        });

        // Initialize charts
        document.addEventListener('DOMContentLoaded', function() {
            // Environmental Conditions Chart
            const envCtx = document.getElementById('envChart').getContext('2d');
            const envChart = new Chart(envCtx, {
                type: 'line',
                data: {
                    labels: Array.from({length: 30}, (_, i) => `Day ${i+1}`),
                    datasets: [
                        {
                            label: 'Temperature (°C)',
                            data: Array.from({length: 30}, () => Math.floor(Math.random() * 5) + 22),
                            borderColor: 'rgb(239, 68, 68)',
                            backgroundColor: 'rgba(239, 68, 68, 0.1)',
                            tension: 0.3,
                            fill: true
                        },
                        {
                            label: 'Humidity (%)',
                            data: Array.from({length: 30}, () => Math.floor(Math.random() * 20) + 50),
                            borderColor: 'rgb(59, 130, 246)',
                            backgroundColor: 'rgba(59, 130, 246, 0.1)',
                            tension: 0.3,
                            fill: true
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'top',
                        },
                        tooltip: {
                            mode: 'index',
                            intersect: false,
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: false,
                            suggestedMin: 15,
                            suggestedMax: 80
                        }
                    }
                }
            });

            // Nutrient Solution Chart
            const nutrientCtx = document.getElementById('nutrientChart').getContext('2d');
            const nutrientChart = new Chart(nutrientCtx, {
                type: 'line',
                data: {
                    labels: Array.from({length: 30}, (_, i) => `Day ${i+1}`),
                    datasets: [
                        {
                            label: 'pH',
                            data: Array.from({length: 30}, () => (Math.random() * 0.5) + 5.7),
                            borderColor: 'rgb(16, 185, 129)',
                            backgroundColor: 'rgba(16, 185, 129, 0.1)',
                            tension: 0.3,
                            fill: true,
                            yAxisID: 'y'
                        },
                        {
                            label: 'EC (mS/cm)',
                            data: Array.from({length: 30}, () => (Math.random() * 0.6) + 1.2),
                            borderColor: 'rgb(245, 158, 11)',
                            backgroundColor: 'rgba(245, 158, 11, 0.1)',
                            tension: 0.3,
                            fill: true,
                            yAxisID: 'y1'
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'top',
                        },
                        tooltip: {
                            mode: 'index',
                            intersect: false,
                        }
                    },
                    scales: {
                        y: {
                            type: 'linear',
                            display: true,
                            position: 'left',
                            min: 5,
                            max: 7,
                            title: {
                                display: true,
                                text: 'pH'
                            }
                        },
                        y1: {
                            type: 'linear',
                            display: true,
                            position: 'right',
                            min: 0.5,
                            max: 2.5,
                            grid: {
                                drawOnChartArea: false,
                            },
                            title: {
                                display: true,
                                text: 'EC (mS/cm)'
                            }
                        }
                    }
                }
            });

            // Water Consumption Chart
            const waterCtx = document.getElementById('waterChart').getContext('2d');
            const waterChart = new Chart(waterCtx, {
                type: 'bar',
                data: {
                    labels: Array.from({length: 7}, (_, i) => `Week ${i+1}`),
                    datasets: [
                        {
                            label: 'Water (L)',
                            data: [2, 3, 4, 5, 6, 7, 8],
                            backgroundColor: 'rgba(59, 130, 246, 0.7)',
                            borderRadius: 4
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'top',
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: true,
                            title: {
                                display: true,
                                text: 'Liters'
                            }
                        }
                    }
                }
            });
        });
    </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=chiminaca/growbuddy" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>