File size: 42,215 Bytes
157d396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>کوکب تک | Kawkab Tech — پلتفرم هوش مصنوعی رایگان</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>⭐</text></svg>">
<style>
@import url('https://cdn.jsdelivr.net/fontsource/fonts/vazirmatn@latest/persian-400-normal.css');
@import url('https://cdn.jsdelivr.net/fontsource/fonts/vazirmatn@latest/persian-700-normal.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-0: #05060f;
  --bg-1: #0a0d1f;
  --bg-2: #121633;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #06b6d4;
  --text: #e8ecf4;
  --text-dim: #94a3b8;
  --border: rgba(255,255,255,0.08);
  --glass: rgba(20, 25, 50, 0.6);
  --success: #10b981;
  --danger: #ef4444;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.cosmos::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.25), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(236, 72, 153, 0.2), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.18), transparent 50%);
  animation: nebula 30s infinite alternate ease-in-out;
}
@keyframes nebula {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.2) rotate(10deg); }
}
.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, white, transparent),
    radial-gradient(1px 1px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(2px 2px at 80% 10%, white, transparent),
    radial-gradient(1px 1px at 90% 60%, white, transparent);
  background-size: 300px 300px;
  animation: twinkle 4s infinite;
}
@keyframes twinkle {
  0%,100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  background: rgba(5, 6, 15, 0.7);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
  animation: spin 20s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text p {
  font-size: 11px;
  color: var(--text-dim);
}

.header-actions {
  display: flex;
  gap: 8px;
}
.icon-btn {
  width: 38px; height: 38px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}
.icon-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 6, 15, 0.5);
  backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.tab.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.15));
  border-color: rgba(139, 92, 246, 0.3);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}
.tab-emoji { font-size: 15px; }

main {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  display: none;
  animation: fadeIn 0.4s ease;
}
.panel.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  margin-bottom: 20px;
}
.panel-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.panel-desc {
  color: var(--text-dim);
  font-size: 13px;
}

