/* ========================================
   SIVO — Chatbot NOVA IA Widget v1.0.6
   ======================================== */

/* BOTÓN FLOTANTE */
.chatbot_btn{
	position:fixed;
	bottom:60px;
	right:40px;
	width:55px;
	height:55px;
	background:linear-gradient(135deg, #0B0D17 0%, #1a1035 50%, #0f1a3a 100%);
	border-radius:50%;
	display:flex;
	align-items:center;
	justify-content:center;
	cursor:pointer;
	z-index:10;
	box-shadow:0 4px 15px rgb(58 17 103 / 40%);
	transition:transform 0.3s,box-shadow 0.3s;
}
.chatbot_btn:hover{
	transform:scale(1.08);
	box-shadow:0 6px 20px rgb(104 13 141 / 50%);
}
.chatbot_btn i{
	font-size:22px;
	color:#fff;
}
.chatbot_btn .chatbot_badge{
	position:absolute;
	top:-2px;
	right:-2px;
	width:14px;
	height:14px;
	background:#e74c3c;
	border-radius:50%;
	border:2px solid #fff;
}

/* ANILLO ANIMADO NOVA IA (solo panel) */
.chatbot_btn.nova_ring{
	animation:nova_beat 2.2s ease-in-out infinite;
}
.chatbot_btn.nova_ring::before{
	content:'';
	position:absolute;
	inset:-3px;
	border-radius:50%;
	background:conic-gradient(from 0deg, #7B2FF7, #FF9A47, #7B2FF7);
	-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
	mask:radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
	animation:nova_ring_spin 3s linear infinite;
	pointer-events:none;
}
@keyframes nova_ring_spin{
	from{ transform:rotate(0deg); }
	to{ transform:rotate(360deg); }
}
@keyframes nova_beat{
	0%, 40%, 100%{ scale:1; }
	12%{ scale:1.07; }
	24%{ scale:1.02; }
	32%{ scale:1.06; }
}
@media (prefers-reduced-motion:reduce){
	.chatbot_btn.nova_ring{ animation-duration:4.4s; }
	.chatbot_btn.nova_ring::before{ animation-duration:2s; }
}

/* VENTANA DEL CHAT */
.chatbot_window{
	display:none;
	position:fixed;
	bottom:15px;
	right:35px;
	width:380px;
	height:520px;
	background:#fff;
	border-radius:16px;
	box-shadow:0 10px 40px rgba(0,0,0,0.15);
	z-index:11;
	flex-direction:column;
	overflow:hidden;
}
.chatbot_window.active{
	display:flex;
}

/* HEADER */
.chatbot_header{
	background:linear-gradient(135deg, #0B0D17 0%, #1a1035 50%, #0f1a3a 100%);
	color:#fff;
	padding:16px 18px;
	display:flex;
	align-items:center;
	justify-content:space-between;
	flex-shrink:0;
}
.chatbot_header_info{
	display:flex;
	align-items:center;
	gap:10px;
}
.chatbot_header_info .chatbot_avatar{
	width:36px;
	height:36px;
	border-radius:50%;
	object-fit:cover;
	border:2px solid rgba(255,255,255,0.3);
}
.chatbot_header_info span{
	font-weight:bold;
	font-size:14px;
}
.chatbot_header_info small{
	display:block;
	font-size:10px;
	opacity:0.85;
	font-weight:normal;
}
.chatbot_close{
	cursor:pointer;
	font-size:18px;
	opacity:0.8;
	transition:opacity 0.2s;
	background:none;
	border:none;
	color:#fff;
	padding:5px;
}
.chatbot_close:hover{
	opacity:1;
}

/* MENSAJES */
.chatbot_messages{
	flex:1;
	overflow-y:auto;
	padding:16px;
	display:flex;
	flex-direction:column;
	gap:12px;
	background:#f7f8fa;
}
.chatbot_messages::-webkit-scrollbar{
	width:4px;
}
.chatbot_messages::-webkit-scrollbar-thumb{
	background:#ccc;
	border-radius:4px;
}

/* BURBUJA MENSAJE */
.chatbot_msg{
	max-width:85%;
	padding:10px 14px;
	border-radius:14px;
	font-size:13px;
	line-height:1.5;
	word-wrap:break-word;
}
.chatbot_msg.bot{
	align-self:flex-start;
	background:#fff;
	color:#333;
	border:1px solid #e8e8e8;
	border-bottom-left-radius:4px;
	display:flex;
	align-items:flex-start;
	gap:8px;
}
.chatbot_msg.user{
	align-self:flex-end;
	background:#618D0D;
	color:#fff;
	border-bottom-right-radius:4px;
}
.chatbot_msg_avatar{
	width:28px;
	height:28px;
	border-radius:50%;
	object-fit:cover;
	flex-shrink:0;
}
.chatbot_msg_text{
	flex:1;
}

/* TYPING INDICATOR */
.chatbot_typing{
	align-self:flex-start;
	display:flex;
	align-items:center;
	gap:4px;
	padding:10px 16px;
	background:#fff;
	border:1px solid #e8e8e8;
	border-radius:14px;
	border-bottom-left-radius:4px;
}
.chatbot_typing span{
	width:7px;
	height:7px;
	background:#999;
	border-radius:50%;
	animation:chatbot_bounce 1.4s infinite ease-in-out;
}
.chatbot_typing span:nth-child(2){animation-delay:0.2s}
.chatbot_typing span:nth-child(3){animation-delay:0.4s}

@keyframes chatbot_bounce{
	0%,80%,100%{transform:scale(0.6);opacity:0.4}
	40%{transform:scale(1);opacity:1}
}

/* INPUT */
.chatbot_input_area{
	display:flex;
	align-items:center;
	padding:12px;
	border-top:1px solid #eee;
	background:#fff;
	flex-shrink:0;
	gap:8px;
}
.chatbot_input_area input{
	flex:1;
	border:1px solid #e0e0e0;
	border-radius:20px;
	padding:10px 16px;
	font-size:13px;
	outline:none;
	transition:border-color 0.2s;
}
.chatbot_input_area input:focus{
	border-color:#618D0D;
}
.chatbot_input_area input:disabled{
	background:#f5f5f5;
	cursor:not-allowed;
}
.chatbot_send{
	width:38px;
	height:38px;
	background:#618D0D;
	border:none;
	border-radius:50%;
	color:#fff;
	font-size:14px;
	cursor:pointer;
	display:flex;
	align-items:center;
	justify-content:center;
	transition:background 0.2s;
	flex-shrink:0;
}
.chatbot_send:hover{
	background:#7ab317;
}
.chatbot_send:disabled{
	background:#ccc;
	cursor:not-allowed;
}

/* POWERED BY */
.chatbot_footer{
	text-align:center;
	padding:6px;
	font-size:9px;
	color:#bbb;
	background:#fff;
	border-top:1px solid #f0f0f0;
	flex-shrink:0;
}

/* SPEECH BUBBLE — Cuadro de diálogo NOVA IA (reutilizable) */
.nova_ia_hero{position:relative;display:inline-block}
.nova_ia_bubble{position:relative;width: 80%;margin:12px auto 0 auto;background:linear-gradient(135deg,#1a1035,#0f1a3a);color:#fff;padding:14px 18px;border-radius:14px;font-size:13.5px;line-height:1.5;box-shadow:0 4px 20px rgba(0,0,0,.25);opacity:0}
.nova_ia_bubble::before{content:'';position:absolute;top:-8px;left:30px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #1a1035}
.nova_ia_bubble.animated{opacity:1}
.nova_ia_bubble b{color:#618D0D}
.nova_ia_cursor{animation:nova_blink .6s infinite;font-weight:300;color:#618D0D}
.nova_ia_cursor.done{display:none}
@keyframes nova_blink{0%,100%{opacity:1}50%{opacity:0}}

/* MINI BUBBLE — Tooltip del botón flotante */
.nova_ia_mini_bubble{position:fixed;bottom:80px;right:105px;background:linear-gradient(135deg,#1a1035,#0f1a3a);color:#fff;padding:8px 14px;border-radius:10px;font-size:12.5px;line-height:1.4;white-space:nowrap;box-shadow:0 4px 16px rgba(0,0,0,.25);z-index:10;opacity:0;transform:translateY(5px);transition:opacity .3s,transform .3s}
.nova_ia_mini_bubble::after{content:'';position:absolute;top:50%;right:-7px;transform:translateY(-50%);width:0;height:0;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:7px solid #0f1a3a}
.nova_ia_mini_bubble.visible{opacity:1;transform:translateY(0)}
.nova_ia_mini_bubble.hide{opacity:0;transform:translateY(5px)}
.nova_ia_mini_bubble b{color:#618D0D}
.nova_ia_mini_bubble .nova_ia_cursor{font-size:11px}

/* MOBILE */
@media screen and (max-width:480px){
	.nova_ia_mini_bubble {
		bottom: 50px;
	}
	.chatbot_window{
		bottom:0;
		right:0;
		width:100%;
		height:100%;
	}
	.chatbot_btn{
		bottom:35px;
		width:50px;
		height:50px;
	}
	.chatbot_btn i{
		font-size:20px;
	}
}
@media screen and (max-width:768px){
	.chatbot_window{
		width:calc(100% - 20px);
		right:10px;
		bottom:10px;
		height:70%;
	}
}

/* ========================================
   PANEL — Consumo de tokens NOVA IA
   ======================================== */

.nova_ia_consumo{
	background:#fff;
	border:1px solid #eee;
	border-radius:12px;
	padding:20px 25px;
	margin-bottom:20px;
}
.nova_ia_consumo h3{
	margin:0 0 15px 0;
	font-size:11pt;
	color:#3f578d;
	font-weight:600;
}
.nova_ia_consumo h3 i{
	margin-right:6px;
	color:#ff8a00;
}
.nova_ia_progress_container{
	margin-bottom:15px;
}
.nova_ia_progress_fill{
	border-radius:10px;
	transition:width 0.6s ease, background 0.3s ease;
}

/* Alertas de cuota */
.nova_ia_alerta{
	display:flex;
	align-items:flex-start;
	gap:12px;
	padding:14px 18px;
	border-radius:10px;
	margin-top:15px;
	font-size:10pt;
	line-height:1.5;
}
.nova_ia_alerta i{
	font-size:16pt;
	flex-shrink:0;
	margin-top:2px;
}
.nova_ia_alerta strong{
	display:block;
	margin-bottom:4px;
}
.nova_ia_alerta p{
	margin:0;
	font-size:9pt;
}
.nova_ia_alerta_amarilla{
	background:#fff8e1;
	border:1px solid #ffe082;
	color:#7a6100;
}
.nova_ia_alerta_amarilla i{
	color:#f9a825;
}
.nova_ia_alerta_roja{
	background:#fdecea;
	border:1px solid #f5c6cb;
	color:#721c24;
}
.nova_ia_alerta_roja i{
	color:#dc3545;
}
