/* CPP GoHighLevel Chatbot — Modern Gradient UI */

#cppghl-chatbot-root {
	--cppghl-primary: #6d28d9;
	--cppghl-accent: #06b6d4;
	--cppghl-gradient: linear-gradient(135deg, var(--cppghl-primary) 0%, var(--cppghl-accent) 100%);
	--cppghl-radius: 22px;
	position: fixed;
	bottom: 26px;
	right: 26px;
	z-index: 999999;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#cppghl-chatbot-root * {
	box-sizing: border-box;
}

/* ---------- Toggle Button ---------- */
.cppghl-toggle-btn {
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--cppghl-gradient);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 30px rgba(109, 40, 217, 0.4);
	transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
}

.cppghl-toggle-btn:hover {
	transform: scale(1.08) rotate(-4deg);
}

.cppghl-toggle-btn svg {
	width: 28px;
	height: 28px;
	position: relative;
	z-index: 2;
}

.cppghl-toggle-ring {
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(109, 40, 217, 0.35);
	animation: cppghl-ring-pulse 2.2s ease-out infinite;
}

@keyframes cppghl-ring-pulse {
	0% { transform: scale(0.85); opacity: 0.8; }
	80% { transform: scale(1.25); opacity: 0; }
	100% { opacity: 0; }
}

.cppghl-icon-close {
	display: none;
}

#cppghl-chatbot-root.cppghl-open .cppghl-icon-chat {
	display: none;
}
#cppghl-chatbot-root.cppghl-open .cppghl-icon-close {
	display: block;
}
#cppghl-chatbot-root.cppghl-open .cppghl-toggle-ring {
	display: none;
}

/* ---------- Chat Window ---------- */
.cppghl-chat-window {
	position: absolute;
	bottom: 80px;
	right: 0;
	width: 392px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 140px);
	border-radius: var(--cppghl-radius);
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(24px) saturate(190%);
	-webkit-backdrop-filter: blur(24px) saturate(190%);
	border: 1px solid rgba(255, 255, 255, 0.5);
	box-shadow: 0 24px 70px rgba(31, 18, 60, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.94);
	pointer-events: none;
	transition: opacity 0.3s cubic-bezier(.22,1,.36,1), transform 0.3s cubic-bezier(.22,1,.36,1);
}

#cppghl-chatbot-root.cppghl-open .cppghl-chat-window {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: all;
}

.cppghl-theme-dark .cppghl-chat-window {
	background: rgba(17, 17, 27, 0.88);
	border-color: rgba(255, 255, 255, 0.08);
	color: #f1f1f5;
}

/* ---------- Header ---------- */
.cppghl-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 18px;
	background: var(--cppghl-gradient);
	color: #fff;
	flex-shrink: 0;
	overflow: hidden;
}

.cppghl-header-glow {
	position: absolute;
	top: -40%;
	right: -10%;
	width: 160px;
	height: 160px;
	background: radial-gradient(circle, rgba(255,255,255,0.25), transparent 70%);
	border-radius: 50%;
	pointer-events: none;
}

.cppghl-header-info {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	z-index: 1;
}

.cppghl-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.cppghl-avatar svg {
	width: 20px;
	height: 20px;
}

.cppghl-header-title {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: -0.01em;
}

.cppghl-header-subtitle {
	font-size: 12px;
	opacity: 0.9;
	display: flex;
	align-items: center;
	gap: 5px;
}

.cppghl-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
	display: inline-block;
}

.cppghl-minimize-btn {
	background: rgba(255, 255, 255, 0.16);
	border: none;
	color: #fff;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
	position: relative;
	z-index: 1;
	transition: background 0.2s;
}

.cppghl-minimize-btn:hover {
	background: rgba(255, 255, 255, 0.28);
}

/* ---------- Messages ---------- */
.cppghl-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cppghl-messages::-webkit-scrollbar {
	width: 5px;
}
.cppghl-messages::-webkit-scrollbar-thumb {
	background: rgba(109, 40, 217, 0.25);
	border-radius: 4px;
}

.cppghl-msg {
	max-width: 86%;
	padding: 11px 15px;
	border-radius: 18px;
	font-size: 14px;
	line-height: 1.5;
	animation: cppghl-msg-in 0.25s cubic-bezier(.22,1,.36,1);
	word-wrap: break-word;
	white-space: pre-line;
}

@keyframes cppghl-msg-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.cppghl-msg-bot {
	align-self: flex-start;
	background: rgba(255, 255, 255, 0.95);
	color: #1f2937;
	border-bottom-left-radius: 5px;
	box-shadow: 0 2px 10px rgba(31, 18, 60, 0.06);
}

