/* ─── Chatbot flottant ─── */

#chatbot-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #4ABFBF;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: background 0.2s, transform 0.2s;
}
#chatbot-toggle:hover { background: #3aafaf; transform: scale(1.07); }
#chatbot-toggle svg { width: 28px; height: 28px; fill: #fff; }
#chatbot-toggle .badge {
  position: absolute;
  top: 2px; right: 2px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

#chatbot-window {
  position: fixed;
  bottom: 98px;
  right: 28px;
  width: 340px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}
#chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

#chatbot-header {
  background: #4ABFBF;
  color: #fff;
  padding: 16px 18px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#chatbot-header .avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
#chatbot-header .info strong { display: block; font-size: 15px; }
#chatbot-header .info span { font-size: 12px; opacity: 0.85; }
#chatbot-header button {
  margin-left: auto;
  background: none; border: none;
  color: #fff; font-size: 22px;
  cursor: pointer; line-height: 1;
  opacity: 0.8;
}
#chatbot-header button:hover { opacity: 1; }

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cb-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
}
.cb-msg.bot {
  background: #f0f7f7;
  color: #2c3e50;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.cb-msg.user {
  background: #4ABFBF;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.cb-suggestions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}
.cb-suggestion-btn {
  background: #fff;
  border: 1.5px solid #4ABFBF;
  color: #2c8f8f;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.cb-suggestion-btn:hover {
  background: #4ABFBF;
  color: #fff;
}

.cb-back-btn {
  background: none;
  border: none;
  color: #4ABFBF;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  align-self: flex-start;
}

#chatbot-input-area {
  padding: 10px 12px 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
}
#chatbot-input {
  flex: 1;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
#chatbot-input:focus { border-color: #4ABFBF; }
#chatbot-send {
  background: #4ABFBF;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
#chatbot-send:hover { background: #3aafaf; }
#chatbot-send svg { width: 16px; height: 16px; fill: #fff; }

@media (max-width: 400px) {
  #chatbot-window { width: calc(100vw - 20px); right: 10px; bottom: 88px; }
  #chatbot-toggle { right: 16px; bottom: 16px; }
}
