File size: 45,217 Bytes
5dceb63
 
 
 
 
734f86c
 
5dceb63
34560f7
734f86c
34560f7
734f86c
5dceb63
734f86c
 
 
6629676
734f86c
 
 
 
6629676
b82741e
734f86c
b82741e
6629676
734f86c
6629676
882a37f
734f86c
 
 
6629676
734f86c
882a37f
734f86c
 
aa3eb0c
734f86c
 
124c208
734f86c
 
124c208
734f86c
 
 
 
 
 
 
 
aa3eb0c
5dceb63
 
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
6629676
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6629676
 
5dceb63
 
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6629676
734f86c
6629676
734f86c
 
 
 
 
 
 
 
 
5dceb63
734f86c
 
 
 
124c208
734f86c
 
 
a871d6b
734f86c
5bd2a95
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a871d6b
124c208
734f86c
 
 
 
 
 
 
b82741e
 
 
 
 
 
734f86c
 
 
 
 
 
 
 
 
 
 
 
5dceb63
b82741e
 
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5dceb63
124c208
b11aec3
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a871d6b
5dceb63
124c208
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6629676
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b8313f5
5bd2a95
b8313f5
0683682
b8313f5
734f86c
 
6629676
 
734f86c
 
 
 
 
 
34560f7
 
 
 
 
 
734f86c
 
 
34560f7
 
 
 
 
 
734f86c
 
 
34560f7
 
734f86c
 
34560f7
 
 
 
 
 
 
734f86c
 
34560f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734f86c
 
34560f7
 
734f86c
 
34560f7
 
734f86c
 
 
 
b8313f5
5bd2a95
7549acf
5dceb63
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a871d6b
734f86c
 
 
 
 
 
 
 
 
 
 
a871d6b
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b82741e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b82741e
734f86c
b82741e
 
 
 
 
 
 
 
 
 
 
 
 
 
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b11aec3
 
 
734f86c
 
 
 
 
 
 
 
b82741e
 
 
 
124c208
734f86c
 
 
 
 
 
 
 
