File size: 33,668 Bytes
b9d9cf5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tools - Amrit Dairy</title>
    <link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🥛</text></svg>">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');
        
        * {
            font-family: 'Poppins', sans-serif;
        }
        
        .glass {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .milk-gradient {
            background: linear-gradient(135deg, #fff5e6 0%, #ffd4a3 50%, #ff9a56 100%);
        }
        
        .tool-card {
            transition: all 0.3s ease;
        }
        
        .tool-card:hover {
            transform: translateY(-5px);
        }
    </style>
</head>
<body class="bg-gradient-to-br from-purple-50 via-pink-50 to-orange-50 min-h-screen">
    <!-- Navigation -->
    <nav class="glass fixed w-full top-0 z-50 px-6 py-4">
        <div class="max-w-7xl mx-auto flex justify-between items-center">
            <div class="flex items-center space-x-2">
                <span class="text-3xl">🥛</span>
                <span class="text-2xl font-bold gradient-text">Amrit Dairy</span>
            </div>
            <div class="hidden md:flex space-x-8">
                <a href="index.html" class="text-gray-700 hover:text-purple-600 transition">Home</a>
                <a href="index.html#products" class="text-gray-700 hover:text-purple-600 transition">Products</a>
                <a href="tools.html" class="text-gray-700 hover:text-purple-600 transition">Tools</a>
                <a href="blog.html" class="text-gray-700 hover:text-purple-600 transition">Blog</a>
                <a href="index.html#quiz" class="text-gray-700 hover:text-purple-600 transition">Quiz</a>
                <a href="index.html#contact" class="text-gray-700 hover:text-purple-600 transition">Contact</a>
            </div>
            <button class="md:hidden">
                <i data-feather="menu" class="w-6 h-6"></i>
            </button>
        </div>
    </nav>

    <!-- Hero Section -->
    <section class="pt-24 pb-12 px-6">
        <div class="max-w-4xl mx-auto text-center">
            <h1 class="text-5xl font-bold mb-6 gradient-text">Dairy Tools & Calculators</h1>
            <p class="text-xl text-gray-600">Powerful tools to help you make informed dairy decisions</p>
        </div>
    </section>

    <!-- Tools Grid -->
    <section class="px-6 pb-20">
        <div class="max-w-7xl mx-auto grid md:grid-cols-2 lg:grid-cols-3 gap-8">
            
            <!-- BMI Calculator -->
            <div class="tool-card bg-white rounded-2xl p-6 shadow-lg">
                <div class="bg-purple-100 w-16 h-16 rounded-xl flex items-center justify-center mb-4">
                    <i data-feather="activity" class="w-8 h-8 text-purple-600"></i>
                </div>
                <h3 class="text-xl font-semibold mb-3">BMI Calculator</h3>
                <p class="text-gray-600 mb-4">Calculate your Body Mass Index to determine healthy weight range</p>
                <button onclick="openTool('bmi')" class="text-purple-600 font-semibold hover:text-purple-700">
                    Open Tool →
                </button>
            </div>

            <!-- Calcium Intake Calculator -->
            <div class="tool-card bg-white rounded-2xl p-6 shadow-lg">
                <div class="bg-green-100 w-16 h-16 rounded-xl flex items-center justify-center mb-4">
                    <i data-feather="calculator" class="w-8 h-8 text-green-600"></i>
                </div>
                <h3 class="text-xl font-semibold mb-3">Calcium Calculator</h3>
                <p class="text-gray-600 mb-4">Track your daily calcium intake from dairy and other sources</p>
                <button onclick="openTool('calcium')" class="text-purple-600 font-semibold hover:text-purple-700">
                    Open Tool →
                </button>
            </div>

            <!-- Recipe Generator -->
            <div class="tool-card bg-white rounded-2xl p-6 shadow-lg">
                <div class="bg-orange-100 w-16 h-16 rounded-xl flex items-center justify-center mb-4">
                    <i data-feather="chef-hat" class="w-8 h-8 text-orange-600"></i>
                </div>
                <h3 class="text-xl font-semibold mb-3">Recipe Generator</h3>
                <p class="text-gray-600 mb-4">Get personalized dairy recipes based on available ingredients</p>
                <button onclick="openTool('recipe')" class="text-purple-600 font-semibold hover:text-purple-700">
                    Open Tool →
                </button>
            </div>

            <!-- Milk Tracker -->
            <div class="tool-card bg-white rounded-2xl p-6 shadow-lg">
                <div class="bg-blue-100 w-16 h-16 rounded-xl flex items-center justify-center mb-4">
                    <i data-feather="trending-up" class="w-8 h-8 text-blue-600"></i>
                </div>
                <h3 class="text-xl font-semibold mb-3">Milk Consumption Tracker</h3>
                <p class="text-gray-600 mb-4">Track your family's daily milk consumption and get insights</p>
                <button onclick="openTool('tracker')" class="text-purple-600 font-semibold hover:text-purple-700">
                    Open Tool →
                </button>
            </div>

            <!-- Cost Calculator -->
            <div class="tool-card bg-white rounded-2xl p-6 shadow-lg">
                <div class="bg-pink-100 w-16 h-16 rounded-xl flex items-center justify-center mb-4">
                    <i data-feather="dollar-sign" class="w-8 h-8 text-pink-600"></i>
                </div>
                <h3 class="text-xl font-semibold mb-3">Cost Calculator</h3>
                <p class="text-gray-600 mb-4">Calculate monthly dairy expenses and find savings opportunities</p>
                <button onclick="openTool('cost')" class="text-purple-600 font-semibold hover:text-purple-700">
                    Open Tool →
                </button>
            </div>

            <!-- Nutrient Analyzer -->
            <div class="tool-card bg-white rounded-2xl p-6 shadow-lg">
                <div class="bg-indigo-100 w-16 h-16 rounded-xl flex items-center justify-center mb-4">
                    <i data-feather="bar-chart-2" class="w-8 h-8 text-indigo-600"></i>
                </div>
                <h3 class="text-xl font-semibold mb-3">Nutrient Analyzer</h3>
                <p class="text-gray-600 mb-4">Analyze nutritional content of different dairy products</p>
                <button onclick="openTool('nutrient')" class="text-purple-600 font-semibold hover:text-purple-700">
                    Open Tool →
                </button>
            </div>

        </div>
    </section>

    <!-- Tool Modal -->
    <div id="toolModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center p-6">
        <div class="bg-white rounded-2xl max-w-2xl w-full max-h-[90vh] overflow-y-auto">
            <div class="p-6 border-b">
                <div class="flex justify-between items-center">
                    <h3 id="toolTitle" class="text-2xl font-bold">Tool Title</h3>
                    <button onclick="closeTool()" class="text-gray-500 hover:text-gray-700">
                        <i data-feather="x" class="w-6 h-6"></i>
                    </button>
                </div>
            </div>
            <div id="toolContent" class="p-6">
                <!-- Dynamic content will be loaded here -->
            </div>
        </div>
    </div>

    <!-- Footer -->
    <footer class="bg-gradient-to-r from-purple-900 to-pink-900 text-white py-12 px-6">
        <div class="max-w-7xl mx-auto">
            <div class="grid md:grid-cols-4 gap-8 mb-8">
                <div>
                    <div class="flex items-center space-x-2 mb-4">
                        <span class="text-3xl">🥛</span>
                        <span class="text-2xl font-bold">Amrit Dairy</span>
                    </div>
                    <p class="text-purple-200">Fresh, pure, and nutritious dairy products for your family.</p>
                </div>
                <div>
                    <h4 class="font-semibold mb-4">Quick Links</h4>
                    <ul class="space-y-2 text-purple-200">
                        <li><a href="index.html" class="hover:text-white transition">Home</a></li>
                        <li><a href="index.html#products" class="hover:text-white transition">Products</a></li>
                        <li><a href="tools.html" class="hover:text-white transition">Tools</a></li>
                        <li><a href="index.html#contact" class="hover:text-white transition">Contact</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-semibold mb-4">Tools</h4>
                    <ul class="space-y-2 text-purple-200">
                        <li><a href="#" onclick="openTool('bmi')" class="hover:text-white transition">BMI Calculator</a></li>
                        <li><a href="#" onclick="openTool('calcium')" class="hover:text-white transition">Calcium Calculator</a></li>
                        <li><a href="#" onclick="openTool('recipe')" class="hover:text-white transition">Recipe Generator</a></li>
                        <li><a href="#" onclick="openTool('cost')" class="hover:text-white transition">Cost Calculator</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-semibold mb-4">Follow Us</h4>
                    <div class="flex space-x-4">
                        <a href="#" class="bg-purple-800 p-2 rounded-lg hover:bg-purple-700 transition">
                            <i data-feather="facebook" class="w-5 h-5"></i>
                        </a>
                        <a href="#" class="bg-purple-800 p-2 rounded-lg hover:bg-purple-700 transition">
                            <i data-feather="twitter" class="w-5 h-5"></i>
                        </a>
                        <a href="#" class="bg-purple-800 p-2 rounded-lg hover:bg-purple-700 transition">
                            <i data-feather="instagram" class="w-5 h-5"></i>
                        </a>
                        <a href="#" class="bg-purple-800 p-2 rounded-lg hover:bg-purple-700 transition">
                            <i data-feather="youtube" class="w-5 h-5"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="border-t border-purple-800 pt-8 text-center text-purple-200">
                <p>&copy; 2024 Amrit Dairy. All rights reserved. Made with ❤️ in India</p>
            </div>
        </div>
    </footer>

    <script>
        feather.replace();

        function openTool(toolType) {
            const modal = document.getElementById('toolModal');
            const title = document.getElementById('toolTitle');
            const content = document.getElementById('toolContent');
            
            switch(toolType) {
                case 'bmi':
                    title.textContent = 'BMI Calculator';
                    content.innerHTML = `
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Height (cm)</label>
                                <input type="number" id="height" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter height">
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Weight (kg)</label>
                                <input type="number" id="weight" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter weight">
                            </div>
                            <button onclick="calculateBMI()" class="w-full py-3 bg-purple-600 text-white rounded-lg font-semibold hover:bg-purple-700">
                                Calculate BMI
                            </button>
                            <div id="bmiResult" class="hidden p-4 bg-purple-50 rounded-lg">
                                <p class="text-lg">Your BMI: <span id="bmiValue" class="font-bold text-purple-600"></span></p>
                                <p id="bmiCategory" class="mt-2"></p>
                            </div>
                        </div>
                    `;
                    break;
                    
                case 'calcium':
                    title.textContent = 'Calcium Intake Calculator';
                    content.innerHTML = `
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Age Group</label>
                                <select id="ageGroup" class="w-full px-4 py-2 rounded-lg border border-gray-300">
                                    <option value="child">Children (4-8 years)</option>
                                    <option value="teen">Teens (9-18 years)</option>
                                    <option value="adult">Adults (19-50 years)</option>
                                    <option value="senior">Seniors (51+ years)</option>
                                </select>
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Milk consumed today (ml)</label>
                                <input type="number" id="milkAmount" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter amount">
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Yogurt/Curd consumed (g)</label>
                                <input type="number" id="yogurtAmount" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter amount">
                            </div>
                            <button onclick="calculateCalcium()" class="w-full py-3 bg-green-600 text-white rounded-lg font-semibold hover:bg-green-700">
                                Calculate Calcium Intake
                            </button>
                            <div id="calciumResult" class="hidden p-4 bg-green-50 rounded-lg">
                                <p class="text-lg">Daily Calcium: <span id="calciumValue" class="font-bold text-green-600"></span> mg</p>
                                <p class="mt-2"><span id="calciumStatus"></span></p>
                            </div>
                        </div>
                    `;
                    break;
                    
                case 'recipe':
                    title.textContent = 'Recipe Generator';
                    content.innerHTML = `
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Select Main Ingredient</label>
                                <select id="mainIngredient" class="w-full px-4 py-2 rounded-lg border border-gray-300">
                                    <option value="paneer">Paneer</option>
                                    <option value="milk">Milk</option>
                                    <option value="yogurt">Yogurt</option>
                                    <option value="cheese">Cheese</option>
                                </select>
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Meal Type</label>
                                <select id="mealType" class="w-full px-4 py-2 rounded-lg border border-gray-300">
                                    <option value="breakfast">Breakfast</option>
                                    <option value="lunch">Lunch</option>
                                    <option value="dinner">Dinner</option>
                                    <option value="snack">Snack</option>
                                </select>
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Cooking Time</label>
                                <select id="cookingTime" class="w-full px-4 py-2 rounded-lg border border-gray-300">
                                    <option value="15">Under 15 minutes</option>
                                    <option value="30">Under 30 minutes</option>
                                    <option value="60">Under 1 hour</option>
                                </select>
                            </div>
                            <button onclick="generateRecipe()" class="w-full py-3 bg-orange-600 text-white rounded-lg font-semibold hover:bg-orange-700">
                                Generate Recipe
                            </button>
                            <div id="recipeResult" class="hidden p-4 bg-orange-50 rounded-lg">
                                <h4 class="font-bold text-lg mb-2">Suggested Recipe:</h4>
                                <p id="recipeName" class="text-purple-600 font-semibold mb-2"></p>
                                <p id="recipeDescription" class="text-gray-600"></p>
                            </div>
                        </div>
                    `;
                    break;
                    
                case 'cost':
                    title.textContent = 'Cost Calculator';
                    content.innerHTML = `
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Monthly Milk Consumption (L)</label>
                                <input type="number" id="monthlyMilk" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter liters">
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Milk Price per Liter (₹)</label>
                                <input type="number" id="milkPrice" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter price">
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Other Dairy Products (₹/month)</label>
                                <input type="number" id="otherDairy" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter amount">
                            </div>
                            <button onclick="calculateCost()" class="w-full py-3 bg-pink-600 text-white rounded-lg font-semibold hover:bg-pink-700">
                                Calculate Monthly Cost
                            </button>
                            <div id="costResult" class="hidden p-4 bg-pink-50 rounded-lg">
                                <p class="text-lg">Total Monthly Cost: <span id="totalCost" class="font-bold text-pink-600"></span></p>
                                <p class="mt-2">Annual Cost: <span id="annualCost" class="font-bold text-pink-600"></span></p>
                            </div>
                        </div>
                    `;
                    break;
                    
                case 'tracker':
                    title.textContent = 'Milk Consumption Tracker';
                    content.innerHTML = `
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Number of Family Members</label>
                                <input type="number" id="familyMembers" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter count">
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Daily Milk Consumption (L)</label>
                                <input type="number" id="dailyMilk" step="0.5" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter liters">
                            </div>
                            <button onclick="trackConsumption()" class="w-full py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700">
                                Track Consumption
                            </button>
                            <div id="trackerResult" class="hidden p-4 bg-blue-50 rounded-lg">
                                <canvas id="consumptionChart" width="400" height="200"></canvas>
                                <div class="mt-4 grid grid-cols-2 gap-4">
                                    <div>
                                        <p class="text-sm text-gray-600">Per Person Daily</p>
                                        <p id="perPersonDaily" class="font-bold text-blue-600"></p>
                                    </div>
                                    <div>
                                        <p class="text-sm text-gray-600">Monthly Consumption</p>
                                        <p id="monthlyConsumption" class="font-bold text-blue-600"></p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    `;
                    break;
                    
                case 'nutrient':
                    title.textContent = 'Nutrient Analyzer';
                    content.innerHTML = `
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Select Dairy Product</label>
                                <select id="dairyProduct" class="w-full px-4 py-2 rounded-lg border border-gray-300">
                                    <option value="milk">Cow Milk</option>
                                    <option value="buffalo">Buffalo Milk</option>
                                    <option value="paneer">Paneer</option>
                                    <option value="yogurt">Yogurt</option>
                                    <option value="butter">Butter</option>
                                </select>
                            </div>
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Quantity</label>
                                <input type="number" id="productQuantity" class="w-full px-4 py-2 rounded-lg border border-gray-300" placeholder="Enter amount">
                            </div>
                            <button onclick="analyzeNutrients()" class="w-full py-3 bg-indigo-600 text-white rounded-lg font-semibold hover:bg-indigo-700">
                                Analyze Nutrients
                            </button>
                            <div id="nutrientResult" class="hidden p-4 bg-indigo-50 rounded-lg">
                                <canvas id="nutrientChart" width="400" height="200"></canvas>
                                <div class="mt-4 space-y-2">
                                    <div class="flex justify-between">
                                        <span>Calories:</span>
                                        <span id="calories" class="font-bold"></span>
                                    </div>
                                    <div class="flex justify-between">
                                        <span>Protein:</span>
                                        <span id="protein" class="font-bold"></span>
                                    </div>
                                    <div class="flex justify-between">
                                        <span>Calcium:</span>
                                        <span id="calcium" class="font-bold"></span>
                                    </div>
                                    <div class="flex justify-between">
                                        <span>Fat:</span>
                                        <span id="fat" class="font-bold"></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    `;
                    break;
            }
            
            modal.classList.remove('hidden');
            feather.replace();
        }

        function closeTool() {
            document.getElementById('toolModal').classList.add('hidden');
        }

        // Calculator functions
        function calculateBMI() {
            const height = document.getElementById('height').value / 100;
            const weight = document.getElementById('weight').value;
            const bmi = (weight / (height * height)).toFixed(1);
            
            let category = '';
            if (bmi < 18.5) category = 'Underweight';
            else if (bmi < 25) category = 'Normal weight';
            else if (bmi < 30) category = 'Overweight';
            else category = 'Obese';
            
            document.getElementById('bmiValue').textContent = bmi;
            document.getElementById('bmiCategory').textContent = `Category: ${category}`;
            document.getElementById('bmiResult').classList.remove('hidden');
        }

        function calculateCalcium() {
            const ageGroup = document.getElementById('ageGroup').value;
            const milkAmount = document.getElementById('milkAmount').value || 0;
            const yogurtAmount = document.getElementById('yogurtAmount').value || 0;
            
            const calcium = (milkAmount * 0.3) + (yogurtAmount * 0.15);
            const recommended = ageGroup === 'child' ? 1000 : ageGroup === 'teen' ? 1300 : ageGroup === 'adult' ? 1000 : 1200;
            
            document.getElementById('calciumValue').textContent = calcium.toFixed(1);
            document.getElementById('calciumStatus').textContent = calcium >= recommended ? 
                '✅ Great job! You\'re meeting your daily calcium requirement.' : 
                `⚠️ You need ${recommended - calcium}mg more calcium daily.`;
            document.getElementById('calciumResult').classList.remove('hidden');
        }

        function generateRecipe() {
            const ingredient = document.getElementById('mainIngredient').value;
            const meal = document.getElementById('mealType').value;
            const time = document.getElementById('cookingTime').value;
            
            const recipes = {
                'paneer-breakfast': 'Paneer Bhurji',
                'paneer-lunch': 'Paneer Tikka Masala',
                'paneer-dinner': 'Palak Paneer',
                'paneer-snack': 'Paneer Cutlets',
                'milk-breakfast': 'Milk Smoothie Bowl',
                'milk-lunch': 'Creamy Tomato Soup',
                'milk-dinner': 'White Sauce Pasta',
                'milk-snack': 'Milk Pudding',
                'yogurt-breakfast': 'Yogurt Parfait',
                'yogurt-lunch': 'Curd Rice',
                'yogurt-dinner': 'Raita',
                'yogurt-snack': 'Lassi',
                'cheese-breakfast': 'Cheese Omelette',
                'cheese-lunch': 'Grilled Cheese Sandwich',
                'cheese-dinner': 'Cheese Pizza',
                'cheese-snack': 'Cheese Sticks'
            };
            
            const recipeKey = `${ingredient}-${meal}`;
            const recipeName = recipes[recipeKey] || 'Special Dish';
            
            document.getElementById('recipeName').textContent = recipeName;
            document.getElementById('recipeDescription').textContent = 
                `A delicious ${recipeName} recipe that can be prepared in under ${time} minutes. Perfect for ${meal}!`;
            document.getElementById('recipeResult').classList.remove('hidden');
        }

        function calculateCost() {
            const milkQty = document.getElementById('monthlyMilk').value || 0;
            const milkPrice = document.getElementById('milkPrice').value || 0;
            const otherDairy = document.getElementById('otherDairy').value || 0;
            
            const monthlyTotal = (milkQty * milkPrice) + parseFloat(otherDairy);
            const annualTotal = monthlyTotal * 12;
            
            document.getElementById('totalCost').textContent = `₹${monthlyTotal.toFixed(2)}`;
            document.getElementById('annualCost').textContent = `₹${annualTotal.toFixed(2)}`;
            document.getElementById('costResult').classList.remove('hidden');
        }

        function trackConsumption() {
            const members = document.getElementById('familyMembers').value;
            const dailyMilk = document.getElementById('dailyMilk').value;
            
            const perPerson = (dailyMilk / members).toFixed(2);
            const monthly = (dailyMilk * 30).toFixed(1);
            
            document.getElementById('perPersonDaily').textContent = `${perPerson} L`;
            document.getElementById('monthlyConsumption').textContent = `${monthly} L`;
            
            // Create chart
            const ctx = document.getElementById('consumptionChart').getContext('2d');
            new Chart(ctx, {
                type: 'bar',
                data: {
                    labels: ['Daily', 'Weekly', 'Monthly'],
                    datasets: [{
                        label: 'Milk Consumption (Liters)',
                        data: [dailyMilk, dailyMilk * 7, dailyMilk * 30],
                        backgroundColor: 'rgba(59, 130, 246, 0.5)',
                        borderColor: 'rgba(59, 130, 246, 1)',
                        borderWidth: 1
                    }]
                },
                options: {
                    responsive: true,
                    scales: {
                        y: {
                            beginAtZero: true
                        }
                    }
                }
            });
            
            document.getElementById('trackerResult').classList.remove('hidden');
        }

        function analyzeNutrients() {
            const product = document.getElementById('dairyProduct').value;
            const quantity = document.getElementById('productQuantity').value || 100;
            
            const nutrientData = {
                'milk': { calories: 42, protein: 3.4, calcium: 125, fat: 1 },
                'buffalo': { calories: 97, protein: 3.8, calcium: 210, fat: 7 },
                'paneer': { calories: 265, protein: 18, calcium: 480, fat: 20 },
                'yogurt': { calories: 59, protein: 10, calcium: 110, fat: 1.5 },
                'butter': { calories: 717, protein: 0.9, calcium: 24, fat: 81 }
            };
            
            const data = nutrientData[product];
            const factor = quantity / 100;
            
            document.getElementById('calories').textContent = `${(data.calories * factor).toFixed(1)} kcal`;
            document.getElementById('protein').textContent = `${(data.protein * factor).toFixed(1)} g`;
            document.getElementById('calcium').textContent = `${(data.calcium * factor).toFixed(1)} mg`;
            document.getElementById('fat').textContent = `${(data.fat * factor).toFixed(1)} g`;
            
            // Create chart
            const ctx = document.getElementById('nutrientChart').getContext('2d');
            new Chart(ctx, {
                type: 'doughnut',
                data: {
                    labels: ['Protein', 'Fat', 'Carbs'],
                    datasets: [{
                        data: [data.protein, data.fat, 5],
                        backgroundColor: [
                            'rgba(255, 99, 132, 0.5)',
                            'rgba(54, 162, 235, 0.5)',
                            'rgba(255, 206, 86, 0.5)'
                        ],
                        borderColor: [
                            'rgba(255, 99, 132, 1)',
                            'rgba(54, 162, 235, 1)',
                            'rgba(255, 206, 86, 1)'
                        ],
                        borderWidth: 1
                    }]
                },
                options: {
                    responsive: true
                }
            });
            
            document.getElementById('nutrientResult').classList.remove('hidden');
        }
    </script>
</body>
</html>