/* ===== Chatbot Styles (Aesthetic Redesign) ===== */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600&display=swap');

:root {
	--ac-primary: #2563EB;
	--ac-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
	--ac-bg-glass: rgba(255, 255, 255, 0.85);
	--ac-border-glass: rgba(255, 255, 255, 0.6);
	--ac-shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
	--ac-radius: 24px;
	--ac-font: 'Figtree', sans-serif;
}

/* Launcher */
#ac-chatbot-launcher {
	position: fixed;
	bottom: 30px;
	right: 30px;
	width: 70px;
	height: 70px;
	border-radius: 50%;
	background: var(--ac-primary-gradient);
	border: none;
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 9999;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

#ac-chatbot-launcher:hover {
	transform: scale(1.1) rotate(5deg);
	box-shadow: 0 12px 30px rgba(42, 183, 255, 0.45);
}

#ac-chatbot-launcher svg,
#ac-chatbot-launcher img {
	width: 40px;
	height: 40px;
	transition: transform 0.3s ease;
}

/* Window */
.ac-chatbot {
	position: fixed;
	bottom: 110px;
	right: 30px;
	width: 380px;
	height: 600px;
	/* Taller */
	max-height: 80vh;
	border-radius: var(--ac-radius);
	box-shadow: var(--ac-shadow-lg);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 10000;
	font-family: var(--ac-font);
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.05);
	opacity: 0;
	transform: translateY(20px) scale(0.95);
	pointer-events: none;
	/* hidden state */
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Visible state (managed by JS toggling class, assuming 'ac-active' or removing 'ac-hidden') */
.ac-chatbot:not(.ac-hidden) {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.ac-hidden {
	display: flex;
	/* keep flex layout but hide via opacity/pointer-events defined above */
	opacity: 0 !important;
	pointer-events: none !important;
	transform: translateY(20px) scale(0.95) !important;
}

/* Header */
.ac-header {
	background: var(--ac-primary-gradient);
	color: #fff;
	padding: 20px 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-weight: 600;
	font-size: 1.1rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	position: relative;
	z-index: 2;
}

.ac-header span {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ac-header span::before {
	content: '';
	width: 10px;
	height: 10px;
	background: #22c55e;
	/* Online dot */
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.ac-header button {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: #fff;
	width: 45px;
	height: 45px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 40px;
	cursor: pointer;
	transition: background 0.2s ease;
	line-height: 1;
}

.ac-header button:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Body */
.ac-body {
	padding: 20px;
	background: #f8fafc;
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
	/* Custom Scrollbar */
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.ac-body::-webkit-scrollbar {
	width: 6px;
}

.ac-body::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, 0.1);
	border-radius: 10px;
}

/* Messages */
.ac-msg {
	display: flex;
	max-width: 85%;
	animation: messageSlide 0.3s ease-out forwards;
}

@keyframes messageSlide {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ac-bot {
	align-self: flex-start;
}

.ac-user {
	align-self: flex-end;
}

.ac-bubble {
	padding: 12px 16px;
	font-size: 0.95rem;
	line-height: 1.5;
	position: relative;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ac-bot .ac-bubble {
	background: #ffffff;
	color: #1e293b;
	border-radius: 18px 18px 18px 4px;
	border: 1px solid #e2e8f0;
}

.ac-user .ac-bubble {
	background: var(--ac-primary-gradient);
	color: #fff;
	border-radius: 18px 18px 4px 18px;
}

/* Quick replies */
.ac-quick {
	padding: 12px 20px;
	background: #ffffff;
	display: flex;
	gap: 8px;
	overflow-x: auto;
	border-top: 1px solid #f1f5f9;
	/* Hide scrollbar */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.ac-quick::-webkit-scrollbar {
	display: none;
}

.ac-quick-btn {
	border-radius: 20px;
	border: 1px solid #e2e8f0;
	background: #fff;
	color: #475569;
	font-size: 0.85rem;
	font-weight: 500;
	padding: 6px 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
	margin-top: 5px;
}

.ac-quick-btn:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	transform: translateY(-1px);
}

/* Footer */
.ac-footer {
	padding: 16px 20px;
	background: #ffffff;
	border-top: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	gap: 12px;
}

#ac-chat-input {
	flex: 1;
	background: #f1f5f9;
	border: 1px solid transparent;
	border-radius: 24px;
	padding: 12px 18px;
	font-size: 0.95rem;
	color: #1e293b;
	outline: none;
	transition: all 0.2s ease;
}

#ac-chat-input:focus {
	background: #fff;
	border-color: var(--ac-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#ac-chat-send {
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: var(--ac-primary-gradient);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	flex-shrink: 0;
}

#ac-chat-send:active {
	transform: scale(0.95);
}

#ac-chat-send:hover {
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Mobile Responsive */
@media (max-width: 480px) {
	#ac-chatbot-launcher {
		bottom: 20px;
		right: 20px;
		width: 56px;
		height: 56px;
	}

	.ac-chatbot {
		right: 20px;
		bottom: 90px;
		width: calc(100% - 40px);
		height: 60vh;
		max-height: 600px;
		border-radius: 24px;
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
		transform: translateY(20px) scale(0.95);
		opacity: 0;
		pointer-events: none;
	}

	.ac-chatbot:not(.ac-hidden) {
		transform: translateY(0) scale(1);
		opacity: 1;
		pointer-events: auto;
	}

	.ac-header {
		padding: 16px 20px;
	}
}