/* ==========================================
   WEB3S CHATBOT AI STYLE SHEET
   ========================================== */
:root {
	--primary-color: #0B3C5D;
	--secondary-color: #D9B310;
	--bg-card: #ffffff;
	--bg-light: #F5F7FA;
	--text-color: #2D3748;
	--text-muted: #718096;
	--border-color: #E2E8F0;
	--radius: 8px;
	--transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	--shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
	--shadow-md: 0 4px 6px rgba(0,0,0,0.05);
}

body.dark-mode {
	--bg-light: #0d131e;
	--bg-card: #1a202c;
	--text-color: #e2e8f0;
	--text-muted: #a0aec0;
	--border-color: #2d3748;
}

/* AI Q&A Page Shortcode Container */
.web3s-ai-qa-box {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	padding: 30px;
	border-radius: 16px;
	box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
	margin: 30px 0;
	position: relative;
	overflow: hidden;
}

.web3s-ai-qa-box::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(11, 60, 93, 0.03) 0%, transparent 60%);
	pointer-events: none;
}

#ai-chat-history {
	max-height: 400px;
	overflow-y: auto;
	margin-bottom: 25px;
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 20px;
	background: rgba(0, 0, 0, 0.02);
	scrollbar-width: thin;
	scrollbar-color: var(--primary-color) transparent;
}

body.dark-mode #ai-chat-history {
	background: rgba(255, 255, 255, 0.02);
}

#ai-chat-history::-webkit-scrollbar {
	width: 6px;
}

#ai-chat-history::-webkit-scrollbar-thumb {
	background-color: var(--border-color);
	border-radius: 3px;
}

.chat-bubble-user {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 15px;
	animation: slideInUp 0.3s ease;
}

.chat-bubble-user .bubble-content {
	background: linear-gradient(135deg, var(--primary-color), #165685);
	color: #fff;
	padding: 12px 18px;
	border-radius: 18px 18px 2px 18px;
	max-width: 80%;
	font-size: 14.5px;
	box-shadow: 0 4px 10px rgba(11, 60, 93, 0.15);
	line-height: 1.5;
	text-align: left;
}

.chat-bubble-ai {
	display: flex;
	justify-content: flex-start;
	margin-bottom: 15px;
	animation: slideInUp 0.3s ease;
}

.chat-bubble-ai .bubble-content {
	background: var(--bg-light);
	color: var(--text-color);
	padding: 12px 18px;
	border-radius: 18px 18px 18px 2px;
	max-width: 80%;
	font-size: 14.5px;
	border: 1px solid var(--border-color);
	box-shadow: var(--shadow-sm);
	line-height: 1.6;
	text-align: left;
}

.chat-bubble-error .bubble-content {
	background: #fdf2f2 !important;
	color: #9b1c1c !important;
	border-color: #fbd5d5 !important;
}

body.dark-mode .chat-bubble-error .bubble-content {
	background: #2e1818 !important;
	color: #f8b4b4 !important;
	border-color: #4b1a1a !important;
}

.ai-textarea {
	width: 100%;
	border: 1px solid var(--border-color);
	border-radius: 12px;
	background: var(--bg-card);
	color: var(--text-color);
	padding: 15px;
	font-size: 14.5px;
	transition: var(--transition);
	resize: none;
	outline: none;
}

.ai-textarea:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(11, 60, 93, 0.15);
}

