/**
 * Premium Glassmorphic Chat Widget CSS
 */

:root {
	--ai-chatbot-primary: #4f46e5;
	--ai-chatbot-secondary: #06b6d4;
	--ai-chatbot-primary-rgb: 79, 70, 229;
}

.ai-chatbot-widget-container {
	position: fixed;
	bottom: 25px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.ai-chatbot-widget-container.position-right {
	right: 25px;
	align-items: flex-end;
}

.ai-chatbot-widget-container.position-left {
	left: 25px;
	align-items: flex-start;
}

/* Launcher Badge */
.ai-chatbot-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--ai-chatbot-primary), var(--ai-chatbot-secondary));
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(var(--ai-chatbot-primary-rgb), 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
	position: relative;
}

.ai-chatbot-launcher:hover {
	transform: scale(1.08) rotate(5deg);
	box-shadow: 0 6px 24px rgba(var(--ai-chatbot-primary-rgb), 0.45);
}

.ai-chatbot-launcher:active {
	transform: scale(0.95);
}

.launcher-icon {
	font-size: 28px;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.launcher-close-icon {
	font-size: 32px;
	color: #ffffff;
	line-height: 1;
}

/* Launcher Pulsing Indicator */
.launcher-pulse {
	position: absolute;
	top: 0;
	right: 0;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background-color: #10b981;
	border: 2px solid #ffffff;
}

/* Chat Window */
.ai-chatbot-window {
	width: 380px;
	height: 580px;
	max-height: 80vh;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(15px) saturate(180%);
	-webkit-backdrop-filter: blur(15px) saturate(180%);
	border-radius: 20px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin-bottom: 18px;
	animation: windowOpen 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	transform-origin: bottom right;
}

.position-left .ai-chatbot-window {
	transform-origin: bottom left;
}

@keyframes windowOpen {
	from {
		opacity: 0;
		transform: scale(0.8) translateY(30px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* Window Header */
.ai-chatbot-window-header {
	background: linear-gradient(135deg, var(--ai-chatbot-primary), var(--ai-chatbot-secondary));
	padding: 16px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #ffffff;
}

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

.header-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.8);
	object-fit: cover;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.header-text h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.2px;
	line-height: 1.2;
}

.header-status {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 2px;
}

.status-pulse-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: #10b981;
	box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
	animation: dotPulse 1.8s infinite;
}

@keyframes dotPulse {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
	}
	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
	}
}

.status-lbl {
	font-size: 11px;
	opacity: 0.9;
	font-weight: 500;
}

.window-close-btn {
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 26px;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.15s ease;
	line-height: 1;
}

.window-close-btn:hover {
	opacity: 1;
}

/* Messages Stream */
.ai-chatbot-messages-stream {
	flex-grow: 1;
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 15px;
	background: rgba(249, 250, 251, 0.4);
}

.chat-bubble-wrapper {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.chat-bubble {
	padding: 11px 15px;
	font-size: 13.5px;
	line-height: 1.5;
	word-wrap: break-word;
	max-width: 80%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.bubble-user-wrap {
	align-items: flex-end;
}

.bubble-user {
	background: var(--ai-chatbot-primary);
	color: #ffffff;
	border-radius: 16px 16px 4px 16px;
}

.bubble-bot-wrap {
	align-items: flex-start;
}

.bubble-bot {
	background: #ffffff;
	color: #1f2937;
	border-radius: 16px 16px 16px 4px;
	border: 1px solid rgba(229, 231, 235, 0.5);
}

.bubble-system {
	align-self: center;
	background: rgba(224, 231, 255, 0.6);
	color: #4f46e5;
	font-style: italic;
	font-size: 12px;
	text-align: center;
	border-radius: 6px;
	border: 1px dashed rgba(79, 70, 229, 0.3);
	padding: 6px 12px;
	max-width: 90%;
}

.chat-meta {
	font-size: 9.5px;
	color: #9ca3af;
	margin-top: 4px;
	font-weight: 500;
}

.bubble-user-wrap .chat-meta {
	padding-right: 4px;
}

.bubble-bot-wrap .chat-meta {
	padding-left: 4px;
}

/* Call To Action Buttons */
.ai-chatbot-cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	margin-top: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	cursor: pointer;
	border: none;
	width: 100%;
	box-sizing: border-box;
}

.ai-chatbot-cta-btn:hover {
	transform: translateY(-1.5px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.cta-whatsapp {
	background: #25d366;
	color: #ffffff !important;
}

.cta-booking {
	background: var(--ai-chatbot-primary);
	color: #ffffff !important;
}

/* Lead Form Widget */
.ai-chatbot-lead-form {
	background: #ffffff;
	border: 1px solid rgba(79, 70, 229, 0.2);
	border-radius: 12px;
	padding: 15px;
	width: 100%;
	box-sizing: border-box;
	margin-top: 10px;
	box-shadow: 0 4px 15px rgba(79, 70, 229, 0.05);
	animation: formSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-chatbot-lead-form h4 {
	margin: 0 0 12px 0;
	font-size: 12.5px;
	color: #4b5563;
	font-weight: 500;
	line-height: 1.4;
}

.lead-form-group {
	margin-bottom: 10px;
}

.lead-form-group input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 7px 10px;
	font-size: 12.5px;
	transition: border-color 0.15s ease;
}

.lead-form-group input:focus {
	border-color: var(--ai-chatbot-primary);
	outline: none;
}

.lead-form-submit-btn {
	width: 100%;
	background: var(--ai-chatbot-primary);
	color: #ffffff;
	border: none;
	border-radius: 6px;
	padding: 9px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.lead-form-submit-btn:hover {
	background: rgba(var(--ai-chatbot-primary-rgb), 0.9);
}

.lead-form-submit-btn:disabled {
	background: #cbd5e1;
	cursor: not-allowed;
}

/* Typing Indicator Animation */
.ai-chatbot-typing {
	display: flex;
	align-items: center;
	gap: 4px;
	background: #ffffff;
	border-radius: 12px;
	padding: 10px 15px;
	margin-left: 20px;
	margin-bottom: 15px;
	width: fit-content;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
	border: 1px solid rgba(229, 231, 235, 0.5);
}

.typing-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: #9ca3af;
	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); }
	40% { transform: scale(1); }
}

/* Footer Input Bar */
.ai-chatbot-window-footer {
	padding: 12px 18px;
	background: #ffffff;
	border-top: 1px solid rgba(229, 231, 235, 0.6);
	display: flex;
	align-items: center;
	gap: 10px;
}

#ai-chatbot-user-input {
	flex-grow: 1;
	border: none;
	resize: none;
	outline: none;
	max-height: 65px;
	font-size: 13.5px;
	padding: 6px 0;
	font-family: inherit;
	line-height: 1.4;
	color: #1f2937;
}

#ai-chatbot-send-btn {
	background: transparent;
	border: none;
	color: var(--ai-chatbot-primary);
	cursor: pointer;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s ease, transform 0.15s ease;
	flex-shrink: 0;
}

#ai-chatbot-send-btn:hover {
	color: var(--ai-chatbot-secondary);
	transform: scale(1.05);
}

#ai-chatbot-send-btn svg {
	width: 18px;
	height: 18px;
}

/* Responsive Widget Adjustments */
@media (max-width: 480px) {
	.ai-chatbot-widget-container {
		bottom: 15px;
		right: 15px;
		left: 15px;
		width: calc(100% - 30px);
	}
	.ai-chatbot-window {
		width: 100%;
		height: 75vh;
	}
}
