| 1 |
#chat-toggle { |
| 2 |
position: fixed; |
| 3 |
bottom: 40px; |
| 4 |
left: 20px; |
| 5 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 6 |
color: white; |
| 7 |
padding: 12px 20px; |
| 8 |
border-radius: 25px; |
| 9 |
cursor: pointer; |
| 10 |
z-index: 9999; |
| 11 |
font-weight: 600; |
| 12 |
font-size: 14px; |
| 13 |
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); |
| 14 |
transition: all 0.3s ease; |
| 15 |
border: none; |
| 16 |
width: fit-content; |
| 17 |
display: inline-block; |
| 18 |
white-space: nowrap; |
| 19 |
} |
| 20 |
|
| 21 |
#chat-toggle:hover { |
| 22 |
transform: translateY(-2px); |
| 23 |
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6); |
| 24 |
} |
| 25 |
|
| 26 |
/* Effet visuel de chargement sur le toggle */ |
| 27 |
#chat-toggle.generating { |
| 28 |
position: fixed; |
| 29 |
animation: toggle-pulse 1.5s ease-in-out infinite; |
| 30 |
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), |
| 31 |
0 0 20px rgba(102, 126, 234, 0.6), |
| 32 |
0 0 40px rgba(102, 126, 234, 0.4); |
| 33 |
transform-origin: left bottom; |
| 34 |
} |
| 35 |
|
| 36 |
@keyframes toggle-pulse { |
| 37 |
|
| 38 |
0%, |
| 39 |
100% { |
| 40 |
transform: scale(1); |
| 41 |
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), |
| 42 |
0 0 20px rgba(102, 126, 234, 0.6), |
| 43 |
0 0 40px rgba(102, 126, 234, 0.4); |
| 44 |
} |
| 45 |
|
| 46 |
50% { |
| 47 |
transform: scale(1.05); |
| 48 |
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), |
| 49 |
0 0 30px rgba(102, 126, 234, 0.8), |
| 50 |
0 0 60px rgba(102, 126, 234, 0.6); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
#chat-box { |
| 55 |
position: fixed; |
| 56 |
bottom: 120px; |
| 57 |
left: 20px; |
| 58 |
width: 450px; |
| 59 |
height: 500px; |
| 60 |
background: white; |
| 61 |
border: none; |
| 62 |
border-radius: 20px; |
| 63 |
display: none; |
| 64 |
flex-direction: column; |
| 65 |
z-index: 9999; |
| 66 |
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); |
| 67 |
overflow: hidden; |
| 68 |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
| 69 |
animation: slideIn 0.3s ease; |
| 70 |
} |
| 71 |
|
| 72 |
#chat-header { |
| 73 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 74 |
color: white; |
| 75 |
padding: 20px; |
| 76 |
text-align: center; |
| 77 |
} |
| 78 |
|
| 79 |
#chat-header h3 { |
| 80 |
margin: 0 0 8px 0; |
| 81 |
font-size: 18px; |
| 82 |
font-weight: 600; |
| 83 |
color: white; |
| 84 |
} |
| 85 |
|
| 86 |
#chat-header .warning-text { |
| 87 |
margin: 0; |
| 88 |
font-size: 12px; |
| 89 |
opacity: 0.9; |
| 90 |
line-height: 1.4; |
| 91 |
color: white; |
| 92 |
} |
| 93 |
|
| 94 |
#chat-messages { |
| 95 |
flex: 1; |
| 96 |
padding: 20px; |
| 97 |
overflow-y: auto; |
| 98 |
font-size: 14px; |
| 99 |
background: #f8f9fa; |
| 100 |
} |
| 101 |
|
| 102 |
#chat-messages .user-message { |
| 103 |
background: #e3f2fd; |
| 104 |
padding: 12px 16px; |
| 105 |
border-radius: 18px; |
| 106 |
margin-bottom: 12px; |
| 107 |
border-bottom-left-radius: 4px; |
| 108 |
max-width: 90%; |
| 109 |
margin-left: auto; |
| 110 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| 111 |
line-height: 1.4; |
| 112 |
min-height: 44px; |
| 113 |
display: flex; |
| 114 |
align-items: center; |
| 115 |
} |
| 116 |
|
| 117 |
#chat-messages .ai-message { |
| 118 |
background: white; |
| 119 |
padding: 12px 16px; |
| 120 |
border-radius: 18px; |
| 121 |
margin-bottom: 12px; |
| 122 |
border-bottom-right-radius: 4px; |
| 123 |
max-width: 90%; |
| 124 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| 125 |
border-left: 3px solid #4caf50; |
| 126 |
line-height: 1.4; |
| 127 |
min-height: 44px; |
| 128 |
display: flex; |
| 129 |
align-items: center; |
| 130 |
} |
| 131 |
|
| 132 |
#chat-messages .ai-message.error { |
| 133 |
border-left-color: #f44336; |
| 134 |
background: #ffebee; |
| 135 |
} |
| 136 |
|
| 137 |
#chat-messages .user-message strong { |
| 138 |
margin-right: 8px; |
| 139 |
} |
| 140 |
|
| 141 |
#chat-messages .ai-message strong { |
| 142 |
margin-right: 8px; |
| 143 |
} |
| 144 |
|
| 145 |
#chat-input { |
| 146 |
border-top: 1px solid #e0e0e0; |
| 147 |
display: flex; |
| 148 |
padding: 15px; |
| 149 |
background: white; |
| 150 |
gap: 8px; |
| 151 |
} |
| 152 |
|
| 153 |
#chat-input textarea { |
| 154 |
flex: 1; |
| 155 |
border: 2px solid #e0e0e0; |
| 156 |
border-radius: 15px; |
| 157 |
padding: 12px 16px; |
| 158 |
font-size: 14px; |
| 159 |
outline: none; |
| 160 |
transition: border-color 0.3s ease; |
| 161 |
resize: none; |
| 162 |
font-family: inherit; |
| 163 |
line-height: 1.4; |
| 164 |
min-height: 60px; |
| 165 |
max-height: 120px; |
| 166 |
} |
| 167 |
|
| 168 |
#chat-input textarea:focus { |
| 169 |
border-color: #667eea; |
| 170 |
} |
| 171 |
|
| 172 |
#chat-input textarea::placeholder { |
| 173 |
color: #999; |
| 174 |
font-style: italic; |
| 175 |
} |
| 176 |
|
| 177 |
#chat-input button { |
| 178 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 179 |
color: white; |
| 180 |
border: none; |
| 181 |
padding: 12px 20px; |
| 182 |
border-radius: 25px; |
| 183 |
cursor: pointer; |
| 184 |
font-weight: 600; |
| 185 |
font-size: 14px; |
| 186 |
transition: all 0.3s ease; |
| 187 |
min-width: 80px; |
| 188 |
} |
| 189 |
|
| 190 |
#chat-input button:hover:not(:disabled) { |
| 191 |
transform: translateY(-1px); |
| 192 |
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4); |
| 193 |
} |
| 194 |
|
| 195 |
#chat-input button:disabled { |
| 196 |
opacity: 0.6; |
| 197 |
cursor: not-allowed; |
| 198 |
transform: none; |
| 199 |
} |
| 200 |
|
| 201 |
#chat-input button.loading { |
| 202 |
position: relative; |
| 203 |
cursor: wait; |
| 204 |
opacity: 0.9; |
| 205 |
font-size: 0px; |
| 206 |
/* Cache le texte original du bouton */ |
| 207 |
} |
| 208 |
|
| 209 |
/* Libellé visible pendant le chargement */ |
| 210 |
#chat-input button.loading::before { |
| 211 |
content: 'Generating…'; |
| 212 |
color: #fff; |
| 213 |
font-size: 14px; |
| 214 |
/* Restaure la taille de police */ |
| 215 |
padding-right: 12px; |
| 216 |
} |
| 217 |
|
| 218 |
/* Spinner moderne à droite du bouton */ |
| 219 |
#chat-input button.loading::after { |
| 220 |
content: ''; |
| 221 |
position: absolute; |
| 222 |
right: 8px; |
| 223 |
top: 50%; |
| 224 |
width: 14px; |
| 225 |
height: 14px; |
| 226 |
margin-top: -7px; |
| 227 |
border-radius: 50%; |
| 228 |
border: 2px solid rgba(255, 255, 255, 0.6); |
| 229 |
border-top-color: #ffffff; |
| 230 |
animation: chat-spin 0.7s linear infinite; |
| 231 |
} |
| 232 |
|
| 233 |
#chat-undo { |
| 234 |
background: #f44336 !important; |
| 235 |
min-width: 60px; |
| 236 |
} |
| 237 |
|
| 238 |
#chat-undo:hover { |
| 239 |
background: #d32f2f !important; |
| 240 |
} |
| 241 |
|
| 242 |
/* Scrollbar personnalisée */ |
| 243 |
#chat-messages::-webkit-scrollbar { |
| 244 |
width: 6px; |
| 245 |
} |
| 246 |
|
| 247 |
#chat-messages::-webkit-scrollbar-track { |
| 248 |
background: #f1f1f1; |
| 249 |
border-radius: 3px; |
| 250 |
} |
| 251 |
|
| 252 |
#chat-messages::-webkit-scrollbar-thumb { |
| 253 |
background: #c1c1c1; |
| 254 |
border-radius: 3px; |
| 255 |
} |
| 256 |
|
| 257 |
#chat-messages::-webkit-scrollbar-thumb:hover { |
| 258 |
background: #a8a8a8; |
| 259 |
} |
| 260 |
|
| 261 |
/* Animation d'apparition */ |
| 262 |
@keyframes slideIn { |
| 263 |
from { |
| 264 |
opacity: 0; |
| 265 |
transform: translateY(20px); |
| 266 |
} |
| 267 |
|
| 268 |
to { |
| 269 |
opacity: 1; |
| 270 |
transform: translateY(0); |
| 271 |
} |
| 272 |
} |
| 273 |
|
| 274 |
/* Animation du spinner */ |
| 275 |
@keyframes chat-spin { |
| 276 |
from { |
| 277 |
transform: rotate(0deg); |
| 278 |
} |
| 279 |
|
| 280 |
to { |
| 281 |
transform: rotate(360deg); |
| 282 |
} |
| 283 |
} |
| 284 |
|
| 285 |
/* Responsive */ |
| 286 |
@media (max-width: 768px) { |
| 287 |
#chat-box { |
| 288 |
width: calc(100vw - 40px); |
| 289 |
left: 20px; |
| 290 |
right: 20px; |
| 291 |
} |
| 292 |
|
| 293 |
#chat-toggle { |
| 294 |
left: 20px; |
| 295 |
right: 20px; |
| 296 |
text-align: center; |
| 297 |
} |
| 298 |
} |