/* WorkFlow Suite — Chat widget */

#wf-chat-launcher {
	position: fixed; bottom: 24px; right: 24px;
	z-index: 9998;
	background: linear-gradient(135deg, #00c4ff, #00a1ff);
	color: white;
	border: none; cursor: pointer;
	padding: 14px 22px; border-radius: 999px;
	font-family: inherit; font-weight: 700; font-size: 14px;
	display: inline-flex; align-items: center; gap: 10px;
	box-shadow: 0 14px 30px -8px rgba(0,161,255,0.6);
	transition: all 0.2s;
}
#wf-chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -8px rgba(0,161,255,0.75); }
#wf-chat-launcher i { font-size: 18px; }
#wf-chat-launcher.has-unread::after {
	content: ''; position: absolute; top: 6px; right: 6px;
	width: 12px; height: 12px; border-radius: 50%;
	background: #ff4d6d;
	box-shadow: 0 0 0 3px white;
	animation: pulse 1.5s infinite;
}
@keyframes pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.2); opacity: 0.8; }
}

/* ===== Panel ===== */
#wf-chat-panel {
	position: fixed; bottom: 24px; right: 24px;
	z-index: 9999;
	width: 380px; max-width: calc(100vw - 32px);
	height: 580px; max-height: calc(100vh - 80px);
	background: white;
	border-radius: 18px;
	box-shadow: 0 30px 80px -20px rgba(15,39,70,0.45);
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: inherit;
}
#wf-chat-panel.open {
	display: flex;
	animation: slideUp 0.25s ease;
}
@keyframes slideUp {
	from { transform: translateY(20px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}

/* Header */
.wf-chat-head {
	background: linear-gradient(135deg, #0086d6, #00a1ff);
	color: white;
	padding: 16px 18px;
	display: flex; align-items: center; justify-content: space-between;
}
.wf-chat-head-l { display: flex; align-items: center; gap: 12px; }
.wf-chat-avatar {
	width: 40px; height: 40px;
	background: rgba(255,255,255,0.2);
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 18px;
}
.wf-chat-title { font-size: 15px; font-weight: 800; }
.wf-chat-status {
	font-size: 11.5px; color: rgba(255,255,255,0.85);
	display: flex; align-items: center; gap: 5px;
	margin-top: 2px;
}
.wf-dot {
	width: 8px; height: 8px; border-radius: 50%;
	background: #aaa;
}
.wf-dot.online { background: #1be0a8; box-shadow: 0 0 0 2px rgba(27,224,168,0.3); }
.wf-dot.offline { background: #ff7184; }
.wf-chat-head-r { display: flex; gap: 6px; }
.wf-icon-btn {
	background: rgba(255,255,255,0.15);
	border: none;
	color: white; cursor: pointer;
	width: 30px; height: 30px;
	border-radius: 6px;
	display: flex; align-items: center; justify-content: center;
	transition: background 0.15s;
}
.wf-icon-btn:hover { background: rgba(255,255,255,0.25); }

/* Form (initial) */
.wf-chat-form {
	padding: 24px 22px;
	flex: 1; overflow-y: auto;
}
.wf-form-intro {
	background: linear-gradient(135deg, #f0faff, #e6f7ff);
	padding: 14px 16px;
	border-radius: 12px;
	font-size: 13.5px; color: #0086d6;
	line-height: 1.5;
	margin-bottom: 18px;
	border: 1px solid #b9def0;
}
.wf-chat-form label {
	display: block; margin-bottom: 14px;
}
.wf-chat-form label span {
	font-size: 12px; font-weight: 700;
	color: #4b5b75; display: block; margin-bottom: 5px;
}
.wf-chat-form input {
	width: 100%; padding: 10px 14px;
	border: 1.5px solid #e3edf5;
	border-radius: 8px;
	font-size: 14px; font-family: inherit;
	outline: none;
	transition: border-color 0.15s;
}
.wf-chat-form input:focus { border-color: #00a1ff; box-shadow: 0 0 0 3px rgba(0,161,255,0.12); }

.wf-btn-primary {
	width: 100%;
	background: linear-gradient(135deg, #00c4ff, #00a1ff);
	color: white;
	border: none; cursor: pointer;
	padding: 12px 18px; border-radius: 10px;
	font-family: inherit; font-weight: 700; font-size: 14px;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	margin-top: 8px;
	transition: all 0.18s;
}
.wf-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -6px rgba(0,161,255,0.5); }

.wf-quick-questions {
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px dashed #e3edf5;
}
.wf-quick-label {
	font-size: 11px; font-weight: 800;
	color: #8a9bb1;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 10px;
}
.wf-quick-btn {
	display: block; width: 100%;
	background: white;
	border: 1.5px solid #e3edf5;
	color: #0086d6;
	padding: 9px 13px; border-radius: 8px;
	font-family: inherit; font-size: 13px; font-weight: 600;
	cursor: pointer;
	text-align: left;
	margin-bottom: 6px;
	transition: all 0.15s;
}
.wf-quick-btn:hover { background: #f3faff; border-color: #00a1ff; }

/* Body (messages) */
.wf-chat-body {
	flex: 1;
	overflow-y: auto;
	background: linear-gradient(180deg, #f7fbff, #ffffff);
}
.wf-messages {
	padding: 18px;
	display: flex; flex-direction: column; gap: 10px;
}
.wf-msg {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.45;
	word-break: break-word;
	animation: msgIn 0.2s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.wf-msg-meta {
	font-size: 10px;
	color: #8a9bb1;
	margin-top: 3px;
	padding: 0 6px;
}
.wf-msg.visitor {
	background: linear-gradient(135deg, #00c4ff, #00a1ff);
	color: white;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}
.wf-msg.visitor + .wf-msg-meta { text-align: right; }
.wf-msg.admin {
	background: white;
	color: #0f2746;
	align-self: flex-start;
	border: 1px solid #e3edf5;
	border-bottom-left-radius: 4px;
}
.wf-msg.system {
	background: #f3faff;
	color: #0086d6;
	align-self: center;
	font-size: 12.5px;
	font-style: italic;
	max-width: 90%;
	text-align: center;
	border-radius: 999px;
	padding: 8px 16px;
}

/* Typing */
.wf-typing {
	padding: 10px 22px 14px;
	font-size: 11.5px; color: #8a9bb1;
	display: flex; align-items: center; gap: 6px;
}
.wf-typing span {
	width: 6px; height: 6px;
	background: #00a1ff;
	border-radius: 50%;
	animation: typeBounce 1.2s infinite;
}
.wf-typing span:nth-child(2) { animation-delay: 0.2s; }
.wf-typing span:nth-child(3) { animation-delay: 0.4s; }
.wf-typing small { margin-left: 6px; font-style: italic; }
@keyframes typeBounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* Input */
.wf-chat-input {
	padding: 12px 14px;
	border-top: 1px solid #e3edf5;
	background: white;
	display: flex; align-items: flex-end; gap: 8px;
}
.wf-chat-input textarea {
	flex: 1;
	border: 1.5px solid #e3edf5;
	border-radius: 10px;
	padding: 10px 14px;
	font-family: inherit; font-size: 14px;
	resize: none;
	outline: none;
	max-height: 100px;
	min-height: 40px;
	transition: border-color 0.15s;
}
.wf-chat-input textarea:focus { border-color: #00a1ff; box-shadow: 0 0 0 3px rgba(0,161,255,0.12); }
.wf-icon-btn.primary {
	background: linear-gradient(135deg, #00c4ff, #00a1ff);
	color: white;
	width: 40px; height: 40px;
	flex-shrink: 0;
	box-shadow: 0 6px 14px -4px rgba(0,161,255,0.5);
}
.wf-icon-btn.primary:hover { transform: translateY(-1px); }

@media (max-width: 480px) {
	#wf-chat-panel {
		bottom: 0; right: 0; left: 0;
		width: 100%; max-width: none;
		height: 100vh; max-height: 100vh;
		border-radius: 0;
	}
	#wf-chat-launcher span { display: none; }
}
