.a8csp-chatbot {
	--a8csp-chatbot-primary-color: #007cba;
	--a8csp-chatbot-primary-color-hover: #005a87;
	--a8csp-chatbot-primary-color-focus: rgba(0, 124, 186, 0.1);
	
	max-width: 600px;
	margin: 20px auto;
	border: 1px solid #e1e5e9;
	border-radius: 12px;
	padding: 0;
	background: #ffffff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#a8csp-chat-history {
	overflow-y: auto;
	padding: 20px;
	margin: 0;
	background: #f8f9fa;
	border-radius: 12px 12px 0 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: 500px;
}

#a8csp-chat-history::-webkit-scrollbar {
	width: 6px;
}

#a8csp-chat-history::-webkit-scrollbar-track {
	background: transparent;
}

#a8csp-chat-history::-webkit-scrollbar-thumb {
	background: #c1c7cd;
	border-radius: 3px;
}

.a8csp-chat-message {
	max-width: 80%;
	padding: 12px 16px;
	border-radius: 18px;
	margin: 4px 0;
	line-height: 1.4;
	word-wrap: break-word;
	animation: fadeIn 0.3s ease-in;
}

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

.user-message {
	background: var(--a8csp-chatbot-primary-color);
	color: white;
	align-self: flex-end;
	margin-left: auto;
	border-bottom-right-radius: 6px;
}

.user-message strong {
	display: none; /* Hide "User:" label for cleaner look */
}

.bot-message {
	background: #ffffff;
	color: #2c3e50;
	align-self: flex-start;
	margin-right: auto;
	border: 1px solid #e1e5e9;
	border-bottom-left-radius: 6px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	
	strong {
		color: var(--a8csp-chatbot-primary-color);
		font-weight: 600;
	}

	a {
		color: var(--a8csp-chatbot-primary-color);
		text-decoration: underline;
	}
	
	a:hover {
		color: var(--a8csp-chatbot-primary-color-hover);
	}
}


.bot-message.error {
	background: #fee;
	border-color: #fcc;
	color: #c33;
}

.bot-message.error strong {
	color: #c33;
}

#a8csp-chat-form {
	padding: 20px;
	background: #ffffff;
	border-radius: 0 0 12px 12px;
	border-top: 1px solid #e1e5e9;
	display: flex;
	gap: 12px;
	align-items: center;

	textarea {
		flex: 1;
		min-height: 44px;
		max-height: 120px;
		padding: 12px 16px;
		border: 1px solid #e1e5e9;
		border-radius: 22px;
		resize: none;
		font-family: inherit;
		font-size: 14px;
		line-height: 1.4;
		outline: none;
		transition: border-color 0.2s ease;
	}
	
	textarea:focus {
		border-color: var(--a8csp-chatbot-primary-color);
		box-shadow: 0 0 0 2px var(--a8csp-chatbot-primary-color-focus);
	}
	
	textarea::placeholder {
		color: #8e9aaf;
	}
	
	button {
		background: var(--a8csp-chatbot-primary-color);
		color: white;
		border: none;
		border-radius: 50%;
		width: 44px;
		height: 44px;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 16px;
		font-weight: 600;
		transition: all 0.2s ease;
		flex-shrink: 0;
	}
	
	button .dashicons {
		font-size: 18px;
		width: 18px;
		height: 18px;
	}
	
	button:hover {
		background: var(--a8csp-chatbot-primary-color-hover);
		transform: scale(1.05);
	}
	
	button:active {
		transform: scale(0.95);
	}
	
	button:disabled {
		background: #c1c7cd;
		cursor: not-allowed;
		transform: none;
	}
}


.a8csp-chat-editor-note {
	padding: 15px;
	text-align: center;
	font-size: 14px;
	color: #666;
	font-style: italic;
	border-top: 1px solid #e1e5e9;
}

/* Typing indicator animation */
.typing-indicator {
	opacity: 0.8;
}

.typing-dots {
	display: inline-block;
	span {
		display: inline-block;
		width: 4px;
		height: 4px;
		border-radius: 50%;
		background-color: var(--a8csp-chatbot-primary-color);
		margin: 0 1px;
		animation: typingDots 1.4s infinite ease-in-out;
	}
	span:nth-child(1) {
		animation-delay: -0.32s;
	}
	
	span:nth-child(2) {
		animation-delay: -0.16s;
	}
	
	span:nth-child(3) {
		animation-delay: 0s;
	}
}



@keyframes typingDots {
	0%, 80%, 100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}
