/*!
 * Aryavarta AI Chatbot — Frontend stylesheet
 * Luxury white / black / gold theme with glassmorphism.
 * Fully scoped to #aryavarta-chatbot-root to avoid theme conflicts.
 */

/* CSS variables (fallback defaults; live values are printed inline by PHP) */
:root {
	--dlc-primary: #0b0b0b;
	--dlc-accent:  #c8a14a;
	--dlc-bg:      #ffffff;
	--dlc-text:    #0b0b0b;
}

#aryavarta-chatbot-root,
#aryavarta-chatbot-root * {
	box-sizing: border-box;
}

#aryavarta-chatbot-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--dlc-text);
	line-height: 1.45;
}

/* ====================== Launcher ====================== */
#aryavarta-chatbot-root .dlc-launcher {
	position: relative;
	width: 60px;
	height: 60px;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	background: linear-gradient(135deg, var(--dlc-primary) 0%, #1f1f1f 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
	transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
	outline: none;
}

#aryavarta-chatbot-root .dlc-launcher:hover {
	transform: translateY(-2px) scale(1.04);
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32), 0 0 0 1px var(--dlc-accent) inset;
}

#aryavarta-chatbot-root .dlc-launcher:focus-visible {
	box-shadow: 0 0 0 3px var(--dlc-accent), 0 10px 30px rgba(0, 0, 0, 0.25);
}

#aryavarta-chatbot-root .dlc-launcher.dlc-hide {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.6);
}

#aryavarta-chatbot-root .dlc-launcher-icon {
	color: var(--dlc-accent);
	display: inline-flex;
}

#aryavarta-chatbot-root .dlc-launcher-pulse {
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid var(--dlc-accent);
	opacity: 0.6;
	animation: dlc-pulse 2.2s ease-out infinite;
	pointer-events: none;
}

@keyframes dlc-pulse {
	0%   { transform: scale(0.85); opacity: 0.7; }
	70%  { transform: scale(1.18); opacity: 0;   }
	100% { transform: scale(1.18); opacity: 0;   }
}

/* ====================== Panel ====================== */
#aryavarta-chatbot-root .dlc-panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: min(380px, calc(100vw - 24px));
	max-height: min(640px, calc(100vh - 110px));
	background: rgba(255, 255, 255, 0.92);
	color: var(--dlc-text);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	border-radius: 20px;
	border: 1px solid rgba(200, 161, 74, 0.25);
	box-shadow:
		0 20px 60px rgba(0, 0, 0, 0.25),
		0 0 0 1px rgba(255, 255, 255, 0.5) inset;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.97);
	pointer-events: none;
	transition: opacity 0.28s ease, transform 0.28s cubic-bezier(.2,.7,.2,1);
	contain: content;
}

#aryavarta-chatbot-root .dlc-panel.dlc-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Dark theme */
#aryavarta-chatbot-root .dlc-panel.dlc-theme-dark {
	background: rgba(20, 20, 20, 0.88);
	color: #f5f5f5;
	border-color: rgba(200, 161, 74, 0.35);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
@media (prefers-color-scheme: dark) {
	#aryavarta-chatbot-root .dlc-panel:not(.dlc-theme-light) {
		background: rgba(20, 20, 20, 0.88);
		color: #f5f5f5;
		border-color: rgba(200, 161, 74, 0.35);
	}
}

/* ====================== Header ====================== */
#aryavarta-chatbot-root .dlc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--dlc-primary) 0%, #1d1d1d 100%);
	color: #fff;
	border-bottom: 1px solid rgba(200, 161, 74, 0.4);
}

#aryavarta-chatbot-root .dlc-header-left {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

#aryavarta-chatbot-root .dlc-logo {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	background: #fff;
	border: 1.5px solid var(--dlc-accent);
}

#aryavarta-chatbot-root .dlc-logo-fallback {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--dlc-accent);
	color: #0b0b0b;
	font-weight: 700;
	font-size: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid #fff;
}

#aryavarta-chatbot-root .dlc-header-meta {
	min-width: 0;
}
#aryavarta-chatbot-root .dlc-header-title {
	font-weight: 600;
	font-size: 15px;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#aryavarta-chatbot-root .dlc-header-sub {
	font-size: 11.5px;
	color: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 2px;
}
#aryavarta-chatbot-root .dlc-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
	display: inline-block;
}

