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
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
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AskLAQ Assistant</title>
    <!-- Leaflet CSS -->
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/>>
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
    <!-- Custom CSS -->
    <style>
        :root {
            /* ChatGPT inspired color palette */
            --bg-color: #343541;
            --chat-bg: #444654;
            --text-color: #ECECF1;
            --input-bg: #40414F;
            --border-color: rgba(255,255,255,0.1);
            --accent-color: #10A37F;
            --accent-hover: #1A7F64;
            --bot-icon-bg: #10A37F;
            --user-icon-bg: #5436DA;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Inter', sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            display: flex;
            height: 100vh;
            overflow: hidden;
            flex-direction: column;
        }

        /* Header */
        header {
            padding: 1rem 2rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background-color: var(--bg-color);
            z-index: 10;
        }

        header h1 {
            font-size: 1.2rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .status-container {
            font-size: 0.85rem;
            color: #ccc;
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .status-badge {
            background: var(--chat-bg);
            padding: 4px 10px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
        }

        /* Chat Container */
        .chat-container {
            flex: 1;
            overflow-y: auto;
            scroll-behavior: smooth;
        }

        .message-row {
            padding: 1.5rem 0;
            border-bottom: 1px solid rgba(0,0,0,0.1);
        }

        .message-row.bot {
            background-color: var(--chat-bg);
            border-bottom: 1px solid rgba(0,0,0,0.2);
        }

        .message-content {
            max-width: 800px;
            margin: 0 auto;
            display: flex;
            gap: 1.5rem;
            padding: 0 1rem;
        }

        .avatar {
            width: 30px;
            height: 30px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .avatar.user { background-color: var(--user-icon-bg); }
        .avatar.bot { background-color: var(--bot-icon-bg); }

        .message-body {
            flex: 1;
            line-height: 1.6;
            font-size: 1rem;
            overflow-wrap: break-word;
        }

        /* Rich Content Elements */
        .rich-content {
            margin-top: 1rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        /* Service Card */
        .service-card {
            background-color: var(--bg-color);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .service-info h3 {
            font-size: 1.1rem;
            margin-bottom: 0.3rem;
            font-weight: 600;
        }

        .service-info p {
            font-size: 0.9rem;
            color: #aaa;
        }

        .btn {
            background-color: var(--accent-color);
            color: white;
            border: none;
            padding: 0.6rem 1rem;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: background 0.2s ease;
            font-size: 0.9rem;
            white-space: nowrap;
        }

        .btn:hover { background-color: var(--accent-hover); }

        .btn-outline {
            background-color: transparent;
            border: 1px solid var(--border-color);
        }
        .btn-outline:hover {
            background-color: rgba(255,255,255,0.05);
        }

        .btn-nav {
            background-color: #2563EB; /* A distinct blue */
            color: white;
        }
        .btn-nav:hover {
            background-color: #1D4ED8;
        }

        .service-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        /* Map Container */
        .map-container {
            height: 250px;
            width: 100%;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            z-index: 1; /* Keep map behind header/input */
        }

        /* Recommendations */
        .recs-container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 1rem;
        }

        .rec-chip {
            background-color: var(--bg-color);
            border: 1px solid var(--border-color);
            color: var(--text-color);
            padding: 0.5rem 1rem;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.2s ease;
        }

        .rec-chip:hover {
            background-color: rgba(255,255,255,0.1);
            border-color: var(--accent-color);
        }

        /* Analytics Data */
        .analytics-data {
            font-size: 0.85rem;
            color: #888;
            margin-top: 1rem;
            display: flex;
            gap: 15px;
            padding-top: 0.8rem;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }
        
        .analytics-data span {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        /* Input Area */
        .input-area {
            padding: 2rem;
            background: linear-gradient(180deg, transparent, var(--bg-color) 20%);
        }

        .input-form {
            max-width: 800px;
            margin: 0 auto;
            position: relative;
            display: flex;
            align-items: flex-end;
            background-color: var(--input-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            box-shadow: 0 0 15px rgba(0,0,0,0.1);
            padding: 8px;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }
        
        .input-form.focused {
            border-color: rgba(255,255,255,0.2);
            box-shadow: 0 0 15px rgba(0,0,0,0.2);
        }

        .input-form textarea {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--text-color);
            padding: 8px 12px;
            font-size: 1rem;
            resize: none;
            outline: none;
            max-height: 200px;
            overflow-y: auto;
            min-height: 24px;
            line-height: 1.5;
        }

        .send-btn {
            background-color: var(--accent-color);
            color: white;
            border: none;
            border-radius: 8px;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.2s ease;
            margin-bottom: 2px;
            margin-right: 4px;
            flex-shrink: 0;
        }

        .send-btn[disabled] {
            background-color: transparent;
            color: #666;
            cursor: not-allowed;
        }

        .send-btn:not([disabled]):hover {
            background-color: var(--accent-hover);
        }

        /* Loading Dots */
        .typing-indicator {
            display: inline-flex;
            gap: 4px;
            padding: 4px 0;
        }
        
        .typing-dot {
            width: 6px;
            height: 6px;
            background-color: #888;
            border-radius: 50%;
            animation: typing 1.4s infinite ease-in-out both;
        }

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

        @keyframes typing {
            0%, 80%, 100% { transform: scale(0); }
            40% { transform: scale(1); }
        }

        /* Markdown-like formatting helpers */
        .message-body strong { font-weight: 600; color: #fff; }
        .message-body p { margin-bottom: 0.8rem; }
        .message-body p:last-child { margin-bottom: 0; }
        .message-body a { color: var(--accent-color); text-decoration: none; }
        .message-body a:hover { text-decoration: underline; }

        /* Custom scrollbar */
        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

        /* Responsive refinements */
        @media (max-width: 768px) {
            .input-area { padding: 1rem; }
            .message-content { padding: 0 0.5rem; gap: 1rem; }
            .service-card { flex-direction: column; align-items: flex-start; }
            header { padding: 1rem; }
            .status-container { display: none; } /* Hide statuses on very small screens to save space */
        }

        .survey-link {
            text-align: center;
            margin-top: 12px;
            font-size: 0.8rem;
            color: #888;
        }

        .survey-link a {
            color: #888;
            text-decoration: none;
            transition: color 0.2s;
        }

        .survey-link a:hover {
            color: var(--accent-color);
            text-decoration: underline;
        }

        /* Modal Styles */
        .modal {
            display: none; 
            position: fixed; 
            z-index: 1000; 
            left: 0;
            top: 0;
            width: 100%; 
            height: 100%; 
            background-color: rgba(0,0,0,0.8); 
        }

        .modal-content {
            background-color: var(--chat-bg);
            margin: 5vh auto; 
            padding: 20px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            width: 90%; 
            max-width: 1000px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        }

        .modal-content h2 {
            margin-top: 0;
            margin-bottom: 15px;
            font-weight: 500;
        }

        .close-modal {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }

        .close-modal:hover {
            color: white;
        }
    </style>
</head>
<body>

    <header>
        <h1>
            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path><path d="M21 8a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2"></path></svg>
            AskLAQ
        </h1>
        <div class="status-container">
            <button id="global-map-btn" class="btn btn-outline" style="padding: 4px 10px; font-size: 0.8rem; margin-right: 10px;">🗺️ Carte des Services</button>
            <div class="status-badge" id="global-intent">Intent: En attente</div>
            <div class="status-badge" id="global-confidence">Confiance: --%</div>
        </div>
    </header>

    <div class="chat-container" id="chat">
        <!-- Initial Message -->
        <div class="message-row bot">
            <div class="message-content">
                <div class="avatar bot">
                    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path><path d="M7 10v4"></path><path d="M11 10v4"></path></svg>
                </div>
                <div class="message-body">
                    <p>Bonjour ! Je suis l'assistant <strong>AskLAQ</strong>.</p>
                    <p>Je suis prêt à analyser vos questions et à vous orienter vers les meilleurs services. Comment puis-je vous aider aujourd'hui ?</p>
                </div>
            </div>
        </div>
    </div>

    <div class="input-area">
        <div class="input-form" id="input-container">
            <textarea id="question" rows="1" placeholder="Envoyer un message à AskLAQ..."></textarea>
            <button id="sendBtn" class="send-btn" disabled>
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
            </button>
        </div>
        <div class="survey-link">
            AskLAQ peut faire des erreurs. <a href="https://docs.google.com/forms/d/e/1FAIpQLSeU80CFppkSmMxCB6K2opel8MSc0Qi8QfKvQtXlIXeHfX7_TQ/viewform?fbzx=9108896931053451286" target="_blank">Aidez-nous à l'améliorer avec ce questionnaire de satisfaction</a>.
        </div>
    </div>

    <!-- Global Map Modal -->
    <div id="global-map-modal" class="modal">
        <div class="modal-content">
            <span class="close-modal" id="close-modal-span">&times;</span>
            <h2>Carte Globale des Services</h2>
            <div id="global-map" style="height: 60vh; width: 100%; border-radius: 8px;"></div>
        </div>
    </div>

    <!-- Leaflet JS -->
    <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
    <!-- Custom JS -->
    <script src="/static/script.js"></script>
</body>
</html>