/* Meezab AI Chatbot widget. Inherits the site's font; colors come from JS-set custom properties. */

#mzb-aic {
	--mzb-c: #0f5257;
	--mzb-on: #ffffff;
	--mzb-c-text: #0f5257;
	--mzb-tint: rgba(15, 82, 87, 0.12);
	--mzb-ink: #1c2426;
	--mzb-muted: #5e6b6e;
	--mzb-line: #dfe5e6;
	--mzb-bot: #f1f4f4;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-size: 15px;
	line-height: 1.45;
	color: var(--mzb-ink);
	text-align: left;
}
#mzb-aic.mzb-left { right: auto; left: 20px; }
#mzb-aic *, #mzb-aic *::before, #mzb-aic *::after { box-sizing: border-box; }

/* Neutralise theme button/input styles inside the widget */
#mzb-aic button {
	font: inherit;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	min-height: 0;
	width: auto;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
	cursor: pointer;
}
#mzb-aic :focus { outline: none; }
#mzb-aic :focus-visible { outline: 2px solid var(--mzb-c); outline-offset: 2px; }
#mzb-aic svg { display: block; flex: none; }

/* Launcher */
#mzb-aic .mzb-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 54px;
	padding: 0 22px 0 8px;
	border-radius: 27px;
	background: var(--mzb-c);
	color: var(--mzb-on);
	font-weight: 600;
	font-size: 15px;
	box-shadow: 0 8px 24px rgba(16, 32, 36, 0.24);
	transition: transform 0.15s ease;
}
#mzb-aic .mzb-launcher:hover { transform: translateY(-2px); }
#mzb-aic .mzb-launcher-mark {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: color-mix(in srgb, currentColor 18%, transparent);
}
#mzb-aic.is-open .mzb-launcher { display: none; }

/* Panel */
#mzb-aic .mzb-panel {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: 380px;
	height: min(620px, calc(100vh - 40px));
	background: #fff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 20px 56px rgba(16, 32, 36, 0.3);
	transform-origin: bottom right;
	animation: mzb-in 0.18s ease-out;
}
#mzb-aic.mzb-left .mzb-panel { right: auto; left: 0; transform-origin: bottom left; }
#mzb-aic .mzb-panel[hidden] { display: none; }
@keyframes mzb-in {
	from { opacity: 0; transform: scale(0.96) translateY(8px); }
	to { opacity: 1; transform: none; }
}

/* Header */
#mzb-aic .mzb-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 10px 14px 16px;
	background: var(--mzb-c);
	color: var(--mzb-on);
}
#mzb-aic .mzb-avatar {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: color-mix(in srgb, currentColor 18%, transparent);
	font-weight: 700;
	font-size: 17px;
	flex: none;
}
#mzb-aic .mzb-title { flex: 1; min-width: 0; }
#mzb-aic .mzb-name {
	font-weight: 600;
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#mzb-aic .mzb-sub { font-size: 12.5px; opacity: 0.85; }
#mzb-aic .mzb-actions { display: flex; align-items: center; gap: 2px; }
#mzb-aic .mzb-icon-btn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
}
#mzb-aic .mzb-icon-btn:hover,
#mzb-aic .mzb-wa:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
#mzb-aic .mzb-wa {
	margin-right: 4px;
	padding: 6px 11px;
	border-radius: 16px;
	border: 1.5px solid color-mix(in srgb, currentColor 45%, transparent);
	color: inherit;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
#mzb-aic .mzb-header :focus-visible { outline-color: var(--mzb-on); }

/* Messages */
#mzb-aic .mzb-log {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 16px 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
#mzb-aic .mzb-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 16px;
	overflow-wrap: anywhere;
}
#mzb-aic .mzb-bot {
	align-self: flex-start;
	background: var(--mzb-bot);
	border-bottom-left-radius: 5px;
}
#mzb-aic .mzb-user {
	align-self: flex-end;
	background: var(--mzb-c);
	color: var(--mzb-on);
	border-bottom-right-radius: 5px;
}
#mzb-aic .mzb-msg a { color: inherit; text-decoration: underline; }
#mzb-aic .mzb-msg strong { font-weight: 700; }
#mzb-aic .mzb-msg[dir="auto"] { unicode-bidi: plaintext; }

#mzb-aic .mzb-note,
#mzb-aic .mzb-error {
	align-self: center;
	max-width: 92%;
	padding: 7px 12px;
	border-radius: 10px;
	font-size: 13px;
	text-align: center;
}
#mzb-aic .mzb-note { color: var(--mzb-c-text); background: var(--mzb-tint); }
#mzb-aic .mzb-error { color: #8a2b1d; background: #fcefeb; }

/* Typing indicator */
#mzb-aic .mzb-typing { display: flex; gap: 5px; padding: 14px 15px; }
#mzb-aic .mzb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mzb-muted);
	opacity: 0.35;
	animation: mzb-dot 1.1s infinite ease-in-out;
}
#mzb-aic .mzb-typing span:nth-child(2) { animation-delay: 0.15s; }
#mzb-aic .mzb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mzb-dot {
	0%, 60%, 100% { opacity: 0.35; transform: none; }
	30% { opacity: 1; transform: translateY(-3px); }
}

/* Quick replies */
#mzb-aic .mzb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#mzb-aic .mzb-chip {
	padding: 7px 13px;
	border: 1.5px solid var(--mzb-c-text);
	border-radius: 18px;
	background: #fff;
	color: var(--mzb-c-text);
	font-size: 14px;
	font-weight: 500;
}
#mzb-aic .mzb-chip:hover { background: var(--mzb-tint); }

/* Composer */
#mzb-aic .mzb-composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--mzb-line);
}
#mzb-aic .mzb-input {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	margin: 0;
	padding: 11px 13px;
	border: 1px solid var(--mzb-line);
	border-radius: 12px;
	background: #fff;
	color: var(--mzb-ink);
	font: inherit;
	font-size: 16px; /* prevents iOS zoom */
	line-height: 1.35;
	resize: none;
	box-shadow: none;
}
#mzb-aic .mzb-input:focus { border-color: var(--mzb-c-text); box-shadow: 0 0 0 3px var(--mzb-tint); outline: none; }
#mzb-aic .mzb-send {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--mzb-c);
	color: var(--mzb-on);
	flex: none;
}
#mzb-aic .mzb-send:disabled { opacity: 0.45; cursor: default; }
#mzb-aic .mzb-foot {
	padding: 0 14px 10px;
	font-size: 11.5px;
	color: var(--mzb-muted);
	text-align: center;
}

/* Phones: full screen */
@media (max-width: 480px) {
	#mzb-aic { right: 14px; bottom: 14px; }
	#mzb-aic.mzb-left { left: 14px; }
	#mzb-aic .mzb-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
	#mzb-aic .mzb-header { padding-top: max(14px, env(safe-area-inset-top)); }
	#mzb-aic .mzb-foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
	#mzb-aic .mzb-panel { animation: none; }
	#mzb-aic .mzb-launcher { transition: none; }
	#mzb-aic .mzb-typing span { animation-duration: 2.4s; }
}
