/**
 * Frontend Chat Widget Stylesheet - AI Support Assistant Chatbot
 * Premium modern design with vibrant gradients, sleek glassmorphism, and responsive interactions.
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

.ai-support-assistant-wrapper {
	position: fixed;
	bottom: 28px;
	right: 28px;
	z-index: 999999;
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	box-sizing: border-box;
}

.ai-support-assistant-wrapper * {
	box-sizing: border-box;
}

/* ==========================================================================
   1. Floating Launcher Bubble
   ========================================================================== */
.ai-support-assistant-bubble {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #4f46e5 100%);
	color: #ffffff;
	box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.45), 0 4px 12px rgba(124, 58, 237, 0.3);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	position: relative;
	margin-left: auto;
}

/* Pulsing outer ring animation */
.ai-support-assistant-launcher-ping {
	position: absolute;
	top: -4px;
	left: -4px;
	right: -4px;
	bottom: -4px;
	border-radius: 50%;
	border: 2px solid rgba(99, 102, 241, 0.6);
	animation: wpRagPulseRing 2.6s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
	pointer-events: none;
}

@keyframes wpRagPulseRing {
	0% {
		transform: scale(0.95);
		opacity: 0.8;
	}
	50% {
		transform: scale(1.25);
		opacity: 0;
	}
	100% {
		transform: scale(0.95);
		opacity: 0;
	}
}

.ai-support-assistant-bubble:hover {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 0 12px 30px -4px rgba(99, 102, 241, 0.55), 0 6px 16px rgba(124, 58, 237, 0.4);
}

.ai-support-assistant-bubble.active {
	transform: scale(0.95);
	background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.ai-support-assistant-launcher-icon {
	color: #ffffff;
	transition: transform 0.25s ease;
}

.ai-support-assistant-bubble:hover .ai-support-assistant-launcher-icon {
	transform: scale(1.1);
}

/* ==========================================================================
   2. Chat Panel Box
   ========================================================================== */
.ai-support-assistant-box {
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 100%;
	min-width: 330px;
	max-width: 410px;
	background: #ffffff;
	border: 1px solid rgba(226, 232, 240, 0.9);
	border-radius: 24px;
	box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.18), 0 10px 24px -6px rgba(99, 102, 241, 0.12);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: wpRagWidgetSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	transform-origin: bottom right;
}

