/* CduFibra - Chatbot com IA */
#cdu-chat-bubble {
	position: fixed;
	bottom: 20px;
	left: 20px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #ffa347, #ff8000);
	box-shadow: 0 6px 20px rgba(255, 128, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 99998;
	transition: transform 0.2s ease;
	border: none;
}
#cdu-chat-bubble:hover { transform: scale(1.08); }
#cdu-chat-bubble svg { width: 30px; height: 30px; fill: #ffffff; }

#cdu-chat-window {
	position: fixed;
	bottom: 90px;
	left: 20px;
	width: 340px;
	max-width: calc(100vw - 40px);
	height: 460px;
	max-height: calc(100vh - 120px);
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0,0,0,0.25);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
	font-family: Arial, Helvetica, sans-serif;
}
#cdu-chat-window.cdu-open { display: flex; }

#cdu-chat-header {
	background: linear-gradient(135deg, #ffa347, #ff8000);
	color: #ffffff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 700;
}
#cdu-chat-header .cdu-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
#cdu-chat-header .cdu-status { font-size: 11px; font-weight: 400; opacity: 0.9; display:block; }
#cdu-chat-close { cursor: pointer; background: none; border: none; color: #fff; font-size: 20px; line-height: 1; padding: 0 4px; }

#cdu-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #faf7f4;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.cdu-msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.cdu-msg-bot { align-self: flex-start; background: #ffffff; border: 1px solid #eee; color: #222; border-bottom-left-radius: 4px; }
.cdu-msg-user { align-self: flex-end; background: #ff8000; color: #fff; border-bottom-right-radius: 4px; }
.cdu-msg-typing { align-self: flex-start; background: #ffffff; border: 1px solid #eee; border-radius: 14px; border-bottom-left-radius: 4px; padding: 10px 14px; display:flex; gap:4px; }
.cdu-msg-typing span { width:6px; height:6px; border-radius:50%; background:#ff8000; opacity:0.4; animation: cduTypingBlink 1.2s infinite; }
.cdu-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.cdu-msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cduTypingBlink { 0%,80%,100% { opacity:0.3; } 40% { opacity:1; } }

#cdu-chat-inputbar {
	display: flex;
	border-top: 1px solid #eee;
	padding: 8px;
	gap: 8px;
	background: #fff;
}
#cdu-chat-input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
	font-family: inherit;
}
#cdu-chat-input:focus { border-color: #ff8000; }
#cdu-chat-send {
	background: #ff8000;
	border: none;
	color: #fff;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
#cdu-chat-send svg { width: 18px; height: 18px; fill: #fff; }
#cdu-chat-send:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 420px) {
	#cdu-chat-window { left: 10px; right: 10px; width: auto; bottom: 80px; }
	#cdu-chat-bubble { left: 14px; bottom: 14px; }
}
