File size: 28,604 Bytes
97163ac
19ba7fe
c6e5d8e
 
19ba7fe
c6e5d8e
 
 
bb9e08f
19ba7fe
 
 
 
13f0280
bb9e08f
35f21d8
97163ac
19ba7fe
999ee93
bb9e08f
 
 
19ba7fe
c38de37
bb9e08f
 
19ba7fe
31f4b4c
97163ac
31f4b4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97163ac
 
 
31f4b4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97163ac
 
 
 
 
31f4b4c
 
 
 
 
97163ac
 
31f4b4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19ba7fe
97163ac
 
35f21d8
97163ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19ba7fe
 
bb9e08f
 
 
97163ac
 
 
bb9e08f
 
97163ac
35f21d8
97163ac
 
bb9e08f
 
97163ac
fa929f9
 
bb9e08f
 
35f21d8
bb9e08f
c38de37
 
bb9e08f
97163ac
 
 
c38de37
 
bb9e08f
 
19ba7fe
97163ac
fa929f9
 
97163ac
 
 
 
 
dd26076
 
bb9e08f
97163ac
bb9e08f
 
 
 
19ba7fe
 
97163ac
 
 
 
 
 
 
 
fa929f9
 
bb9e08f
97163ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
 
97163ac
35f21d8
bb9e08f
 
97163ac
fa929f9
 
bb9e08f
 
 
c38de37
 
bb9e08f
 
 
dd26076
 
bb9e08f
35f21d8
 
 
97163ac
dd26076
 
bb9e08f
 
35f21d8
dd26076
 
97163ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
c38de37
 
97163ac
 
 
bb9e08f
 
97163ac
9591b2e
bb9e08f
97163ac
c38de37
 
bb9e08f
 
 
19ba7fe
 
bb9e08f
97163ac
 
fa929f9
 
 
 
 
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa929f9
 
bb9e08f
97163ac
fa929f9
 
bb9e08f
 
fa929f9
 
bb9e08f
 
97163ac
bb9e08f
 
 
 
c38de37
bb9e08f
19ba7fe
 
13f0280
19ba7fe
 
 
 
 
dd26076
13f0280
19ba7fe
 
97163ac
31f4b4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97163ac
31f4b4c
97163ac
13f0280
bb9e08f
 
97163ac
bb9e08f
13f0280
bb9e08f
 
 
 
 
97163ac
bb9e08f
 
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
97163ac
bb9e08f
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
20023d0
 
bb9e08f
 
97163ac
bb9e08f
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
20023d0
 
bb9e08f
 
97163ac
bb9e08f
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
 
 
97163ac
 
 
 
 
 
 
 
 
 
 
20023d0
 
bb9e08f
97163ac
 
 
 
 
 
 
 
 
 
 
 
bb9e08f
 
 
c6e5d8e
 
97163ac
c6e5d8e
 
 
 
 
 
 
35f21d8
 
c6e5d8e
bb9e08f
35f21d8
1117279
35f21d8
c6e5d8e
 
 
 
 
 
 
 
 
35f21d8
c6e5d8e
 
 
 
 
 
 
bb9e08f
 
 
 
 
 
7dbd1b0
bb9e08f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7dbd1b0
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

class CustomSidebar extends HTMLElement {
    constructor() {
        super();
        this.attachShadow({ mode: 'open' });
    }
    
