File size: 33,497 Bytes
3aa248e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e5ed59
 
3aa248e
 
2e5ed59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3aa248e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e5ed59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3aa248e
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI Ecosystem Sandbox</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        'desktop-blue': '#0f172a',
                        'taskbar-gray': '#1e293b',
                        'app-blue': '#1d4ed8',
                        'app-light': '#3b82f6',
                        'ai-purple': '#7e22ce'
                    }
                }
            }
        }
    </script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        
        * {
            font-family: 'Inter', sans-serif;
            user-select: none;
        }
        
        body {
            overflow: hidden;
            background: linear-gradient(135deg, #0f172a, #1e293b);
        }
        
        .desktop-icon {
            transition: all 0.2s ease;
        }
        
        .desktop-icon:hover {
            transform: scale(1.05);
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        .window {
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            transition: all 0.3s ease;
            border-radius: 8px;
            overflow: hidden;
            resize: both;
            min-width: 400px;
            min-height: 300px;
        }
        
        .window-header {
            cursor: move;
        }
        
        .taskbar-app {
            transition: all 0.2s ease;
        }
        
        .taskbar-app.active {
            border-bottom: 2px solid #3b82f6;
        }
        
        .ai-message {
            animation: fadeIn 0.3s ease;
        }
        
        .typing-indicator {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: #94a3b8;
            margin-right: 4px;
            animation: bounce 1.5s infinite;
        }
        
        .typing-indicator:nth-child(2) {
            animation-delay: 0.2s;
        }
        
        .typing-indicator:nth-child(3) {
            animation-delay: 0.4s;
        }
        
        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-5px); }
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .grid-bg {
            background-image: 
                linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
            background-size: 20px 20px;
        }
        
        .app-icon {
            transition: all 0.2s ease;
        }
        
        .app-icon:hover {
            transform: scale(1.1);
            filter: brightness(1.2);
        }
        
        .notification {
            animation: slideIn 0.3s forwards, fadeOut 0.3s forwards 2.7s;
        }
        
        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        
        @keyframes fadeOut {
            from { opacity: 1; }
            to { opacity: 0; }
        }
    </style>
