/* ==========================================================================
   Monowara Hospital — AI chatbot widget
   Scoped to .mh-chat-* so it cannot affect any theme styles.
   ========================================================================== */

.mh-chat-launcher,
.mh-chat-panel,
.mh-chat-body * {
	font-family: inherit;
}

/* Launcher ---------------------------------------------------------------- */
.mh-chat-launcher {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 9999;
	width: 60px;
	height: 60px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #396cf0;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 26px rgba(57, 108, 240, .38), 0 2px 6px rgba(16, 24, 40, .16);
	transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.mh-chat-launcher:hover {
	background: #2f5de0;
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(57, 108, 240, .45);
}

.mh-chat-launcher:focus-visible {
	outline: 3px solid #101828;
	outline-offset: 3px;
}

.mh-chat-launcher svg {
	width: 27px;
	height: 27px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mh-chat-launcher .mh-chat-icon-close {
	display: none;
}

.mh-chat-launcher.is-open {
	background: #101828;
}

.mh-chat-launcher.is-open .mh-chat-icon-chat {
	display: none;
}

.mh-chat-launcher.is-open .mh-chat-icon-close {
	display: block;
}

/* Panel ------------------------------------------------------------------- */
.mh-chat-panel {
	position: fixed;
	right: 24px;
	bottom: 96px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	width: min(372px, calc(100vw - 32px));
	height: min(568px, calc(100vh - 140px));
	background: #fff;
	border: 1px solid #e6ebf5;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(16, 24, 40, .22), 0 4px 12px rgba(16, 24, 40, .08);
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.mh-chat-panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Header */
.mh-chat-head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px;
	background: linear-gradient(135deg, #396cf0 0%, #2f56d6 100%);
	color: #fff;
}

.mh-chat-avatar {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.mh-chat-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.mh-chat-avatar svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: #fff;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mh-chat-head-text {
	flex: 1 1 auto;
	min-width: 0;
}

.mh-chat-title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mh-chat-status {
	display: block;
	font-size: 11.5px;
	opacity: .85;
	line-height: 1.3;
	margin-top: 2px;
}

.mh-chat-close {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .15s ease;
}

.mh-chat-close:hover {
	background: rgba(255, 255, 255, .3);
}

.mh-chat-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.mh-chat-close svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

/* Messages */
.mh-chat-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 16px 14px;
	background: #f6f8fc;
	display: flex;
	flex-direction: column;
	gap: 10px;
	overscroll-behavior: contain;
}

.mh-chat-msg {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.55;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	animation: mh-chat-in .18s ease both;
}

@keyframes mh-chat-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.mh-chat-msg--bot {
	align-self: flex-start;
	background: #fff;
	color: #1b2559;
	border: 1px solid #e9eef7;
	border-bottom-left-radius: 4px;
}

.mh-chat-msg--user {
	align-self: flex-end;
	background: #396cf0;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.mh-chat-msg a {
	color: #2f5de0;
	font-weight: 600;
	text-decoration: underline;
	word-break: break-word;
}

.mh-chat-msg--user a {
	color: #fff;
}

.mh-chat-msg strong,
.mh-chat-msg b {
	font-weight: 700;
}

.mh-chat-msg--notice {
	align-self: stretch;
	max-width: 100%;
	background: #fff4e5;
	border: 1px solid #ffdca8;
	color: #7a4b00;
	font-size: 13.5px;
}

/* Typing indicator */
.mh-chat-typing {
	align-self: flex-start;
	display: none;
	align-items: center;
	gap: 5px;
	padding: 13px 14px;
	background: #fff;
	border: 1px solid #e9eef7;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.mh-chat-typing.is-visible {
	display: flex;
}

.mh-chat-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #a9b4cc;
	display: block;
	animation: mh-chat-bounce 1.1s infinite ease-in-out;
}

.mh-chat-typing i:nth-child(2) {
	animation-delay: .15s;
}

.mh-chat-typing i:nth-child(3) {
	animation-delay: .3s;
}

@keyframes mh-chat-bounce {
	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: .55;
	}
	30% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

/* Quick replies */
.mh-chat-chips {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	padding: 10px 14px;
	background: #fff;
	border-top: 1px solid #eef1f7;
}

.mh-chat-chip {
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid #d7e0f4;
	background: #fff;
	color: #2f5de0;
	border-radius: 999px;
	padding: 7px 12px;
	font-size: 12.5px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mh-chat-chip:hover {
	background: #eef3ff;
	border-color: #396cf0;
}

.mh-chat-chip:focus-visible {
	outline: 2px solid #396cf0;
	outline-offset: 2px;
}

/* Input */
.mh-chat-inputrow {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 14px;
	background: #fff;
	border-top: 1px solid #eef1f7;
}

.mh-chat-input {
	flex: 1 1 auto;
	min-width: 0;
	resize: none;
	max-height: 96px;
	padding: 10px 12px;
	border: 1px solid #dfe5f1;
	border-radius: 10px;
	background: #fbfcfe;
	color: #1b2559;
	font-size: 14.5px;
	line-height: 1.45;
	font-family: inherit;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.mh-chat-input::placeholder {
	color: #97a1b7;
}

.mh-chat-input:focus {
	outline: 0;
	border-color: #396cf0;
	box-shadow: 0 0 0 3px rgba(57, 108, 240, .16);
	background: #fff;
}

.mh-chat-send {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #396cf0;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .15s ease, transform .15s ease;
}

.mh-chat-send:hover:not(:disabled) {
	background: #2f5de0;
	transform: translateY(-1px);
}

.mh-chat-send:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.mh-chat-send:focus-visible {
	outline: 3px solid #101828;
	outline-offset: 2px;
}

.mh-chat-send svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Disclaimer */
.mh-chat-foot {
	flex: 0 0 auto;
	padding: 8px 14px 10px;
	background: #fff;
	border-top: 1px solid #f2f4f9;
	color: #97a1b7;
	font-size: 11px;
	line-height: 1.45;
	text-align: center;
}

/* Hide on very small heights so it never traps the viewport ------------- */
@media (max-height: 460px) {
	.mh-chat-panel {
		height: calc(100vh - 84px);
		bottom: 84px;
	}
}

/* Mobile: full width sheet */
@media (max-width: 520px) {
	.mh-chat-launcher {
		right: 16px;
		bottom: 16px;
		width: 54px;
		height: 54px;
	}

	.mh-chat-panel {
		right: 0;
		left: 0;
		bottom: 0;
		width: 100vw;
		height: 88vh;
		max-height: 88vh;
		border-radius: 16px 16px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		transform: translateY(24px);
	}
}

/* Reduced motion: keep it accessible and static */
@media (prefers-reduced-motion: reduce) {

	.mh-chat-panel,
	.mh-chat-launcher,
	.mh-chat-msg,
	.mh-chat-typing i {
		transition: none !important;
		animation: none !important;
	}
}

/* Print: never print the widget */
@media print {
	.mh-chat-launcher,
	.mh-chat-panel {
		display: none !important;
	}
}
