/* POC Chatbot — styles du widget. Variables à surcharger dans le thème si besoin. */
.poc-chatbot {
	--pcb-primary: #0b2545;
	--pcb-accent: #e07a1f;
	--pcb-bg: #ffffff;
	--pcb-muted: #5b6675;
	--pcb-user: #e4ecf6;
	--pcb-bot: #f3f5f8;
	--pcb-public: #2e7d32;
	--pcb-private: #b03a2e;
	--pcb-radius: 12px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: #1f2937;
	box-sizing: border-box;
}
.poc-chatbot *, .poc-chatbot *::before, .poc-chatbot *::after { box-sizing: inherit; }

/* Modes d'affichage */
.poc-chatbot--inline .poc-chatbot__panel { width: 100%; max-width: 720px; height: 520px; margin: 1.5em 0; }
.poc-chatbot--floating { position: fixed; right: 20px; bottom: 20px; z-index: 99990; }
.poc-chatbot--floating .poc-chatbot__panel {
	width: min(380px, calc(100vw - 32px));
	height: min(560px, calc(100vh - 100px));
	box-shadow: 0 12px 32px rgba(11, 37, 69, 0.22);
}
.poc-chatbot__panel[hidden], .poc-chatbot__launcher[hidden] { display: none !important; }

.poc-chatbot__launcher {
	width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--pcb-primary); color: #fff; font-size: 26px;
	box-shadow: 0 8px 20px rgba(11, 37, 69, 0.3);
}
.poc-chatbot__launcher:focus-visible { outline: 3px solid var(--pcb-accent); outline-offset: 3px; }

.poc-chatbot__panel {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--pcb-bg); border: 1px solid #d6dde7; border-radius: var(--pcb-radius);
}

/* En-tête */
.poc-chatbot__header {
	display: flex; align-items: center; gap: 8px; padding: 10px 12px;
	background: var(--pcb-primary); color: #fff;
}
.poc-chatbot__title { font-weight: 700; margin-right: auto; }
.poc-chatbot__badge {
	font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #fff;
}
.poc-chatbot__badge--public { color: var(--pcb-public); }
.poc-chatbot__badge--private { color: var(--pcb-private); }
.poc-chatbot__badge--demo { color: var(--pcb-accent); }
.poc-chatbot__badge[hidden] { display: none; }
.poc-chatbot__icon-btn {
	background: transparent; border: 0; color: #fff; font-size: 20px; line-height: 1;
	width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
}
.poc-chatbot__icon-btn:hover, .poc-chatbot__icon-btn:focus-visible { background: rgba(255, 255, 255, 0.15); outline: none; }

/* Messages */
.poc-chatbot__messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.poc-chatbot__msg { display: flex; flex-direction: column; max-width: 88%; }
.poc-chatbot__msg--user { align-self: flex-end; }
.poc-chatbot__msg--bot, .poc-chatbot__msg--error { align-self: flex-start; }
.poc-chatbot__bubble { padding: 8px 12px; border-radius: var(--pcb-radius); white-space: pre-wrap; word-wrap: break-word; }
.poc-chatbot__msg--user .poc-chatbot__bubble { background: var(--pcb-user); border-bottom-right-radius: 4px; }
.poc-chatbot__msg--bot .poc-chatbot__bubble { background: var(--pcb-bot); border-bottom-left-radius: 4px; }
.poc-chatbot__msg--error .poc-chatbot__bubble { background: #fdecea; color: var(--pcb-private); }
.poc-chatbot__bubble--md { white-space: normal; }
.poc-chatbot__bubble--md p { margin: 0 0 0.5em; }
.poc-chatbot__bubble--md p:last-child, .poc-chatbot__bubble--md ul:last-child, .poc-chatbot__bubble--md ol:last-child { margin-bottom: 0; }
.poc-chatbot__bubble--md ul, .poc-chatbot__bubble--md ol { margin: 0 0 0.5em 1.2em; padding: 0; }
.poc-chatbot__bubble--md code { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; background: rgba(0,0,0,0.06); padding: 0 3px; border-radius: 3px; }
.poc-chatbot__md-title { font-weight: 700; }
.poc-chatbot__msg--thinking .poc-chatbot__bubble { color: var(--pcb-muted); font-style: italic; }

.poc-chatbot__sources { margin-top: 6px; font-size: 13px; color: var(--pcb-muted); }
.poc-chatbot__sources-title { font-weight: 600; }
.poc-chatbot__sources ul { margin: 2px 0 0 18px; padding: 0; }
.poc-chatbot__sources a { color: var(--pcb-primary); }

/* Saisie */
.poc-chatbot__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e1e6ed; }
.poc-chatbot__input {
	flex: 1; resize: none; font: inherit; padding: 8px 10px;
	border: 1px solid #c9d3e0; border-radius: 8px;
}
.poc-chatbot__input:focus { outline: 2px solid var(--pcb-accent); outline-offset: 0; }
.poc-chatbot__send {
	border: 0; border-radius: 8px; padding: 0 14px; cursor: pointer; font-weight: 600;
	background: var(--pcb-accent); color: #fff;
}
.poc-chatbot__send:disabled, .poc-chatbot__input:disabled { opacity: 0.6; cursor: wait; }
