/* Premium Glassmorphic Chat Widget CSS */

:root {
	--my-ai-chat-theme: #4f46e5;
	--my-ai-chat-theme-bg-alpha: rgba(79, 70, 229, 0.1);
	--my-ai-chat-white: rgba(255, 255, 255, 0.85);
	--my-ai-chat-white-solid: #ffffff;
	--my-ai-chat-gray-light: #f1f5f9;
	--my-ai-chat-text-dark: #1e293b;
	--my-ai-chat-text-muted: #64748b;
}

/* Floating Action Button (Launcher) */
.my-ai-chat-launcher {
	position: fixed;
	bottom: 25px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: var(--my-ai-chat-theme);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.my-ai-chat-launcher:hover {
	transform: scale(1.08) translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.my-ai-chat-launcher svg {
	width: 28px;
	height: 28px;
	fill: #ffffff;
	transition: transform 0.3s ease;
}

.my-ai-chat-launcher.active svg {
	transform: rotate(90deg) scale(0.8);
}

/* Chat Widget Window */
.my-ai-chat-window {
	position: fixed;
	bottom: 100px;
	width: 380px;
	height: 580px;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.45);
	box-shadow: 0 16px 48px -10px rgba(0, 0, 0, 0.15);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
	animation: chatOpen 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.my-ai-chat-window * {
	box-sizing: border-box;
}

/* Position options */
.my-ai-chat-pos-right {
	right: 25px;
}
.my-ai-chat-pos-left {
	left: 25px;
}

/* Chat Header */
.my-ai-chat-win-header {
	background: linear-gradient(135deg, var(--my-ai-chat-theme) 0%, rgba(124, 58, 237, 0.9) 100%);
	padding: 16px 20px;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.my-ai-chat-profile {
	display: flex;
	align-items: center;
	gap: 12px;
}

.my-ai-chat-avatar-container {
	position: relative;
}

.my-ai-chat-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.2);
	border: 2px solid rgba(255, 255, 255, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.my-ai-chat-online-dot {
	position: absolute;
	bottom: 1px;
	right: 1px;
	width: 9px;
	height: 9px;
	background-color: #22c55e;
	border-radius: 50%;
	border: 2px solid var(--my-ai-chat-theme);
}

.my-ai-chat-bot-info h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
}

.my-ai-chat-bot-info p {
	margin: 2px 0 0 0;
	font-size: 11px;
	opacity: 0.85;
	display: flex;
	align-items: center;
	gap: 4px;
}

.my-ai-chat-win-close {
	background: none;
	border: none;
	color: #ffffff;
	cursor: pointer;
	opacity: 0.8;
	padding: 4px;
	font-size: 20px;
	line-height: 1;
	transition: opacity 0.2s ease;
}

.my-ai-chat-win-close:hover {
	opacity: 1;
}

/* Chat Body Wrapper */
.my-ai-chat-win-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	position: relative;
}

/* Onboarding Lead Form */
.my-ai-chat-onboarding-panel {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.95);
	padding: 30px 25px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	z-index: 10;
	animation: fadeIn 0.3s ease;
}

.my-ai-chat-onboarding-panel h4 {
	margin: 0 0 10px 0;
	font-size: 18px;
	color: var(--my-ai-chat-text-dark);
	text-align: center;
}

.my-ai-chat-onboarding-panel p {
	margin: 0 0 24px 0;
	font-size: 13px;
	color: var(--my-ai-chat-text-muted);
	text-align: center;
	line-height: 1.4;
}

.my-ai-chat-form-field {
	margin-bottom: 15px;
}

.my-ai-chat-form-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--my-ai-chat-text-dark);
	margin-bottom: 6px;
}

.my-ai-chat-form-field input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 13px;
	outline: none;
	transition: all 0.2s ease;
	background-color: #f8fafc;
}

.my-ai-chat-form-field input:focus {
	border-color: var(--my-ai-chat-theme);
	background-color: #ffffff;
	box-shadow: 0 0 0 3px var(--my-ai-chat-theme-bg-alpha);
}

.my-ai-chat-form-submit {
	width: 100%;
	padding: 12px;
	background-color: var(--my-ai-chat-theme);
	border: none;
	border-radius: 8px;
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
	margin-top: 10px;
}

.my-ai-chat-form-submit:hover {
	background-color: #3b30be;
}

/* Chat Messages Area */
.my-ai-chat-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
	background-color: rgba(248, 250, 252, 0.3);
}

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

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

.my-ai-chat-messages::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.08);
	border-radius: 10px;
}

.my-ai-chat-messages::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.15);
}