.ai-submit-btn {
	background-color: var(--primary-color);
	color: #ffffff;
	border: none;
	border-radius: 30px;
	padding: 12px 25px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: var(--transition);
	width: 100%;
	margin-top: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.ai-submit-btn:hover:not(:disabled) {
	background-color: var(--secondary-color);
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(217, 179, 16, 0.3);
}

.ai-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ==========================================
   FLOATING WIDGET CHAT
   ========================================== */
.ai-widget-toggler {
	position: fixed;
	bottom: 25px;
	right: 25px;
	width: 60px;
	height: 60px;
	background: linear-gradient(135deg, var(--primary-color), #165685);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 5px 25px rgba(11, 60, 93, 0.35);
	cursor: pointer;
	z-index: 9999;
	transition: var(--transition);
	border: 2px solid rgba(255, 255, 255, 0.1);
}

.ai-widget-toggler i {
	font-size: 24px;
}

.ai-widget-toggler:hover {
	transform: scale(1.1) rotate(5deg);
	box-shadow: 0 8px 30px rgba(11, 60, 93, 0.45);
}

.ai-widget-container {
	position: fixed;
	bottom: 95px;
	right: 25px;
	width: 380px;
	max-width: calc(100vw - 50px);
	height: 520px;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 9999;
	transform: scale(0.85) translateY(30px);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-widget-container.active {
	transform: scale(1) translateY(0);
	opacity: 1;
	visibility: visible;
}

.ai-widget-header {
	background: linear-gradient(135deg, var(--primary-color), #165685);
	color: #fff;
	padding: 12px 15px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-widget-persona-profile {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ai-widget-avatar-container {
	position: relative;
	display: flex;
	align-items: center;
}

.ai-widget-avatar-container img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
}

.ai-widget-avatar-container .avatar-placeholder {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	color: var(--primary-color);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 700;
	border: 2px solid #fff;
}

.ai-widget-avatar-container .status-dot {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 10px;
	height: 10px;
	background-color: #22c55e;
	border: 2px solid #fff;
	border-radius: 50%;
	display: block;
}

.ai-widget-persona-meta {
	text-align: left;
}

.ai-widget-persona-meta h4 {
	margin: 0;
	font-size: 14.5px;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
}

.ai-widget-persona-meta p {
	margin: 0;
	font-size: 11px;
	opacity: 0.9;
	color: #f1f5f9;
	line-height: 1.2;
}

.ai-widget-close-btn {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	font-size: 20px;
	transition: var(--transition);
	padding: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-widget-close-btn:hover {
	color: #fff;
	transform: scale(1.15);
}

.ai-widget-history {
	flex: 1;
	padding: 20px 15px;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.01);
	scrollbar-width: thin;
	scrollbar-color: var(--primary-color) transparent;
}

body.dark-mode .ai-widget-history {
	background: rgba(255, 255, 255, 0.01);
}

.ai-widget-history::-webkit-scrollbar {
	width: 5px;
}

.ai-widget-history::-webkit-scrollbar-thumb {
	background-color: var(--border-color);
	border-radius: 3px;
}

.ai-widget-form {
	padding: 15px;
	border-top: 1px solid var(--border-color);
	display: flex;
	gap: 10px;
	background: var(--bg-card);
	align-items: center;
}

.ai-widget-input-field {
	flex: 1;
	border: 1px solid var(--border-color);
	border-radius: 24px;
	padding: 10px 18px;
	font-size: 14px;
	outline: none;
	background: var(--bg-card);
	color: var(--text-color);
	transition: var(--transition);
}

.ai-widget-input-field:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(11, 60, 93, 0.1);
}

.ai-widget-send-button {
	background: var(--primary-color);
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: var(--transition);
	box-shadow: 0 3px 8px rgba(11, 60, 93, 0.2);
	padding: 0;
}

.ai-widget-send-button:hover {
	background: var(--secondary-color);
	transform: scale(1.05);
}

.ai-widget-send-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Invitation Tooltip */
.ai-widget-invitation {
	position: fixed;
	bottom: 95px;
	right: 25px;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 15px 35px 15px 18px;
	box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
	z-index: 9998;
	max-width: 300px;
	font-size: 13.5px;
	color: var(--text-color);
	cursor: pointer;
	transform: translateY(15px);
	opacity: 0;
	visibility: hidden;
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	text-align: left;
	border-left: 4px solid var(--secondary-color);
}

.ai-widget-invitation.active {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
}

.ai-widget-invitation:hover {
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.ai-widget-invitation-close {
	position: absolute;
	top: 5px;
	right: 5px;
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	font-size: 16px;
	padding: 2px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-widget-invitation-close:hover {
	color: var(--text-color);
}

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

/* ==========================================
   ADVANCED FEATURES STYLE SHEET
   ========================================== */

/* Lead Capture Form */
.web3s-lead-container {
	padding: 20px 0;
	background: transparent;
	display: flex;
	flex-direction: column;
	text-align: left;
}

.web3s-lead-title {
	margin: 0 0 10px 0;
	font-size: 18px;
	font-weight: 800;
	color: var(--primary-color);
}

.web3s-lead-desc {
	margin: 0 0 20px 0;
	font-size: 13.5px;
	color: var(--text-muted);
	line-height: 1.4;
}

.web3s-lead-field {
	margin-bottom: 15px;
}

.web3s-lead-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--text-color);
	display: block;
	margin-bottom: 6px;
}

.web3s-lead-input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 12px;
	font-size: 14px;
	outline: none;
	background: var(--bg-card);
	color: var(--text-color);
	transition: var(--transition);
}

.web3s-lead-input:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(11, 60, 93, 0.1);
}

.web3s-lead-submit {
	width: 100%;
	background: var(--primary-color);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 12px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: var(--transition);
	margin-top: 10px;
}

.web3s-lead-submit:hover {
	background: var(--secondary-color);
}

/* Voice Input Microphone */
.ai-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	border: 1px solid var(--border-color);
	border-radius: 12px;
	background: var(--bg-card);
	overflow: hidden;
}

.ai-input-wrapper .ai-textarea,
.ai-input-wrapper .ai-widget-input-field {
	border: none !important;
	box-shadow: none !important;
	flex: 1;
	background: transparent !important;
}

.ai-mic-btn {
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--transition);
	border-left: 1px solid var(--border-color);
	flex-shrink: 0;
}

.ai-mic-btn:hover {
	color: var(--primary-color);
	background: rgba(0,0,0,0.02);
}

.ai-mic-btn.listening {
	color: #e53e3e;
	background: rgba(229, 62, 62, 0.08);
	animation: pulse-mic 1.5s infinite;
}

/* Smart Routing CTA Card */
.ai-routing-cta-box {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.ai-routing-cta-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	transition: var(--transition);
	box-shadow: var(--shadow-sm);
}

.ai-routing-cta-btn.zalo {
	background: #0068ff;
	color: #ffffff !important;
}

.ai-routing-cta-btn.phone {
	background: #22c55e;
	color: #ffffff !important;
}

.ai-routing-cta-btn:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	opacity: 0.95;
}

