File size: 40,203 Bytes
f443ea7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
faaff62
 
 
 
 
f443ea7
faaff62
 
 
 
 
 
f443ea7
 
faaff62
f443ea7
faaff62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f443ea7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
faaff62
f443ea7
 
 
 
 
 
 
faaff62
f443ea7
 
faaff62
f443ea7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
faaff62
 
f443ea7
faaff62
f443ea7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
faaff62
 
 
f443ea7
 
 
 
 
faaff62
f443ea7
 
 
 
 
 
 
 
faaff62
f443ea7
faaff62
f443ea7
 
faaff62
 
 
 
f443ea7
 
 
 
 
 
 
 
faaff62
 
f443ea7
faaff62
f443ea7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
faaff62
 
 
 
 
 
 
f443ea7
 
 
 
 
 
 
faaff62
 
 
 
f443ea7
 
 
faaff62
 
 
 
f443ea7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
faaff62
 
 
 
 
f443ea7
faaff62
7312c39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
faaff62
 
 
 
 
 
7312c39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f443ea7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>FloatChat - ARGO Data Explorer</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
    <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
        body {
            font-family: 'Poppins', sans-serif;
            background-color: #f8fafc;
        }
        .govt-header {
            background: linear-gradient(135deg, #0f4c81 0%, #1a5f8b 100%);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        .nav-link {
            position: relative;
        }
        .nav-link:after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: 0;
            left: 0;
            background-color: #fff;
            transition: width 0.3s ease;
        }
        .nav-link:hover:after {
            width: 100%;
        }
        .main-container {
            display: flex;
            height: 100vh;
            width: 100%;
        }
        .chat-container {
            display: flex;
            flex-direction: column;
            flex-grow: 1;
            height: 100vh;
            width: 100%;
            border-left: 1px solid #e2e8f0;
        }
        .chat-messages {
            flex-grow: 1;
            overflow-y: auto;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            background-color: #ffffff;
        }
        .user-message {
            align-self: flex-end;
            max-width: 80%;
        }
        .user-message .message-bubble {
            background-color: #d1e7ff;
            border-radius: 18px 18px 0 18px;
            padding: 12px 16px;
            margin: 4px 0;
            line-height: 1.4;
        }
        .bot-message {
            align-self: flex-start;
            max-width: 80%;
        }
        .bot-message .message-bubble {
            background-color: #f1f1f1;
            border-radius: 18px 18px 18px 0;
            padding: 12px 16px;
            margin: 4px 0;
            line-height: 1.4;
        }
        .message-time {
            font-size: 0.75rem;
            color: #64748b;
            margin-top: 4px;
            text-align: right;
        }
        .message-time {
            font-size: 0.75rem;
            color: #64748b;
            margin-top: 4px;
        }
        .chat-input-container {
            padding: 1rem;
            border-top: 1px solid #e2e8f0;
            background: white;
            position: sticky;
            bottom: 0;
        }
        .chat-input {
            display: flex;
            padding: 0.5rem;
            gap: 0.5rem;
            align-items: center;
        }
        .chat-input textarea {
            flex-grow: 1;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 0.75rem 1rem;
            resize: none;
            min-height: 44px;
            max-height: 200px;
            outline: none;
            font-family: inherit;
            line-height: 1.5;
        }
        .chat-input textarea:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }
        .quick-replies {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-top: 0.5rem;
        }
        .quick-reply {
            background-color: #f1f5f9;
            border-radius: 16px;
            padding: 4px 12px;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .quick-reply:hover {
            background-color: #e2e8f0;
        }
        @media (max-width: 768px) {
            .history-sidebar {
                position: absolute;
                left: -100%;
                transition: transform 0.3s ease;
                z-index: 10;
                height: 100vh;
                background: white;
            }
            .history-sidebar.active {
                transform: translateX(100%);
            }
            .chat-container {
                width: 100%;
            }
        }
        .user-message {
            animation: slideInRight 0.3s ease-out;
        }
        .bot-message {
            animation: slideInLeft 0.3s ease-out;
        }
        @keyframes slideInRight {
            from { transform: translateX(20px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        @keyframes slideInLeft {
            from { transform: translateX(-20px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        .visualization-container {
            transition: all 0.5s ease;
        }
        .history-item {
            transition: all 0.2s ease;
        }
        .history-item:hover {
            background-color: #f0f4f8;
        }
        .map-container {
            height: 400px;
            border-radius: 8px;
            overflow: hidden;
        }
        .graph-container {
            height: 400px;
            border-radius: 8px;
            overflow: hidden;
        }
        .typing-dots span {
            display: inline-block;
            width: 8px;
            height: 8px;
            background-color: #64748b;
            border-radius: 50%;
            animation: bounce 1.4s infinite ease-in-out;
        }
        .typing-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }
        .typing-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }
        @keyframes bounce {
            0%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-8px); }
        }
    </style>
</head>
<body class="min-h-screen flex flex-col">
    <!-- Government Header -->
    <div class="govt-header text-white py-2 px-4">
        <div class="container mx-auto flex justify-between items-center">
            <div class="flex items-center space-x-4">
                <img src="https://upload.wikimedia.org/wikipedia/en/thumb/4/41/Flag_of_India.svg/1200px-Flag_of_India.svg.png" alt="Indian Flag" class="h-8">
                <img src="https://www.moes.gov.in/sites/default/files/moes-logo_1.png" alt="MoES Logo" class="h-10">
                <span class="font-bold">भारत सरकार | Government of India</span>
            </div>
            <div class="flex items-center space-x-4">
                <span class="text-sm">A-14, 15 & 19, Sector-1, Noida, UP-201301</span>
                <span class="text-sm">Email: support@moes.gov.in</span>
            </div>
        </div>
    </div>

    <!-- Main Navigation -->
    <nav class="bg-white shadow-md">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-8">
                <a href="index.html" class="text-xl font-bold text-blue-800">ARGO Data Explorer</a>
                <div class="hidden md:flex space-x-6">
                    <a href="index.html" class="nav-link text-gray-600 hover:text-blue-800 font-medium">Home</a>
                    <a href="chatbot.html" class="nav-link text-blue-800 font-medium">FloatChat</a>
                    <a href="#" class="nav-link text-gray-600 hover:text-blue-800 font-medium">Datasets</a>
                    <a href="#" class="nav-link text-gray-600 hover:text-blue-800 font-medium">Research</a>
                    <a href="#" class="nav-link text-gray-600 hover:text-blue-800 font-medium">Publications</a>
                    <a href="#" class="nav-link text-gray-600 hover:text-blue-800 font-medium">About</a>
                </div>
            </div>
            <div class="flex items-center space-x-4">
                <span class="text-sm hidden md:block">Welcome, Researcher</span>
                <button class="bg-blue-700 hover:bg-blue-800 text-white px-4 py-2 rounded-md font-medium transition duration-300 flex items-center space-x-2">
                    <i data-feather="log-out" class="w-4 h-4"></i>
                    <span>Logout</span>
                </button>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main class="flex-1">
        <div class="main-container">
            <!-- Chat History Sidebar -->
            <div class="history-sidebar w-64 bg-white p-4 border-r border-gray-200 overflow-y-auto" data-aos="fade-right">
                <div class="flex justify-between items-center mb-4">
                    <h2 class="text-xl font-bold text-gray-800">Chat History</h2>
                    <button class="text-blue-600 hover:text-blue-800">
                        <i data-feather="refresh-cw" class="w-5 h-5"></i>
                    </button>
                </div>
                <div class="space-y-2 max-h-[calc(100vh-250px)] overflow-y-auto">
                    <div class="history-item p-3 rounded-md cursor-pointer bg-blue-50 border border-blue-200">
                        <p class="font-medium text-blue-800 truncate">Show salinity profiles near the equator</p>
                        <p class="text-xs text-gray-500">Today, 10:45 AM</p>
                    </div>
                    <div class="history-item p-3 rounded-md cursor-pointer hover:bg-gray-50 border border-transparent">
                        <p class="font-medium text-gray-700 truncate">Compare BGC parameters in Arabian Sea</p>
                        <p class="text-xs text-gray-500">Yesterday, 3:22 PM</p>
                    </div>
                    <div class="history-item p-3 rounded-md cursor-pointer hover:bg-gray-50 border border-transparent">
                        <p class="font-medium text-gray-700 truncate">Nearest ARGO floats to Mumbai</p>
                        <p class="text-xs text-gray-500">Yesterday, 11:10 AM</p>
                    </div>
                    <div class="history-item p-3 rounded-md cursor-pointer hover:bg-gray-50 border border-transparent">
                        <p class="font-medium text-gray-700 truncate">Temperature trends in Bay of Bengal</p>
                        <p class="text-xs text-gray-500">May 15, 2023</p>
                    </div>
                    <div class="history-item p-3 rounded-md cursor-pointer hover:bg-gray-50 border border-transparent">
                        <p class="font-medium text-gray-700 truncate">Salinity-depth profile at 10°N, 75°E</p>
                        <p class="text-xs text-gray-500">May 14, 2023</p>
                    </div>
                </div>
                <button class="mt-4 w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-md font-medium transition duration-300 flex items-center justify-center space-x-2">
                    <i data-feather="plus" class="w-4 h-4"></i>
                    <span>New Chat</span>
                </button>
            </div>

            <!-- Main Chat Area -->
            <div class="chat-container bg-white" data-aos="fade-up">
                <!-- Chat Header -->
                <div class="border-b p-4 bg-blue-50">
                        <h2 class="text-xl font-bold text-gray-800">FloatChat - ARGO Data Explorer</h2>
                        <p class="text-sm text-gray-600">Ask questions about ARGO float data in natural language</p>
                    </div>
                    
                    <!-- Chat Messages -->
                    <div class="chat-messages">
                        <!-- Sample Bot Message -->
                        <div class="bot-message flex">
                            <div class="flex-shrink-0 mr-3">
                                <div class="bg-blue-100 text-blue-800 rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="cpu" class="w-4 h-4"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="message-bubble">
                                    <p>Hello! I'm your ARGO data assistant. You can ask me questions about ocean temperature, salinity, and other parameters from ARGO floats worldwide. How can I help you today?</p>
                                    <div class="message-time">Today, 10:45 AM</div>
                                    <div class="mt-2">
                                        <p class="text-sm font-medium text-gray-700 mb-1">Try asking:</p>
                                        <div class="quick-replies">
                                            <div class="quick-reply">Show salinity profiles near equator</div>
                                            <div class="quick-reply">Compare BGC parameters in Arabian Sea</div>
                                            <div class="quick-reply">Nearest ARGO floats to Mumbai</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Sample User Message -->
                        <div class="user-message flex justify-end">
                            <div class="flex-1">
                                <div class="message-bubble">
                                    <p>Show me temperature profiles at 10°N, 75°E for the last month</p>
                                    <div class="message-time">Today, 10:46 AM</div>
                                </div>
                            </div>
                            <div class="flex-shrink-0 ml-3">
                                <div class="bg-blue-700 text-white rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="user" class="w-4 h-4"></i>
                                </div>
                            </div>
                        </div>

                        <!-- Sample Bot Response with Graph -->
                        <div class="bot-message flex">
                            <div class="flex-shrink-0 mr-3">
                                <div class="bg-blue-100 text-blue-800 rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="cpu" class="w-4 h-4"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="bg-gray-50 p-4 rounded-lg">
                                    <p>Here are the temperature profiles from ARGO floats near 10°N, 75°E over the past month:</p>
                                    
                                    <!-- Graph Visualization -->
                                    <div class="mt-4 visualization-container">
                                        <div class="graph-container" id="temperatureGraph"></div>
                                        <script>
                                            // Sample Plotly graph
                                            const tempData = [
                                                {
                                                    z: [[28.5, 28.3, 28.1], [25.0, 24.8, 24.6], [15.0, 14.8, 14.6], [8.0, 7.9, 7.8]],
                                                    x: ['May 1', 'May 15', 'May 30'],
                                                    y: ['0-50m', '50-200m', '200-500m', '500-1000m'],
                                                    type: 'heatmap',
                                                    colorscale: 'Viridis',
                                                    colorbar: {
                                                        title: 'Temperature (°C)'
                                                    }
                                                }
                                            ];
                                            const tempLayout = {
                                                title: 'Temperature Profiles at 10°N, 75°E',
                                                xaxis: { title: 'Date' },
                                                yaxis: { title: 'Depth Range' }
                                            };
                                            Plotly.newPlot('temperatureGraph', tempData, tempLayout);
                                        </script>
                                    </div>
                                    
                                    <div class="mt-4 text-sm text-gray-600">
                                        <p>The data shows surface temperatures around 28-29°C, decreasing with depth. The thermocline is visible around 50-200m depth where temperature drops rapidly.</p>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Sample User Message -->
                        <div class="user-message flex justify-end">
                            <div class="flex-1 max-w-[80%]">
                                <div class="bg-blue-100 p-4 rounded-lg">
                                    <p>Show the locations of ARGO floats in the Indian Ocean</p>
                                </div>
                            </div>
                            <div class="flex-shrink-0 ml-3">
                                <div class="bg-blue-700 text-white rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="user" class="w-4 h-4"></i>
                                </div>
                            </div>
                        </div>

                        <!-- Sample Bot Response with Map -->
                        <div class="bot-message flex">
                            <div class="flex-shrink-0 mr-3">
                                <div class="bg-blue-100 text-blue-800 rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="cpu" class="w-4 h-4"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="bg-gray-50 p-4 rounded-lg">
                                    <p>Here are the active ARGO floats currently reporting data in the Indian Ocean region:</p>
                                    
                                    <!-- Map Visualization -->
                                    <div class="mt-4 visualization-container">
                                        <div class="map-container" id="argoMap"></div>
                                        <script>
                                            // Initialize map
                                            const map = L.map('argoMap').setView([10, 75], 4);
                                            
                                            // Add tile layer
                                            L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
                                                attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
                                            }).addTo(map);
                                            
                                            // Sample ARGO float locations
                                            const floatLocations = [
                                                { lat: 8.5, lng: 72.5, id: '2902304', date: '2023-05-28' },
                                                { lat: 12.3, lng: 68.7, id: '2902305', date: '2023-05-27' },
                                                { lat: 15.2, lng: 80.1, id: '2902306', date: '2023-05-26' },
                                                { lat: 5.5, lng: 85.3, id: '2902307', date: '2023-05-25' },
                                                { lat: -2.4, lng: 78.9, id: '2902308', date: '2023-05-24' }
                                            ];
                                            
                                            // Add markers
                                            floatLocations.forEach(loc => {
                                                const marker = L.marker([loc.lat, loc.lng]).addTo(map)
                                                    .bindPopup(`<b>ARGO Float ${loc.id}</b><br>Last report: ${loc.date}`);
                                                
                                                // Custom icon
                                                marker.setIcon(L.icon({
                                                    iconUrl: 'https://cdn-icons-png.flaticon.com/512/447/447031.png',
                                                    iconSize: [25, 25],
                                                    iconAnchor: [12, 12]
                                                }));
                                            });
                                        </script>
                                    </div>
                                    
                                    <div class="mt-4">
                                        <p class="text-sm text-gray-600">There are currently 47 active ARGO floats in the Indian Ocean region. Click on any marker to see float details.</p>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Sample User Message -->
                        <div class="user-message flex justify-end">
                            <div class="flex-1 max-w-[80%]">
                                <div class="bg-blue-100 p-4 rounded-lg">
                                    <p>Show a table comparing salinity at different depths for float 2902304</p>
                                </div>
                            </div>
                            <div class="flex-shrink-0 ml-3">
                                <div class="bg-blue-700 text-white rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="user" class="w-4 h-4"></i>
                                </div>
                            </div>
                        </div>

                        <!-- Sample Bot Response with Table -->
                        <div class="bot-message flex">
                            <div class="flex-shrink-0 mr-3">
                                <div class="bg-blue-100 text-blue-800 rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="cpu" class="w-4 h-4"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="bg-gray-50 p-4 rounded-lg">
                                    <p>Here's the salinity data at different depths for ARGO float 2902304:</p>
                                    
                                    <!-- Table Visualization -->
                                    <div class="mt-4 overflow-x-auto">
                                        <table class="min-w-full divide-y divide-gray-200">
                                            <thead class="bg-gray-50">
                                                <tr>
                                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Depth (m)</th>
                                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Salinity (PSU)</th>
                                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Temperature (°C)</th>
                                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
                                                </tr>
                                            </thead>
                                            <tbody class="bg-white divide-y divide-gray-200">
                                                <tr>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">10</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">34.56</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">28.7</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-05-28</td>
                                                </tr>
                                                <tr>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">50</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">35.12</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">25.3</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-05-28</td>
                                                </tr>
                                                <tr>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">100</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">35.45</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">20.1</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-05-28</td>
                                                </tr>
                                                <tr>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">200</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">35.67</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15.8</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-05-28</td>
                                                </tr>
                                                <tr>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">500</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">35.72</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8.5</td>
                                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-05-28</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    
                                    <div class="mt-4">
                                        <button class="text-sm bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md font-medium transition duration-300 flex items-center space-x-2">
                                            <i data-feather="download" class="w-4 h-4"></i>
                                            <span>Download Data (CSV)</span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Typing Indicator (hidden by default) -->
                        <div class="typing-indicator flex hidden">
                            <div class="flex-shrink-0 mr-3">
                                <div class="bg-blue-100 text-blue-800 rounded-full w-8 h-8 flex items-center justify-center">
                                    <i data-feather="cpu" class="w-4 h-4"></i>
                                </div>
                            </div>
                            <div class="flex-1">
                                <div class="bg-gray-50 p-4 rounded-lg">
                                    <div class="flex items-center space-x-2">
                                        <div class="typing-dots flex space-x-1">
                                            <span></span>
                                            <span></span>
                                            <span></span>
                                        </div>
                                        <span class="text-sm text-gray-600">FloatChat is typing...</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Input Area -->
                    <div class="chat-input-container">
                        <form class="chat-input">
                            <textarea placeholder="Ask about ARGO data..." rows="1"></textarea>
                            <button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md font-medium transition duration-300 flex items-center justify-center">
                                <i data-feather="send" class="w-4 h-4"></i>
                            </button>
                        </form>
                        <div class="quick-replies">
                            <div class="quick-reply">Show salinity profiles</div>
                            <div class="quick-reply">Compare temperature trends</div>
                            <div class="quick-reply">Map of ARGO floats</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-800 text-white py-6 mt-auto">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <p class="text-sm">© 2023 Ministry of Earth Sciences, Government of India. All Rights Reserved.</p>
                </div>
                <div class="flex space-x-4">
                    <a href="#" class="text-sm hover:underline">Privacy Policy</a>
                    <a href="#" class="text-sm hover:underline">Terms of Service</a>
                    <a href="#" class="text-sm hover:underline">Contact Us</a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        AOS.init();
        feather.replace();
        
        // Auto-expand textarea
        const textarea = document.querySelector('textarea');
        textarea.addEventListener('input', function() {
            this.style.height = 'auto';
            this.style.height = (this.scrollHeight) + 'px';
        });

        // Check for quick chat input from home page
        const quickChatInput = sessionStorage.getItem('quickChatInput');
        if (quickChatInput) {
            // Add the quick input as a user message
            const messagesContainer = document.querySelector('.chat-messages');
            const userMessage = document.createElement('div');
            userMessage.className = 'user-message flex justify-end';
            userMessage.innerHTML = `
                <div class="flex-1 max-w-[80%]">
                    <div class="bg-blue-100 p-4 rounded-lg">
                        <p>${quickChatInput}</p>
                    </div>
                </div>
                <div class="flex-shrink-0 ml-3">
                    <div class="bg-blue-700 text-white rounded-full w-8 h-8 flex items-center justify-center">
                        <i data-feather="user" class="w-4 h-4"></i>
                    </div>
                </div>
            `;
            messagesContainer.appendChild(userMessage);
            
            // Clear the stored input
            sessionStorage.removeItem('quickChatInput');
            
            // Show typing indicator
            showTyping();
            
            // Generate mock response after delay
            setTimeout(() => {
                generateMockResponse(quickChatInput);
            }, 1500);
        }

        // Auto-scroll to bottom of chat
        const messagesContainer = document.querySelector('.chat-messages');
        function scrollToBottom() {
            messagesContainer.scrollTop = messagesContainer.scrollHeight;
        }
        scrollToBottom();

        // Generate mock response based on input
        function generateMockResponse(input) {
            const messagesContainer = document.querySelector('.chat-messages');
            const botMessage = document.createElement('div');
            botMessage.className = 'bot-message flex';
            
            let responseContent = '';
            if (input.toLowerCase().includes('temperature')) {
                responseContent = `
                    <div class="bg-gray-50 p-4 rounded-lg">
                        <p>Here are temperature profiles matching your query:</p>
                        <div class="mt-4 text-sm text-gray-600">
                            <p>• Surface temperature: 28-30°C</p>
                            <p>• 50m depth: 25-27°C</p>
                            <p>• 100m depth: 20-22°C</p>
                            <p>• 200m depth: 15-17°C</p>
                        </div>
                        <p class="mt-2 text-sm">Would you like to see this data visualized on a graph?</p>
                    </div>
                `;
            } else if (input.toLowerCase().includes('salinity')) {
                responseContent = `
                    <div class="bg-gray-50 p-4 rounded-lg">
                        <p>Here are salinity measurements:</p>
                        <div class="mt-4 text-sm text-gray-600">
                            <p>• Surface salinity: 34-35 PSU</p>
                            <p>• 50m depth: 35-36 PSU</p>
                            <p>• 100m depth: 36-37 PSU</p>
                        </div>
                        <p class="mt-2 text-sm">I can show you a time series comparison if you'd like.</p>
                    </div>
                `;
            } else if (input.toLowerCase().includes('map') || input.toLowerCase().includes('location')) {
                responseContent = `
                    <div class="bg-gray-50 p-4 rounded-lg">
                        <p>Here are ARGO float locations in the Indian Ocean region:</p>
                        <div class="mt-4 text-sm text-gray-600">
                            <p>• 8°N, 72°E - Float ID: 2902304</p>
                            <p>• 12°N, 68°E - Float ID: 2902305</p>
                            <p>• 15°N, 80°E - Float ID: 2902306</p>
                        </div>
                        <p class="mt-2 text-sm">Would you like to see these on an interactive map?</p>
                    </div>
                `;
            } else {
                responseContent = `
                    <div class="bg-gray-50 p-4 rounded-lg">
                        <p>I can help you explore ARGO float data including:</p>
                        <div class="mt-2 text-sm text-gray-600">
                            <p>• Temperature profiles</p>
                            <p>• Salinity measurements</p>
                            <p>• Float locations and trajectories</p>
                            <p>• Time series comparisons</p>
                        </div>
                        <p class="mt-2 text-sm">Try asking about specific parameters or regions.</p>
                    </div>
                `;
            }

            botMessage.innerHTML = `
                <div class="flex-shrink-0 mr-3">
                    <div class="bg-blue-100 text-blue-800 rounded-full w-8 h-8 flex items-center justify-center">
                        <i data-feather="cpu" class="w-4 h-4"></i>
                    </div>
                </div>
                <div class="flex-1">
                    ${responseContent}
                </div>
            `;
            
            messagesContainer.appendChild(botMessage);
            feather.replace();
            scrollToBottom();
            
            // Animate new message
            anime({
                targets: botMessage,
                opacity: [0, 1],
                translateX: [-20, 0],
                duration: 300
            });
        }
        
        // Simulate typing indicator
        function showTyping() {
            const typing = document.querySelector('.typing-indicator');
            typing.classList.remove('hidden');
            
            setTimeout(() => {
                typing.classList.add('hidden');
                // Add new bot message here
            }, 1500);
        }
        
        // Handle form submission
        document.querySelector('form').addEventListener('submit', (e) => {
            e.preventDefault();
            const input = e.target.querySelector('input');
            const message = input.value.trim();
            
            if (message) {
                // Add user message
                const messagesContainer = document.querySelector('.chat-messages');
                const userMessage = document.createElement('div');
                userMessage.className = 'user-message flex justify-end';
                userMessage.innerHTML = `
                    <div class="flex-1 max-w-[80%]">
                        <div class="bg-blue-100 p-4 rounded-lg">
                            <p>${message}</p>
                        </div>
                    </div>
                    <div class="flex-shrink-0 ml-3">
                        <div class="bg-blue-700 text-white rounded-full w-8 h-8 flex items-center justify-center">
                            <i data-feather="user" class="w-4 h-4"></i>
                        </div>
                    </div>
                `;
                messagesContainer.appendChild(userMessage);
                
                // Scroll to bottom
                messagesContainer.scrollTop = messagesContainer.scrollHeight;
                
                // Clear input
                input.value = '';
                
                // Show typing indicator
                showTyping();
                
                // Animate new message
                anime({
                    targets: userMessage,
                    opacity: [0, 1],
                    translateX: [20, 0],
                    duration: 300
                });
                
                // Replace feather icons
                feather.replace();
            }
        });
    </script>
</body>
</html>