/* Site Content AI Chatbot — widget styles. Scoped under .scc-root. */

.scc-root {
	--scc-primary: #2271b1;
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

.scc-pos-right { right: 20px; }
.scc-pos-left { left: 20px; }

/* Launcher */
.scc-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var(--scc-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.scc-launcher:hover {
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.scc-launcher.scc-hidden { display: none; }

/* Panel */
/* Author-origin display:flex would otherwise beat the UA [hidden] rule,
   leaving the panel permanently open — restore the hidden semantics. */
.scc-panel[hidden] {
	display: none !important;
}

.scc-panel {
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	overflow: hidden;
}

.scc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--scc-primary);
	color: #fff;
}
.scc-title {
	font-weight: 600;
	font-size: 15px;
}
.scc-close {
	border: none;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: 0.85;
}
.scc-close:hover { opacity: 1; }

/* Messages */
.scc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #f6f7f8;
}

.scc-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 14px;
	white-space: pre-wrap;
	overflow-wrap: break-word;
	word-break: break-word;
}
.scc-msg-user {
	align-self: flex-end;
	background: var(--scc-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.scc-msg-assistant {
	align-self: flex-start;
	background: #fff;
	color: #1f2328;
	border: 1px solid #e3e5e8;
	border-bottom-left-radius: 4px;
}

/* Sources */
.scc-sources {
	align-self: flex-start;
	max-width: 85%;
	font-size: 12px;
	color: #57606a;
	padding: 0 4px;
}
.scc-source-link {
	color: var(--scc-primary);
	text-decoration: underline;
}

/* Typing indicator */
.scc-typing {
	display: flex;
	gap: 4px;
	padding: 12px 14px;
}
.scc-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #a0a6ad;
	animation: scc-bounce 1.2s infinite ease-in-out;
}
.scc-dot:nth-child(2) { animation-delay: 0.15s; }
.scc-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes scc-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* Input row */
.scc-input-row {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e3e5e8;
	background: #fff;
	margin: 0;
}
.scc-input {
	flex: 1;
	resize: none;
	border: 1px solid #d0d5da;
	border-radius: 10px;
	padding: 8px 10px;
	font: inherit;
	color: #1f2328;
	background: #fff;
	max-height: 90px;
}
.scc-input:focus {
	outline: 2px solid var(--scc-primary);
	outline-offset: -1px;
	border-color: transparent;
}
.scc-send {
	border: none;
	border-radius: 10px;
	background: var(--scc-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	padding: 0 14px;
	cursor: pointer;
}
.scc-send:disabled {
	opacity: 0.55;
	cursor: default;
}

/* Small screens: bottom sheet */
@media (max-width: 480px) {
	.scc-root { bottom: 12px; }
	.scc-pos-right { right: 12px; }
	.scc-pos-left { left: 12px; }
	.scc-panel {
		width: calc(100vw - 24px);
		height: 70vh;
		height: 70dvh;
	}
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
	.scc-panel { background: #1c1f23; }
	.scc-messages { background: #16181b; }
	.scc-msg-assistant {
		background: #24282d;
		color: #e6e8ea;
		border-color: #33383e;
	}
	.scc-sources { color: #9aa2ab; }
	.scc-input-row {
		background: #1c1f23;
		border-top-color: #33383e;
	}
	.scc-input {
		background: #24282d;
		color: #e6e8ea;
		border-color: #3a4046;
	}
}
