/* PointagePro — Widget chat IA flottant */
#agent-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  border: none;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,122,255,0.4);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
#agent-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,122,255,0.5);
}

#agent-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 350px;
  height: 500px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.14);
  display: flex;
  flex-direction: column;
  z-index: 99998;
  overflow: hidden;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s;
}
#agent-chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#agent-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #007aff;
  color: #fff;
  flex-shrink: 0;
}
#agent-chat-header-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
#agent-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.85;
}
#agent-chat-close:hover { opacity: 1; }

#agent-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
}

.agent-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.agent-msg-user {
  align-self: flex-end;
  background: #007aff;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.agent-msg-bot {
  align-self: flex-start;
  background: #f2f2f7;
  color: #1c1c1e;
  border-bottom-left-radius: 4px;
}

/* Markdown rendu dans les bulles agent */
.agent-msg-bot strong { font-weight: 700; }
.agent-msg-bot ul, .agent-msg-bot ol { margin: 6px 0 6px 16px; padding: 0; }
.agent-msg-bot li { margin: 2px 0; }
.agent-msg-bot table {
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 6px 0;
  width: 100%;
}
.agent-msg-bot th, .agent-msg-bot td {
  border: 1px solid #d1d1d6;
  padding: 4px 7px;
  text-align: left;
}
.agent-msg-bot th { background: #e5e5ea; font-weight: 600; }
.agent-msg-bot code {
  background: #e5e5ea;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.82rem;
}

#agent-chat-thinking {
  align-self: flex-start;
  background: #f2f2f7;
  color: #8e8e93;
  padding: 9px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  font-size: 0.85rem;
  font-style: italic;
  display: none;
}

.agent-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
  width: 100%;
}
.agent-suggestion-btn {
  background: #fff;
  border: 1px solid #007aff;
  color: #007aff;
  border-radius: 10px;
  padding: 7px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.agent-suggestion-btn:hover { background: #f0f6ff; }

#agent-chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e5ea;
  flex-shrink: 0;
  background: #fff;
}
#agent-chat-input {
  flex: 1;
  border: 1px solid #d1d1d6;
  border-radius: 10px;
  padding: 8px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #1c1c1e;
  outline: none;
  resize: none;
  height: 38px;
  line-height: 1.4;
}
#agent-chat-input:focus { border-color: #007aff; box-shadow: 0 0 0 2px rgba(0,122,255,0.15); }
#agent-chat-send {
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
#agent-chat-send:hover { background: #0066dd; }
#agent-chat-send:disabled { background: #c7c7cc; cursor: default; }
