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

#cfc-chat-container {
	--cfc-navy-dark: #0F1428;
	--cfc-navy: #12172B;
	--cfc-navy-light: #1B2340;
	--cfc-blue: #264065;
	--cfc-blue-light: #274e85;
	--cfc-green: #3DDC97;
	--cfc-bg: #F3F5FA;
	--cfc-text: #1A1D29;
	--cfc-text-muted: #767B8C;
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#cfc-chat-bubble {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--cfc-navy) 0%, var(--cfc-navy-dark) 100%);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(18, 23, 43, 0.35), 0 0 0 1px rgba(76, 124, 243, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
}

#cfc-chat-bubble::after {
	content: '';
	position: absolute;
	top: -2px;
	right: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--cfc-green);
	border: 2px solid #fff;
	box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
	animation: cfc-status-pulse 2.4s ease-out infinite;
}

@keyframes cfc-status-pulse {
	0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5); }
	70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); }
	100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

#cfc-chat-bubble:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(18, 23, 43, 0.4), 0 0 0 1px rgba(76, 124, 243, 0.2);
}

#cfc-chat-bubble svg {
	width: 24px;
	height: 24px;
}

#cfc-chat-window {
	display: flex;
	flex-direction: column;
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 500px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 20px 60px rgba(18, 23, 43, 0.25), 0 0 0 1px rgba(18, 23, 43, 0.04);
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	pointer-events: none;
	transform-origin: bottom right;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

#cfc-chat-window.cfc-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

#cfc-chat-header {
	background: linear-gradient(135deg, var(--cfc-navy) 0%, var(--cfc-navy-dark) 100%);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}

#cfc-chat-avatar {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
}

#cfc-chat-avatar svg {
	width: 20px;
	height: 20px;
	color: var(--cfc-blue-light);
}

#cfc-chat-avatar::after {
	content: '';
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--cfc-green);
	border: 2px solid var(--cfc-navy);
}

#cfc-chat-header-text {
	flex: 1;
	min-width: 0;
}

#cfc-chat-header-text .cfc-bot-name {
	font-weight: 600;
	font-size: 14.5px;
	line-height: 1.3;
	display: block;
}

#cfc-chat-header-text .cfc-bot-status {
	font-weight: 400;
	font-size: 12px;
	color: var(--cfc-green);
	line-height: 1.3;
	display: block;
}

#cfc-chat-close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	line-height: 1;
	padding: 4px;
	border-radius: 6px;
	display: flex;
	transition: background 0.15s ease, color 0.15s ease;
}

#cfc-chat-close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

#cfc-chat-close svg {
	width: 18px;
	height: 18px;
}

#cfc-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--cfc-bg);
}

.cfc-msg {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.cfc-msg-bot {
	align-self: flex-start;
	background: #fff;
	color: var(--cfc-text);
	box-shadow: 0 2px 8px rgba(18, 23, 43, 0.06);
	border-bottom-left-radius: 4px;
}

.cfc-msg-user {
	align-self: flex-end;
	background: linear-gradient(135deg, var(--cfc-blue) 0%, var(--cfc-blue-light) 100%);
	color: #fff;
	box-shadow: 0 2px 10px rgba(76, 124, 243, 0.3);
	border-bottom-right-radius: 4px;
}

.cfc-msg-typing {
	align-self: flex-start;
	background: #fff;
	box-shadow: 0 2px 8px rgba(18, 23, 43, 0.06);
	border-bottom-left-radius: 4px;
	padding: 13px 16px;
}

.cfc-typing-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 4px;
	background: var(--cfc-blue);
	border-radius: 50%;
	animation: cfc-bounce 1.2s infinite;
}

.cfc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.cfc-typing-dot:nth-child(3) { animation-delay: 0.4s; margin-right: 0; }

@keyframes cfc-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
	30% { transform: translateY(-4px); opacity: 1; }
}

#cfc-chat-input-area {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	background: #fff;
	border-top: 1px solid #EEF0F5;
}

#cfc-chat-input {
	flex: 1;
	resize: none;
	border: 1px solid #E3E6EE;
	border-radius: 20px;
	padding: 10px 16px;
	font-size: 14px;
	font-family: inherit;
	max-height: 90px;
	outline: none;
	background: var(--cfc-bg);
	color: var(--cfc-text);
	transition: border-color 0.15s ease, background 0.15s ease;
}

#cfc-chat-input::placeholder {
	color: var(--cfc-text-muted);
}

#cfc-chat-input:focus {
	border-color: var(--cfc-blue);
	background: #fff;
}

#cfc-chat-send {
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	background: linear-gradient(135deg, var(--cfc-blue) 0%, var(--cfc-blue-light) 100%);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

#cfc-chat-send:hover:not(:disabled) {
	transform: scale(1.06);
}

#cfc-chat-send:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

#cfc-chat-send svg {
	width: 16px;
	height: 16px;
}

#cfc-chat-messages::-webkit-scrollbar {
	width: 6px;
}

#cfc-chat-messages::-webkit-scrollbar-thumb {
	background: rgba(18, 23, 43, 0.15);
	border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
	#cfc-chat-bubble::after,
	.cfc-typing-dot,
	#cfc-chat-window {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 480px) {
	#cfc-chat-window {
		width: calc(100vw - 24px);
		right: -12px;
	}
}
