/************************************/
/****     Ekoss Chat Bot Widget    ****/
/************************************/

:root {
	--chatbot-primary      : #163300;
	--chatbot-accent       : #6eeb39;
	--chatbot-bg           : #ffffff;
	--chatbot-bubble-bot   : #EFF1ED;
	--chatbot-bubble-user  : #163300;
	--chatbot-text-dark    : #163300;
	--chatbot-text-light   : #ffffff;
	--chatbot-muted        : #888888;
	--chatbot-shadow       : 0 10px 40px rgba(22, 51, 0, 0.25);
}

.ekoss-chatbot,
.ekoss-chatbot * {
	box-sizing: border-box;
}

.ekoss-chatbot {
	font-family: 'Rubik', sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--chatbot-text-dark);
}

/* Floating launcher (LEFT side) */
.ekoss-chatbot-launcher {
	position: fixed;
	left: 24px;
	bottom: 24px;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--chatbot-bg);
	border: 3px solid var(--chatbot-primary);
	box-shadow: 0 6px 20px rgba(22, 51, 0, 0.25);
	cursor: pointer;
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	animation: ekossChatbotPulse 2.4s ease-in-out infinite;
}

.ekoss-chatbot-launcher:hover {
	transform: scale(1.08);
}

.ekoss-chatbot-launcher:focus {
	outline: none;
}

.ekoss-chatbot-launcher img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

.ekoss-chatbot-launcher.is-hidden {
	opacity: 0;
	transform: scale(0.5);
	pointer-events: none;
}

.ekoss-chatbot-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--chatbot-accent);
	border: 2px solid var(--chatbot-primary);
}

@keyframes ekossChatbotPulse {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.06);
	}
}

.ekoss-chatbot-launcher:hover {
	animation-play-state: paused;
}

/* Chat panel */
.ekoss-chatbot-panel {
	position: fixed;
	left: 24px;
	bottom: 24px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 32px);
	background: var(--chatbot-bg);
	border-radius: 16px;
	box-shadow: var(--chatbot-shadow);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.ekoss-chatbot-panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Header */
.ekoss-chatbot-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--chatbot-primary);
	color: var(--chatbot-text-light);
}

.ekoss-chatbot-header-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}

.ekoss-chatbot-header-avatar img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ekoss-chatbot-header-info {
	flex: 1;
	min-width: 0;
}

.ekoss-chatbot-header-title {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 17px;
	line-height: 1.2;
	color: var(--chatbot-text-light);
	margin: 0;
}

.ekoss-chatbot-header-status {
	font-size: 12px;
	opacity: 0.85;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ekoss-chatbot-header-status::before {
	content: "";
	width: 8px;
	height: 8px;
	background: var(--chatbot-accent);
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(110, 235, 57, 0.7);
	animation: ekossChatbotDot 1.8s ease-in-out infinite;
}

@keyframes ekossChatbotDot {
	0%, 100% { box-shadow: 0 0 0 0 rgba(110, 235, 57, 0.6); }
	50% { box-shadow: 0 0 0 6px rgba(110, 235, 57, 0); }
}

.ekoss-chatbot-close {
	background: transparent;
	border: none;
	color: var(--chatbot-text-light);
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
	padding: 0;
}

.ekoss-chatbot-close:hover,
.ekoss-chatbot-close:focus {
	background: rgba(255, 255, 255, 0.15);
	outline: none;
}

.ekoss-chatbot-close svg {
	width: 18px;
	height: 18px;
}

/* Messages */
.ekoss-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #fafbf9;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}

.ekoss-chatbot-messages::-webkit-scrollbar {
	width: 6px;
}

.ekoss-chatbot-messages::-webkit-scrollbar-thumb {
	background: #d9dbd4;
	border-radius: 3px;
}

.ekoss-chatbot-messages::-webkit-scrollbar-thumb:hover {
	background: #b9bbb4;
}

.ekoss-chatbot-disclaimer {
	background: #eef4e7;
	border-left: 3px solid var(--chatbot-accent);
	color: var(--chatbot-text-dark);
	font-size: 12.5px;
	line-height: 1.5;
	padding: 10px 12px;
	border-radius: 8px;
	margin-bottom: 4px;
}

.ekoss-chatbot-message {
	display: flex;
	max-width: 85%;
	animation: ekossChatbotFadeIn 0.25s ease;
}

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

.ekoss-chatbot-message.is-bot {
	align-self: flex-start;
}

.ekoss-chatbot-message.is-user {
	align-self: flex-end;
}

.ekoss-chatbot-bubble {
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
	white-space: pre-wrap;
}

.ekoss-chatbot-message.is-bot .ekoss-chatbot-bubble {
	background: var(--chatbot-bubble-bot);
	color: var(--chatbot-text-dark);
	border-bottom-left-radius: 4px;
}

.ekoss-chatbot-message.is-user .ekoss-chatbot-bubble {
	background: var(--chatbot-bubble-user);
	color: var(--chatbot-text-light);
	border-bottom-right-radius: 4px;
}

.ekoss-chatbot-bubble a {
	color: inherit;
	text-decoration: underline;
}

/* Typing indicator */
.ekoss-chatbot-typing {
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
	background: var(--chatbot-bubble-bot);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.ekoss-chatbot-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--chatbot-primary);
	opacity: 0.4;
	animation: ekossChatbotTyping 1.2s infinite ease-in-out;
}

.ekoss-chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.ekoss-chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ekossChatbotTyping {
	0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
	30%           { opacity: 1;   transform: translateY(-3px); }
}

/* Input area */
.ekoss-chatbot-form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e7e9e2;
	background: #ffffff;
}

.ekoss-chatbot-input {
	flex: 1;
	border: 1px solid #dcdfd6;
	border-radius: 22px;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	color: var(--chatbot-text-dark);
	background: #fafbf9;
	outline: none;
	transition: border-color 0.2s ease, background 0.2s ease;
	min-width: 0;
}

.ekoss-chatbot-input:focus {
	border-color: var(--chatbot-accent);
	background: #ffffff;
}

.ekoss-chatbot-send {
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--chatbot-primary);
	color: var(--chatbot-text-light);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.2s ease, transform 0.2s ease;
	padding: 0;
}

.ekoss-chatbot-send:hover,
.ekoss-chatbot-send:focus {
	background: #0e2400;
	outline: none;
	transform: scale(1.05);
}

.ekoss-chatbot-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.ekoss-chatbot-send svg {
	width: 18px;
	height: 18px;
}

/* Mobile */
@media (max-width: 480px) {
	.ekoss-chatbot-launcher {
		left: 16px;
		bottom: 16px;
		width: 64px;
		height: 64px;
	}

	.ekoss-chatbot-panel {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
		height: 65vh;
		max-height: 65vh;
		min-height: 360px;
	}
}

@media (max-height: 620px) and (max-width: 480px) {
	.ekoss-chatbot-panel {
		height: calc(100vh - 100px);
		max-height: calc(100vh - 100px);
	}
}

/* Avoid clash with site cursor follower */
.ekoss-chatbot-launcher,
.ekoss-chatbot-panel,
.ekoss-chatbot-panel * {
	cursor: auto;
}

.ekoss-chatbot-launcher,
.ekoss-chatbot-close,
.ekoss-chatbot-send {
	cursor: pointer;
}

.ekoss-chatbot-input {
	cursor: text;
}
