/* ═══════════════════════════════════════════════════
   2easy — chat.css
   ═══════════════════════════════════════════════════ */

/* ── FLOATING BUTTON ── */
#chat-fab {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 1000;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--orange); border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(232,102,10,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: visible;
}
#chat-fab:hover { transform: scale(1.1); box-shadow: 0 8px 32px rgba(232,102,10,0.6); }
#chat-fab svg { transition: transform 0.3s; }
#chat-fab.open svg { transform: rotate(45deg); }
.chat-fab-status {
  position: absolute; top: 2px; right: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--dark); background: #4CAF50;
  transition: background 0.3s;
}
.chat-fab-status.offline { background: #888; }
.chat-fab-status.checking { background: #FFC107; animation: pulse 1s infinite; }

/* ── CHAT PANEL ── */
#chat-panel {
  position: fixed; bottom: 6rem; right: 2rem; z-index: 999;
  width: 380px; max-height: 520px;
  display: flex; flex-direction: column;
  background: var(--dark-2); border: 0.5px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(16px) scale(0.96);
  opacity: 0; pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
}
#chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1; pointer-events: all;
}

/* ── HEADER ── */
.chat-header {
  background: var(--dark-3); padding: 1rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 0.5px solid var(--border); flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-header-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--orange-dim); border: 0.5px solid var(--border-orange);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-header-name { font-family: var(--font-display); font-size: 0.92rem; font-weight: 700; }
.chat-header-status {
  font-size: 0.7rem; display: flex; align-items: center; gap: 5px; margin-top: 1px;
}
.chat-status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #4CAF50;
  animation: pulse 2s infinite; transition: background 0.3s;
}
.chat-status-dot.offline { background: #888; animation: none; }
.chat-status-dot.checking { background: #FFC107; }
.chat-status-text { color: #4CAF50; transition: color 0.3s; }
.chat-status-text.offline { color: #888; }
.chat-close { background: none; border: none; color: var(--text-dim); padding: 4px; border-radius: 6px; transition: color 0.2s, background 0.2s; }
.chat-close:hover { color: var(--text); background: var(--dark-4); }

/* ── MESSAGES ── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.msg { display: flex; gap: 8px; align-items: flex-end; animation: msg-in 0.2s ease; }
@keyframes msg-in { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.msg.user { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 80%; padding: 0.65rem 0.9rem; border-radius: 14px;
  font-size: 0.85rem; line-height: 1.5;
}
.msg.bot .msg-bubble { background: var(--dark-3); border: 0.5px solid var(--border); color: var(--text); border-radius: 14px 14px 14px 2px; }
.msg.user .msg-bubble { background: var(--orange); color: white; border-radius: 14px 14px 2px 14px; }
.msg-avatar {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--orange-dim); border: 0.5px solid var(--border-orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: var(--orange);
}

/* ── TYPING ── */
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 10px 14px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); display: inline-block; animation: dot-bounce 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

/* ── SUGGESTIONS ── */
.chat-suggestions { padding: 0 0.8rem 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-suggestion {
  background: var(--dark-4); border: 0.5px solid var(--border);
  border-radius: 20px; padding: 5px 12px;
  font-size: 0.75rem; color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.chat-suggestion:hover { border-color: var(--border-orange); color: var(--text); }

/* ── INPUT ── */
.chat-input-area {
  padding: 0.8rem; border-top: 0.5px solid var(--border);
  display: flex; gap: 0.5rem; align-items: flex-end; flex-shrink: 0;
  background: var(--dark-3);
}
#chatInput {
  flex: 1; background: var(--dark-4); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 0.65rem 0.9rem;
  color: var(--text); font-family: var(--font-body); font-size: 0.85rem;
  resize: none; min-height: 38px; max-height: 120px;
  transition: border-color 0.2s;
}
#chatInput:focus { outline: none; border-color: var(--border-orange); }
#chatInput::placeholder { color: var(--text-dim); }
#chatSend {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--orange); border: none; color: white;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
#chatSend:hover { background: var(--orange-light); transform: scale(1.05); }
#chatSend:disabled { background: var(--dark-4); color: var(--text-dim); transform: none; }

/* ── OFFLINE BANNER ── */
.chat-offline-banner {
  background: rgba(136,136,136,0.1); border: 0.5px solid rgba(136,136,136,0.2);
  margin: 0.5rem 0.8rem; border-radius: 8px;
  padding: 0.6rem 0.9rem; font-size: 0.78rem; color: var(--text-dim);
  text-align: center; display: none;
}
.chat-offline-banner.visible { display: block; }

@media (max-width: 480px) {
  #chat-panel { width: calc(100vw - 2rem); right: 1rem; }
  #chat-fab { right: 1rem; bottom: 1rem; }
}
/* ── BOUTON NOUVELLE CONVERSATION ── */
.chat-clear-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: 0.5px solid var(--border);
  border-radius: 8px; padding: 4px 9px;
  font-size: 0.7rem; color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.chat-clear-btn:hover { border-color: var(--border-orange); color: var(--text); background: var(--dark-4); }
.chat-clear-btn svg { flex-shrink: 0; }

/* ── SUGGESTIONS v2 (icône séparée) ── */
.chat-suggestion { display: flex; align-items: center; gap: 6px; }
.sug-icon { font-size: 0.85rem; flex-shrink: 0; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
