/* ==========================================================================
   AI Receptionist Chat — "Emily" Floating Chat Widget
   ========================================================================== */

/* ── Chat Bubble ─────────────────────────────────────────────────────── */

#arc-chat-bubble {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #494fdf;
	color: #fff;
	border: none;
	cursor: pointer;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(73, 79, 223, 0.4);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#arc-chat-bubble:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 28px rgba(73, 79, 223, 0.55);
}

#arc-chat-bubble:active {
	transform: scale(0.95);
}

#arc-chat-bubble svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

/* ── Chat Drawer / Panel ────────────────────────────────────────────── */

#arc-chat-drawer {
	position: fixed;
	bottom: 96px;
	right: 24px;
	width: 380px;
	max-height: 550px;
	background: #16181a;
	color: #fff;
	border-radius: 16px;
	overflow: hidden;
	z-index: 9998;
	display: none;
	flex-direction: column;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
	animation: arc-slide-up 0.3s ease forwards;
}

#arc-chat-drawer.arc-open {
	display: flex;
}

@keyframes arc-slide-up {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ── Chat Header ────────────────────────────────────────────────────── */

#arc-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #494fdf;
	color: #fff;
	flex-shrink: 0;
}

#arc-chat-header-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

#arc-chat-header-title svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

#arc-chat-close {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

#arc-chat-close:hover {
	background: rgba(255, 255, 255, 0.15);
}

#arc-chat-close svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* ── Chat Messages Area ─────────────────────────────────────────────── */

#arc-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
	background: #000;
}

#arc-chat-messages::-webkit-scrollbar {
	width: 5px;
}

#arc-chat-messages::-webkit-scrollbar-track {
	background: transparent;
}

#arc-chat-messages::-webkit-scrollbar-thumb {
	background: #333;
	border-radius: 10px;
}

/* ── Message Bubbles ────────────────────────────────────────────────── */

.arc-message {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
	animation: arc-fade-in 0.25s ease;
}

@keyframes arc-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.arc-message--user {
	align-self: flex-end;
	background: #494fdf;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.arc-message--emily {
	align-self: flex-start;
	background: #222426;
	color: #fff;
	border-bottom-left-radius: 4px;
}

.arc-message--emily .arc-message__sender {
	font-size: 11px;
	font-weight: 600;
	color: #494fdf;
	margin-bottom: 2px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ── Typing Indicator ────────────────────────────────────────────────── */

.arc-typing {
	align-self: flex-start;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 16px;
	background: #222426;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
}

.arc-typing__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #666;
	animation: arc-bounce 1.4s ease-in-out infinite;
}

.arc-typing__dot:nth-child(2) {
	animation-delay: 0.2s;
}

.arc-typing__dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes arc-bounce {
	0%, 60%, 100% {
		transform: translateY(0);
		background: #666;
	}
	30% {
		transform: translateY(-6px);
		background: #aaa;
	}
}

/* ── Chat Input Bar ─────────────────────────────────────────────────── */

#arc-chat-input-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	background: #16181a;
	border-top: 1px solid #2a2a2a;
	flex-shrink: 0;
}

#arc-chat-input {
	flex: 1;
	background: #222426;
	border: 1px solid #333;
	border-radius: 10px;
	padding: 10px 14px;
	color: #fff;
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s ease;
}

#arc-chat-input::placeholder {
	color: #666;
}

#arc-chat-input:focus {
	border-color: #494fdf;
}

#arc-chat-send {
	background: #494fdf;
	border: none;
	border-radius: 10px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
	flex-shrink: 0;
}

#arc-chat-send:hover {
	background: #5c62e8;
}

#arc-chat-send:disabled {
	background: #333;
	cursor: not-allowed;
}

#arc-chat-send svg {
	width: 18px;
	height: 18px;
	fill: #fff;
}

/* ── Mobile Responsive ──────────────────────────────────────────────── */

@media (max-width: 767px) {

	#arc-chat-drawer {
		position: fixed;
		bottom: 0;
		right: 0;
		left: 0;
		width: 100%;
		max-height: 85vh;
		border-radius: 16px 16px 0 0;
		animation: arc-slide-up-mobile 0.3s ease forwards;
	}

	@keyframes arc-slide-up-mobile {
		from {
			opacity: 0;
			transform: translateY(40px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	#arc-chat-bubble {
		bottom: 16px;
		right: 16px;
	}
}