.cppghl-theme-dark .cppghl-msg-bot {
	background: rgba(255, 255, 255, 0.08);
	color: #f1f1f5;
}

.cppghl-msg-user {
	align-self: flex-end;
	background: var(--cppghl-gradient);
	color: #fff;
	border-bottom-right-radius: 5px;
	box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
}

.cppghl-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 13px 17px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 18px;
	border-bottom-left-radius: 5px;
}

.cppghl-theme-dark .cppghl-typing {
	background: rgba(255, 255, 255, 0.08);
}

.cppghl-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cppghl-primary);
	opacity: 0.6;
	animation: cppghl-typing-bounce 1.2s infinite;
}

.cppghl-typing span:nth-child(2) { animation-delay: 0.15s; }
.cppghl-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes cppghl-typing-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Buttons area ---------- */
.cppghl-buttons-area {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	padding: 6px 16px 14px;
	flex-shrink: 0;
}

.cppghl-option-btn {
	font-size: 13px;
	font-weight: 500;
	padding: 10px 16px;
	border-radius: 14px;
	border: 1.5px solid transparent;
	background: rgba(255, 255, 255, 0.75);
	color: #3730a3;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(.22,1,.36,1);
	box-shadow: 0 1px 4px rgba(31, 18, 60, 0.06);
}

.cppghl-option-btn:hover {
	background: var(--cppghl-gradient);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(109, 40, 217, 0.3);
}

.cppghl-option-btn.cppghl-option-wide {
	flex: 1 0 100%;
	text-align: center;
}

.cppghl-theme-dark .cppghl-option-btn {
	background: rgba(255, 255, 255, 0.07);
	color: #c4b5fd;
	box-shadow: none;
}

.cppghl-option-btn.cppghl-skip-btn {
	background: transparent;
	border-style: dashed;
	border-color: rgba(109, 40, 217, 0.3);
	opacity: 0.75;
	font-size: 12px;
	color: #6b7280;
}

.cppghl-option-btn.cppghl-skip-btn:hover {
	background: rgba(109, 40, 217, 0.08);
	color: #6b7280;
	transform: none;
	box-shadow: none;
}

/* ---------- Text input ---------- */
.cppghl-text-form {
	display: flex;
	gap: 10px;
	padding: 12px 16px 10px;
	border-top: 1px solid rgba(109, 40, 217, 0.1);
	flex-shrink: 0;
}

.cppghl-text-input {
	flex: 1;
	padding: 11px 16px;
	border-radius: 22px;
	border: 1.5px solid rgba(109, 40, 217, 0.15);
	font-size: 14px;
	background: rgba(255, 255, 255, 0.9);
	color: inherit;
	outline: none;
	transition: border-color 0.2s;
}

.cppghl-text-input:focus {
	border-color: var(--cppghl-primary);
}

.cppghl-theme-dark .cppghl-text-input {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.15);
}

.cppghl-send-btn {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: none;
	background: var(--cppghl-gradient);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
	transition: transform 0.15s;
}

.cppghl-send-btn:hover {
	transform: scale(1.08);
}

.cppghl-send-btn svg {
	width: 18px;
	height: 18px;
}

/* ---------- Footer brand ---------- */
.cppghl-footer-brand {
	text-align: center;
	font-size: 10.5px;
	color: #9ca3af;
	padding: 6px 0 10px;
	letter-spacing: 0.02em;
	flex-shrink: 0;
}

/* ---------- Navigation buttons (Start Over) ---------- */
.cppghl-nav-row {
	display: flex;
	width: 100%;
	padding: 4px 16px 14px;
}

.cppghl-nav-btn {
	width: 100%;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 16px;
	border-radius: 14px;
	border: none;
	cursor: pointer;
	letter-spacing: 0.02em;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.cppghl-nav-restart {
	background: var(--cppghl-gradient);
	color: #fff;
	box-shadow: 0 4px 14px rgba(109, 40, 217, 0.25);
}

.cppghl-nav-restart:hover {
	opacity: 0.88;
	transform: translateY(-1px);
}

.cppghl-theme-dark .cppghl-nav-restart {
	box-shadow: 0 4px 14px rgba(109, 40, 217, 0.4);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
	#cppghl-chatbot-root {
		bottom: 18px;
		right: 18px;
	}

	.cppghl-chat-window {
		width: calc(100vw - 24px);
		height: calc(100vh - 120px);
		bottom: 76px;
		right: -10px;
	}
}
