/* Allie AI chat — floating widget. */

.alleavia-chat-bubble {
	position: fixed; bottom: 24px; right: 24px; z-index: 9000;
	width: 60px; height: 60px;
	background: #14202b; color: #fff;
	border: 0; border-radius: 999px;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	box-shadow: 0 12px 32px rgba(20,32,43,.3);
	transition: width .25s ease, background .15s ease, transform .15s ease;
	overflow: hidden;
	padding: 0;
	font: inherit; font-weight: 700; font-size: 14px;
}
.alleavia-chat-bubble:hover { background: #1d2c3a; transform: scale( 1.05 ); }
.alleavia-chat-bubble svg { display: block; flex: 0 0 auto; }
.alleavia-chat-bubble__label {
	display: none; white-space: nowrap;
}
.alleavia-chat-bubble:not(.is-open):hover { width: 160px; padding: 0 22px 0 18px; }
.alleavia-chat-bubble:not(.is-open):hover .alleavia-chat-bubble__label { display: inline; }
.alleavia-chat-bubble.is-open { background: #ffb703; color: #14202b; }

.alleavia-chat-panel {
	position: fixed; bottom: 100px; right: 24px; z-index: 8999;
	width: 380px; max-width: calc( 100vw - 32px );
	height: 560px; max-height: calc( 100vh - 130px );
	background: #fff; border-radius: 18px;
	box-shadow: 0 24px 60px rgba(20,32,43,.25);
	display: flex; flex-direction: column;
	overflow: hidden;
	transform: translateY( 12px ) scale( .95 ); opacity: 0;
	pointer-events: none;
	transition: transform .2s ease, opacity .2s ease;
}
.alleavia-chat-panel.is-open {
	transform: translateY( 0 ) scale( 1 ); opacity: 1;
	pointer-events: auto;
}
@media (max-width: 540px) {
	.alleavia-chat-panel { right: 8px; left: 8px; bottom: 92px; width: auto; height: calc( 100vh - 110px ); }
}

.alleavia-chat-head {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 18px;
	background: linear-gradient(180deg, #14202b 0%, #1d2c3a 100%);
	color: #fff;
}
.alleavia-chat-head__avatar {
	width: 40px; height: 40px; border-radius: 50%;
	background: #ffb703; color: #14202b;
	display: flex; align-items: center; justify-content: center;
	font-size: 22px;
	flex: 0 0 auto;
}
.alleavia-chat-head strong { display: block; font-size: 15px; line-height: 1; }
.alleavia-chat-head small { display: block; font-size: 11px; color: #d9e2ec; margin-top: 4px; }
.alleavia-chat-head__close {
	margin-left: auto; background: transparent; border: 0; color: #fff;
	font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px;
	opacity: .7; transition: opacity .15s ease;
}
.alleavia-chat-head__close:hover { opacity: 1; }

.alleavia-chat-log {
	flex: 1; overflow-y: auto; padding: 18px; background: #fafbfc;
	display: flex; flex-direction: column; gap: 10px;
}
.alleavia-chat-msg { display: flex; max-width: 85%; }
.alleavia-chat-msg--user { align-self: flex-end; }
.alleavia-chat-msg--assistant { align-self: flex-start; }
.alleavia-chat-bubble-msg {
	padding: 10px 14px; border-radius: 16px;
	font-size: 14px; line-height: 1.5;
	word-wrap: break-word;
}
.alleavia-chat-msg--user .alleavia-chat-bubble-msg {
	background: #ffb703; color: #14202b;
	border-bottom-right-radius: 4px;
}
.alleavia-chat-msg--assistant .alleavia-chat-bubble-msg {
	background: #fff; color: #14202b;
	border: 1px solid #eef0f3;
	border-bottom-left-radius: 4px;
}
.alleavia-chat-bubble-msg p { margin: 0 0 8px; }
.alleavia-chat-bubble-msg p:last-child { margin-bottom: 0; }
.alleavia-chat-bubble-msg ul, .alleavia-chat-bubble-msg ol { margin: 6px 0; padding-left: 18px; }
.alleavia-chat-bubble-msg a { color: #14202b; text-decoration: underline; font-weight: 600; }
.alleavia-chat-bubble-msg a:hover { color: #ffb703; }

/* Typing indicator */
.alleavia-chat-msg--typing .alleavia-chat-bubble-msg {
	display: inline-flex; gap: 4px; padding: 14px 16px;
}
.alleavia-chat-msg--typing span {
	width: 8px; height: 8px; border-radius: 50%; background: #b8c2cc;
	animation: alleavia-chat-bounce 1.2s infinite ease-in-out;
}
.alleavia-chat-msg--typing span:nth-child(2) { animation-delay: .15s; }
.alleavia-chat-msg--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes alleavia-chat-bounce {
	0%, 80%, 100% { transform: scale( .6 ); opacity: .4; }
	40%           { transform: scale( 1 );  opacity: 1; }
}

/* Suggestion chips */
.alleavia-chat-suggest {
	padding: 0 14px 8px; display: flex; gap: 6px;
	flex-wrap: nowrap; overflow-x: auto;
	scrollbar-width: none; -ms-overflow-style: none;
}
.alleavia-chat-suggest::-webkit-scrollbar { display: none; }
.alleavia-chat-sug {
	background: #fff8ec; color: #14202b; border: 1px solid #f1e3c2;
	padding: 8px 12px; border-radius: 999px;
	font-size: 12px; font-weight: 600; cursor: pointer;
	white-space: nowrap; flex: 0 0 auto;
	transition: background .15s ease, border-color .15s ease;
}
.alleavia-chat-sug:hover { background: #ffb703; border-color: #ffb703; }
.alleavia-chat-sug span { margin-right: 6px; }

/* Form */
.alleavia-chat-form {
	display: flex; gap: 8px; align-items: flex-end;
	padding: 12px 14px; border-top: 1px solid #eef0f3;
	background: #fff;
}
.alleavia-chat-form textarea {
	flex: 1; resize: none; min-height: 40px; max-height: 120px;
	padding: 10px 14px;
	border: 1px solid #d8dde3; border-radius: 12px;
	font: inherit; font-size: 14px; outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.alleavia-chat-form textarea:focus {
	border-color: #ffb703; box-shadow: 0 0 0 3px rgba(255,183,3,.18);
}
.alleavia-chat-form button {
	width: 40px; height: 40px; border: 0; border-radius: 50%;
	background: #14202b; color: #fff;
	cursor: pointer; font-size: 18px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	flex: 0 0 auto;
	transition: background .15s ease;
}
.alleavia-chat-form button:hover { background: #ffb703; color: #14202b; }
.alleavia-chat-form button:disabled { opacity: .5; cursor: progress; }

.alleavia-chat-foot {
	display: flex; justify-content: space-between; align-items: center;
	padding: 8px 14px;
	background: #fafbfc;
	border-top: 1px solid #eef0f3;
	font-size: 11px; color: #5a6773;
}
.alleavia-chat-foot a { color: #14202b; text-decoration: underline; }
.alleavia-chat-foot__clear {
	background: transparent; border: 0; color: #5a6773;
	cursor: pointer; font-size: 11px; text-decoration: underline;
	padding: 0;
}
.alleavia-chat-foot__clear:hover { color: #b03333; }
