File size: 5,252 Bytes
29477ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b71de78
 
 
 
 
 
 
 
 
 
 
 
29477ed
b71de78
 
29477ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b71de78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29477ed
 
 
 
 
 
 
 
 
 
 
 
 
 
b71de78
 
 
 
29477ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
:root {
  --tesco-blue: #00539F;
  --tesco-blue-dark: #003e7e;
  --tesco-red: #EE1C2E;
  --bg-color: #f4f5f7;
  --text-color: #333;
  --chat-bg: #ffffff;
  --user-msg-bg: #00539F;
  --user-msg-text: #ffffff;
  --bot-msg-bg: #f3f3f3;
  --bot-msg-text: #333;
  --input-bg: #ffffff;
  --border-color: #e5e5e5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --chat-bg: #2d2d2d;
    --user-msg-bg: #00539F;
    /* Keep brand color */
    --user-msg-text: #ffffff;
    --bot-msg-bg: #3d3d3d;
    --bot-msg-text: #ffffff;
    --input-bg: #2d2d2d;
    --border-color: #444;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

.app-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
}

/* Chat Interface */
.chat-container {
  width: 100%;
  max-width: 800px;
  height: 100vh;
  /* Full height for mobile feel */
  background-color: var(--chat-bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Header */
.chat-header {
  padding: 1rem;
  background-color: var(--tesco-blue);
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-area {
  background: transparent;
  padding: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--tesco-red);
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 0px white;
  /* Simple Tesco-like text representation */
  background: white;
  padding: 2px 6px;
  border-radius: 2px;
}

.header-title h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.header-title p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Messages Area */
.messages-area {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.message {
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Message Rendering - Markdown Support */
.markdown-body {
  font-size: 0.95rem;
  line-height: 1.5;
}

.markdown-body p {
  margin: 0 0 10px 0;
}

.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 8px 0;
  padding-left: 20px;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-weight: 600;
  margin: 12px 0 8px 0;
  font-size: 1.1em;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child {
  margin-top: 0;
}

.markdown-body strong {
  font-weight: 600;
}

.markdown-body a {
  color: var(--tesco-blue);
  text-decoration: underline;
}

/* User Message specific overrides */
.message.user {
  align-self: flex-end;
  background-color: var(--user-msg-bg);
  color: var(--user-msg-text);
  border-bottom-right-radius: 2px;
}

.message.assistant {
  align-self: flex-start;
  background-color: var(--bot-msg-bg);
  color: var(--bot-msg-text);
  border-bottom-left-radius: 2px;
}

.message.assistant .markdown-body {
  color: var(--bot-msg-text);
}

/* Input Area */
.input-area {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--chat-bg);
  display: flex;
  gap: 0.5rem;
}

.input-field {
  flex: 1;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--tesco-blue);
}

.send-button {
  background-color: var(--tesco-blue);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.send-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.send-button:hover:not(:disabled) {
  background-color: var(--tesco-blue-dark);
}

/* Loading/Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background-color: var(--bot-msg-bg);
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  width: fit-content;
  align-self: flex-start;
}

.dot {
  width: 8px;
  height: 8px;
  background-color: #888;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
  animation-delay: -0.32s;
}

.dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}