/**
 * LLM Demo - Styles
 * Clone visuel d'aegis_demo. Mêmes classes pour partager la cohérence
 * graphique et les sélecteurs JS du chat.
 *
 * @version 1.0.0
 * @date    2026.05.05
 */

.aegis-demo-container {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
	font-family: 'Ropa Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.aegis-header {
	text-align: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--border-dark, #333);
}

.aegis-logo {
	width: 80px;
	height: 80px;
	margin-bottom: 10px;
}

.aegis-header h2 {
	margin: 0 0 5px 0;
	color: var(--primary-color, #FFC735);
	font-size: 1.8em;
}

.aegis-subtitle {
	margin: 0;
	color: var(--text-muted, #888);
	font-size: 0.95em;
}

.chat_history {
	background: var(--card-bg, #232323);
	border: 1px solid var(--border-dark, #333);
	border-radius: var(--border-radius, 8px);
	padding: 20px;
	min-height: 300px;
	max-height: 500px;
	overflow-y: auto;
	margin-bottom: 20px;
}

.chat_message {
	display: flex;
	gap: 12px;
	margin-bottom: 16px;
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.message_user {
	flex-direction: row-reverse;
}

.message_user .content {
	background: var(--primary-color, #FFC735);
	color: #000;
	border-radius: 18px 18px 4px 18px;
}

.message_assistant .content {
	background: var(--frame-bg, #2F3235);
	color: var(--text-primary, #fff);
	border-radius: 18px 18px 18px 4px;
}

.chat_message .content {
	padding: 12px 16px;
	max-width: 75%;
	line-height: 1.5;
}

.chat_message .content pre {
	margin: 0;
	white-space: pre-wrap;
	word-wrap: break-word;
	font-family: inherit;
}

.chat_message .content p {
	margin: 0 0 0.5em 0;
}

.chat_message .content p:last-child {
	margin-bottom: 0;
}

.chat_message .content code {
	background: rgba(0,0,0,0.3);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: var(--font-mono, monospace);
	font-size: 0.9em;
}

.chat_message .content pre code {
	display: block;
	padding: 12px;
	overflow-x: auto;
}

.chat_message .avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.system_message {
	justify-content: center;
}

.system_message p {
	background: transparent;
	color: var(--text-muted, #888);
	font-style: italic;
	text-align: center;
	padding: 10px;
}

.content .error {
	color: var(--error-color, #ff4500);
}

.cursor {
	animation: blink 1s infinite;
}

@keyframes blink {
	0%, 50%   { opacity: 1; }
	51%, 100% { opacity: 0; }
}

.loader_spinner {
	text-align: center;
	padding: 20px;
	color: var(--text-muted, #888);
}

.spinner {
	width: 30px;
	height: 30px;
	border: 3px solid var(--border-dark, #333);
	border-top-color: var(--primary-color, #FFC735);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 10px;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.input_wrapper {
	display: flex;
	gap: 10px;
	background: var(--card-bg, #232323);
	border: 1px solid var(--border-dark, #333);
	border-radius: var(--border-radius, 8px);
	padding: 10px;
}

#prompt_input {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--text-primary, #fff);
	font-family: inherit;
	font-size: 1em;
	resize: none;
	outline: none;
	min-height: 24px;
	max-height: 150px;
}

#prompt_input::placeholder {
	color: var(--text-muted, #888);
}

.btn_send {
	background: var(--primary-color, #FFC735);
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.btn_send:hover:not(:disabled) {
	background: var(--primary-hover, #E6B330);
	transform: scale(1.05);
}

.btn_send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn_send .btn_icon {
	font-size: 1.2em;
	color: #000;
}

.input_footer {
	display: flex;
	justify-content: space-between;
	padding: 8px 4px 0;
	font-size: 0.8em;
	color: var(--text-muted, #666);
}

.char_count {
	font-family: var(--font-mono, monospace);
}

.chat_history::-webkit-scrollbar {
	width: 8px;
}

.chat_history::-webkit-scrollbar-track {
	background: var(--body-bg-start, #262929);
}

.chat_history::-webkit-scrollbar-thumb {
	background: var(--border-color, #666);
	border-radius: 4px;
}

.chat_history::-webkit-scrollbar-thumb:hover {
	background: var(--text-muted, #888);
}

@media (max-width: 600px) {
	.aegis-demo-container {
		padding: 10px;
	}

	.chat_history {
		min-height: 250px;
		max-height: 400px;
		padding: 12px;
	}

	.chat_message .content {
		max-width: 85%;
		padding: 10px 14px;
	}

	.chat_message .avatar {
		width: 32px;
		height: 32px;
	}

	.aegis-logo {
		width: 60px;
		height: 60px;
	}
}
