/* Ollama Chatbot Widget Styles */

.ollama-chatbot-toggle {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	color: white;
	font-size: 28px;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transition: all 0.3s ease;
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ollama-chatbot-toggle:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ollama-chatbot-toggle.active {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ollama-chatbot-container {
	position: fixed;
	bottom: 90px;
	right: 20px;
	width: 380px;
	max-height: 600px;
	background: white;
	border-radius: 12px;
	box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
	display: none;
	flex-direction: column;
	z-index: 9999;
	overflow: hidden;
	animation: slideUp 0.3s ease;
}

.ollama-chatbot-container.active {
	display: flex;
}

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

.chatbot-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #e0e0e0;
}

.chatbot-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}

.chatbot-close {
	background: none;
	border: none;
	color: white;
	font-size: 24px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: transform 0.2s;
}

.chatbot-close:hover {
	transform: rotate(90deg);
}

.chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #f8f9fa;
	min-height: 300px;
	max-height: 450px;
}

.chatbot-message {
	display: flex;
	gap: 8px;
	animation: fadeIn 0.3s ease;
}

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

.chatbot-message.user {
	justify-content: flex-end;
}

.chatbot-message.bot {
	justify-content: flex-start;
}

.chatbot-message-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: bold;
	flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
	background: #667eea;
	color: white;
	order: 2;
}

.chatbot-message.bot .chatbot-message-avatar {
	background: #e0e0e0;
	color: #333;
}

.chatbot-message-content {
	max-width: 70%;
	padding: 10px 14px;
	border-radius: 8px;
	word-wrap: break-word;
	line-height: 1.4;
	font-size: 14px;
}

.chatbot-message.user .chatbot-message-content {
	background: #667eea;
	color: white;
	border-bottom-right-radius: 2px;
}

.chatbot-message.bot .chatbot-message-content {
	background: white;
	color: #333;
	border: 1px solid #e0e0e0;
	border-bottom-left-radius: 2px;
}

.chatbot-typing {
	display: flex;
	gap: 4px;
	align-items: center;
}

.chatbot-typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #667eea;
	animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typing {
	0%, 60%, 100% {
		opacity: 0.5;
		transform: translateY(0);
	}
	30% {
		opacity: 1;
		transform: translateY(-10px);
	}
}

.chatbot-input-area {
	display: flex;
	gap: 8px;
	padding: 12px;
	background: white;
	border-top: 1px solid #e0e0e0;
}

#chatbot-input,
#chatbot-input-sidebar {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.2s;
	color: #333;
	background-color: #ffffff;
}

#chatbot-input::placeholder,
#chatbot-input-sidebar::placeholder {
	color: #999;
}

#chatbot-input:focus,
#chatbot-input-sidebar:focus {
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-send {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	border-radius: 6px;
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s;
	font-weight: 600;
}

.chatbot-send:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.chatbot-send:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Sidebar widget variant */
.ollama-chatbot-sidebar {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: white;
}

#chatbot-messages-sidebar {
	min-height: 300px;
}

/* Responsive design */
@media (max-width: 600px) {
	.ollama-chatbot-container {
		width: calc(100% - 40px);
		bottom: 80px;
		max-height: 70vh;
	}

	.chatbot-message-content {
		max-width: 85%;
	}

	.ollama-chatbot-toggle {
		bottom: 15px;
		right: 15px;
		width: 56px;
		height: 56px;
		font-size: 24px;
	}
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
	width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
	background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
	background: #999;
}
