/* widget chat */
#chat-widget {
	position: fixed;
	bottom: 25px;
	right: 20px;
	width: 300px;
	height: 550px;
	background: #ffffff;
	border-radius: 15px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.2);
	display: flex;
	flex-direction: column;
	z-index: 9999;
	overflow: hidden;
}

/* header */
#chat-header{
	background:#0d6efd;
	color:#fff;
	padding:15px;
	display:flex;
	justify-content:space-between;
	align-items:center;
	font-weight:bold;
}

#chat-toggle{
	background:transparent;
	border:none;
	color:#fff;
	cursor:pointer;
	font-size:18px;
}

#chat-body{
	display:flex;
	flex-direction:column;
	flex:1;
	overflow:hidden;
}

#chat-toggle:hover{
	opacity:.8;
}

#chat-widget.minimized{
	height:55px;
}

#chat-widget.minimized #chat-body{
	display:none;
}


/* Area Chat */
#chat-box {
	flex: 1;
	padding: 10px;
	overflow-y: auto;
	background: #f8f9fa;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* bubble chat */
.msg {
	padding: 10px 14px;
	border-radius: 15px;
	max-width: 100%;
	word-wrap: break-word;
	text-align :justify;
	line-height: 1.5;
}

/* user */
.msg.user {
	font-size : 12px;
	background: #0d6efd;
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 5px;
}

/* ai */
.msg.ai {
	font-size : 12px;
	background: #e9ecef;
	color: #333;
	align-self: flex-start;
	border-bottom-left-radius: 5px;
}

/* error */
.msg.error {
	background: #ffdddd;
	color: #900;
	align-self: flex-start;
}

/* typing animation */
.msg.typing {
	display: inline-flex;
	align-items: center;
	padding: 10px 15px;
}

.msg.typing .dot {
	height: 8px;
	width: 8px;
	margin: 0 2px;
	background-color: #555;
	border-radius: 50%;
	display: inline-block;
	animation: blink 1.4s infinite both;
}

.msg.typing .dot:nth-child(1) {
	animation-delay: 0s;
}

.msg.typing .dot:nth-child(2) {
	animation-delay: 0.2s;
}

.msg.typing .dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes blink {
	0%, 80%, 100% {
		opacity: 0.2;
	}
	40% {
		opacity: 1;
	}
}

/* footer input */
#chat-footer {
	border-top: 1px solid #ddd;
	padding: 10px;
	display: flex;
	gap: 10px;
	background: #fff;
}

#chat-input {
	flex: 1;
	border: 1px solid #ccc;
	border-radius: 20px;
	padding: 10px 15px;
	outline: none;
}

#chat-send {
	background: #0d6efd;
	color: white;
	border: none;
	padding: 0 20px;
	border-radius: 50px;
	cursor: pointer;
}

#chat-send:hover {
	background: #0b5ed7;
}

/* responsive mobile */
@media (max-width: 768px) {
	#chat-widget {
		width: 100%;
		height: 90%;
		right: 0;
		bottom: 0;
		border-radius: 0;
	}
}