@keyframes wpRagWidgetSlideIn {
	from {
		transform: scale(0.88) translateY(24px);
		opacity: 0;
	}
	to {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
}

/* ==========================================================================
   3. Header Section
   ========================================================================== */
.ai-support-assistant-header {
	padding: 16px 20px;
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #6366f1 100%);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 2px 10px rgba(79, 70, 229, 0.15);
	position: relative;
}

.ai-support-assistant-header-identity {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ai-support-assistant-avatar-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-support-assistant-avatar-icon {
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.25);
	box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.ai-support-assistant-online-indicator {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 11px;
	height: 11px;
	background-color: #22c55e;
	border: 2px solid #4f46e5;
	border-radius: 50%;
	box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.ai-support-assistant-header-text h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.ai-support-assistant-status-text {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.85);
	font-weight: 500;
	display: block;
	margin-top: 2px;
}

.ai-support-assistant-header-controls {
	display: flex;
	gap: 6px;
}

.ai-support-assistant-header-controls button {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: rgba(255, 255, 255, 0.9);
	cursor: pointer;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.ai-support-assistant-header-controls button:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.28);
	transform: translateY(-1px);
}

/* ==========================================================================
   4. Chat Thread & Messages
   ========================================================================== */
.ai-support-assistant-body {
	flex-grow: 1;
	padding: 18px 16px;
	overflow-y: auto;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Custom Scrollbar */
.ai-support-assistant-body::-webkit-scrollbar {
	width: 5px;
}

.ai-support-assistant-body::-webkit-scrollbar-track {
	background: transparent;
}

.ai-support-assistant-body::-webkit-scrollbar-thumb {
	background: rgba(148, 163, 184, 0.3);
	border-radius: 10px;
}

.ai-support-assistant-msg {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	max-width: 88%;
	animation: wpRagMsgFade 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-support-assistant-msg-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.ai-support-assistant-msg-bot {
	align-self: flex-start;
}

.ai-support-assistant-msg-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-top: 2px;
	box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.ai-support-assistant-msg-content {
	padding: 12px 16px;
	font-size: 13.5px;
	line-height: 1.55;
	position: relative;
	word-break: break-word;
}

.ai-support-assistant-msg-user .ai-support-assistant-msg-content {
	background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
	color: #ffffff;
	border-radius: 18px 18px 4px 18px;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.ai-support-assistant-msg-bot .ai-support-assistant-msg-content {
	background-color: #ffffff;
	color: #1e293b;
	border-radius: 18px 18px 18px 4px;
	border: 1px solid rgba(226, 232, 240, 0.9);
	box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
}

.ai-support-assistant-msg-content p,
.ai-support-assistant-msg-paragraph {
	margin: 0 0 8px 0;
	line-height: 1.6;
	color: inherit;
}

.ai-support-assistant-msg-paragraph:last-child {
	margin-bottom: 0;
}

.ai-support-assistant-msg-heading {
	font-size: 14px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	margin: 10px 0 6px 0 !important;
	line-height: 1.35 !important;
}

.ai-support-assistant-msg-list {
	margin: 8px 0 10px 18px !important;
	padding: 0 !important;
	list-style-type: disc !important;
}

ol.ai-support-assistant-msg-list {
	list-style-type: decimal !important;
}

.ai-support-assistant-msg-list li {
	margin-bottom: 6px !important;
	line-height: 1.55 !important;
	color: #334155 !important;
	padding-left: 2px !important;
}

.ai-support-assistant-msg-list li:last-child {
	margin-bottom: 0 !important;
}

.ai-support-assistant-msg-list li strong {
	color: #0f172a !important;
	font-weight: 700 !important;
}

.ai-support-assistant-inline-code {
	font-family: 'Fira Code', Consolas, Monaco, monospace !important;
	font-size: 12px !important;
	background: rgba(99, 102, 241, 0.08) !important;
	color: #4f46e5 !important;
	padding: 2px 6px !important;
	border-radius: 4px !important;
}

/* Quick Prompt Suggestions */
.ai-support-assistant-quick-prompts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.ai-support-assistant-chip {
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	color: #334155;
	padding: 6px 11px;
	border-radius: 16px;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: inherit;
}

.ai-support-assistant-chip-icon {
	font-size: 12px;
}

.ai-support-assistant-chip:hover {
	background: #6366f1;
	color: #ffffff;
	border-color: #6366f1;
	transform: translateY(-1.5px);
	box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

/* Code Blocks inside messages */
.ai-support-assistant-msg-content pre {
	background: #0f172a;
	color: #f8fafc;
	padding: 10px 12px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 8px 0;
	font-family: 'Fira Code', Consolas, Monaco, monospace;
	font-size: 12px;
}

.ai-support-assistant-msg-content code {
	font-family: 'Fira Code', Consolas, Monaco, monospace;
	font-size: 12px;
	background: rgba(15, 23, 42, 0.06);
	padding: 2px 5px;
	border-radius: 4px;
}

.ai-support-assistant-msg-user code {
	background: rgba(255, 255, 255, 0.2);
}

/* Citation Sources */
.ai-support-assistant-citations {
	font-size: 11px;
	color: #475569;
	margin-top: 8px;
	padding: 6px 10px;
	background: #f8fafc;
	border-left: 3px solid #6366f1;
	border-radius: 0 6px 6px 0;
}

.ai-support-assistant-citations h5 {
	margin: 0 0 4px 0;
	font-weight: 700;
	color: #334155;
	font-size: 11px;
}

.ai-support-assistant-citations ul {
	margin: 0;
	padding-left: 14px;
}

.ai-support-assistant-citations li {
	margin-bottom: 2px;
}

/* Copy Action Button */
.ai-support-assistant-copy-btn {
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 2px 4px;
	margin-top: 6px;
	align-self: flex-end;
	font-size: 11px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	transition: all 0.2s ease;
	border-radius: 4px;
	font-family: inherit;
}

.ai-support-assistant-copy-btn:hover {
	color: #6366f1;
	background: rgba(99, 102, 241, 0.08);
}

/* Typing Indicator */
.ai-support-assistant-typing {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 4px 2px;
}

.ai-support-assistant-typing-dot {
	width: 6px;
	height: 6px;
	background-color: #6366f1;
	border-radius: 50%;
	animation: wpRagBounce 1.4s infinite ease-in-out both;
}

.ai-support-assistant-typing-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.ai-support-assistant-typing-dot:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes wpRagBounce {
	0%, 80%, 100% {
		transform: scale(0.3);
		opacity: 0.5;
	}
	40% {
		transform: scale(1.1);
		opacity: 1;
	}
}

/* ==========================================================================
   5. Footer & Input Area
   ========================================================================== */
.ai-support-assistant-footer {
	padding: 14px 16px 10px 16px;
	background: #ffffff;
	border-top: 1px solid #f1f5f9;
}

.ai-support-assistant-input-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: 20px;
	padding: 4px 6px 4px 14px;
	transition: all 0.25s ease;
}

.ai-support-assistant-input-wrapper:focus-within {
	border-color: #6366f1;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ai-support-assistant-footer textarea {
	flex-grow: 1;
	border: none;
	background: transparent;
	font-size: 13.5px;
	font-family: inherit;
	color: #0f172a;
	resize: none;
	outline: none;
	max-height: 90px;
	height: 26px;
	line-height: 1.4;
	overflow-y: hidden;
	padding: 4px 0;
}

.ai-support-assistant-footer textarea::placeholder {
	color: #94a3b8;
}

.ai-support-assistant-footer button#ai-support-assistant-submit-btn {
	background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
	color: #ffffff;
	border: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
	flex-shrink: 0;
	box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
	padding: 0;
}

.ai-support-assistant-footer button#ai-support-assistant-submit-btn:hover {
	background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
	transform: scale(1.08);
	box-shadow: 0 5px 14px rgba(79, 70, 229, 0.45);
}

.ai-support-assistant-footer button#ai-support-assistant-submit-btn:active {
	transform: scale(0.92);
}

.ai-support-assistant-send-icon {
	transition: transform 0.2s ease;
}

.ai-support-assistant-footer button#ai-support-assistant-submit-btn:hover .ai-support-assistant-send-icon {
	transform: translate(1px, -1px);
}

