/**
 * AI Chatbot Styles - v1.0.0
 * Matches the existing Bunts Group Intro design language
 */

/* ================================================
   CHATBOT CONTAINER
   ================================================ */

.bunts-chatbot-container {
	max-width: 600px;
	margin: 0 auto;
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	border-radius: 20px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
	border: 1px solid #e2e8f0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* ================================================
   CHATBOT HEADER
   ================================================ */

.bunts-chat-header {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: #ffffff;
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bunts-chat-header-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.bunts-chat-header-avatar {
	width: 42px;
	height: 42px;
	background: rgba(255,255,255,0.2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
}

.bunts-chat-header-text h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #ffffff;
}

.bunts-chat-header-text p {
	margin: 2px 0 0 0;
	font-size: 12px;
	opacity: 0.85;
	color: #e0e7ff;
}

.bunts-chat-header-status {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	opacity: 0.9;
}

.bunts-chat-header-status .bunts-status-dot {
	width: 8px;
	height: 8px;
	background: #34d399;
	border-radius: 50%;
	animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* ================================================
   MESSAGES AREA
   ================================================ */

.bunts-chat-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	max-height: 400px;
	min-height: 280px;
	background: #fafbfc;
	scroll-behavior: smooth;
}

.bunts-chat-messages::-webkit-scrollbar {
	width: 5px;
}

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

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

/* ================================================
   MESSAGE BUBBLES
   ================================================ */

.bunts-chat-msg {
	display: flex;
	gap: 10px;
	margin-bottom: 16px;
	animation: chatFadeIn 0.3s ease;
}

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

.bunts-chat-msg-user {
	flex-direction: row-reverse;
}

.bunts-chat-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
	background: #e2e8f0;
}

.bunts-chat-msg-assistant .bunts-chat-avatar {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.bunts-chat-msg-user .bunts-chat-avatar {
	background: #10b981;
}

.bunts-chat-bubble {
	max-width: 80%;
	padding: 12px 16px;
	border-radius: 16px;
	line-height: 1.5;
	font-size: 14px;
}

.bunts-chat-msg-assistant .bunts-chat-bubble {
	background: #ffffff;
	color: #1e293b;
	border: 1px solid #e2e8f0;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.bunts-chat-msg-user .bunts-chat-bubble {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.bunts-chat-sender {
	font-size: 11px;
	font-weight: 600;
	margin-bottom: 4px;
	opacity: 0.7;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.bunts-chat-msg-user .bunts-chat-sender {
	text-align: right;
}

.bunts-chat-text {
	word-wrap: break-word;
}

.bunts-chat-text strong {
	font-weight: 600;
}

/* ================================================
   TYPING INDICATOR
   ================================================ */

.bunts-typing-dots {
	display: flex;
	gap: 5px;
	padding: 4px 0;
}

.bunts-typing-dots span {
	width: 8px;
	height: 8px;
	background: #94a3b8;
	border-radius: 50%;
	animation: typingBounce 1.4s infinite ease-in-out;
}

.bunts-typing-dots span:nth-child(1) { animation-delay: 0s; }
.bunts-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.bunts-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* ================================================
   INPUT AREA
   ================================================ */

.bunts-chat-input-area {
	padding: 16px 20px;
	border-top: 1px solid #e2e8f0;
	background: #ffffff;
	display: flex;
	gap: 10px;
	align-items: flex-end;
}

.bunts-chat-input-area.disabled {
	opacity: 0.5;
	pointer-events: none;
}

#bunts-chat-input {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 14px;
	resize: none;
	outline: none;
	transition: border-color 0.2s;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	min-height: 44px;
	max-height: 100px;
	line-height: 1.4;
	color: #1e293b;
	background: #ffffff;
}

#bunts-chat-input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#bunts-chat-input::placeholder {
	color: #94a3b8;
}

#bunts-chat-input:disabled {
	background: #f1f5f9;
	cursor: not-allowed;
}

#bunts-chat-send {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: #ffffff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition: all 0.2s;
	flex-shrink: 0;
}

#bunts-chat-send:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#bunts-chat-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

/* ================================================
   SKIP LINK
   ================================================ */

.bunts-chat-footer {
	padding: 0 20px 16px;
	background: #ffffff;
	text-align: center;
}