#aryavarta-chatbot-root .dlc-header-right {
	display: flex;
	gap: 6px;
}
#aryavarta-chatbot-root .dlc-header-btn {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, color 0.2s ease;
	padding: 0;
}
#aryavarta-chatbot-root .dlc-header-btn:hover {
	background: var(--dlc-accent);
	color: #0b0b0b;
}
#aryavarta-chatbot-root .dlc-header-btn:focus-visible {
	outline: 2px solid var(--dlc-accent);
	outline-offset: 2px;
}

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

#aryavarta-chatbot-root .dlc-messages::-webkit-scrollbar {
	width: 6px;
}
#aryavarta-chatbot-root .dlc-messages::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 3px;
}
.dlc-theme-dark .dlc-messages::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
}

#aryavarta-chatbot-root .dlc-msg {
	display: flex;
	gap: 8px;
	max-width: 95%;
	align-items: flex-end;
}
#aryavarta-chatbot-root .dlc-msg-bot { align-self: flex-start; }
#aryavarta-chatbot-root .dlc-msg-user { align-self: flex-end; flex-direction: row-reverse; }

#aryavarta-chatbot-root .dlc-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--dlc-accent);
	color: #0b0b0b;
	font-weight: 700;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-bottom: 2px;
}

#aryavarta-chatbot-root .dlc-bubble {
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.45;
	max-width: 280px;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

#aryavarta-chatbot-root .dlc-msg-bot .dlc-bubble {
	background: #f3f3f3;
	color: var(--dlc-text);
	border-bottom-left-radius: 6px;
}
.dlc-theme-dark .dlc-msg-bot .dlc-bubble {
	background: rgba(255, 255, 255, 0.08);
	color: #f5f5f5;
}

#aryavarta-chatbot-root .dlc-msg-user .dlc-bubble {
	background: linear-gradient(135deg, var(--dlc-primary) 0%, #2a2a2a 100%);
	color: #fff;
	border-bottom-right-radius: 6px;
	border: 1px solid var(--dlc-accent);
}

#aryavarta-chatbot-root .dlc-msg-in {
	animation: dlc-msg-in 0.28s cubic-bezier(.2,.7,.2,1);
}
@keyframes dlc-msg-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Typing dots */
#aryavarta-chatbot-root .dlc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
#aryavarta-chatbot-root .dlc-typing-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	animation: dlc-typing 1.4s infinite ease-in-out;
}
.dlc-theme-dark .dlc-typing-dot { background: rgba(255, 255, 255, 0.5); }
#aryavarta-chatbot-root .dlc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
#aryavarta-chatbot-root .dlc-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dlc-typing {
	0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
	40%         { transform: scale(1);   opacity: 1;   }
}

/* ====================== Footer / Inputs ====================== */
#aryavarta-chatbot-root .dlc-footer {
	padding: 10px 12px 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	background: rgba(255, 255, 255, 0.6);
	position: relative;
}
.dlc-theme-dark .dlc-footer {
	background: rgba(0, 0, 0, 0.25);
	border-top-color: rgba(255, 255, 255, 0.08);
}

#aryavarta-chatbot-root .dlc-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
#aryavarta-chatbot-root .dlc-choice {
	flex: 1 1 auto;
	min-width: calc(50% - 4px);
	padding: 10px 12px;
	border-radius: 12px;
	border: 1.5px solid var(--dlc-accent);
	background: rgba(255, 255, 255, 0.7);
	color: var(--dlc-text);
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.dlc-theme-dark .dlc-choice {
	background: rgba(255, 255, 255, 0.05);
	color: #f5f5f5;
}
#aryavarta-chatbot-root .dlc-choice:hover,
#aryavarta-chatbot-root .dlc-choice:focus-visible {
	background: var(--dlc-accent);
	color: #0b0b0b;
	transform: translateY(-1px);
	outline: none;
	box-shadow: 0 6px 16px rgba(200, 161, 74, 0.35);
}

#aryavarta-chatbot-root .dlc-input-row {
	display: flex;
	gap: 8px;
	align-items: center;
}
#aryavarta-chatbot-root .dlc-input {
	flex: 1;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
	color: var(--dlc-text);
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	font-family: inherit;
	min-width: 0;
}
.dlc-theme-dark .dlc-input {
	background: rgba(255, 255, 255, 0.07);
	color: #f5f5f5;
	border-color: rgba(255, 255, 255, 0.15);
}
#aryavarta-chatbot-root .dlc-input:focus {
	border-color: var(--dlc-accent);
	box-shadow: 0 0 0 3px rgba(200, 161, 74, 0.25);
}
#aryavarta-chatbot-root .dlc-input-error {
	border-color: #e11d48 !important;
	box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18) !important;
}

