/* Haide Chat widget — self-contained styles.
   Recycled from Shango Chat. Colors are driven by CSS variables set inline by
   app.js + the plugin's critical inline <style> (--sc-primary, --sc-accent). */

.sc-root,
.sc-root * {
	box-sizing: border-box;
}

.sc-root {
	--sc-primary: #111418;
	--sc-accent: #f332f3;
	--sc-accent-bright: #f55ef5;
	--sc-text: #1f2328;
	--sc-muted: #6b7280;
	--sc-border: rgba(243, 50, 243, 0.22);
	--sc-soft: rgba(243, 50, 243, 0.06);
	font-family: inherit;
	direction: rtl;
}

/* ---------- Floating toggle button ---------- */
.sc-fab {
	position: fixed !important;
	right: 20px !important;
	left: auto !important;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
	z-index: 2147483000 !important;
	width: 58px;
	height: 58px;
	border: none;
	border-radius: 999px;
	background: var(--sc-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: transform 0.15s ease, background 0.15s ease;
}
.sc-fab:hover {
	background: var(--sc-accent-bright);
	transform: scale(1.07);
}
.sc-fab:active {
	transform: scale(0.95);
}
.sc-fab.sc-open {
	background: #2a2a2a;
}
.sc-fab svg {
	width: 27px;
	height: 27px;
	fill: currentColor;
}
/* Mascot logo on the floating bubble. */
.sc-fab-logo {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 7px;
	display: block;
}
/* Subtle pulse ring + green online dot (closed state only). */
.sc-fab:not(.sc-open)::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 999px;
	border: 2px solid var(--sc-accent);
	opacity: 0.5;
	animation: sc-pulse-ring 2.1s ease-out infinite;
	pointer-events: none;
}
@keyframes sc-pulse-ring {
	0% { transform: scale(1); opacity: 0.5; }
	100% { transform: scale(1.5); opacity: 0; }
}
.sc-fab-online {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 14px;
	height: 14px;
	border-radius: 999px;
	background: #34c759;
	border: 2.5px solid #fff;
	box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
}
.sc-fab.sc-open .sc-fab-online { display: none; }
.sc-fab-label {
	position: fixed !important;
	right: 88px !important;
	left: auto !important;
	bottom: calc(34px + env(safe-area-inset-bottom, 0px)) !important;
	z-index: 2147482999 !important;
	background: #fff;
	color: var(--sc-text);
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translateX(8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.sc-fab-label.sc-show {
	opacity: 1;
	transform: translateX(0);
}

/* ---------- Panel ---------- */
.sc-panel {
	position: fixed !important;
	right: 20px !important;
	left: auto !important;
	bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
	z-index: 2147483000 !important;
	width: 380px;
	max-width: calc(100vw - 24px);
	max-height: 75vh;
	background: #fff;
	color: var(--sc-text);
	border: 1px solid var(--sc-border);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: sc-pop 0.18s ease-out;
}
@keyframes sc-pop {
	from { opacity: 0; transform: translateY(10px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 480px) {
	.sc-panel {
		left: 12px !important;
		right: 12px !important;
		width: auto !important;
		max-height: 80vh;
	}
}

/* ---------- Header ---------- */
.sc-header {
	background: var(--sc-primary);
	color: #fff;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.sc-identity {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.sc-avatar {
	width: 38px;
	height: 38px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}
.sc-avatar svg { width: 18px; height: 18px; fill: #fff; }
.sc-avatar-logo { width: 100%; height: 100%; object-fit: contain; padding: 4px; display: block; }
.sc-title { font-weight: 700; font-size: 14px; line-height: 1.2; }
.sc-status { font-size: 11px; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.sc-dot { width: 7px; height: 7px; border-radius: 999px; background: #36d399; display: inline-block; }
.sc-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sc-iconbtn {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: background 0.15s ease;
}
.sc-iconbtn:hover { background: rgba(255, 255, 255, 0.4); }
.sc-iconbtn svg { width: 16px; height: 16px; fill: #fff; }
.sc-clear {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.85);
	font-size: 11px;
	cursor: pointer;
	padding: 4px 6px;
}
.sc-clear:hover { color: #fff; }

/* ---------- Messages ---------- */
.sc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--sc-soft);
}
.sc-bubble {
	max-width: 90%;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
	padding: 10px 12px;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.sc-bot {
	background: #fff;
	color: var(--sc-text);
	border: 1px solid var(--sc-border);
	border-top-left-radius: 4px;
	align-self: flex-start;
}
.sc-user {
	background: var(--sc-accent);
	color: #fff;
	border-top-right-radius: 4px;
	align-self: flex-end;
}
.sc-bubble a { color: inherit; text-decoration: underline; }
.sc-user a { color: #fff; }
.sc-bot a { color: var(--sc-accent); }

.sc-typing { display: inline-flex; gap: 3px; padding: 2px 0; }
.sc-typing span {
	width: 6px; height: 6px; border-radius: 999px; background: var(--sc-muted);
	animation: sc-blink 1.2s infinite both;
}
.sc-typing span:nth-child(2) { animation-delay: 0.2s; }
.sc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sc-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* ---------- Suggestion chips ---------- */
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-chip {
	font-size: 12.5px;
	padding: 7px 12px;
	background: #fff;
	color: var(--sc-primary);
	border: 1px solid var(--sc-border);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.sc-chip:hover { background: var(--sc-accent); color: #fff; border-color: var(--sc-accent); }
.sc-chip:disabled { opacity: 0.5; cursor: default; }

/* ---------- Lead card (optional) ---------- */
.sc-lead {
	background: #fff;
	border: 1px solid var(--sc-border);
	border-radius: 14px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.sc-lead h4 { margin: 0; font-size: 13.5px; color: var(--sc-primary); }
.sc-lead p { margin: 0; font-size: 12px; color: var(--sc-muted); }
.sc-lead input {
	width: 100%;
	font-size: 14px;
	padding: 8px 10px;
	border: 1px solid var(--sc-border);
	border-radius: 8px;
	background: #fff;
	color: var(--sc-text);
}
.sc-lead-row { display: flex; gap: 8px; }
.sc-lead-row > * { flex: 1; }
.sc-btn {
	border: none;
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}
.sc-btn-primary { background: var(--sc-accent); color: #fff; }
.sc-btn-primary:hover { background: var(--sc-accent-bright); }
.sc-btn-primary:disabled { opacity: 0.55; cursor: default; }
.sc-btn-ghost { background: transparent; color: var(--sc-muted); }
.sc-lead-success {
	background: #ecfdf3;
	border: 1px solid #abefc6;
	color: #067647;
	border-radius: 14px;
	padding: 12px;
	font-size: 13.5px;
}
.sc-error {
	background: #fef3f2;
	border: 1px solid #fecdca;
	color: #b42318;
	border-radius: 12px;
	padding: 10px;
	font-size: 12.5px;
}

/* ---------- Composer ---------- */
.sc-form {
	border-top: 1px solid var(--sc-border);
	background: #fff;
	padding: 8px 10px;
	display: flex;
	gap: 8px;
	align-items: flex-end;
}
.sc-input {
	flex: 1;
	resize: none;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	max-height: 96px;
	padding: 9px 11px;
	border: 1px solid var(--sc-border);
	border-radius: 10px;
	background: #fff;
	color: var(--sc-text);
	outline: none;
}
.sc-input:focus { box-shadow: 0 0 0 3px var(--sc-soft); border-color: var(--sc-accent); }
.sc-send {
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 10px;
	background: var(--sc-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.15s ease;
}
.sc-send:hover { background: var(--sc-accent-bright); }
.sc-send:disabled { opacity: 0.5; cursor: default; }
.sc-send svg { width: 18px; height: 18px; fill: #fff; transform: scaleX(-1); }

.sc-disclaimer {
	text-align: center;
	font-size: 10px;
	color: var(--sc-muted);
	padding: 4px 8px 8px;
}

/* ---------- Job cards ---------- */
.sc-products {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
}
.sc-product {
	display: flex;
	gap: 10px;
	align-items: center;
	background: #fff;
	border: 1px solid var(--sc-border);
	border-radius: 12px;
	padding: 8px;
	text-decoration: none;
	color: var(--sc-text);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.sc-product:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); transform: translateY(-1px); }
.sc-product-img {
	width: 58px;
	height: 58px;
	border-radius: 9px;
	object-fit: contain;
	flex-shrink: 0;
	background: #fff;
	border: 1px solid var(--sc-border);
	padding: 4px;
}
.sc-product-noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	border: 1px solid var(--sc-border);
	background: var(--sc-soft);
}
.sc-product-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sc-product-name {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sc-job-meta {
	font-size: 12px;
	color: var(--sc-muted);
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sc-job-salary { font-size: 12px; color: var(--sc-accent); font-weight: 700; }
.sc-product-link { font-size: 11.5px; color: var(--sc-primary); font-weight: 700; margin-top: 2px; }

.sc-hidden { display: none !important; }
