/* CLIMEDGE Chatbot Widget */

#climedge-chat-launcher {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: #F97316;
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	z-index: 99998;
	transition: transform 0.2s, box-shadow 0.2s;
}

#climedge-chat-launcher:hover {
	transform: scale(1.05);
	box-shadow: 0 12px 32px rgba(249, 115, 22, 0.5);
}

#climedge-chat-launcher.cc-hidden {
	display: none;
}

.cc-pulse {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 14px;
	height: 14px;
	background: #0EA5E9;
	border-radius: 50%;
	border: 2px solid #fff;
	animation: cc-pulse 2s infinite;
}

@keyframes cc-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.3); opacity: 0.7; }
}

#climedge-chat-window {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 580px;
	max-height: calc(100vh - 48px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

#climedge-chat-window.cc-open {
	display: flex;
}

.cc-header {
	background: #0F172A;
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #1e293b;
}

.cc-header-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cc-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, #F97316, #0EA5E9);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 900;
	font-size: 16px;
}

.cc-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0;
}

.cc-status {
	font-size: 11px;
	color: #94a3b8;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cc-status::before {
	content: '';
	width: 8px;
	height: 8px;
	background: #22c55e;
	border-radius: 50%;
}

.cc-close {
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 22px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
}

.cc-close:hover {
	background: #1e293b;
	color: #fff;
}

.cc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cc-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
}

.cc-msg.cc-bot {
	background: #fff;
	color: #0F172A;
	align-self: flex-start;
	border: 1px solid #e2e8f0;
	border-bottom-left-radius: 4px;
}

.cc-msg.cc-user {
	background: #F97316;
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.cc-msg.cc-typing {
	background: #fff;
	border: 1px solid #e2e8f0;
	display: inline-flex;
	gap: 4px;
	align-self: flex-start;
	padding: 12px 14px;
}

.cc-typing span {
	width: 6px;
	height: 6px;
	background: #94a3b8;
	border-radius: 50%;
	animation: cc-bounce 1.4s infinite ease-in-out both;
}

.cc-typing span:nth-child(2) { animation-delay: 0.16s; }
.cc-typing span:nth-child(3) { animation-delay: 0.32s; }

@keyframes cc-bounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
	40% { transform: scale(1); opacity: 1; }
}

.cc-input-zone {
	padding: 12px;
	border-top: 1px solid #e2e8f0;
	background: #fff;
	display: flex;
	gap: 8px;
}

.cc-input-zone textarea {
	flex: 1;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	resize: none;
	font-family: inherit;
	max-height: 80px;
	outline: none;
}

.cc-input-zone textarea:focus {
	border-color: #F97316;
}

.cc-send {
	background: #F97316;
	color: #fff;
	border: none;
	border-radius: 10px;
	width: 44px;
	cursor: pointer;
	font-size: 18px;
	transition: background 0.2s;
}

.cc-send:hover { background: #ea580c; }
.cc-send:disabled { background: #cbd5e1; cursor: not-allowed; }

.cc-footer {
	font-size: 10px;
	color: #94a3b8;
	text-align: center;
	padding: 6px;
	background: #fff;
	border-top: 1px solid #e2e8f0;
}

.cc-footer a {
	color: #64748b;
	text-decoration: none;
}

.cc-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 13px;
	margin: 8px 0;
}

@media (max-width: 480px) {
	#climedge-chat-window {
		bottom: 0;
		right: 0;
		width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
	}
}
