File size: 7,994 Bytes
9f069df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* =============================================
   CHAT CARD LAYOUT - Flex container with sticky compose
   ============================================= */

/* Main chat card - flex column layout, transparent background */
.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  height: 100%;
  min-height: 0; /* Allow flex shrinking */
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Chat header - fixed at top, transparent */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  padding-bottom: 12px;
  margin-bottom: 12px;
  background: transparent;
}

.chat-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.chat-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-session {
  min-width: 180px;
}

/* Chat thread - scrollable middle section, transparent */
.chat-thread {
  flex: 1 1 0; /* Grow, shrink, and use 0 base for proper scrolling */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 4px;
  margin: 0 -4px;
  min-height: 0; /* Allow shrinking for flex scroll behavior */
  border-radius: 12px;
  background: transparent;
}

/* Focus mode exit button */
.chat-focus-exit {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 100;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 150ms ease-out,
    color 150ms ease-out,
    border-color 150ms ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chat-focus-exit:hover {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--accent);
}

.chat-focus-exit svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Chat compose - sticky at bottom */
.chat-compose {
  position: sticky;
  bottom: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto; /* Push to bottom of flex container */
  padding: 12px 4px 4px;
  background: linear-gradient(to bottom, transparent, var(--bg) 20%);
  z-index: 10;
}

/* Image attachments preview */
.chat-attachments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--border);
  width: fit-content;
  max-width: 100%;
  align-self: flex-start; /* Don't stretch in flex column parent */
}

.chat-attachment {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.chat-attachment__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chat-attachment__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 150ms ease-out;
}

.chat-attachment:hover .chat-attachment__remove {
  opacity: 1;
}

.chat-attachment__remove:hover {
  background: rgba(220, 38, 38, 0.9);
}

.chat-attachment__remove svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2px;
}

/* Light theme attachment overrides */
:root[data-theme="light"] .chat-attachments {
  background: #f8fafc;
  border-color: rgba(16, 24, 40, 0.1);
}

:root[data-theme="light"] .chat-attachment {
  border-color: rgba(16, 24, 40, 0.15);
  background: #fff;
}

:root[data-theme="light"] .chat-attachment__remove {
  background: rgba(0, 0, 0, 0.6);
}

/* Message images (sent images displayed in chat) */
.chat-message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-message-image {
  max-width: 300px;
  max-height: 200px;
  border-radius: 8px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 150ms ease-out;
}

.chat-message-image:hover {
  transform: scale(1.02);
}

/* User message images align right */
.chat-group.user .chat-message-images {
  justify-content: flex-end;
}

/* Compose input row - horizontal layout */
.chat-compose__row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex: 1;
}

:root[data-theme="light"] .chat-compose {
  background: linear-gradient(to bottom, transparent, var(--bg-content) 20%);
}

.chat-compose__field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
}

/* Hide the "Message" label - keep textarea only */
.chat-compose__field > span {
  display: none;
}

/* Override .field textarea min-height (180px) from components.css */
.chat-compose .chat-compose__field textarea {
  width: 100%;
  height: 40px;
  min-height: 40px;
  max-height: 150px;
  padding: 9px 12px;
  border-radius: 8px;
  overflow-y: auto;
  resize: none;
  white-space: pre-wrap;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
}

.chat-compose__field textarea:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.chat-compose__actions {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.chat-compose .chat-compose__actions .btn {
  padding: 0 16px;
  font-size: 13px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Chat controls - moved to content-header area, left aligned */
.chat-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-controls__session {
  min-width: 140px;
  max-width: 420px;
}

.chat-controls__thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* Icon button style */
.btn--icon {
  padding: 8px !important;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

/* Controls separator */
.chat-controls__separator {
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  margin: 0 8px;
  font-weight: 300;
}

:root[data-theme="light"] .chat-controls__separator {
  color: rgba(16, 24, 40, 0.3);
}

.btn--icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Light theme icon button overrides */
:root[data-theme="light"] .btn--icon {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  color: var(--muted);
}

:root[data-theme="light"] .btn--icon:hover {
  background: #ffffff;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--icon svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-controls__session select {
  padding: 6px 10px;
  font-size: 13px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-controls__thinking {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Light theme thinking indicator override */
:root[data-theme="light"] .chat-controls__thinking {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(16, 24, 40, 0.15);
}

@media (max-width: 640px) {
  .chat-session {
    min-width: 140px;
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }

  .chat-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .chat-controls__session {
    min-width: 120px;
  }
}