/* ============================================
   AI ASSISTANT CHAT BUBBLE STYLES
   ============================================ */

/* Floating toggle button - Icon only vertical tab */
.ai-chat-toggle {
	position: fixed;
	top: calc(50% - 30px);
	right: 0;
	width: 40px;
	height: 48px;
	border-radius: 8px 0 0 8px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	border-right: none;
	color: white;
	font-size: 20px;
	cursor: pointer;
	box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	z-index: 1039;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 8px;
}

.ai-chat-toggle:hover {
	width: 45px;
	box-shadow: -4px 0 15px rgba(102, 126, 234, 0.3);
}

.ai-chat-toggle:active {
	width: 38px;
}

/* Offcanvas customization */
.ai-chat-offcanvas {
	width: 420px !important;
	max-width: 90vw;
}

/* Chat header */
.ai-chat-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.ai-chat-header .offcanvas-title i {
	font-size: 20px;
}

/* Messages container */
.ai-chat-messages {
	overflow-y: auto;
	padding: 16px;
	background: #f8f9fa;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Individual messages */
.ai-message {
	display: flex;
	max-width: 85%;
}

.ai-message-user {
	align-self: flex-end;
}

.ai-message-assistant {
	align-self: flex-start;
}

.ai-message-content {
	padding: 12px 16px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
}

.ai-message-user .ai-message-content {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border-bottom-right-radius: 4px;
}

.ai-message-assistant .ai-message-content {
	background: white;
	color: #333;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Links in AI messages */
.ai-message-content .ai-link {
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
	border-bottom: 1px dashed #667eea;
	transition: all 0.2s ease;
}

.ai-message-content .ai-link:hover {
	color: #764ba2;
	border-bottom-color: #764ba2;
}

.ai-message-user .ai-message-content .ai-link {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.7);
}

.ai-message-user .ai-message-content .ai-link:hover {
	border-bottom-color: #fff;
}

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

.ai-message-content code {
	background: rgba(0, 0, 0, 0.1);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 13px;
}

/* Typing indicator */
.ai-typing-indicator .ai-message-content {
	display: flex;
	gap: 4px;
	padding: 16px;
}

.typing-dot {
	width: 8px;
	height: 8px;
	background: #667eea;
	border-radius: 50%;
	animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes typingBounce {
	0%, 80%, 100% {
		transform: scale(0.6);
		opacity: 0.6;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Input area */
.ai-chat-input-container {
	padding: 12px 16px 16px;
	background: white;
	border-top: 1px solid #eee;
}

.ai-quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ai-quick-btn {
	background: #f0f2ff;
	border: 1px solid #e0e4ff;
	color: #667eea;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ai-quick-btn:hover {
	background: #667eea;
	color: white;
	border-color: #667eea;
}

.ai-chat-input-wrapper {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ai-chat-input-wrapper .form-control {
	flex: 1;
	border-radius: 20px;
	padding: 10px 16px;
	border: 1px solid #ddd;
	font-size: 14px;
}

.ai-chat-input-wrapper .form-control:focus {
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-chat-send-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	color: white;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-chat-send-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.ai-chat-send-btn:not(:disabled):hover {
	transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.ai-chat-toggle {
		top: calc(50% - 25px);
		width: 38px;
		height: 44px;
		font-size: 18px;
	}
	
	.ai-chat-offcanvas {
		width: 100vw !important;
		max-width: 100vw;
	}
}

@media (max-width: 480px) {
	.ai-chat-toggle {
		top: calc(50% - 20px);
		width: 36px;
		height: 40px;
		font-size: 16px;
	}
}

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

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

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

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
	background: #aaa;
}
