/**
 * Elearners365 AI Chatbot — elearners365.com brand (Elementor kit 280)
 */

#el365-ai-root {
	--el365-dark: #2c2c2c;
	--el365-primary: #6ec1e4;
	--el365-accent-green: #61ce70;
	--el365-gold: #ffc71e;
	--el365-blue: #4361ee;
	--el365-purple: #4636ff;
	--el365-muted: #7a7a7a;
	--el365-panel-bg: #f2f2f2;
	--el365-radius: 14px;
	--el365-shadow: 0 12px 40px rgba(44, 44, 44, 0.2);
	font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--el365-dark);
	box-sizing: border-box;
}

#el365-ai-root *,
#el365-ai-root *::before,
#el365-ai-root *::after {
	box-sizing: border-box;
}

#el365-ai-launcher {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 999998;
	width: 58px;
	height: 58px;
	border: 3px solid var(--el365-primary);
	border-radius: 50%;
	cursor: pointer;
	background: #ffffff;
	box-shadow: var(--el365-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#el365-ai-launcher .el365-launcher-logo {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

#el365-ai-launcher:hover {
	border-color: var(--el365-gold);
	box-shadow: 0 10px 36px rgba(67, 97, 238, 0.22);
}

#el365-ai-launcher:focus-visible {
	outline: 3px solid var(--el365-blue);
	outline-offset: 2px;
}

#el365-ai-panel {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(84px, calc(16px + env(safe-area-inset-bottom) + 58px));
	z-index: 999999;
	width: min(400px, calc(100vw - 32px));
	height: min(580px, calc(100vh - 100px));
	max-height: calc(100dvh - 100px);
	background: var(--el365-panel-bg);
	border-radius: var(--el365-radius);
	box-shadow: var(--el365-shadow);
	display: none;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(110, 193, 228, 0.35);
}

#el365-ai-panel.el365-open {
	display: flex;
}

#el365-ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	background: linear-gradient(135deg, #2c2c2c 0%, #3d3d3d 100%);
	color: #f2f2f2;
	font-weight: 600;
	border-bottom: 3px solid var(--el365-gold);
	flex-shrink: 0;
}

.el365-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.el365-header-logo {
	height: 38px;
	width: auto;
	max-width: 90px;
	object-fit: contain;
	flex-shrink: 0;
}

.el365-header-texts {
	min-width: 0;
}

.el365-header-title {
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: 0.02em;
}

.el365-header-tagline {
	font-size: 11px;
	font-weight: 500;
	color: var(--el365-primary);
	margin-top: 2px;
	line-height: 1.25;
}

#el365-ai-close {
	background: transparent;
	border: none;
	color: #b0b0b0;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	flex-shrink: 0;
}

#el365-ai-close:hover {
	color: #fff;
}

#el365-ai-tabs {
	display: flex;
	border-bottom: 1px solid #e0e0e0;
	background: #ffffff;
	flex-shrink: 0;
}

#el365-ai-tabs button {
	flex: 1;
	padding: 10px 8px;
	border: none;
	background: transparent;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--el365-muted);
	border-bottom: 2px solid transparent;
}

#el365-ai-tabs button.el365-active {
	color: var(--el365-blue);
	border-bottom-color: var(--el365-gold);
}

#el365-ai-panels {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #ffffff;
}

.el365-panel-page {
	display: none;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.el365-panel-page.el365-active {
	display: flex;
}

#el365-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #ffffff;
	-webkit-overflow-scrolling: touch;
}

.el365-msg {
	max-width: 90%;
	padding: 10px 12px;
	border-radius: 12px;
	word-wrap: break-word;
	white-space: pre-wrap;
}

.el365-msg-user {
	align-self: flex-end;
	background: linear-gradient(180deg, rgba(110, 193, 228, 0.18), rgba(110, 193, 228, 0.32));
	color: #1a3a4a;
	border: 1px solid rgba(110, 193, 228, 0.45);
}

.el365-msg-bot {
	align-self: flex-start;
	background: #f2f2f2;
	color: var(--el365-dark);
	border: 1px solid #e0e0e0;
}

.el365-msg-err {
	align-self: stretch;
	max-width: 100%;
	background: #fef2f2;
	color: #991b1b;
}

.el365-typing {
	font-size: 13px;
	color: var(--el365-muted);
	padding: 0 12px 4px;
	min-height: 20px;
	flex-shrink: 0;
}

#el365-ai-connect {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 12px;
	padding: 8px 12px;
	background: var(--el365-dark);
	border-top: 1px solid rgba(255, 199, 30, 0.35);
	flex-shrink: 0;
}

#el365-ai-connect .el365-brand-site {
	color: var(--el365-gold);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}

#el365-ai-connect .el365-brand-site:hover {
	color: var(--el365-primary);
	text-decoration: underline;
}

.el365-brand-social {
	display: flex;
	align-items: center;
	gap: 10px;
}

.el365-brand-social-link {
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.92;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.el365-brand-social-link:hover {
	color: var(--el365-primary);
	opacity: 1;
}

#el365-ai-composer {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e0e0e0;
	background: #ffffff;
	flex-shrink: 0;
}

#el365-ai-input {
	flex: 1;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	padding: 10px 12px;
	font: inherit;
	min-height: 42px;
}

#el365-ai-input:focus {
	outline: none;
	border-color: var(--el365-blue);
	box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

#el365-ai-send {
	border: none;
	border-radius: 10px;
	padding: 10px 16px;
	background: linear-gradient(135deg, var(--el365-blue), var(--el365-purple));
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	min-width: 72px;
}

#el365-ai-send:hover {
	filter: brightness(1.05);
}

#el365-ai-send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

#el365-lead-form {
	padding: 14px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}

#el365-lead-form label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
}

#el365-lead-form input,
#el365-lead-form textarea {
	font: inherit;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	width: 100%;
}

#el365-lead-form textarea {
	min-height: 88px;
	resize: vertical;
}

#el365-lead-submit {
	margin-top: 4px;
	border: none;
	border-radius: 10px;
	padding: 12px;
	background: linear-gradient(135deg, var(--el365-blue), var(--el365-purple));
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

#el365-lead-submit:hover {
	filter: brightness(1.05);
}

#el365-lead-submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

#el365-lead-notice {
	font-size: 14px;
	padding: 8px 0;
	display: none;
}

#el365-lead-notice.el365-ok {
	display: block;
	color: #166534;
}

#el365-lead-notice.el365-err {
	display: block;
	color: #991b1b;
}

@media (max-width: 480px) {
	#el365-ai-panel {
		right: 8px;
		left: 8px;
		width: auto;
		bottom: max(78px, env(safe-area-inset-bottom));
		height: min(74vh, 540px);
	}

	#el365-ai-launcher {
		right: max(12px, env(safe-area-inset-right));
		bottom: max(12px, env(safe-area-inset-bottom));
	}
}
