/* --- AI CHATBOT FLOAT WIDGET STYLES (Modern Glassmorphism) --- */

#tt-chatbot-wrapper {
	position: fixed;
	bottom: 90px;
	right: 30px;
	z-index: 999999;
	font-family: 'Be Vietnam Pro', sans-serif;
}

/* Bong bóng chat tròn */
#tt-chatbot-bubble {
	width: 62px;
	height: 62px;
	background: linear-gradient(135deg, #0d9488, #0f766e);
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
	cursor: pointer;
	transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	position: relative;
}

#tt-chatbot-bubble:hover {
	transform: scale(1.08) translateY(-4px);
	box-shadow: 0 16px 32px rgba(13, 148, 136, 0.5);
}

/* Badge thông báo màu đỏ nhấp nháy */
#tt-chatbot-notification {
	position: absolute;
	top: -2px;
	right: -2px;
	background-color: #ef4444;
	color: white;
	font-size: 10px;
	font-weight: 700;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	border: 2px solid #ffffff;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0% { transform: scale(0.9); opacity: 0.9; }
	50% { transform: scale(1.1); opacity: 1; }
	100% { transform: scale(0.9); opacity: 0.9; }
}

/* Cửa sổ khung chat (Glassmorphic & Rounded) */
#tt-chatbot-window {
	position: absolute;
	bottom: 82px;
	right: 0;
	width: 370px;
	height: 520px;
	background: rgba(255, 255, 255, 0.92) !important;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-radius: 20px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.6);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(20px);
	opacity: 0;
	pointer-events: none;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#tt-chatbot-window.active {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

/* Header của khung chat: Gradient y tế hiện đại */
#tt-chatbot-header {
	background: linear-gradient(135deg, #0d9488, #14b8a6);
	color: #ffffff;
	padding: 16px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top-left-radius: 20px;
	border-top-right-radius: 20px;
}

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

.tt-avatar {
	width: 40px;
	height: 40px;
	background-color: rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	font-weight: 700;
	font-size: 14px;
	border: 1.5px solid rgba(255, 255, 255, 0.75);
}

.tt-header-info h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff !important;
	line-height: 1.2;
}

.tt-header-info p {
	margin: 0;
	font-size: 11px;
	opacity: 0.9;
	color: #ffffff;
	display: flex;
	align-items: center;
}

/* Chấm trạng thái nhấp nháy xanh y tế */
.tt-status-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	background-color: #4ade80;
	border-radius: 50%;
	margin-right: 6px;
	box-shadow: 0 0 0 rgba(74, 222, 128, 0.4);
	animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
	0% { box-shadow: 0 0 0 0px rgba(74, 222, 128, 0.7); }
	70% { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
	100% { box-shadow: 0 0 0 0px rgba(74, 222, 128, 0); }
}

/* Nút Gặp nhân viên trên Header */
.tt-header-btn {
	background: rgba(255, 255, 255, 0.18) !important;
	border: 1px solid rgba(255, 255, 255, 0.4) !important;
	color: #ffffff !important;
	padding: 5px 12px !important;
	border-radius: 30px !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.25s ease;
	outline: none !important;
	box-shadow: none !important;
	text-transform: none !important;
	height: auto !important;
	line-height: 1.2 !important;
}

.tt-header-btn:hover {
	background: #ffffff !important;
	color: #0d9488 !important;
	border-color: #ffffff !important;
	transform: translateY(-1px);
}

#tt-chatbot-close {
	background: none;
	border: none;
	color: #ffffff;
	font-size: 26px;
	cursor: pointer;
	opacity: 0.8;
	transition: opacity 0.2s;
	line-height: 1;
	padding: 0 5px;
}

#tt-chatbot-close:hover {
	opacity: 1;
}

/* Khung hiển thị các tin nhắn */
#tt-chatbot-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	background-color: rgba(248, 250, 252, 0.95);
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Thiết lập scrollbar đẹp */
#tt-chatbot-messages::-webkit-scrollbar {
	width: 5px;
}
#tt-chatbot-messages::-webkit-scrollbar-thumb {
	background-color: #cbd5e1;
	border-radius: 4px;
}

/* Bubble tin nhắn */
.tt-msg {
	max-width: 82%;
	padding: 11px 15px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.5;
	word-wrap: break-word;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tt-msg p {
	margin: 0 0 6px 0 !important;
}
.tt-msg p:last-child {
	margin-bottom: 0 !important;
}
.tt-msg ul, .tt-msg ol {
	margin: 6px 0 !important;
	padding-left: 20px !important;
}
.tt-msg li {
	margin-bottom: 4px !important;
}
.tt-msg li:last-child {
	margin-bottom: 0 !important;
}

.tt-msg.user {
	align-self: flex-end;
	background-color: #0d9488;
	color: #ffffff;
	border-bottom-right-radius: 2px;
	box-shadow: 0 4px 10px rgba(13, 148, 136, 0.15);
}

.tt-msg.bot {
	align-self: flex-start;
	background-color: #ffffff;
	color: #1e293b;
	border-bottom-left-radius: 2px;
	border: 1px solid #e2e8f0;
}

.tt-msg.system {
	align-self: center;
	background-color: #fee2e2;
	color: #ef4444;
	font-size: 11px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 30px;
	max-width: 90%;
	text-align: center;
	border: 1px solid #fee2e2;
}

/* Khung nhập tin nhắn */
#tt-chatbot-footer {
	padding: 14px;
	background-color: #ffffff;
	border-top: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	gap: 10px;
}

#tt-chatbot-input {
	flex: 1;
	border: 1.5px solid #cbd5e1;
	border-radius: 22px;
	padding: 8px 18px;
	font-size: 13.5px;
	resize: none;
	outline: none;
	max-height: 80px;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

#tt-chatbot-input:focus {
	border-color: #0d9488;
}

#tt-chatbot-send {
	background-color: #0d9488;
	color: white;
	border: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	transition: background-color 0.2s, transform 0.2s;
	flex-shrink: 0;
	box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}

#tt-chatbot-send:hover {
	background-color: #0f766e;
	transform: scale(1.05);
}

/* Nút liên hệ nhân viên */
.tt-request-agent-btn {
	background-color: #fee2e2;
	color: #dc2626;
	border: 1px dashed #fca5a5;
	padding: 8px 14px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 10px auto;
	transition: all 0.2s;
	width: 80%;
}

.tt-request-agent-btn:hover {
	background-color: #fecaca;
	color: #b91c1c;
	transform: translateY(-1px);
}
