/* Kajdut AI Support - Frontend Styles */
.kajdut-chat-container {
	--kajdut-primary: #295d7b;
	--kajdut-primary-dark: #1f4863;
	--kajdut-live-green: #22c55e;
	--kajdut-bg: #ffffff;
	--kajdut-text: #1f2937;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
}

.kajdut-chat-container[data-embedded="1"] {
	position: relative;
	right: auto;
	bottom: auto;
	max-width: 480px;
	margin: 0 auto;
}

.kajdut-floating-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--kajdut-primary);
	border: none;
	padding: 0;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
	position: relative;
	overflow: hidden;
}
.kajdut-floating-btn:hover { transform: scale(1.06); }
.kajdut-floating-btn .dashicons { color: #fff; font-size: 28px; width: 28px; height: 28px; }

/* কাস্টম আপলোডেড আইকন থাকলে - কোনো ব্যাকগ্রাউন্ড ছাড়াই পুরো বাটন জুড়ে
   ছবিটি রাউন্ড শেপে সম্পূর্ণভাবে ভরাট হয়ে থাকবে। */
.kajdut-floating-btn.kajdut-has-icon {
	background: transparent;
	box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.kajdut-floating-btn.kajdut-has-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	border-radius: 50%;
	display: block;
}

/* ফ্লোটিং আইকনের পাশে লাইভ স্ট্যাটাস বাতি (সবুজ) */
.kajdut-live-indicator {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--kajdut-live-green);
	border: 2px solid #fff;
	z-index: 2;
	box-shadow: 0 0 0 rgba(34, 197, 94, 0.6);
	animation: kajdut-pulse-green 2s infinite;
}
@keyframes kajdut-pulse-green {
	0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
	70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.kajdut-chat-window {
	display: none;
	flex-direction: column;
	width: 360px;
	max-width: 92vw;
	height: 520px;
	max-height: 75vh;
	background: var(--kajdut-bg);
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0,0,0,0.2);
	overflow: hidden;
	position: absolute;
	right: 0;
	bottom: 74px;
}
.kajdut-chat-container[data-embedded="1"] .kajdut-chat-window {
	position: relative;
	right: auto;
	bottom: auto;
	width: 100%;
	max-width: 100%;
}
.kajdut-chat-window.kajdut-open { display: flex; }

.kajdut-chat-header {
	background: var(--kajdut-primary);
	color: #fff;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.kajdut-header-avatar-wrap { position: relative; flex-shrink: 0; }
.kajdut-header-avatar, .kajdut-header-avatar-fallback {
	width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.2);
	display: flex; align-items: center; justify-content: center;
}
.kajdut-header-live-dot {
	position: absolute;
	bottom: -1px;
	right: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--kajdut-live-green);
	border: 2px solid var(--kajdut-primary);
}
.kajdut-header-text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; }
.kajdut-header-text strong { font-size: 15px; letter-spacing: 0.03em; text-transform: uppercase; }
.kajdut-status-text { font-size: 12px; opacity: 0.9; }
.kajdut-close-btn { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.kajdut-end-chat-btn {
	background: none;
	border: none;
	color: #fff;
	opacity: 0.85;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
}
.kajdut-end-chat-btn:hover { opacity: 1; }
.kajdut-end-chat-btn .dashicons { font-size: 18px; width: 18px; height: 18px; }

.kajdut-chat-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f7f8fa;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.kajdut-msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap; }
.kajdut-msg-user { align-self: flex-end; background: var(--kajdut-primary); color: #fff; border-bottom-right-radius: 4px; }
.kajdut-msg-ai { align-self: flex-start; background: #fff; color: var(--kajdut-text); border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.kajdut-msg-agent { align-self: flex-start; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-bottom-left-radius: 4px; }
.kajdut-msg-system { align-self: center; background: #fef3c7; color: #92400e; font-size: 12px; border-radius: 10px; padding: 6px 10px; }
.kajdut-msg-typing { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 10px 14px; }

.kajdut-typing-dots span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; background: #9ca3af; border-radius: 50%; animation: kajdut-blink 1.2s infinite; }
.kajdut-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.kajdut-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes kajdut-blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

.kajdut-chat-input-area {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}
.kajdut-chat-input-area textarea {
	flex: 1;
	resize: none;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 14px;
	max-height: 90px;
	font-family: inherit;
}
.kajdut-chat-input-area textarea:focus { outline: none; border-color: var(--kajdut-primary); }

/* ইমেজ অ্যাটাচমেন্ট বাটন */
.kajdut-attach-btn {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid #d1d5db;
	background: #fff;
	color: #6b7280;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.kajdut-attach-btn:hover { background: #f3f4f6; color: var(--kajdut-primary); border-color: var(--kajdut-primary); }
.kajdut-attach-btn .dashicons { font-size: 18px; width: 18px; height: 18px; }

/* সংযুক্ত ইমেজের প্রিভিউ (সেন্ড করার আগে) */
.kajdut-image-preview-wrap {
	position: relative;
	display: inline-flex;
	margin: 0 10px 8px;
	width: 64px;
	height: 64px;
}
.kajdut-image-preview-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
}
.kajdut-image-preview-wrap button {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ef4444;
	color: #fff;
	border: 2px solid #fff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

/* চ্যাট বাবলের ভেতরের ইমেজ */
.kajdut-msg img.kajdut-msg-image {
	display: block;
	max-width: 100%;
	max-height: 220px;
	border-radius: 10px;
	margin-top: 4px;
	cursor: pointer;
	object-fit: cover;
}
.kajdut-msg-typing-label {
	font-size: 11px;
	color: #9ca3af;
	margin: 2px 0 0 4px;
	align-self: flex-start;
}

/* সেন্ড বাটন - বড় হাতের অক্ষরে "SEND" লেখাসহ */
.kajdut-send-btn {
	min-width: 64px;
	height: 38px;
	padding: 0 16px;
	border-radius: 10px;
	border: none;
	background: var(--kajdut-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.kajdut-send-btn:hover { background: var(--kajdut-primary-dark); }
.kajdut-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
	.kajdut-chat-container { right: 12px; bottom: 12px; }
	.kajdut-chat-window { width: 92vw; height: 78vh; bottom: 70px; }
}