#aryavarta-chatbot-root .dlc-send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, var(--dlc-primary) 0%, #1f1f1f 100%);
	color: var(--dlc-accent);
	cursor: pointer;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#aryavarta-chatbot-root .dlc-send:hover {
	transform: scale(1.06);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
#aryavarta-chatbot-root .dlc-send:focus-visible {
	outline: 2px solid var(--dlc-accent);
	outline-offset: 2px;
}

#aryavarta-chatbot-root .dlc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

#aryavarta-chatbot-root .dlc-error {
	color: #e11d48;
	font-size: 12px;
	margin-top: 6px;
	min-height: 1em;
}

/* Autocomplete dropdown */
#aryavarta-chatbot-root .dlc-autocomplete { position: relative; }
#aryavarta-chatbot-root .dlc-suggestions {
	list-style: none;
	margin: 6px 0 0;
	padding: 6px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	max-height: 180px;
	overflow-y: auto;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
	display: none;
}
#aryavarta-chatbot-root .dlc-suggestions.dlc-suggestions-open {
	display: block;
}
.dlc-theme-dark .dlc-suggestions {
	background: #1a1a1a;
	border-color: rgba(255, 255, 255, 0.12);
}
#aryavarta-chatbot-root .dlc-suggestion {
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 13.5px;
	color: var(--dlc-text);
}
.dlc-theme-dark .dlc-suggestion { color: #f5f5f5; }
#aryavarta-chatbot-root .dlc-suggestion:hover {
	background: var(--dlc-accent);
	color: #0b0b0b;
}

/* Submitting & done states */
#aryavarta-chatbot-root .dlc-submitting {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: center;
	padding: 10px;
	font-size: 13.5px;
	color: rgba(0, 0, 0, 0.65);
}
.dlc-theme-dark .dlc-submitting { color: rgba(255, 255, 255, 0.75); }
#aryavarta-chatbot-root .dlc-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--dlc-accent);
	border-radius: 50%;
	animation: dlc-spin 0.9s linear infinite;
}
@keyframes dlc-spin { to { transform: rotate(360deg); } }

#aryavarta-chatbot-root .dlc-footer-done {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-radius: 12px;
	background: linear-gradient(135deg, rgba(200, 161, 74, 0.15) 0%, rgba(200, 161, 74, 0.05) 100%);
	border: 1px solid rgba(200, 161, 74, 0.4);
	color: var(--dlc-text);
}
.dlc-theme-dark .dlc-footer-done { color: #f5f5f5; }
#aryavarta-chatbot-root .dlc-done-icon {
	color: var(--dlc-accent);
	display: inline-flex;
	flex-shrink: 0;
}
#aryavarta-chatbot-root .dlc-done-text { font-size: 13.5px; }

#aryavarta-chatbot-root .dlc-retry {
	margin-top: 8px;
	padding: 8px 14px;
	border-radius: 10px;
	border: 1.5px solid var(--dlc-accent);
	background: transparent;
	color: var(--dlc-text);
	font-weight: 500;
	cursor: pointer;
}
.dlc-theme-dark .dlc-retry { color: #f5f5f5; }
#aryavarta-chatbot-root .dlc-retry:hover {
	background: var(--dlc-accent);
	color: #0b0b0b;
}

/* Brand footer */
#aryavarta-chatbot-root .dlc-brand {
	text-align: center;
	font-size: 10.5px;
	color: rgba(0, 0, 0, 0.45);
	padding: 6px 12px 10px;
	background: rgba(255, 255, 255, 0.55);
	letter-spacing: 0.02em;
}
.dlc-theme-dark .dlc-brand {
	color: rgba(255, 255, 255, 0.5);
	background: rgba(0, 0, 0, 0.25);
}
#aryavarta-chatbot-root .dlc-brand strong { color: var(--dlc-accent); }

/* ====================== Responsive ====================== */
@media (max-width: 480px) {
	#aryavarta-chatbot-root {
		right: 12px;
		bottom: 12px;
	}
	#aryavarta-chatbot-root .dlc-panel {
		width: calc(100vw - 24px);
		bottom: 76px;
		max-height: min(80vh, 580px);
	}
	#aryavarta-chatbot-root .dlc-launcher {
		width: 56px;
		height: 56px;
	}
	#aryavarta-chatbot-root .dlc-choice {
		min-width: 100%;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	#aryavarta-chatbot-root *, #aryavarta-chatbot-root *::before, #aryavarta-chatbot-root *::after {
		animation-duration: 0.001s !important;
		transition-duration: 0.001s !important;
	}
}