    connectedCallback() {
        this.shadowRoot.innerHTML = `
            <style>
                @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
                * { font-family: 'Inter', sans-serif; }
                .sidebar {
                    width: 260px;
                    background: #09090b;
                    border-right: 1px solid #18181b;
                    padding: 16px;
                    overflow-y: auto;
                    height: 100vh;
                    position: fixed;
                    left: 0;
                    top: 0;
                    z-index: 40;
                    transition: transform 0.3s ease;
                    display: flex;
                    flex-direction: column;
                }
                .sidebar-header {
                    margin-bottom: 24px;
                    text-align: center;
                    position: relative;
                }
                
                .logo-container {
                    display: flex;
                    justify-content: center;
                    margin-bottom: 12px;
                }
                
                .logo-wrapper {
                    position: relative;
                    width: 60px;
                    height: 60px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }
                
                .logo-inner {
                    position: relative;
                    width: 40px;
                    height: 40px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }
                
                .logo-core {
                    width: 20px;
                    height: 20px;
                    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
                    border-radius: 50%;
                    position: absolute;
                    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
                    animation: corePulse 2s ease-in-out infinite;
                }
                
                .logo-ring {
                    position: absolute;
                    border: 2px solid transparent;
                    border-radius: 50%;
                    animation: ringRotate 4s linear infinite;
                }
                
                .logo-ring-1 {
                    width: 40px;
                    height: 40px;
                    border-top-color: #3b82f6;
                    border-right-color: #3b82f6;
                    animation-duration: 3s;
                }
                
                .logo-ring-2 {
                    width: 50px;
                    height: 50px;
                    border-bottom-color: #8b5cf6;
                    border-left-color: #8b5cf6;
                    animation-duration: 4s;
                    animation-direction: reverse;
                }
                
                .logo-ring-3 {
                    width: 60px;
                    height: 60px;
                    border-top-color: #ec4899;
                    border-bottom-color: #ec4899;
                    animation-duration: 5s;
                }
                
                .sidebar-title {
                    font-size: 24px;
                    font-weight: 800;
                    margin-bottom: 6px;
                    letter-spacing: -0.5px;
                }
                
                .title-gradient {
                    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 50%, #71717a 100%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                    background-clip: text;
                    text-fill-color: transparent;
                    position: relative;
                }
                
                .title-gradient::after {
                    content: '';
                    position: absolute;
                    bottom: -2px;
                    left: 50%;
                    transform: translateX(-50%);
                    width: 30px;
                    height: 2px;
                    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
                    animation: titleGlow 3s ease-in-out infinite;
                }
                
                .sidebar-subtitle {
                    font-size: 12px;
                    color: #71717a;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    gap: 8px;
                    flex-wrap: wrap;
                }
                
                .subtitle-glow {
                    color: #a1a1aa;
                    font-weight: 500;
                    text-transform: uppercase;
                    letter-spacing: 1px;
                    position: relative;
                }
                
                .status-pill {
                    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
                    color: white;
                    font-size: 9px;
                    font-weight: 600;
                    padding: 2px 8px;
                    border-radius: 12px;
                    text-transform: uppercase;
                    letter-spacing: 0.5px;
                    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
                    animation: statusPulse 2s ease-in-out infinite;
                }
                
                @keyframes corePulse {
                    0%, 100% { 
                        transform: scale(1);
                        box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
                    }
                    50% { 
                        transform: scale(1.1);
                        box-shadow: 0 0 30px rgba(139, 92, 246, 0.8);
                    }
                }
                
                @keyframes ringRotate {
                    0% { transform: rotate(0deg); }
                    100% { transform: rotate(360deg); }
                }
                
                @keyframes titleGlow {
                    0%, 100% { opacity: 0.3; width: 30px; }
                    50% { opacity: 1; width: 50px; }
                }
                
                @keyframes statusPulse {
                    0%, 100% { 
                        box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
                        transform: scale(1);
                    }
                    50% { 
                        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
                        transform: scale(1.05);
                    }
                }
.new-chat-btn {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    gap: 8px;
                    width: 100%;
                    padding: 12px;
                    background: #18181b;
                    border: 1px solid #27272a;
                    border-radius: 12px;
                    color: #ffffff;
                    font-size: 14px;
                    font-weight: 500;
                    cursor: pointer;
                    transition: all 0.2s ease;
                    margin-bottom: 8px;
                }
                
                .new-chat-btn:hover {
                    background: #27272a;
                    border-color: #3f3f46;
                }
                
                .sidebar-btn {
                    display: flex;
                    align-items: center;
                    gap: 12px;
                    width: 100%;
                    padding: 12px;
                    background: #18181b;
                    border: 1px solid #27272a;
                    border-radius: 12px;
                    color: #71717a;
                    font-size: 14px;
                    font-weight: 500;
                    cursor: pointer;
                    transition: all 0.2s ease;
                    text-align: left;
                }
                
                .sidebar-btn:hover {
                    background: #27272a;
                    color: #fafafa;
                    border-color: #3f3f46;
                }
                
                .sidebar-btn svg {
                    width: 20px;
                    height: 20px;
                    flex-shrink: 0;
                }
                
                .history-section {
                    flex: 1;
                    overflow-y: auto;
                    margin-top: 24px;
                }
                
                .history-header {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-bottom: 12px;
                }
                
                .history-title {
                    font-size: 12px;
                    font-weight: 600;
                    color: #52525b;
                    text-transform: uppercase;
                    letter-spacing: 0.05em;
                }
                
                .history-actions {
                    display: flex;
                    gap: 8px;
                }
                
                .history-action-btn {
                    width: 24px;
                    height: 24px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    background: transparent;
                    border: none;
                    color: #52525b;
                    cursor: pointer;
                    transition: color 0.2s ease;
                }
                
                .history-action-btn:hover {
                    color: #ffffff;
                }
                
                .history-action-btn svg {
                    width: 14px;
                    height: 14px;
                }
                
                .history-group {
                    margin-bottom: 20px;
                }
                
                .chat-item {
                    display: flex;
                    align-items: center;
                    gap: 12px;
                    width: 100%;
                    padding: 10px 12px;
                    background: #18181b;
                    border: 1px solid #27272a;
                    border-radius: 10px;
                    margin-bottom: 8px;
                    cursor: pointer;
                    transition: all 0.2s ease;
                    text-align: left;
                }
                
                .chat-item:hover {
                    background: #27272a;
                    border-color: #3f3f46;
                }
                
                .chat-item.active {
                    background: #27272a;
                    border-color: #52525b;
                }
                
                .chat-item svg {
                    width: 18px;
                    height: 18px;
                    color: #71717a;
                    flex-shrink: 0;
                }
                
                .chat-item:hover svg,
                .chat-item.active svg {
                    color: #fafafa;
                }
                
                .chat-info {
                    flex: 1;
                    overflow: hidden;
                }
                
                .chat-title {
                    font-size: 13px;
                    font-weight: 500;
                    color: #ffffff;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    margin-bottom: 2px;
                }
                
                .chat-meta {
                    font-size: 11px;
                    color: #71717a;
                    display: flex;
                    align-items: center;
                    gap: 8px;
                }
                
                .chat-time,
                .chat-model {
                    display: flex;
                    align-items: center;
                    gap: 4px;
                }
                
                .model-dot {
                    width: 6px;
                    height: 6px;
                    border-radius: 50%;
                    display: inline-block;
                }
                
                .user-section {
                    margin-top: auto;
                    padding-top: 16px;
                    border-top: 1px solid #18181b;
                }
                
                .user-button {
                    display: flex;
                    align-items: center;
                    gap: 12px;
                    width: 100%;
                    padding: 12px;
                    background: #18181b;
                    border: 1px solid #27272a;
                    border-radius: 12px;
                    cursor: pointer;
                    transition: all 0.2s ease;
                    text-align: left;
                }
                
                .user-button:hover {
                    background: #27272a;
                    border-color: #3f3f46;
                }
                
                .user-avatar {
                    width: 32px;
                    height: 32px;
                    border-radius: 50%;
                    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: white;
                    font-weight: 600;
                    font-size: 14px;
                    flex-shrink: 0;
                }
                
                .user-info {
                    flex: 1;
                }
                
                .user-name {
                    font-size: 13px;
                    font-weight: 500;
                    color: #ffffff;
                    margin-bottom: 2px;
                }
                
                .user-plan {
                    font-size: 11px;
                    color: #a1a1aa;
                }
                
                .user-status {
                    display: flex;
                    align-items: center;
                    gap: 4px;
                }
                
                .status-dot {
                    width: 6px;
                    height: 6px;
                    border-radius: 50%;
                    background: #10b981;
                    animation: pulse 2s infinite;
                }
                
                @keyframes pulse {
                    0%, 100% { opacity: 1; }
                    50% { opacity: 0.5; }
                }
                
                .sidebar::-webkit-scrollbar {
                    width: 4px;
                }
                
                .sidebar::-webkit-scrollbar-track {
                    background: transparent;
                }
                
                .sidebar::-webkit-scrollbar-thumb {
                    background: #525252;
                    border-radius: 2px;
                }
                
                .sidebar::-webkit-scrollbar-thumb:hover {
                    background: #71717a;
                }
                @media (max-width: 768px) {
                    .sidebar {
                        transform: translateX(-100%);
                        width: 260px;
                    }
                    
                    .sidebar.active {
                        transform: translateX(0);
                    }
                }
</style>
            
            <nav class="sidebar">
                <div class="sidebar-header">
                    <div class="logo-container mb-3">
                        <div class="logo-wrapper">
                            <div class="logo-inner">
                                <div class="logo-core"></div>
                                <div class="logo-ring logo-ring-1"></div>
                                <div class="logo-ring logo-ring-2"></div>
                                <div class="logo-ring logo-ring-3"></div>
                            </div>
                        </div>
                    </div>
                    <h1 class="sidebar-title">
                        <span class="title-gradient">Nixaut</span>
                    </h1>
                    <p class="sidebar-subtitle">
                        <span class="subtitle-glow">AI Assistant</span>
                        <span class="status-pill">Online</span>
                    </p>
                </div>
<div class="sidebar-buttons">
                    <button onclick="startNewChat()" class="new-chat-btn">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <path d="M12 5v14m-7-7h14"/>
                        </svg>
                        <span>New Chat</span>
                    </button>
<button onclick="window.location.href='/media'" class="sidebar-btn">
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
                            <circle cx="8.5" cy="8.5" r="1.5"/>
                            <path d="M21 15l-5-5L5 21"/>
                        </svg>
                        <span>Media Library</span>
                    </button>
                </div>
                
                <div class="history-section">
                    <div class="history-header">
                        <span class="history-title">Chat History</span>
                        <div class="history-actions">
                            <button class="history-action-btn" title="Search">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                    <circle cx="11" cy="11" r="8"/>
                                    <path d="m21 21-4.35-4.35"/>
                                </svg>
                            </button>
                            <button class="history-action-btn" title="Clear">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                    <path d="M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2m3 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6h14zM10 11v6M14 11v6"/>
                                </svg>
                            </button>
                        </div>
                    </div>
                    
                    <div class="history-group">
                        <button onclick="loadChatHistory(1)" class="chat-item" data-id="1">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
                            </svg>
                            <div class="chat-info">
                                <div class="chat-title">Website Redesign</div>
                                <div class="chat-meta">
                                    <span class="chat-time">2:30 PM</span>
                                    <span class="chat-model">
                                        <span class="model-dot" style="background: #ffffff;"></span>
                                        Max
                                    </span>
                                </div>
                            </div>
                        </button>
                        <button onclick="loadChatHistory(2)" class="chat-item" data-id="2">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
                            </svg>
                            <div class="chat-info">
                                <div class="chat-title">JavaScript Performance Tips</div>
                                <div class="chat-meta">
                                    <span class="chat-time">1:15 PM</span>
                                    <span class="chat-model">
                                        <span class="model-dot" style="background: #a1a1aa;"></span>
                                        Turbo
                                    </span>
                                </div>
                            </div>
                        </button>
                        <button onclick="loadChatHistory(3)" class="chat-item active" data-id="3">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
                            </svg>
                            <div class="chat-info">
                                <div class="chat-title">React Architecture</div>
                                <div class="chat-meta">
                                    <span class="chat-time">11:45 AM</span>
                                    <span class="chat-model">
                                        <span class="model-dot" style="background: #71717a;"></span>
                                        Lite
                                    </span>
                                </div>
                            </div>
                        </button>
                    </div>
                    
                    <div class="history-group">
                        <div class="history-title">Yesterday</div>
                        <button onclick="loadChatHistory(4)" class="chat-item" data-id="4">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
                            </svg>
                            <div class="chat-info">
                                <div class="chat-title">Data Analysis Project</div>
                                <div class="chat-meta">
                                    <span class="chat-time">6:20 PM</span>
                                    <span class="chat-model">
                                        <span class="model-dot" style="background: #d4d4d8;"></span>
                                        Deep Research
                                    </span>
                                </div>
                            </div>
                        </button>
                        <button onclick="loadChatHistory(5)" class="chat-item" data-id="5">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
                            </svg>
                            <div class="chat-info">
                                <div class="chat-title">Cloud Architecture Design</div>
                                <div class="chat-meta">
                                    <span class="chat-time">4:10 PM</span>
                                    <span class="chat-model">
                                        <span class="model-dot" style="background: #ffffff;"></span>
                                        Max
                                    </span>
                                </div>
                            </div>
                        </button>
                    </div>
                    
                    <div class="history-group">
                        <div class="history-title">Older</div>
                        <button onclick="loadChatHistory(6)" class="chat-item" data-id="6">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
                            </svg>
                            <div class="chat-info">
                                <div class="chat-title">Database Optimization</div>
                                <div class="chat-meta">
                                    <span class="chat-time">3 days ago</span>
                                    <span class="chat-model">
                                        <span class="model-dot" style="background: #a1a1aa;"></span>
                                        Turbo
                                    </span>
                                </div>
                            </div>
                        </button>
                        <button onclick="loadChatHistory(7)" class="chat-item" data-id="7">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
                            </svg>
                            <div class="chat-info">
                                <div class="chat-title">Security Best Practices</div>
                                <div class="chat-meta">
                                    <span class="chat-time">5 days ago</span>
                                    <span class="chat-model">
                                        <span class="model-dot" style="background: #ffffff;"></span>
                                        Max
                                    </span>
                                </div>
                            </div>
                        </button>
                    </div>
                </div>
                
                <div class="user-section">
                    <button onclick="openAccount()" class="user-button">
                        <div class="user-avatar">U</div>
                        <div class="user-info">
                            <div class="user-name">User Account</div>
                            <div class="user-plan">Pro Plan</div>
                        </div>
                        <div class="user-status">
                            <div class="status-dot"></div>
                        </div>
                    </button>
                </div>
            </nav>
        `;
        
        this.setupMobileMenu();
    }
setupMobileMenu() {
        const menuButton = document.createElement('button');
        menuButton.className = 'mobile-menu-trigger';
        menuButton.innerHTML = `
            <style>
                .mobile-menu-trigger {
                    display: none;
                    position: fixed;
                    top: 12px;
                    left: 12px;
                    z-index: 50;
                    background: #09090b;
                    border: 1px solid #18181b;
                    border-radius: 6px;
                    padding: 8px;
                    cursor: pointer;
                }
                
                @media (max-width: 768px) {
                    .mobile-menu-trigger {
                        display: block;
                    }
                }
            </style>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">
                <path d="M3 12h18M3 6h18M3 18h18"/>
            </svg>
        `;
        menuButton.onclick = () => {
            const sidebar = this.shadowRoot.querySelector('.sidebar');
            sidebar.classList.toggle('active');
        };
        document.body.appendChild(menuButton);
    }
}

customElements.define('custom-sidebar', CustomSidebar);

// Sidebar functions
function startNewChat() {
    clearChat();
}

function loadChatHistory(chatId) {
    console.log('Loading chat history for:', chatId);
    
    document.querySelectorAll('.chat-item').forEach(item => {
        item.classList.remove('active');
    });
    
    const clickedChat = document.querySelector(`.chat-item[data-id="${chatId}"]`);
    if (clickedChat) {
        clickedChat.classList.add('active');
    }
}

function openAccount() {
    console.log('Opening account settings...');
}