/* Chat Message Bubbles */
.my-ai-chat-bubble {
	max-width: 80%;
	padding: 11px 15px;
	font-size: 13px;
	line-height: 1.55;
	border-radius: 16px;
	word-wrap: break-word;
	animation: messagePop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

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

.my-ai-chat-bubble.bot {
	background-color: var(--my-ai-chat-white-solid);
	color: var(--my-ai-chat-text-dark);
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	border: 1px solid rgba(0, 0, 0, 0.04);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.my-ai-chat-bubble.user {
	background-color: var(--my-ai-chat-theme);
	color: #ffffff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
	box-shadow: 0 4px 10px var(--my-ai-chat-theme-bg-alpha);
}

/* Formats in Bot response */
.my-ai-chat-bubble strong {
	font-weight: 700;
}

.my-ai-chat-bubble p {
	margin: 0 0 8px 0;
}

.my-ai-chat-bubble p:last-child {
	margin-bottom: 0;
}

.my-ai-chat-bubble ul, .my-ai-chat-bubble ol {
	margin: 5px 0;
	padding-left: 20px;
}

.my-ai-chat-bubble li {
	margin-bottom: 4px;
}

/* Typing Indicator Bubble */
.my-ai-chat-typing {
	display: none;
	align-self: flex-start;
	background-color: var(--my-ai-chat-white-solid);
	border: 1px solid rgba(0, 0, 0, 0.04);
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	padding: 12px 18px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.my-ai-chat-typing-dots {
	display: flex;
	gap: 4px;
	align-items: center;
	height: 8px;
}

.my-ai-chat-typing-dots span {
	width: 6px;
	height: 6px;
	background-color: var(--my-ai-chat-text-muted);
	border-radius: 50%;
	animation: typingBounce 1.4s infinite ease-in-out both;
}

.my-ai-chat-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.my-ai-chat-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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

/* Chat Input Bar */
.my-ai-chat-win-footer {
	background: var(--my-ai-chat-white);
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	padding: 12px 15px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.my-ai-chat-input-textarea {
	flex: 1;
	height: 38px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 20px;
	padding: 9px 15px;
	font-size: 13px;
	resize: none;
	outline: none;
	color: var(--my-ai-chat-text-dark);
	background-color: var(--my-ai-chat-white-solid);
	font-family: inherit;
	line-height: 1.4;
	transition: all 0.2s ease;
}

.my-ai-chat-input-textarea:focus {
	border-color: var(--my-ai-chat-theme);
	box-shadow: 0 0 0 2px var(--my-ai-chat-theme-bg-alpha);
}

.my-ai-chat-send-btn {
	background-color: var(--my-ai-chat-theme);
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, background-color 0.2s ease;
	flex-shrink: 0;
}

.my-ai-chat-send-btn:hover {
	transform: scale(1.05);
	background-color: #3b30be;
}

.my-ai-chat-send-btn svg {
	width: 16px;
	height: 16px;
	fill: #ffffff;
	margin-left: 2px;
}

/* Settings button & sliding drawer styling */
.my-ai-chat-win-settings {
	background: none;
	border: none;
	color: #ffffff;
	cursor: pointer;
	opacity: 0.8;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease, transform 0.3s ease;
}

.my-ai-chat-win-settings:hover {
	opacity: 1;
	transform: rotate(45deg);
}

.my-ai-chat-win-settings svg {
	width: 18px;
	height: 18px;
	fill: #ffffff;
}

.my-ai-chat-settings-drawer {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 100;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.my-ai-chat-settings-drawer.open {
	transform: translateX(0);
}

.my-ai-chat-drawer-header {
	padding: 15px 20px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #f8fafc;
}

.my-ai-chat-drawer-header h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--my-ai-chat-text-dark);
}

.my-ai-chat-drawer-close {
	background: none;
	border: none;
	color: var(--my-ai-chat-text-muted);
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 4px;
	transition: color 0.2s ease;
}

.my-ai-chat-drawer-close:hover {
	color: var(--my-ai-chat-text-dark);
}

.my-ai-chat-drawer-body {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
}

.my-ai-chat-drawer-desc {
	margin: 0 0 16px 0;
	font-size: 12px;
	line-height: 1.45;
	color: var(--my-ai-chat-text-muted);
}

.my-ai-chat-field-tip {
	display: block;
	font-size: 11px;
	color: var(--my-ai-chat-text-muted);
	margin-top: 4px;
}

.my-ai-chat-btn-reset-memory {
	display: block;
	width: 100%;
	text-align: center;
	margin-top: 20px;
	background: none;
	border: 1px solid #ef4444;
	border-radius: 8px;
	color: #ef4444;
	padding: 10px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.my-ai-chat-btn-reset-memory:hover {
	background-color: #ef4444;
	color: #ffffff;
}

/* Mobile Responsive Adaptations */
@media (max-width: 450px) {
	.my-ai-chat-window {
		bottom: 0 !important;
		right: 0 !important;
		left: 0 !important;
		width: 100vw !important;
		height: 100vh !important;
		border-radius: 0 !important;
		border: none !important;
	}
	.my-ai-chat-launcher {
		bottom: 15px !important;
		right: 15px !important;
	}
}