</head>
<body class="h-screen grid-bg flex flex-col">
    <!-- Desktop Icons -->
    <div class="flex-1 relative p-4">
        <div class="absolute top-4 left-4 flex flex-col items-center w-20 text-center text-white desktop-icon" onclick="openApp('ai-assistant')">
            <div class="bg-ai-purple w-14 h-14 rounded-xl flex items-center justify-center mb-1">
                <i class="fas fa-robot text-2xl"></i>
            </div>
            <span class="text-xs">AI Assistant</span>
        </div>
        
        <div class="absolute top-4 left-28 flex flex-col items-center w-20 text-center text-white desktop-icon">
            <div class="bg-green-600 w-14 h-14 rounded-xl flex items-center justify-center mb-1">
                <i class="fas fa-tasks text-2xl"></i>
            </div>
            <span class="text-xs">Task Manager</span>
        </div>
        
        <div class="absolute top-28 left-4 flex flex-col items-center w-20 text-center text-white desktop-icon" onclick="openApp('documents')">
            <div class="bg-yellow-500 w-14 h-14 rounded-xl flex items-center justify-center mb-1">
                <i class="fas fa-file-alt text-2xl"></i>
            </div>
            <span class="text-xs">Documents</span>
        </div>
        
        <div class="absolute top-28 left-28 flex flex-col items-center w-20 text-center text-white desktop-icon">
            <div class="bg-red-500 w-14 h-14 rounded-xl flex items-center justify-center mb-1">
                <i class="fas fa-cog text-2xl"></i>
            </div>
            <span class="text-xs">Settings</span>
        </div>
    </div>
    
    <!-- Taskbar -->
    <div class="h-12 bg-taskbar-gray bg-opacity-90 backdrop-blur-sm flex items-center px-3 border-t border-gray-700">
        <div class="mr-4 relative">
            <button class="bg-app-blue w-8 h-8 rounded flex items-center justify-center text-white" onclick="toggleStartMenu()">
                <i class="fab fa-windows"></i>
            </button>
            <!-- Start Menu -->
            <div id="start-menu" class="absolute bottom-12 left-0 w-64 bg-gray-800 border border-gray-700 rounded-lg shadow-xl hidden z-50">
                <div class="p-3 border-b border-gray-700">
                    <input type="text" class="w-full bg-gray-700 text-white rounded px-3 py-1 text-sm focus:outline-none" placeholder="Search apps and files">
                </div>
                <div class="p-2 max-h-96 overflow-y-auto">
                    <div class="text-gray-400 text-xs uppercase px-2 py-1">Apps</div>
                    <div class="flex items-center px-2 py-2 hover:bg-gray-700 rounded cursor-pointer" onclick="openApp('ai-assistant')">
                        <div class="w-8 h-8 bg-ai-purple rounded flex items-center justify-center mr-2">
                            <i class="fas fa-robot text-white text-sm"></i>
                        </div>
                        <span class="text-white text-sm">AI Assistant</span>
                    </div>
                    <div class="flex items-center px-2 py-2 hover:bg-gray-700 rounded cursor-pointer" onclick="openApp('documents')">
                        <div class="w-8 h-8 bg-yellow-500 rounded flex items-center justify-center mr-2">
                            <i class="fas fa-file-alt text-white text-sm"></i>
                        </div>
                        <span class="text-white text-sm">Documents</span>
                    </div>
                    <div class="text-gray-400 text-xs uppercase px-2 py-1 mt-2">System</div>
                    <div class="flex items-center px-2 py-2 hover:bg-gray-700 rounded cursor-pointer">
                        <div class="w-8 h-8 bg-red-500 rounded flex items-center justify-center mr-2">
                            <i class="fas fa-cog text-white text-sm"></i>
                        </div>
                        <span class="text-white text-sm">Settings</span>
                    </div>
                    <div class="flex items-center px-2 py-2 hover:bg-gray-700 rounded cursor-pointer" onclick="minimizeAllWindows()">
                        <div class="w-8 h-8 bg-gray-600 rounded flex items-center justify-center mr-2">
                            <i class="fas fa-window-minimize text-white text-sm"></i>
                        </div>
                        <span class="text-white text-sm">Minimize All</span>
                    </div>
                </div>
                <div class="p-3 border-t border-gray-700 flex justify-between items-center">
                    <div class="flex items-center">
                        <div class="w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center mr-2">
                            <i class="fas fa-user text-white text-sm"></i>
                        </div>
                        <span class="text-white text-sm">User</span>
                    </div>
                    <button class="w-8 h-8 rounded flex items-center justify-center hover:bg-gray-700" onclick="toggleStartMenu()">
                        <i class="fas fa-power-off text-white text-sm"></i>
                    </button>
                </div>
            </div>
        </div>
        
        <div class="flex-1 flex items-center h-full">
            <div class="taskbar-app active mr-2 px-3 h-full flex items-center text-white text-sm rounded cursor-pointer" onclick="focusApp('ai-assistant')">
                <i class="fas fa-robot mr-2"></i>
                <span>AI Assistant</span>
            </div>
            <div class="taskbar-app mr-2 px-3 h-full flex items-center text-white text-sm rounded cursor-pointer" onclick="focusApp('documents')">
                <i class="fas fa-folder mr-2"></i>
                <span>Documents</span>
            </div>
        </div>
        
        <div class="flex items-center">
            <div class="text-white text-xs mr-4">
                <i class="fas fa-wifi mr-2"></i>
                <i class="fas fa-volume-up mr-2"></i>
                <span id="clock">12:45 PM</span>
            </div>
            <div class="w-px h-6 bg-gray-600 mx-2"></div>
            <div class="text-gray-300">
                <div class="relative">
                    <button class="w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center">
                        <i class="fas fa-user"></i>
                    </button>
                </div>
            </div>
        </div>
    </div>
    
    <!-- AI Assistant Window -->
    <div id="ai-assistant" class="window absolute top-1/4 left-1/4 w-2/5 h-2/3 bg-gray-900 border border-gray-700 flex flex-col hidden">
        <div class="window-header bg-gray-800 h-10 flex items-center justify-between px-3 border-b border-gray-700">
            <div class="flex items-center">
                <div class="bg-ai-purple w-6 h-6 rounded flex items-center justify-center mr-2">
                    <i class="fas fa-robot text-xs text-white"></i>
                </div>
                <span class="text-white text-sm font-medium">AI Assistant</span>
            </div>
            <div class="flex">
                <button class="w-8 h-8 flex items-center justify-center text-gray-400 hover:bg-gray-700 rounded" onclick="minimizeApp('ai-assistant')">
                    <i class="fas fa-window-minimize"></i>
                </button>
                <button class="w-8 h-8 flex items-center justify-center text-gray-400 hover:bg-gray-700 rounded" onclick="maximizeApp('ai-assistant')">
                    <i class="fas fa-window-maximize"></i>
                </button>
                <button class="w-8 h-8 flex items-center justify-center text-gray-400 hover:bg-red-500 hover:text-white rounded" onclick="closeApp('ai-assistant')">
                    <i class="fas fa-times"></i>
                </button>
            </div>
        </div>
        
        <div class="flex-1 flex flex-col">
            <div class="p-4 bg-gray-800 border-b border-gray-700">
                <div class="flex">
                    <button class="px-3 py-1 bg-app-blue text-white rounded-l text-sm">Assistant</button>
                    <button class="px-3 py-1 bg-gray-700 text-gray-300 rounded-r text-sm">Tools</button>
                </div>
            </div>
            
            <div id="chat-container" class="flex-1 overflow-y-auto p-4 bg-gray-850">
                <div class="ai-message mb-4 flex">
                    <div class="w-8 h-8 bg-ai-purple rounded-full flex items-center justify-center mr-3">
                        <i class="fas fa-robot text-white"></i>
                    </div>
                    <div class="flex-1">
                        <div class="bg-gray-800 rounded-lg p-3 text-gray-200">
                            <p>Hello! I'm your AI assistant. How can I help you today? Here are some things I can do:</p>
                            <ul class="mt-2 ml-4 list-disc">
                                <li>Complete tasks and automate workflows</li>
                                <li>Analyze and summarize documents</li>
                                <li>Generate reports and content</li>
                                <li>Answer questions and provide insights</li>
                            </ul>
                        </div>
                        <div class="mt-2 text-xs text-gray-500">Just now</div>
                    </div>
                </div>
            </div>
            
            <div class="p-4 border-t border-gray-700 bg-gray-800">
                <div class="flex">
                    <div class="flex-1 mr-3">
                        <input 
                            type="text" 
                            id="user-input" 
                            class="w-full bg-gray-700 text-white rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-app-light" 
                            placeholder="Ask AI to complete a task..."
                            onkeypress="if(event.key === 'Enter') sendMessage()"
                        >
                    </div>
                    <button 
                        id="send-btn"
                        class="bg-app-blue hover:bg-app-light text-white px-4 py-2 rounded-lg flex items-center transition"
                        onclick="sendMessage()"
                    >
                        <i class="fas fa-paper-plane mr-2"></i> Send
                    </button>
                </div>
                <div class="mt-2 flex flex-wrap">
                    <span class="text-xs text-gray-400 mr-3">Try:</span>
                    <button class="text-xs bg-gray-700 text-gray-300 px-2 py-1 rounded mr-2 mb-1 hover:bg-gray-600" onclick="quickPrompt('Summarize my latest project documents')">Summarize documents</button>
                    <button class="text-xs bg-gray-700 text-gray-300 px-2 py-1 rounded mr-2 mb-1 hover:bg-gray-600" onclick="quickPrompt('Generate a monthly report')">Generate report</button>
                    <button class="text-xs bg-gray-700 text-gray-300 px-2 py-1 rounded mr-2 mb-1 hover:bg-gray-600" onclick="quickPrompt('Analyze sales data from last quarter')">Analyze data</button>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Documents Window -->
    <div id="documents" class="window absolute top-1/4 left-1/3 w-1/3 h-2/3 bg-gray-900 border border-gray-700 flex flex-col hidden">
        <div class="window-header bg-gray-800 h-10 flex items-center justify-between px-3 border-b border-gray-700">
            <div class="flex items-center">
                <div class="bg-yellow-500 w-6 h-6 rounded flex items-center justify-center mr-2">
                    <i class="fas fa-file-alt text-xs text-white"></i>
                </div>
                <span class="text-white text-sm font-medium">Documents</span>
            </div>
            <div class="flex">
                <button class="w-8 h-8 flex items-center justify-center text-gray-400 hover:bg-gray-700 rounded" onclick="minimizeApp('documents')">
                    <i class="fas fa-window-minimize"></i>
                </button>
                <button class="w-8 h-8 flex items-center justify-center text-gray-400 hover:bg-gray-700 rounded" onclick="maximizeApp('documents')">
                    <i class="fas fa-window-maximize"></i>
                </button>
                <button class="w-8 h-8 flex items-center justify-center text-gray-400 hover:bg-red-500 hover:text-white rounded" onclick="closeApp('documents')">
                    <i class="fas fa-times"></i>
                </button>
            </div>
        </div>
        
        <div class="flex-1 overflow-y-auto p-4 bg-gray-850">
            <div class="mb-4">
                <h3 class="text-white font-medium mb-2">Recent Documents</h3>
                <div class="bg-gray-800 rounded-lg p-3 text-gray-200 mb-2 flex items-center cursor-pointer hover:bg-gray-750" onclick="aiProcessDocument('Project_Report.pdf')">
                    <i class="fas fa-file-pdf text-red-400 mr-3"></i>
                    <span>Project_Report.pdf</span>
                </div>
                <div class="bg-gray-800 rounded-lg p-3 text-gray-200 mb-2 flex items-center cursor-pointer hover:bg-gray-750" onclick="aiProcessDocument('Sales_Data_Q3.xlsx')">
                    <i class="fas fa-file-excel text-green-400 mr-3"></i>
                    <span>Sales_Data_Q3.xlsx</span>
                </div>
                <div class="bg-gray-800 rounded-lg p-3 text-gray-200 mb-2 flex items-center cursor-pointer hover:bg-gray-750" onclick="aiProcessDocument('Meeting_Notes.docx')">
                    <i class="fas fa-file-word text-blue-400 mr-3"></i>
                    <span>Meeting_Notes.docx</span>
                </div>
            </div>
            
            <div class="mb-4">
                <h3 class="text-white font-medium mb-2">AI Document Actions</h3>
                <button class="w-full bg-ai-purple hover:bg-purple-700 text-white px-4 py-2 rounded-lg mb-2 flex items-center justify-center" onclick="quickPrompt('Summarize all documents')">
                    <i class="fas fa-robot mr-2"></i> Summarize Documents
                </button>
                <button class="w-full bg-ai-purple hover:bg-purple-700 text-white px-4 py-2 rounded-lg mb-2 flex items-center justify-center" onclick="quickPrompt('Extract key data points from all documents')">
                    <i class="fas fa-database mr-2"></i> Extract Data
                </button>
                <button class="w-full bg-ai-purple hover:bg-purple-700 text-white px-4 py-2 rounded-lg flex items-center justify-center" onclick="quickPrompt('Generate report combining all documents')">
                    <i class="fas fa-file-contract mr-2"></i> Generate Combined Report
                </button>
            </div>
        </div>
    </div>

    <!-- Notification -->
    <div id="notification" class="fixed top-4 right-4 w-80 bg-gray-800 border border-gray-700 rounded-lg shadow-lg p-4 hidden">
        <div class="flex items-start">
            <div class="mr-3 mt-1 text-ai-purple">
                <i class="fas fa-robot"></i>
            </div>
            <div class="flex-1">
                <div class="font-medium text-white">AI Assistant</div>
                <div class="text-gray-300 text-sm mt-1" id="notification-message">Task completed successfully</div>
            </div>
            <button class="text-gray-400 hover:text-white" onclick="document.getElementById('notification').classList.add('hidden')">
                <i class="fas fa-times"></i>
            </button>
        </div>
    </div>
    
    <script>
        // Initialize clock
        function updateClock() {
            const now = new Date();
            const hours = now.getHours();
            const minutes = now.getMinutes().toString().padStart(2, '0');
            const ampm = hours >= 12 ? 'PM' : 'AM';
            const formattedHours = hours % 12 || 12;
            
            document.getElementById('clock').textContent = `${formattedHours}:${minutes} ${ampm}`;
        }
        
        setInterval(updateClock, 60000);
        updateClock();
        
        // App management functions
        function openApp(appId) {
            const app = document.getElementById(appId);
            app.classList.remove('hidden');
            focusApp(appId);
        }
        
        function closeApp(appId) {
            document.getElementById(appId).classList.add('hidden');
        }
        
        function minimizeApp(appId) {
            const app = document.getElementById(appId);
            app.classList.add('hidden');
        }
        
        function maximizeApp(appId) {
            const app = document.getElementById(appId);
            app.classList.toggle('w-full');
            app.classList.toggle('h-full');
            app.classList.toggle('top-0');
            app.classList.toggle('left-0');
        }
        
        function focusApp(appId) {
            document.querySelectorAll('.window').forEach(window => {
                window.style.zIndex = '10';
            });
            document.getElementById(appId).style.zIndex = '50';
            document.querySelectorAll('.taskbar-app').forEach(app => {
                app.classList.remove('active');
            });
            document.querySelector(`.taskbar-app:nth-child(1)`).classList.add('active');
        }
        
        // Chat functionality
        function sendMessage() {
            const input = document.getElementById('user-input');
            const message = input.value.trim();
            
            if (message) {
                addMessage(message, 'user');
                input.value = '';
                
                // Simulate AI processing
                setTimeout(() => {
                    processTask(message);
                }, 1000);
            }
        }
        
        function addMessage(message, sender) {
            const chatContainer = document.getElementById('chat-container');
            const now = new Date();
            const time = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
            
            if (sender === 'user') {
                const messageElement = `
                    <div class="ai-message mb-4 flex justify-end">
                        <div class="flex-1 max-w-3/4">
                            <div class="bg-app-blue rounded-lg p-3 text-white">
                                ${message}
                            </div>
                            <div class="mt-2 text-xs text-gray-500 text-right">${time}</div>
                        </div>
                        <div class="w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center ml-3">
                            <i class="fas fa-user text-white"></i>
                        </div>
                    </div>
                `;
                chatContainer.innerHTML += messageElement;
            } else {
                const messageElement = `
                    <div class="ai-message mb-4 flex">
                        <div class="w-8 h-8 bg-ai-purple rounded-full flex items-center justify-center mr-3">
                            <i class="fas fa-robot text-white"></i>
                        </div>
                        <div class="flex-1">
                            <div class="bg-gray-800 rounded-lg p-3 text-gray-200">
                                ${message}
                            </div>
                            <div class="mt-2 text-xs text-gray-500">${time}</div>
                        </div>
                    </div>
                `;
                chatContainer.innerHTML += messageElement;
            }
            
            chatContainer.scrollTop = chatContainer.scrollHeight;
        }
        
        function showTypingIndicator() {
            const chatContainer = document.getElementById('chat-container');
            const typingElement = `
                <div class="ai-message mb-4 flex">
                    <div class="w-8 h-8 bg-ai-purple rounded-full flex items-center justify-center mr-3">
                        <i class="fas fa-robot text-white"></i>
                    </div>
                    <div class="flex-1">
                        <div class="bg-gray-800 rounded-lg p-3 text-gray-200">
                            <span class="typing-indicator"></span>
                            <span class="typing-indicator"></span>
                            <span class="typing-indicator"></span>
                        </div>
                    </div>
                </div>
            `;
            chatContainer.innerHTML += typingElement;
            chatContainer.scrollTop = chatContainer.scrollHeight;
            return chatContainer.lastElementChild;
        }
        
        function removeTypingIndicator(element) {
            element.remove();
        }
        
        function processTask(task) {
            const typingElement = showTypingIndicator();
            
            setTimeout(() => {
                removeTypingIndicator(typingElement);
                
                // Simulated AI responses based on task
                let response = "";
                let notification = "Task completed";
                
                if (task.toLowerCase().includes("report")) {
                    response = `I've generated a comprehensive report based on your request. The report includes:<br><br>
                    <ul class="list-disc ml-5">
                        <li>Executive summary of key findings</li>
                        <li>Quarterly performance metrics</li>
                        <li>Competitive analysis</li>
                        <li>Recommendations for next quarter</li>
                    </ul><br>
                    The report has been saved to your Documents folder as "Q3_Report.pdf".`;
                    notification = "Report generated successfully";
                } else if (task.toLowerCase().includes("summarize") || task.toLowerCase().includes("document")) {
                    response = `I've analyzed and summarized the requested documents. Here's the key summary:<br><br>
                    <div class="bg-gray-750 p-3 rounded-lg">
                        <p class="font-medium">Project Status Summary:</p>
                        <p>The project is currently 75% complete with all major milestones achieved on schedule. The remaining tasks involve final testing and documentation. Budget utilization is at 68% which is within projected parameters.</p>
                    </div><br>
                    The full summary has been saved to your Documents folder.`;
                    notification = "Documents summarized";
                } else if (task.toLowerCase().includes("data") || task.toLowerCase().includes("analyze")) {
                    response = `I've completed the analysis of your sales data. Key insights:<br><br>
                    <div class="bg-gray-750 p-3 rounded-lg">
                        <p>📈 <span class="font-medium">Top Performing Products:</span> Product X increased sales by 24% this quarter</p>
                        <p>🌍 <span class="font-medium">Regional Performance:</span> European market shows strongest growth at 18%</p>
                        <p>📊 <span class="font-medium">Forecast:</span> Projected 12% growth next quarter based on current trends</p>
                    </div><br>
                    I've created visualizations and saved the full analysis to your Documents folder.`;
                    notification = "Data analysis complete";
                } else {
                    response = `I've completed the task: "${task}".<br><br>
                    The results have been saved to your Documents folder. Let me know if you need anything else!`;
                }
                
                addMessage(response, 'ai');
                showNotification(notification);
            }, 2000);
        }
        
        function quickPrompt(prompt) {
            document.getElementById('user-input').value = prompt;
            sendMessage();
        }

        function aiProcessDocument(filename) {
            const typingElement = showTypingIndicator();
            
            setTimeout(() => {
                removeTypingIndicator(typingElement);
                
                let response = "";
                if (filename.includes('.pdf')) {
                    response = `I've analyzed <span class="font-medium">${filename}</span> and found:<br><br>
                    <ul class="list-disc ml-5">
                        <li>32 pages of comprehensive project documentation</li>
                        <li>5 key recommendations for next steps</li>
                        <li>3 critical risks identified</li>
                    </ul><br>
                    <button class="bg-ai-purple hover:bg-purple-700 text-white px-3 py-1 rounded text-sm" onclick="quickPrompt('Summarize ${filename}')">Summarize Document</button>`;
                } else if (filename.includes('.xlsx')) {
                    response = `I've processed <span class="font-medium">${filename}</span> containing:<br><br>
                    <ul class="list-disc ml-5">
                        <li>Quarterly sales data across 5 regions</li>
                        <li>12 product categories with performance metrics</li>
                        <li>Year-over-year growth analysis</li>
                    </ul><br>
                    <button class="bg-ai-purple hover:bg-purple-700 text-white px-3 py-1 rounded text-sm" onclick="quickPrompt('Analyze trends in ${filename}')">Analyze Data</button>`;
                } else {
                    response = `I've reviewed <span class="font-medium">${filename}</span> which contains:<br><br>
                    <ul class="list-disc ml-5">
                        <li>Meeting minutes from 3 sessions</li>
                        <li>Action items for 5 team members</li>
                        <li>Project timeline updates</li>
                    </ul><br>
                    <button class="bg-ai-purple hover:bg-purple-700 text-white px-3 py-1 rounded text-sm" onclick="quickPrompt('Extract action items from ${filename}')">Extract Actions</button>`;
                }
                
                addMessage(response, 'ai');
                showNotification(`Processed ${filename}`);
                focusApp('ai-assistant');
            }, 1500);
        }
        
        function showNotification(message) {
            const notification = document.getElementById('notification');
            document.getElementById('notification-message').textContent = message;
            notification.classList.remove('hidden');
            
            setTimeout(() => {
                notification.classList.add('hidden');
            }, 3000);
        }
        
        // Make windows draggable
        document.querySelectorAll('.window-header').forEach(header => {
            header.addEventListener('mousedown', (e) => {
                const window = header.parentElement;
                let posX = e.clientX;
                let posY = e.clientY;
                
                function mouseMoveHandler(e) {
                    const dx = e.clientX - posX;
                    const dy = e.clientY - posY;
                    
                    window.style.left = (window.offsetLeft + dx) + 'px';
                    window.style.top = (window.offsetTop + dy) + 'px';
                    
                    posX = e.clientX;
                    posY = e.clientY;
                }
                
                function mouseUpHandler() {
                    document.removeEventListener('mousemove', mouseMoveHandler);
                    document.removeEventListener('mouseup', mouseUpHandler);
                }
                
                document.addEventListener('mousemove', mouseMoveHandler);
                document.addEventListener('mouseup', mouseUpHandler);
            });
        });
        
        // Toggle start menu
        function toggleStartMenu() {
            const menu = document.getElementById('start-menu');
            menu.classList.toggle('hidden');
        }

        // Close start menu when clicking elsewhere
        document.addEventListener('click', function(e) {
            const menu = document.getElementById('start-menu');
            const btn = document.querySelector('.mr-4 button');
            
            if (!menu.contains(e.target) && e.target !== btn && !btn.contains(e.target)) {
                menu.classList.add('hidden');
            }
        });

        // Minimize all windows
        function minimizeAllWindows() {
            document.querySelectorAll('.window').forEach(window => {
                window.classList.add('hidden');
            });
            document.getElementById('start-menu').classList.add('hidden');
        }

        // Open AI Assistant on load
        window.onload = function() {
            openApp('ai-assistant');
        };
    </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=kdub307/computer-use" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>