34560f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734f86c
34560f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734f86c
34560f7
a871d6b
34560f7
b11aec3
734f86c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e0b8927
5dceb63
34560f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734f86c
5dceb63
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Interview Management - Quantals Collect</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
    <script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
    <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
    <style>
        /* Custom styles */
        .recording-indicator {
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }
        #videoPreview {
            aspect-ratio: 16/9;
            background: #f3f4f6;
        }
        .ql-editor {
            min-height: 200px;
        }
        .interview-history-table th {
            position: sticky;
            top: 0;
            background: white;
            z-index: 10;
        }
        .mobile-menu {
            transition: transform 0.3s ease-in-out;
        }
        .mobile-menu.hidden {
            transform: translateX(-100%);
        }
        .mobile-menu.show {
            transform: translateX(0);
        }
        @media (max-width: 768px) {
            .nav-item {
                padding: 0.75rem 1rem;
                border-bottom: 1px solid #e5e7eb;
            }
            .nav-item:last-child {
                border-bottom: none;
            }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans">
    <div class="flex flex-col h-screen overflow-hidden">
        <!-- Top Navigation Bar -->
        <nav class="bg-indigo-800 text-white shadow-lg">
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
                <div class="flex justify-between items-center h-16">
                    <!-- Logo and Brand -->
                    <div class="flex items-center space-x-3">
                        <div class="bg-white p-2 rounded-lg">
                            <i class="fas fa-microscope text-indigo-800 text-xl"></i>
                        </div>
                        <h1 class="text-xl font-bold">Quantals Collect</h1>
                    </div>

                    <!-- Desktop Navigation -->
                    <div class="hidden md:flex items-center space-x-1">
                        <a href="index.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-home"></i>
                            <span>Dashboard</span>
                        </a>
                        <a href="projects.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-project-diagram"></i>
                            <span>Projects</span>
                        </a>
                        <a href="participants.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-users"></i>
                            <span>Participants</span>
                        </a>
                        <a href="interview.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg bg-indigo-700 text-white">
                            <i class="fas fa-microphone"></i>
                            <span>Interviews</span>
                        </a>
                        <a href="analysis.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-chart-pie"></i>
                            <span>Analysis</span>
                        </a>
                        <a href="ai-assist.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-robot"></i>
                            <span>AI Assist</span>
                        </a>
                        <a href="transcriber.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-keyboard"></i>
                            <span>Transcriber</span>
                        </a>
                    </div>

                    <!-- User Menu and Mobile Menu Button -->
                    <div class="flex items-center space-x-4">
                        <!-- Settings Link (Desktop) -->
                        <a href="settings.html" class="hidden md:flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-cog"></i>
                            <span>Settings</span>
                        </a>
                        
                        <!-- Mobile Menu Button -->
                        <button id="mobileMenuBtn" class="md:hidden p-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
                            <i class="fas fa-bars text-xl"></i>
                        </button>
                    </div>
                </div>
            </div>

            <!-- Mobile Navigation Menu -->
            <div id="mobileMenu" class="mobile-menu hidden md:hidden bg-indigo-800 border-t border-indigo-700">
                <div class="px-4 py-2 space-y-1">
                    <a href="index.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
                        <i class="fas fa-home w-5"></i>
                        <span>Dashboard</span>
                    </a>
                    <a href="projects.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
                        <i class="fas fa-project-diagram w-5"></i>
                        <span>Projects</span>
                    </a>
                    <a href="participants.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
                        <i class="fas fa-users w-5"></i>
                        <span>Participants</span>
                    </a>
                    <a href="interview.html" class="nav-item flex items-center space-x-3 bg-indigo-700 text-white rounded-lg">
                        <i class="fas fa-microphone w-5"></i>
                        <span>Interviews</span>
                    </a>
                    <a href="analysis.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
                        <i class="fas fa-chart-pie w-5"></i>
                        <span>Analysis</span>
                    </a>
                    <a href="ai-assist.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
                        <i class="fas fa-robot w-5"></i>
                        <span>AI Assist</span>
                    </a>
                    <a href="transcriber.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
                        <i class="fas fa-keyboard w-5"></i>
                        <span>Transcriber</span>
                    </a>
                    <a href="settings.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
                        <i class="fas fa-cog w-5"></i>
                        <span>Settings</span>
                    </a>
                </div>
            </div>
        </nav>

        <!-- Main Content -->
        <div class="flex-1 flex flex-col overflow-hidden">
            <!-- Header -->
            <header class="bg-white shadow-sm p-4 flex justify-between items-center">
                <div class="flex items-center space-x-4">
                    <h2 class="text-xl font-semibold text-gray-800">Interviews</h2>
                    <div class="offline-indicator hidden px-3 py-1 bg-yellow-100 text-yellow-800 rounded-full text-sm">
                        <i class="fas fa-wifi-slash mr-1"></i> Offline
                    </div>
                </div>
                <div class="flex items-center space-x-4">
                    <button class="p-2 rounded-full hover:bg-gray-100 relative">
                        <i class="fas fa-bell text-gray-600"></i>
                        <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span>
                    </button>
                    <div class="hidden sm:flex items-center space-x-2">
                        <div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center">
                            <span class="text-xs font-medium text-indigo-800">RS</span>
                        </div>
                        <span class="text-sm">Research Team</span>
                    </div>
                    <button class="bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition-colors flex items-center space-x-2">
                        <i class="fas fa-plus"></i>
                        <span class="hidden sm:inline">Start New Interview</span>
                        <span class="sm:hidden">New</span>
                    </button>
                </div>
            </header>

            <!-- Main Content Area -->
            <main class="flex-1 overflow-y-auto p-4 sm:p-6">
                <div class="max-w-7xl mx-auto">
                    <div class="grid grid-cols-1 lg:grid-cols-12 gap-6">
                        <!-- Left Sidebar - Scheduling Panel -->
                        <div class="lg:col-span-3">
                            <div class="bg-white rounded-lg shadow-sm p-4">
                                <h3 class="text-lg font-semibold text-gray-800 mb-4">Upcoming Interviews</h3>
                                <div class="space-y-4">
                                    <!-- Sample Interview Items -->
                                    <div class="p-3 bg-gray-50 rounded-lg">
                                        <div class="text-sm text-gray-600">Today, 2:00 PM</div>
                                        <div class="font-medium">John Doe</div>
                                        <div class="text-sm text-gray-500">Project: UX Research</div>
                                    </div>
                                    <div class="p-3 bg-gray-50 rounded-lg">
                                        <div class="text-sm text-gray-600">Tomorrow, 10:30 AM</div>
                                        <div class="font-medium">Jane Smith</div>
                                        <div class="text-sm text-gray-500">Project: Market Study</div>
                                    </div>
                                </div>
                                <button class="mt-4 w-full bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition-colors flex items-center justify-center space-x-2">
                                    <i class="fas fa-plus"></i>
                                    <span>Schedule Interview</span>
                                </button>
                            </div>
                        </div>

                        <!-- Main Workspace -->
                        <div class="lg:col-span-9 space-y-6">
                            <!-- Recording Panel -->
                            <div class="bg-white rounded-lg shadow-sm p-4">
                                <h3 class="text-lg font-semibold text-gray-800 mb-4">Recording</h3>
                                <div class="flex flex-wrap gap-4 mb-4">
                                    <div class="w-full">
                                        <label class="block text-sm font-medium text-gray-700 mb-1">Camera</label>
                                        <select id="cameraSelect" class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
                                            <option value="">Select Camera</option>
                                        </select>
                                    </div>
                                    <button class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors flex items-center space-x-2">
                                        <i class="fas fa-microphone"></i>
                                        <span>Record Audio</span>
                                    </button>
                                    <button class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors flex items-center space-x-2">
                                        <i class="fas fa-video"></i>
                                        <span>Record Video</span>
                                    </button>
                                    <button class="bg-gray-600 text-white px-4 py-2 rounded-lg hover:bg-gray-700 transition-colors flex items-center space-x-2">
                                        <i class="fas fa-upload"></i>
                                        <span>Upload File</span>
                                    </button>
                                </div>
                                <div class="mb-4">
                                    <video id="videoPreview" autoplay muted class="w-full rounded-lg"></video>
                                </div>
                                <div class="flex justify-between items-center">
                                    <div class="text-sm text-gray-600">
                                        <span class="recording-indicator hidden text-red-600">
                                            <i class="fas fa-circle"></i> Recording...
                                        </span>
                                        <span class="timer">00:00:00</span>
                                    </div>
                                    <div class="flex space-x-2">
                                        <button class="bg-gray-100 text-gray-700 px-3 py-1 rounded hover:bg-gray-200 transition-colors">
                                            <i class="fas fa-pause"></i>
                                        </button>
                                        <button class="bg-gray-100 text-gray-700 px-3 py-1 rounded hover:bg-gray-200 transition-colors">
                                            <i class="fas fa-stop"></i>
                                        </button>
                                    </div>
                                </div>
                            </div>

                            <!-- Notes Panel -->
                            <div class="bg-white rounded-lg shadow-sm p-4">
                                <h3 class="text-lg font-semibold text-gray-800 mb-4">Live Notes</h3>
                                <div class="mb-4">
                                    <div class="text-sm text-gray-600">
                                        <span class="font-medium">Project:</span> UX Research
                                        <span class="mx-2">|</span>
                                        <span class="font-medium">Participant:</span> John Doe
                                    </div>
                                </div>
                                <div id="editor" class="h-64"></div>
                                <div class="mt-4 flex justify-between items-center">
                                    <button class="bg-gray-100 text-gray-700 px-3 py-1 rounded hover:bg-gray-200 transition-colors flex items-center space-x-2">
                                        <i class="fas fa-clock"></i>
                                        <span>Insert Timestamp</span>
                                    </button>
                                    <div class="text-sm text-gray-500">
                                        Last saved: Just now
                                    </div>
                                </div>
                            </div>

                            <!-- Playback & Review Panel -->
                            <div class="bg-white rounded-lg shadow-sm p-4">
                                <h3 class="text-lg font-semibold text-gray-800 mb-4">Playback & Review</h3>
                                <div class="flex flex-wrap gap-4 mb-4">
                                    <button class="bg-gray-100 text-gray-700 px-4 py-2 rounded hover:bg-gray-200 transition-colors flex items-center space-x-2">
                                        <i class="fas fa-file-alt"></i>
                                        <span>View Transcript</span>
                                    </button>
                                    <div class="relative">
                                        <button class="bg-gray-100 text-gray-700 px-4 py-2 rounded hover:bg-gray-200 transition-colors flex items-center space-x-2">
                                            <i class="fas fa-download"></i>
                                            <span>Export</span>
                                            <i class="fas fa-chevron-down ml-2"></i>
                                        </button>
                                        <!-- Export dropdown menu -->
                                    </div>
                                </div>
                                <div class="flex flex-wrap items-center gap-4 mb-4">
                                    <label class="flex items-center space-x-2">
                                        <input type="checkbox" class="form-checkbox text-indigo-600">
                                        <span class="text-sm text-gray-700">Show Transcript</span>
                                    </label>
                                    <label class="flex items-center space-x-2">
                                        <input type="checkbox" class="form-checkbox text-indigo-600">
                                        <span class="text-sm text-gray-700">Sync Notes Timeline</span>
                                    </label>
                                </div>
                                <div id="transcript" class="hidden bg-gray-50 rounded-lg p-4 max-h-64 overflow-y-auto">
                                    <!-- Transcript content will be inserted here -->
                                </div>
                            </div>

                            <!-- Interview History -->
                            <div class="bg-white rounded-lg shadow-sm p-4">
                                <h3 class="text-lg font-semibold text-gray-800 mb-4">Interview History</h3>
                                <div class="overflow-x-auto">
                                    <table class="interview-history-table min-w-full">
                                        <thead>
                                            <tr class="bg-gray-50">
                                                <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Interview ID</th>
                                                <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Participant</th>
                                                <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Date</th>
                                                <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Status</th>
                                                <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Media Type</th>
                                                <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Actions</th>
                                            </tr>
                                        </thead>
                                        <tbody class="divide-y divide-gray-200">
                                            <!-- Sample rows -->
                                            <tr>
                                                <td class="px-4 py-2 text-sm">IVW-20240315-001</td>
                                                <td class="px-4 py-2 text-sm">John Doe</td>
                                                <td class="px-4 py-2 text-sm">Mar 15, 2024</td>
                                                <td class="px-4 py-2 text-sm">
                                                    <span class="px-2 py-1 bg-green-100 text-green-800 rounded-full text-xs">Completed</span>
                                                </td>
                                                <td class="px-4 py-2 text-sm">Video</td>
                                                <td class="px-4 py-2 text-sm">
                                                    <div class="flex space-x-2">
                                                        <button class="text-indigo-600 hover:text-indigo-800">
                                                            <i class="fas fa-eye"></i>
                                                        </button>
                                                        <button class="text-gray-600 hover:text-gray-800">
                                                            <i class="fas fa-download"></i>
                                                        </button>
                                                        <button class="text-red-600 hover:text-red-800">
                                                            <i class="fas fa-trash"></i>
                                                        </button>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <!-- Schedule Interview Modal -->
    <div id="scheduleModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
        <div class="bg-white rounded-lg p-6 w-full max-w-md mx-4">
            <h3 class="text-lg font-semibold text-gray-800 mb-4">Schedule New Interview</h3>
            <form class="space-y-4">
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-1">Participant *</label>
                    <select class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
                        <option value="">Select Participant</option>
                        <option>John Doe (ID: P001)</option>
                        <option>Jane Smith (ID: P002)</option>
                        <!-- Will be populated dynamically -->
                    </select>
                </div>
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-1">Project *</label>
                    <select class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
                        <option value="">Select Project</option>
                        <option>UX Research</option>
                        <option>Market Study</option>
                        <!-- Will be populated dynamically -->
                    </select>
                </div>
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-1">Date & Time *</label>
                    <input type="datetime-local" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
                </div>
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-1">Interviewer *</label>
                    <select class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
                        <option value="">Select Interviewer</option>
                        <option>Research Team</option>
                        <option>Alex Johnson</option>
                        <option>Sam Williams</option>
                    </select>
                </div>
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-1">Mode *</label>
                    <div class="space-y-2 mt-1">
                        <div class="flex items-center">
                            <input type="radio" id="mode-in-person" name="mode" value="in-person" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500">
                            <label for="mode-in-person" class="ml-2 block text-sm text-gray-700">In-Person</label>
                        </div>
                        <div class="flex items-center">
                            <input type="radio" id="mode-online" name="mode" value="online" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500">
                            <label for="mode-online" class="ml-2 block text-sm text-gray-700">Zoom/Online</label>
                        </div>
                        <div class="flex items-center">
                            <input type="radio" id="mode-phone" name="mode" value="phone" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500">
                            <label for="mode-phone" class="ml-2 block text-sm text-gray-700">Phone</label>
                        </div>
                    </div>
                </div>
                <div id="locationField">
                    <label for="location" class="block text-sm font-medium text-gray-700 mb-1">Location/Link *</label>
                    <input type="text" id="location" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
                </div>
                <div>
                    <label for="notes" class="block text-sm font-medium text-gray-700 mb-1">Notes (Optional)</label>
                    <textarea id="notes" rows="3" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"></textarea>
                </div>
                <div class="flex justify-end space-x-3 mt-6">
                    <button type="button" id="cancelScheduleBtn" 
                        class="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                        Cancel
                    </button>
                    <button type="submit" id="submitScheduleBtn"
                        class="px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                        Schedule
                    </button>
                </div>
            </form>
        </div>
    </div>

    <script>
        // Mobile menu functionality
        const mobileMenuBtn = document.getElementById('mobileMenuBtn');
        const mobileMenu = document.getElementById('mobileMenu');
        let isMobileMenuOpen = false;

        mobileMenuBtn.addEventListener('click', () => {
            isMobileMenuOpen = !isMobileMenuOpen;
            if (isMobileMenuOpen) {
                mobileMenu.classList.remove('hidden');
                mobileMenu.classList.add('show');
                mobileMenuBtn.innerHTML = '<i class="fas fa-times text-xl"></i>';
            } else {
                mobileMenu.classList.add('hidden');
                mobileMenu.classList.remove('show');
                mobileMenuBtn.innerHTML = '<i class="fas fa-bars text-xl"></i>';
            }
        });

        // Close mobile menu when clicking outside
        document.addEventListener('click', (e) => {
            if (!mobileMenuBtn.contains(e.target) && !mobileMenu.contains(e.target)) {
                if (isMobileMenuOpen) {
                    isMobileMenuOpen = false;
                    mobileMenu.classList.add('hidden');
                    mobileMenu.classList.remove('show');
                    mobileMenuBtn.innerHTML = '<i class="fas fa-bars text-xl"></i>';
                }
            }
        });

        // Close mobile menu on window resize if screen becomes larger
        window.addEventListener('resize', () => {
            if (window.innerWidth >= 768 && isMobileMenuOpen) {
                isMobileMenuOpen = false;
                mobileMenu.classList.add('hidden');
                mobileMenu.classList.remove('show');
                mobileMenuBtn.innerHTML = '<i class="fas fa-bars text-xl"></i>';
            }
        });

        // Initialize Quill editor
        var quill = new Quill('#editor', {
            theme: 'snow',
            modules: {
                toolbar: [
                    ['bold', 'italic', 'underline'],
                    [{ 'list': 'ordered'}, { 'list': 'bullet' }],
                    ['clean']
                ]
            }
        });

        // MediaRecorder setup
        let mediaRecorder;
        let recordedChunks = [];
        let isRecording = false;
        let timerInterval;
        let startTime;
        let videoStream;

        // Get available cameras and start preview
        async function getCameras() {
            try {
                const devices = await navigator.mediaDevices.enumerateDevices();
                const videoDevices = devices.filter(device => device.kind === 'videoinput');
                const cameraSelect = document.getElementById('cameraSelect');
                const videoPreview = document.getElementById('videoPreview');
                
                // Clear existing options
                cameraSelect.innerHTML = '<option value="">Select Camera</option>';
                
                // Add camera options
                videoDevices.forEach(device => {
                    const option = document.createElement('option');
                    option.value = device.deviceId;
                    option.text = device.label || `Camera ${cameraSelect.length + 1}`;
                    cameraSelect.appendChild(option);
                });

                // Start preview with first available camera
                if (videoDevices.length > 0) {
                    const stream = await navigator.mediaDevices.getUserMedia({
                        video: { deviceId: videoDevices[0].deviceId }
                    });
                    videoPreview.srcObject = stream;
                }
            } catch (err) {
                console.error('Error accessing media devices:', err);
            }
        }

        // Call initially and whenever devices change
        getCameras();
        navigator.mediaDevices.addEventListener('devicechange', getCameras);

        // Handle camera selection change
        document.getElementById('cameraSelect').addEventListener('change', async function() {
            const videoPreview = document.getElementById('videoPreview');
            const selectedDeviceId = this.value;
            
            if (selectedDeviceId) {
                try {
                    const stream = await navigator.mediaDevices.getUserMedia({
                        video: { deviceId: selectedDeviceId }
                    });
                    
                    // Stop previous stream
                    if (videoPreview.srcObject) {
                        videoPreview.srcObject.getTracks().forEach(track => track.stop());
                    }
                    
                    videoPreview.srcObject = stream;
                } catch (err) {
                    console.error('Error switching camera:', err);
                }
            }
        });

        // Timer display
        const timerDisplay = document.querySelector('.timer');
        const recordingIndicator = document.querySelector('.recording-indicator');

        function startTimer() {
            startTime = Date.now();
            timerInterval = setInterval(updateTimer, 1000);
        }

        function updateTimer() {
            const elapsed = Date.now() - startTime;
            const seconds = Math.floor(elapsed / 1000);
            const minutes = Math.floor(seconds / 60);
            const hours = Math.floor(minutes / 60);
            
            timerDisplay.textContent = `${String(hours).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:${String(seconds % 60).padStart(2, '0')}`;
        }

        function stopTimer() {
            clearInterval(timerInterval);
        }

        // Recording functions
        async function startRecording(type) {
            try {
                const constraints = {
                    audio: type === 'audio' || type === 'video',
                    video: false
                };

                if (type === 'video') {
                    const cameraSelect = document.getElementById('cameraSelect');
                    const selectedCameraId = cameraSelect.value;
                    
                    constraints.video = {
                        deviceId: selectedCameraId ? { exact: selectedCameraId } : undefined
                    };
                }

                const stream = await navigator.mediaDevices.getUserMedia(constraints);
                videoStream = stream;

                mediaRecorder = new MediaRecorder(stream);
                recordedChunks = [];

                mediaRecorder.ondataavailable = (event) => {
                    if (event.data.size > 0) {
                        recordedChunks.push(event.data);
                    }
                };

                mediaRecorder.onstop = () => {
                    const blob = new Blob(recordedChunks, {
                        type: type === 'video' ? 'video/webm' : 'audio/webm'
                    });
                    const url = URL.createObjectURL(blob);
                    const mediaContainer = document.querySelector('.media-container');
                    
                    if (type === 'video') {
                        mediaContainer.innerHTML = `<video controls src="${url}" class="w-full h-full"></video>`;
                    } else {
                        mediaContainer.innerHTML = `<audio controls src="${url}" class="w-full"></audio>`;
                    }
                };

                mediaRecorder.start();
                isRecording = true;
                recordingIndicator.classList.remove('hidden');
                startTimer();
            } catch (err) {
                console.error('Error accessing media devices:', err);
                alert('Error accessing media devices. Please ensure you have granted the necessary permissions.');
            }
        }

        function stopRecording() {
            if (mediaRecorder && isRecording) {
                mediaRecorder.stop();
                isRecording = false;
                recordingIndicator.classList.add('hidden');
                stopTimer();
                
                // Stop all tracks
                if (videoStream) {
                    videoStream.getTracks().forEach(track => track.stop());
                    videoStream = null;
                }
            }
        }

        // Event listeners
        document.querySelector('button:has(.fa-microphone)').addEventListener('click', () => startRecording('audio'));
        document.querySelector('button:has(.fa-video)').addEventListener('click', () => startRecording('video'));
        document.querySelector('button:has(.fa-stop)').addEventListener('click', stopRecording);

        // Schedule interview modal
        function setupScheduleModal() {
            const scheduleButtons = document.querySelectorAll('button:has(.fa-plus)');
            
            scheduleButtons.forEach(button => {
                button.addEventListener('click', () => {
                    modal.classList.remove('hidden');
                    document.body.style.overflow = 'hidden';
                    modal.querySelector('input').focus();
                });
            });

            // Pre-populate with today's date
            const now = new Date();
            const timeString = `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}`;
            const today = `${now.getFullYear()}-${(now.getMonth()+1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}`;
            document.querySelector('input[type="datetime-local"]').value = `${today}T${timeString}`;

            // Handle mode selection changes
            const modeRadios = document.querySelectorAll('input[name="mode"]');
            const locationField = document.getElementById('locationField');
            const locationInput = document.getElementById('location');
            
            modeRadios.forEach(radio => {
                radio.addEventListener('change', (e) => {
                    const mode = e.target.value;
                    const label = locationField.querySelector('label');
                    
                    if (mode === 'online') {
                        label.textContent = 'Meeting Link *';
                        locationInput.placeholder = 'https://zoom.us/j/...';
                    } else if (mode === 'phone') {
                        label.textContent = 'Phone Number *';
                        locationInput.placeholder = '+1 (555) 123-4567';
                    } else {
                        label.textContent = 'Location *';
                        locationInput.placeholder = 'Office address or room number';
                    }
                });
            });
        }

        document.addEventListener('DOMContentLoaded', setupScheduleModal);

        // Auto-save notes
        setInterval(() => {
            const content = quill.root.innerHTML;
            localStorage.setItem('interview_notes', content);
            // TODO: Implement remote save
        }, 30000);

        // Load saved notes
        const savedNotes = localStorage.getItem('interview_notes');
        if (savedNotes) {
            quill.root.innerHTML = savedNotes;
        }

        // Before unload warning
        window.addEventListener('beforeunload', (e) => {
            if (isRecording) {
                e.preventDefault();
                e.returnValue = '';
            }
        });
    </script>

    <!-- Toast Notification -->
    <div id="toast" class="hidden fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg">
        Interview successfully scheduled.
    </div>

    <script>
        // Modal handling
        const modal = document.getElementById('scheduleModal');
        const cancelBtn = document.getElementById('cancelScheduleBtn');
        const submitBtn = document.getElementById('submitScheduleBtn');
        const form = modal.querySelector('form');
        const toast = document.getElementById('toast');

        // Modal close functions
        function closeModal() {
            modal.classList.add('hidden');
            document.body.style.overflow = 'auto';
        }

        // Keyboard accessibility
        modal.addEventListener('keydown', (e) => {
            if (e.key === 'Escape') closeModal();
            if (e.key === 'Tab') {
                const focusable = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
                if (focusable.length === 0) return;
                
                const first = focusable[0];
                const last = focusable[focusable.length - 1];
                
                if (e.shiftKey) {
                    if (document.activeElement === first) {
                        last.focus();
                        e.preventDefault();
                    }
                } else {
                    if (document.activeElement === last) {
                        first.focus();
                        e.preventDefault();
                    }
                }
            }
        });

        // Close buttons
        cancelBtn.addEventListener('click', closeModal);

        // Form submission
        form.addEventListener('submit', async (e) => {
            e.preventDefault();
            
            // Validate required fields
            const requiredFields = form.querySelectorAll('[required]');
            let isValid = true;
            
            requiredFields.forEach(field => {
                if (!field.value) {
                    isValid = false;
                    field.classList.add('border-red-500');
                } else {
                    field.classList.remove('border-red-500');
                }
            });
            
            if (!isValid) return;
            
            // Get form values
            const formData = {
                participantId: form.querySelector('select:nth-of-type(1)').value,
                projectId: form.querySelector('select:nth-of-type(2)').value,
                interviewerId: form.querySelector('select:nth-of-type(3)').value,
                datetime: form.querySelector('input[type="datetime-local"]').value,
                mode: form.querySelector('input[name="mode"]:checked').value,
                location: document.getElementById('location').value,
                notes: document.getElementById('notes').value,
                status: 'scheduled'
            };
            
            try {
                // In a real app, you would call an API here
                // For demo, we'll use localStorage
                const interviews = JSON.parse(localStorage.getItem('interviews') || '[]');
                const newInterview = {
                    ...formData,
                    id: 'IVW-' + Date.now().toString().slice(-6)
                };
                
                interviews.push(newInterview);
                localStorage.setItem('interviews', JSON.stringify(interviews));
                
                // Show success & close modal
                toast.classList.remove('hidden');
                setTimeout(() => toast.classList.add('hidden'), 3000);
                closeModal();
                
                // Refresh upcoming interviews
                refreshUpcomingInterviews();
            } catch (error) {
                console.error('Error saving interview:', error);
                alert('Failed to schedule interview');
            }
        });

        function refreshUpcomingInterviews() {
            const interviews = JSON.parse(localStorage.getItem('interviews') || '[]');
            const upcomingContainer = document.querySelector('.space-y-4');
            
            // Sort by datetime
            const sorted = interviews
                .filter(i => new Date(i.datetime) > new Date())
                .sort((a, b) => new Date(a.datetime) - new Date(b.datetime));
            
            // Update UI
            upcomingContainer.innerHTML = sorted
                .map(interview => `
                    <div class="p-3 bg-gray-50 rounded-lg">
                        <div class="text-sm text-gray-600">${new Date(interview.datetime).toLocaleString()}</div>
                        <div class="font-medium">${interview.participantId}</div>
                        <div class="text-sm text-gray-500">Project: ${interview.projectId}</div>
                    </div>
                `).join('');
        }
    </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=dataquantals/quantals-collect" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>