.chat-container {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.chat-messages {
  height: 520px;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 3px; }

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.message.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.message.bot .msg-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}
.message.user .msg-avatar {
  background: linear-gradient(135deg, var(--accent-3), #3b82f6);
}
.msg-content {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.message.bot .msg-content {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-top-right-radius: 4px;
}
.message.user .msg-content {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-top-left-radius: 4px;
}
.msg-content pre {
  background: rgba(0,0,0,0.5);
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  direction: ltr;
  text-align: left;
  font-size: 12.5px;
  font-family: 'Courier New', monospace;
}
.msg-content code {
  background: rgba(0,0,0,0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: 'Courier New', monospace;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.typing-dots span {
  width: 7px; height: 7px;
  background: #c4b5fd;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}
.typing-dots span:nth-child(2){ animation-delay: 0.2s; }
.typing-dots span:nth-child(3){ animation-delay: 0.4s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: rgba(5, 6, 15, 0.5);
}
.chat-input-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  transition: border-color 0.2s;
}
.chat-input-wrap:focus-within { border-color: rgba(139, 92, 246, 0.5); }
.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 10px;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  line-height: 1.6;
}
.chat-input::placeholder { color: #64748b; }

.send-btn {
  padding: 9px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}
.send-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.quick-prompt {
  padding: 5px 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11.5px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.quick-prompt:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #fff;
}

.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .image-grid { grid-template-columns: 1fr; }
}

.control-card, .image-result, .video-display, .about-content, .tool-workspace {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(20px);
}
.control-card h3, .image-result h3 {
  font-size: 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(139, 92, 246, 0.5);
}
.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}
.form-select {
  cursor: pointer;
}
.form-select option { background: var(--bg-1); }

.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 11px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
  width: 100%;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.image-result {
  min-height: 400px;
  display: flex;
  flex-direction: column;
}
.image-display {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  position: relative;
  overflow: hidden;
}
.image-display img {
  max-width: 100%;
  max-height: 500px;
  border-radius: 12px;
}
.image-placeholder {
  text-align: center;
  color: var(--text-dim);
  padding: 20px;
}
.image-placeholder .big-icon {
  font-size: 56px;
  margin-bottom: 10px;
  opacity: 0.5;
}
.image-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.image-actions .btn { width: auto; flex: 1; min-width: 100px; }

.loader {
  display: inline-block;
  width: 40px; height: 40px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}
.loader.sm { width: 20px; height: 20px; border-width: 2px; }
@keyframes rotate {
  to { transform: rotate(360deg); }
}

.video-display { margin-top: 20px; }
.video-canvas {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  margin: 0 auto;
  display: block;
}
.video-controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.video-controls .btn { width: auto; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.tool-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: all 0.2s;
}
.tool-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}
.tool-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 700;
}
.tool-card h4 {
  font-size: 15px;
  margin-bottom: 5px;
}
.tool-card p {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.tool-workspace {
  display: none;
  margin-top: 20px;
}
.tool-workspace.active { display: block; }
.tool-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tool-workspace-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.drop-zone {
  border: 2px dashed rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(139, 92, 246, 0.05);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
}
.drop-zone-icon { font-size: 36px; margin-bottom: 8px; }
.drop-zone-text { color: var(--text-dim); font-size: 13px; }

.about-content h3 {
  font-size: 18px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.about-content p {
  color: var(--text-dim);
  margin-bottom: 10px;
  font-size: 13.5px;
  line-height: 1.9;
}
.feature-list {
  list-style: none;
  margin: 14px 0;
}
.feature-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before {
  content: '✨';
  font-size: 16px;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.tech-badge {
  padding: 5px 11px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 100px;
  font-size: 11.5px;
  color: #c4b5fd;
}

footer {
  padding: 22px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(5, 6, 15, 0.6);
  backdrop-filter: blur(20px);
  margin-top: 40px;
}
footer p {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-bottom: 6px;
}
footer .powered {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 100px;
  font-size: 12.5px;
  color: #c4b5fd;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  padding: 11px 18px;
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  z-index: 1000;
  transition: transform 0.3s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }

.output-box {
  padding: 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  min-height: 50px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 12px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-row .btn { width: auto; }

@media (max-width: 640px) {
  main { padding: 14px; }
  .panel-title { font-size: 20px; }
  .chat-messages { height: 420px; }
  .msg-content { max-width: 85%; }
  header { padding: 12px 14px; }
  .logo-text h1 { font-size: 16px; }
  .tabs { padding: 8px 14px; }
  .tab { padding: 8px 12px; font-size: 12px; }
}
</style>
</head>
<body>

<div class="cosmos">
  <div class="stars"></div>
</div>

<div class="app">

  <header>
    <div class="logo">
      <div class="logo-icon"></div>
      <div class="logo-text">
        <h1>کوکب تک</h1>
        <p>Kawkab Tech — پلتفرم هوش مصنوعی</p>
      </div>
    </div>
    <div class="header-actions">
      <button class="icon-btn" id="clearChatBtn" title="پاک کردن چت">🗑️</button>
    </div>
  </header>

  <nav class="tabs">
    <button class="tab active" data-tab="chat">
      <span class="tab-emoji">💬</span> چت هوشمند
    </button>
    <button class="tab" data-tab="image">
      <span class="tab-emoji">🎨</span> تولید تصویر
    </button>
    <button class="tab" data-tab="video">
      <span class="tab-emoji">🎬</span> تولید ویدیو
    </button>
    <button class="tab" data-tab="tools">
      <span class="tab-emoji">🛠️</span> ابزارهای تبدیل
    </button>
    <button class="tab" data-tab="about">
      <span class="tab-emoji">ℹ️</span> درباره
    </button>
  </nav>

  <main>

    <section class="panel active" id="panel-chat">
      <div class="panel-header">
        <h2 class="panel-title">💬 چت هوشمند با AI</h2>
        <p class="panel-desc">گفتگوی زنده با مدل زبانی پیشرفته — بدون ثبت‌نام، کاملاً رایگان</p>
      </div>
      <div class="chat-container">
        <div class="chat-messages" id="chatMessages">
          <div class="message bot">
            <div class="msg-avatar"></div>
            <div class="msg-content">
              سلام! من دستیار هوشمند <strong>کوکب تک</strong> هستم 🌟<br>
              هر سوالی داری بپرس — از برنامه‌نویسی و ریاضی گرفته تا ترجمه، تحلیل، ایده‌پردازی و هر چیز دیگه.
            </div>
          </div>
        </div>
        <div class="chat-input-area">
          <div class="chat-input-wrap">
            <textarea class="chat-input" id="chatInput" placeholder="پیامت رو بنویس... (Shift+Enter برای خط جدید)" rows="1"></textarea>
            <button class="send-btn" id="sendBtn">ارسال ➤</button>
          </div>
          <div class="quick-prompts">
            <button class="quick-prompt" data-prompt="یک داستان کوتاه خلاقانه بنویس">📖 داستان</button>
            <button class="quick-prompt" data-prompt="کد پایتون برای مرتب‌سازی لیست بنویس">💻 کد پایتون</button>
            <button class="quick-prompt" data-prompt="تفاوت React و Vue را توضیح بده">⚛️ React vs Vue</button>
            <button class="quick-prompt" data-prompt="یک شعر زیبا درباره ستاره ها بگو">✨ شعر</button>
            <button class="quick-prompt" data-prompt="معنی کلمه Serendipity چیست؟">📚 ترجمه</button>
          </div>
        </div>
      </div>
    </section>

    <section class="panel" id="panel-image">
      <div class="panel-header">
        <h2 class="panel-title">🎨 تولید تصویر با AI</h2>
        <p class="panel-desc">تصویر دلخواهت را توصیف کن — هوش مصنوعی آن را خلق می‌کند</p>
      </div>
      <div class="image-grid">
        <div class="control-card">
          <h3>⚙️ تنظیمات تصویر</h3>
          <div class="form-group">
            <label class="form-label">توصیف تصویر (انگلیسی بهتر است)</label>
            <textarea class="form-textarea" id="imagePrompt" placeholder="مثال: A majestic Persian cat sitting on a throne in a cosmic galaxy, digital art, highly detailed"></textarea>
          </div>
          <div class="form-group">
            <label class="form-label">سبک هنری</label>
            <select class="form-select" id="imageStyle">
              <option value="">بدون سبک خاص</option>
              <option value=", digital art, highly detailed">Digital Art</option>
              <option value=", oil painting, classical">Oil Painting</option>
              <option value=", anime style, vibrant colors">Anime</option>
              <option value=", photorealistic, 8k, ultra detailed">Photorealistic</option>
              <option value=", watercolor painting, soft">Watercolor</option>
              <option value=", cyberpunk, neon lights, futuristic">Cyberpunk</option>
              <option value=", fantasy art, magical, ethereal">Fantasy</option>
              <option value=", minimalist, clean, modern">Minimalist</option>
              <option value=", 3d render, octane, cinema 4d">3D Render</option>
            </select>
          </div>
          <div class="form-group">
            <label class="form-label">ابعاد تصویر</label>
            <select class="form-select" id="imageSize">
              <option value="1024x1024">مربع (1024×1024)</option>
              <option value="1280x720">افقی (1280×720)</option>
              <option value="720x1280">عمودی (720×1280)</option>
              <option value="1920x1080">Full HD (1920×1080)</option>
              <option value="512x512">کوچک (512×512)</option>
            </select>
          </div>
          <div class="form-group">
            <label class="form-label">مدل</label>
            <select class="form-select" id="imageModel">
              <option value="flux">Flux (پیشنهادی)</option>
              <option value="flux-realism">Flux Realism</option>
              <option value="flux-anime">Flux Anime</option>
              <option value="flux-3d">Flux 3D</option>
              <option value="turbo">Turbo (سریع)</option>
            </select>
          </div>
          <button class="btn btn-primary" id="generateImageBtn">✨ خلق تصویر</button>
        </div>
        <div class="image-result">
          <h3>🖼️ نتیجه</h3>
          <div class="image-display" id="imageDisplay">
            <div class="image-placeholder">
              <div class="big-icon">🎨</div>
              <p>توصیف تصویر را وارد کن و روی "خلق تصویر" کلیک کن</p>
            </div>
          </div>
          <div class="image-actions" id="imageActions" style="display:none;">
            <button class="btn btn-secondary" id="downloadImageBtn">💾 دانلود</button>
            <button class="btn btn-secondary" id="copyImageBtn">📋 کپی لینک</button>
            <button class="btn btn-secondary" id="regenerateImageBtn">🔄 تولید مجدد</button>
          </div>
        </div>
      </div>
    </section>

    <section class="panel" id="panel-video">
      <div class="panel-header">
        <h2 class="panel-title">🎬 تولید ویدیو از متن</h2>
        <p class="panel-desc">متن خود را به ویدیوی متحرک تبدیل کن — با افکت‌های زیبا</p>
      </div>
      <div class="control-card">
        <h3>⚙️ تنظیمات ویدیو</h3>
        <div class="form-group">
          <label class="form-label">متن ویدیو</label>
          <textarea class="form-textarea" id="videoText" placeholder="متنی که می‌خواهی در ویدیو نمایش داده شود..."></textarea>
        </div>
        <div style="display:grid; grid-template-columns: 1fr 1fr; gap:12px;">
          <div class="form-group">
            <label class="form-label">سبک انیمیشن</label>
            <select class="form-select" id="videoStyle">
              <option value="typewriter">ماشین تحریر</option>
              <option value="fade">محو شدن</option>
              <option value="bounce">پرش</option>
              <option value="glitch">گلیچ</option>
              <option value="neon">نئون</option>
              <option value="particles">ذرات</option>
            </select>
          </div>
          <div class="form-group">
            <label class="form-label">رنگ پس‌زمینه</label>
            <select class="form-select" id="videoBg">
              <option value="cosmic">کهکشانی</option>
              <option value="sunset">غروب</option>
              <option value="ocean">اقیانوس</option>
              <option value="forest">جنگل</option>
              <option value="dark">تیره</option>
            </select>
          </div>
        </div>
        <button class="btn btn-primary" id="generateVideoBtn">🎬 ساخت ویدیو</button>
      </div>
      <div class="video-display" id="videoDisplay" style="display:none;">
        <canvas class="video-canvas" id="videoCanvas" width="1280" height="720"></canvas>
        <div class="video-controls">
          <button class="btn btn-secondary" id="playVideoBtn">▶️ پخش</button>
          <button class="btn btn-secondary" id="pauseVideoBtn">⏸️ توقف</button>
          <button class="btn btn-secondary" id="resetVideoBtn">🔄 بازنشانی</button>
          <button class="btn btn-primary" id="recordVideoBtn" style="width:auto;">🔴 ضبط ویدیو</button>
        </div>
      </div>
    </section>

    <section class="panel" id="panel-tools">
      <div class="panel-header">
        <h2 class="panel-title">🛠️ ابزارهای تبدیل و پردازش</h2>
        <p class="panel-desc">مجموعه‌ای از ابزارهای کاربردی برای تبدیل و پردازش محتوا</p>
      </div>

      <div class="tools-grid" id="toolsGrid">
        <div class="tool-card" data-tool="text2speech">
          <div class="tool-icon">🔊</div>
          <h4>تبدیل متن به گفتار</h4>
          <p>متن فارسی یا انگلیسی را به صدا تبدیل کن</p>
        </div>
        <div class="tool-card" data-tool="image-convert">
          <div class="tool-icon">🖼️</div>
          <h4>تبدیل فرمت تصویر</h4>
          <p>PNG, JPG, WebP, BMP — تبدیل بین فرمت‌ها</p>
        </div>
        <div class="tool-card" data-tool="image-resize">
          <div class="tool-icon">📐</div>
          <h4>تغییر اندازه تصویر</h4>
          <p>ابعاد تصویر را به دلخواه تغییر بده</p>
        </div>
        <div class="tool-card" data-tool="text-tools">
          <div class="tool-icon">📝</div>
          <h4>ابزارهای متن</h4>
          <p>شمارش کلمات، تبدیل حروف، کدگذاری و...</p>
        </div>
        <div class="tool-card" data-tool="color-tools">
          <div class="tool-icon">🎨</div>
          <h4>ابزارهای رنگ</h4>
          <p>تبدیل HEX, RGB, HSL — پالت رنگ</p>
        </div>
        <div class="tool-card" data-tool="qr-code">
          <div class="tool-icon">📱</div>
          <h4>ساخت QR Code</h4>
          <p>از هر متن یا لینک، QR Code بساز</p>
        </div>
        <div class="tool-card" data-tool="password-gen">
          <div class="tool-icon">🔐</div>
          <h4>تولید رمز عبور</h4>
          <p>رمز عبور قامن و تصادفی بساز</p>
        </div>
        <div class="tool-card" data-tool="json-formatter">
          <div class="tool-icon">{ }</div>
          <h4>مرتب‌ساز JSON</h4>
          <p>JSON را زیبا و مرتب کن یا فشرده</p>
        </div>
      </div>

      <div class="tool-workspace" id="workspace-text2speech">
        <div class="tool-workspace-header">
          <h3>🔊 تبدیل متن به گفتار</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="form-group">
          <label class="form-label">متن</label>
          <textarea class="form-textarea" id="ttsText" placeholder="متن خود را اینجا بنویسید..."></textarea>
        </div>
        <div style="display:grid; grid-template-columns: 1fr 1fr 1fr; gap:12px;">
          <div class="form-group">
            <label class="form-label">صدا</label>
            <select class="form-select" id="ttsVoice"></select>
          </div>
          <div class="form-group">
            <label class="form-label">سرعت: <span id="ttsRateVal">1</span></label>
            <input type="range" id="ttsRate" min="0.5" max="2" step="0.1" value="1" style="width:100%;">
          </div>
          <div class="form-group">
            <label class="form-label">زیر و بمی: <span id="ttsPitchVal">1</span></label>
            <input type="range" id="ttsPitch" min="0" max="2" step="0.1" value="1" style="width:100%;">
          </div>
        </div>
        <div style="display:flex; gap:8px;">
          <button class="btn btn-primary" id="speakBtn" style="width:auto;">▶️ پخش</button>
          <button class="btn btn-secondary" id="stopSpeechBtn">⏹️ توقف</button>
        </div>
      </div>

      <div class="tool-workspace" id="workspace-image-convert">
        <div class="tool-workspace-header">
          <h3>🖼️ تبدیل فرمت تصویر</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="drop-zone" id="imgConvertDrop">
          <div class="drop-zone-icon">📁</div>
          <div class="drop-zone-text">تصویر را اینجا بکش یا کلیک کن</div>
          <input type="file" id="imgConvertFile" accept="image/*" style="display:none;">
        </div>
        <div class="form-group" style="margin-top:14px;">
          <label class="form-label">فرمت خروجی</label>
          <select class="form-select" id="imgConvertFormat">
            <option value="image/png">PNG</option>
            <option value="image/jpeg">JPEG</option>
            <option value="image/webp">WebP</option>
            <option value="image/bmp">BMP</option>
          </select>
        </div>
        <div class="form-group">
          <label class="form-label">کیفیت: <span id="imgQualityVal">90</span>%</label>
          <input type="range" id="imgQuality" min="10" max="100" value="90" style="width:100%;">
        </div>
        <button class="btn btn-primary" id="convertImageBtn">💾 تبدیل و دانلود</button>
        <div id="imgConvertPreview" style="margin-top:14px;"></div>
      </div>

      <div class="tool-workspace" id="workspace-image-resize">
        <div class="tool-workspace-header">
          <h3>📐 تغییر اندازه تصویر</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="drop-zone" id="imgResizeDrop">
          <div class="drop-zone-icon">📁</div>
          <div class="drop-zone-text">تصویر را اینجا بکش یا کلیک کن</div>
          <input type="file" id="imgResizeFile" accept="image/*" style="display:none;">
        </div>
        <div style="display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-top:14px;">
          <div class="form-group">
            <label class="form-label">عرض (px)</label>
            <input type="number" class="form-input" id="resizeWidth" value="800">
          </div>
          <div class="form-group">
            <label class="form-label">ارتفاع (px)</label>
            <input type="number" class="form-input" id="resizeHeight" value="600">
          </div>
        </div>
        <button class="btn btn-primary" id="resizeImageBtn">📐 تغییر اندازه و دانلود</button>
      </div>

      <div class="tool-workspace" id="workspace-text-tools">
        <div class="tool-workspace-header">
          <h3>📝 ابزارهای متن</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="form-group">
          <label class="form-label">متن ورودی</label>
          <textarea class="form-textarea" id="textToolInput" placeholder="متن خود را وارد کنید..." style="min-height:140px;"></textarea>
        </div>
        <div class="btn-row">
          <button class="btn btn-secondary" data-text-op="upper">حروف بزرگ</button>
          <button class="btn btn-secondary" data-text-op="lower">حروف کوچک</button>
          <button class="btn btn-secondary" data-text-op="reverse">معکوس</button>
          <button class="btn btn-secondary" data-text-op="trim">حذف فاصله‌ها</button>
          <button class="btn btn-secondary" data-text-op="encode-base64">Base64 Encode</button>
          <button class="btn btn-secondary" data-text-op="decode-base64">Base64 Decode</button>
          <button class="btn btn-secondary" data-text-op="encode-url">URL Encode</button>
          <button class="btn btn-secondary" data-text-op="count">آمار متن</button>
        </div>
        <div class="output-box" id="textToolOutput"></div>
      </div>

      <div class="tool-workspace" id="workspace-color-tools">
        <div class="tool-workspace-header">
          <h3>🎨 ابزارهای رنگ</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="form-group">
          <label class="form-label">یک رنگ انتخاب کن</label>
          <input type="color" id="colorPicker" value="#8b5cf6" style="width:100%; height:60px; border-radius:10px; cursor:pointer; border:1px solid var(--border);">
        </div>
        <div class="output-box" id="colorOutput"></div>
      </div>

      <div class="tool-workspace" id="workspace-qr-code">
        <div class="tool-workspace-header">
          <h3>📱 ساخت QR Code</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="form-group">
          <label class="form-label">متن یا لینک</label>
          <input type="text" class="form-input" id="qrInput" placeholder="https://example.com">
        </div>
        <button class="btn btn-primary" id="generateQRBtn">🔳 ساخت QR Code</button>
        <div id="qrOutput" style="margin-top:14px; text-align:center;"></div>
      </div>

      <div class="tool-workspace" id="workspace-password-gen">
        <div class="tool-workspace-header">
          <h3>🔐 تولید رمز عبور</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="form-group">
          <label class="form-label">طول رمز: <span id="pwdLenVal">16</span></label>
          <input type="range" id="pwdLen" min="6" max="64" value="16" style="width:100%;">
        </div>
        <div style="display:grid; grid-template-columns: 1fr 1fr; gap:12px;">
          <label style="display:flex; align-items:center; gap:8px; font-size:13px;"><input type="checkbox" id="pwdUpper" checked> حروف بزرگ</label>
          <label style="display:flex; align-items:center; gap:8px; font-size:13px;"><input type="checkbox" id="pwdLower" checked> حروف کوچک</label>
          <label style="display:flex; align-items:center; gap:8px; font-size:13px;"><input type="checkbox" id="pwdNumbers" checked> اعداد</label>
          <label style="display:flex; align-items:center; gap:8px; font-size:13px;"><input type="checkbox" id="pwdSymbols" checked> نمادها</label>
        </div>
        <button class="btn btn-primary" id="generatePasswordBtn" style="margin-top:14px;">🎲 تولید رمز</button>
        <div class="output-box" id="pwdOutput" style="direction:ltr; text-align:left; font-family:monospace; word-break:break-all;"></div>
      </div>

      <div class="tool-workspace" id="workspace-json-formatter">
        <div class="tool-workspace-header">
          <h3>{ } مرتب‌ساز JSON</h3>
          <button class="btn btn-secondary close-tool-btn">✕ بستن</button>
        </div>
        <div class="form-group">
          <label class="form-label">JSON ورودی</label>
          <textarea class="form-textarea" id="jsonInput" placeholder='{"name":"کوکب","version":1}' style="min-height:140px; direction:ltr; text-align:left; font-family:monospace;"></textarea>
        </div>
        <div class="btn-row">
          <button class="btn btn-primary" data-json-op="pretty" style="width:auto;">✨ مرتب‌سازی</button>
          <button class="btn btn-secondary" data-json-op="minify">📦 فشرده‌سازی</button>
          <button class="btn btn-secondary" data-json-op="validate">✅ اعتبارسنجی</button>
        </div>
        <div class="output-box" id="jsonOutput" style="direction:ltr; text-align:left; font-family:monospace; white-space:pre-wrap; font-size:12.5px;"></div>
      </div>

    </section>

    <section class="panel" id="panel-about">
      <div class="panel-header">
        <h2 class="panel-title">ℹ️ درباره کوکب تک</h2>
        <p class="panel-desc">پلتفرمی برای همه — بدون ثبت‌نام، بدون محدودیت، کاملاً رایگان</p>
      </div>
      <div class="about-content">
        <h3>⭐ کوکب تک چیست؟</h3>
        <p>
          <strong>کوکب تک</strong> یک پلتفرم یکپارچه هوش مصنوعی است که با هدف ارائه ابزارهای پیشرفته AI به صورت کاملاً رایگان و بدون نیاز به ثبت‌نام طراحی شده است.
        </p>
        <h3 style="margin-top:20px;">🚀 قابلیت‌ها</h3>
        <ul class="feature-list">
          <li>چت هوشمند با مدل زبانی پیشرفته (متن‌باز و رایگان)</li>
          <li>تولید تصویر با AI — چندین سبک هنری و ابعاد مختلف</li>
          <li>ساخت ویدیوهای متنی با افکت‌های متنوع</li>
          <li>تبدیل متن به گفتار (TTS) با پشتیبانی از فارسی</li>
          <li>تبدیل فرمت تصویر (PNG, JPG, WebP, BMP)</li>
          <li>تغییر اندازه تصویر بدون افت کیفیت</li>
          <li>ابزارهای متن (شمارش، تبدیل، کدگذاری)</li>
          <li>تولید QR Code از هر متن یا لینک</li>
          <li>تولید رمز عبور قامن و تصادفی</li>
          <li>مرتب‌ساز و اعتبارسنج JSON</li>
          <li>ابزارهای تبدیل رنگ (HEX, RGB, HSL)</li>
          <li>رابط کاربری فارسی، زیبا و واکنش‌گرا</li>
        </ul>
        <h3 style="margin-top:20px;">🔧 فناوری‌های استفاده‌شده</h3>
        <div class="tech-stack">
          <span class="tech-badge">Pollinations AI (Chat)</span>
          <span class="tech-badge">Pollinations Image API</span>
          <span class="tech-badge">Web Speech API</span>
          <span class="tech-badge">Canvas API</span>
          <span class="tech-badge">MediaRecorder API</span>
          <span class="tech-badge">QR Server API</span>
          <span class="tech-badge">HTML5 / CSS3</span>
          <span class="tech-badge">Vanilla JavaScript</span>
        </div>
        <h3 style="margin-top:20px;">💡 چرا رایگان؟</h3>
        <p>
          کوکب تک از API های متن‌باز و عمومی مانند <strong>Pollinations.ai</strong> استفاده می‌کند که به صورت رایگان در دسترس همه قرار دارند.
        </p>
      </div>
    </section>

  </main>

  <footer>
    <p>⭐ کوکب تک — ساخته شده با عشق برای جامعه فارسی‌زبان</p>
    <div class="powered">
      ✨ با کمک <strong style="color:#fff; margin:0 4px;">Qwen AI</strong> — کاملاً متصل به API های هوش مصنوعی
    </div>
  </footer>

</div>

<div class="toast" id="toast"></div>

<script>
// Tab Navigation
document.querySelectorAll('.tab').forEach(tab => {
  tab.addEventListener('click', () => {
    document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
    document.querySelectorAll('.panel').forEach(p => p.classList.remove('active'));
    tab.classList.add('active');
    document.getElementById('panel-' + tab.dataset.tab).classList.add('active');
  });
});

// Toast
function showToast(msg, type = 'success') {
  const toast = document.getElementById('toast');
  toast.textContent = msg;
  toast.className = 'toast show ' + type;
  clearTimeout(toast._timer);
  toast._timer = setTimeout(() => toast.classList.remove('show'), 3000);
}

// Markdown Parser
function parseMarkdown(text) {
  if (!text) return '';
  let html = text
    .replace(/&/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;');
  
  html = html.replace(/