File size: 4,279 Bytes
c42add9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* Variables de couleur et styles de base */
:root {
    --bg-color: #1a1a1a;
    --surface-color: #2c2c2c;
    --primary-color: #ffffff;
    --secondary-color: #a0a0a0;
    --accent-color: #007bff;
    --user-msg-bg: #005cbb;
    --bot-msg-bg: #3a3a3a;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

/* Conteneur principal */
#chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background-color: var(--surface-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* En-tête */
.chat-header {
    padding: 20px;
    background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid #444;
    text-align: center;
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Section pour la clé API */
.api-token-section {
    padding: 16px;
    background-color: rgba(0,0,0,0.15);
    border-bottom: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-token-section label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-color);
}

#hf-token-input {
    width: 100%;
    background-color: #4a4a4a;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-family: 'Inter', sans-serif;
}

#hf-token-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

.api-token-section .warning {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-align: center;
}

/* Zone des messages */
#message-area {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#message-area::-webkit-scrollbar { width: 8px; }
#message-area::-webkit-scrollbar-track { background: var(--surface-color); }
#message-area::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 20px;
    border: 2px solid var(--surface-color);
}

/* Bulles de message */
.message {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message {
    background-color: var(--user-msg-bg);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

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

/* Indicateur de frappe */
.typing-indicator {
    align-self: flex-start;
    display: flex;
    align-items: center;
    padding: 12px 18px;
    background-color: var(--bot-msg-bg);
    border-radius: 20px;
    border-bottom-left-radius: 5px;
}
.typing-indicator span {
    height: 8px; width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Formulaire de saisie */
#input-form {
    display: flex;
    padding: 16px;
    border-top: 1px solid #444;
    gap: 12px;
}

#user-input {
    flex-grow: 1;
    background-color: #4a4a4a;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    color: var(--primary-color);
    resize: none;
    font-family: 'Inter', sans-serif;
}

#user-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

#send-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#send-button:hover:not(:disabled) { background-color: #0056b3; }
#send-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}