.ai-support-assistant-branding {
	text-align: center;
	font-size: 10.5px;
	color: #94a3b8;
	margin-top: 8px;
	font-weight: 500;
}

.ai-support-assistant-branding strong {
	color: #6366f1;
	font-weight: 600;
}

/* ==========================================================================
   6. Theme Presets (Dark Mode & Glassmorphism)
   ========================================================================== */

/* Dark Mode */
.ai-support-assistant-theme-dark .ai-support-assistant-box {
	background-color: #0f172a;
	border-color: rgba(255, 255, 255, 0.1);
	color: #f8fafc;
	box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.5);
}

.ai-support-assistant-theme-dark .ai-support-assistant-header {
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
}

.ai-support-assistant-theme-dark .ai-support-assistant-body {
	background-color: #0f172a;
}

.ai-support-assistant-theme-dark .ai-support-assistant-msg-bot .ai-support-assistant-msg-content {
	background-color: #1e293b;
	color: #f8fafc;
	border-color: #334155;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.ai-support-assistant-theme-dark .ai-support-assistant-chip {
	background: #1e293b;
	border-color: #334155;
	color: #cbd5e1;
}

.ai-support-assistant-theme-dark .ai-support-assistant-chip:hover {
	background: #6366f1;
	color: #ffffff;
	border-color: #6366f1;
}

.ai-support-assistant-theme-dark .ai-support-assistant-footer {
	background-color: #0f172a;
	border-top-color: #1e293b;
}

.ai-support-assistant-theme-dark .ai-support-assistant-input-wrapper {
	background-color: #1e293b;
	border-color: #334155;
}

.ai-support-assistant-theme-dark .ai-support-assistant-input-wrapper:focus-within {
	background-color: #1e293b;
	border-color: #6366f1;
}

.ai-support-assistant-theme-dark .ai-support-assistant-footer textarea {
	color: #f8fafc;
}

.ai-support-assistant-theme-dark .ai-support-assistant-citations {
	background-color: #1e293b;
	border-left-color: #6366f1;
	color: #cbd5e1;
}

.ai-support-assistant-theme-dark .ai-support-assistant-citations h5 {
	color: #e2e8f0;
}

/* Glassmorphism Preset */
.ai-support-assistant-theme-glass .ai-support-assistant-box {
	background: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.5);
	box-shadow: 0 20px 48px rgba(31, 38, 135, 0.18);
}

.ai-support-assistant-theme-glass .ai-support-assistant-body {
	background: transparent;
}

.ai-support-assistant-theme-glass .ai-support-assistant-msg-bot .ai-support-assistant-msg-content {
	background: rgba(255, 255, 255, 0.6);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.4);
}

.ai-support-assistant-theme-glass .ai-support-assistant-footer {
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.ai-support-assistant-theme-glass .ai-support-assistant-input-wrapper {
	background: rgba(255, 255, 255, 0.7);
	border-color: rgba(0, 0, 0, 0.1);
}