#bunts-chat-skip {
	color: #94a3b8;
	font-size: 12px;
	text-decoration: none;
	transition: color 0.2s;
}

#bunts-chat-skip:hover {
	color: #6366f1;
	text-decoration: underline;
}

/* ================================================
   QUICK REPLIES
   ================================================ */

.bunts-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 20px;
	background: #fafbfc;
}

.bunts-quick-reply {
	padding: 8px 14px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	font-size: 13px;
	color: #6366f1;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
	white-space: nowrap;
}

.bunts-quick-reply:hover {
	background: #eef2ff;
	border-color: #6366f1;
}

/* ================================================
   COMPLETION STATES
   ================================================ */

.bunts-chat-complete {
	text-align: center;
	padding: 30px 20px;
	margin: 10px 0;
	background: #ecfdf5;
	border-radius: 16px;
	border: 1px solid #d1fae5;
	animation: chatFadeIn 0.4s ease;
}

.bunts-chat-complete-info {
	background: #f0f4ff;
	border-color: #c7d2fe;
}

.bunts-chat-complete-icon {
	font-size: 40px;
	margin-bottom: 12px;
}

.bunts-chat-complete h3 {
	margin: 0 0 8px 0;
	font-size: 18px;
	color: #1e293b;
}

.bunts-chat-complete p {
	margin: 0;
	font-size: 14px;
	color: #64748b;
	line-height: 1.6;
}

.bunts-chat-call-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding: 12px 24px;
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: #ffffff;
	border-radius: 10px;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	transition: all 0.2s;
}

.bunts-chat-call-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
	color: #ffffff;
}

.bunts-chat-call-btn-secondary {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.bunts-chat-call-btn-secondary:hover {
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ================================================
   PHONE LINK IN CHAT
   ================================================ */

.bunts-chat-phone-link {
	display: inline-block;
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: #ffffff !important;
	padding: 6px 14px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	margin: 4px 0;
	transition: all 0.2s;
}

.bunts-chat-phone-link:hover {
	transform: scale(1.03);
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
	color: #ffffff !important;
}

.bunts-chat-msg-assistant .bunts-chat-phone-link {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 640px) {
	.bunts-chatbot-container {
		border-radius: 16px;
		margin: 0 -5px;
	}

	.bunts-chat-header {
		padding: 16px 18px;
	}

	.bunts-chat-header-avatar {
		width: 36px;
		height: 36px;
		font-size: 18px;
	}

	.bunts-chat-messages {
		padding: 16px;
		max-height: 350px;
		min-height: 250px;
	}

	.bunts-chat-bubble {
		max-width: 85%;
		font-size: 13px;
		padding: 10px 14px;
	}

	.bunts-chat-input-area {
		padding: 12px 16px;
	}

	.bunts-quick-replies {
		padding: 8px 16px;
	}
}

/* ============================================================
   v5.1.0: Click-to-Call CTA for qualified leads (60%+ score)
   ============================================================ */
.bunts-chat-call-cta {
	text-align: center;
	padding: 20px 16px;
	margin: 12px 16px;
	background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
	border-radius: 16px;
	border: 2px solid #a7f3d0;
	animation: bunts-cta-fade-in 0.5s ease;
}

@keyframes bunts-cta-fade-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.bunts-call-cta-icon {
	font-size: 36px;
	margin-bottom: 8px;
}

.bunts-call-cta-text {
	font-size: 16px;
	font-weight: 700;
	color: #065f46;
	margin-bottom: 12px;
}

.bunts-call-cta-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, #059669 0%, #047857 100%);
	color: white !important;
	padding: 14px 32px;
	border-radius: 50px;
	font-size: 18px;
	font-weight: 700;
	text-decoration: none !important;
	box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
	transition: all 0.3s ease;
	position: relative;
}

.bunts-call-cta-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
	background: linear-gradient(135deg, #047857 0%, #065f46 100%);
	color: white !important;
}

.bunts-call-cta-pulse {
	display: inline-block;
	width: 12px;
	height: 12px;
	background: #34d399;
	border-radius: 50%;
	animation: bunts-pulse 1.5s infinite;
}

@keyframes bunts-pulse {
	0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
	70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
	100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.bunts-call-cta-note {
	font-size: 12px;
	color: #6b7280;
	margin-top: 10px;
}