/* ============ Send button label ============ */
#aryavarta-chatbot-root .dlc-send {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0 14px;
	min-width: 40px;
	height: 40px;
	border-radius: 20px;
	border: none;
	background: linear-gradient(135deg, var(--dlc-primary) 0%, #1f1f1f 100%);
	color: var(--dlc-accent);
	cursor: pointer;
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	white-space: nowrap;
}
#aryavarta-chatbot-root .dlc-send .dlc-send-label {
	font-size: 12px;
	font-weight: 600;
}
#aryavarta-chatbot-root .dlc-send:hover {
	transform: scale(1.04);
	box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

/* ============ Done footer ============ */
#aryavarta-chatbot-root .dlc-footer-done {
	padding: 14px 16px;
}
#aryavarta-chatbot-root .dlc-done-top {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 14px;
}
#aryavarta-chatbot-root .dlc-done-icon {
	flex-shrink: 0;
	margin-top: 1px;
}
#aryavarta-chatbot-root .dlc-done-text {
	font-size: 13px;
	color: #374151;
	line-height: 1.5;
}
.dlc-theme-dark .dlc-done-text { color: #d1d5db; }

/* ============ CTA Buttons ============ */
#aryavarta-chatbot-root .dlc-cta-row {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

#aryavarta-chatbot-root .dlc-cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	flex: 1;
	min-width: 120px;
	padding: 11px 16px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	border: none;
	letter-spacing: 0.01em;
}

#aryavarta-chatbot-root .dlc-cta-call {
	background: linear-gradient(135deg, var(--dlc-primary) 0%, #1f1f1f 100%);
	color: var(--dlc-accent);
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#aryavarta-chatbot-root .dlc-cta-call:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.35);
	color: var(--dlc-accent);
	text-decoration: none;
}

#aryavarta-chatbot-root .dlc-cta-wa {
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	color: #fff;
	box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}
#aryavarta-chatbot-root .dlc-cta-wa:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
	color: #fff;
	text-decoration: none;
}

/* ============ Branding link ============ */
#aryavarta-chatbot-root .dlc-brand-link {
	color: var(--dlc-accent);
	text-decoration: none;
	font-weight: 600;
}
#aryavarta-chatbot-root .dlc-brand-link:hover {
	text-decoration: underline;
}

/* ============ Settings heading ============ */
.dlc-settings-heading {
	font-size: 16px !important;
	font-weight: 700 !important;
	color: #0b0b0b !important;
	margin: 32px 0 10px !important;
	padding-bottom: 8px !important;
	border-bottom: 2px solid #c8a14a !important;
}

/* ── Captcha ─────────────────────────── */
#aryavarta-chatbot-root .dlc-captcha-wrap { padding: 4px 0; }
#aryavarta-chatbot-root .dlc-captcha-input { max-width: 120px; text-align: center; font-size: 18px; font-weight: 700; letter-spacing: .08em; }
#aryavarta-chatbot-root .dlc-captcha-refresh { background: transparent; border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 10px; cursor: pointer; color: #6b7280; margin-top: 6px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
#aryavarta-chatbot-root .dlc-captcha-refresh:hover { border-color: var(--dlc-accent); color: var(--dlc-accent); }
#aryavarta-chatbot-root .dlc-captcha-err { font-size: 12px; color: #dc2626; margin-top: 4px; }

/* ── Setup notice (shown when no questions configured) ─── */
#aryavarta-chatbot-root .dlc-setup-notice {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-left: 4px solid #c8a14a;
	border-radius: 10px;
	padding: 14px 16px;
	margin: 8px;
	font-size: 13px;
	color: #374151;
}
#aryavarta-chatbot-root .dlc-setup-notice p {
	margin: 0 0 6px;
	line-height: 1.5;
}
#aryavarta-chatbot-root .dlc-setup-notice p:last-of-type { margin-bottom: 10px; }
#aryavarta-chatbot-root .dlc-setup-link {
	display: inline-block;
	background: #c8a14a;
	color: #0b0b0b;
	font-weight: 700;
	font-size: 12px;
	padding: 6px 14px;
	border-radius: 8px;
	text-decoration: none;
}
#aryavarta-chatbot-root .dlc-setup-link:hover { opacity: .85; }
