/* New Chatbot – frontend chat styles */

.ncb-chat-wrap {
	--ncb-bg: #1a1d23;
	--ncb-surface: #252830;
	--ncb-border: #3d424d;
	--ncb-text: #e8eaed;
	--ncb-text-muted: #9aa0a6;
	--ncb-accent: #6b7cff;
	--ncb-accent-hover: #5a6bef;
	--ncb-radius: 12px;
	--ncb-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ncb-text);
	max-width: 420px;
	margin: 0 auto;
}

.ncb-chat-panel {
	background: var(--ncb-bg);
	border-radius: var(--ncb-radius);
	box-shadow: var(--ncb-shadow);
	border: 1px solid var(--ncb-border);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ncb-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--ncb-surface);
	border-bottom: 1px solid var(--ncb-border);
}

.ncb-chat-title {
	font-weight: 600;
	font-size: 1em;
}

.ncb-chat-close {
	background: none;
	border: none;
	color: var(--ncb-text-muted);
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	padding: 0 4px;
	border-radius: 4px;
}

.ncb-chat-close:hover {
	color: var(--ncb-text);
	background: rgba(255, 255, 255, 0.08);
}

.ncb-chat-messages {
	flex: 1;
	min-height: 280px;
	max-height: 400px;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ncb-message {
	max-width: 90%;
	align-self: flex-start;
	padding: 10px 14px;
	border-radius: 14px;
	word-wrap: break-word;
}

.ncb-message-user {
	align-self: flex-end;
	background: var(--ncb-accent);
	color: #fff;
}

.ncb-message-assistant {
	background: var(--ncb-surface);
	border: 1px solid var(--ncb-border);
}

.ncb-message-welcome {
	background: transparent;
	border-color: transparent;
	color: var(--ncb-text-muted);
}

.ncb-message-content {
	white-space: pre-wrap;
}

.ncb-message-typing .ncb-message-content::after {
	content: '';
	animation: ncb-dots 1.2s steps(4, end) infinite;
}

@keyframes ncb-dots {
	0%, 20% { content: ''; }
	40% { content: '.'; }
	60% { content: '..'; }
	80%, 100% { content: '...'; }
}

.ncb-chat-input-wrap {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--ncb-border);
	align-items: flex-end;
}

.ncb-chat-input {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	padding: 10px 14px;
	border: 1px solid var(--ncb-border);
	border-radius: 22px;
	background: var(--ncb-surface);
	color: var(--ncb-text);
	font: inherit;
	resize: none;
	transition: border-color 0.2s;
}

.ncb-chat-input:focus {
	outline: none;
	border-color: var(--ncb-accent);
}

.ncb-chat-input::placeholder {
	color: var(--ncb-text-muted);
}

.ncb-chat-send {
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: var(--ncb-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.2s;
}

.ncb-chat-send:hover:not(:disabled) {
	background: var(--ncb-accent-hover);
}

.ncb-chat-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ncb-chat-clear {
	display: block;
	width: calc(100% - 24px);
	margin: 0 12px 12px;
	padding: 8px 12px;
	background: transparent;
	border: 1px solid var(--ncb-border);
	border-radius: 8px;
	color: var(--ncb-text-muted);
	font-size: 13px;
	cursor: pointer;
}

.ncb-chat-clear:hover {
	color: var(--ncb-text);
	background: rgba(255, 255, 255, 0.05);
}

/* Floating widget */
.ncb-chat-floating {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	max-width: 420px;
	margin: 0;
}

.ncb-chat-floating .ncb-chat-panel {
	width: 380px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
}

.ncb-chat-floating .ncb-chat-panel[hidden] {
	display: none !important;
}

.ncb-chat-floating .ncb-chat-messages {
	max-height: 50vh;
}

.ncb-chat-toggle {
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var(--ncb-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--ncb-shadow);
	transition: transform 0.2s, background 0.2s;
}

.ncb-chat-floating.ncb-open .ncb-chat-toggle {
	display: none;
}

.ncb-chat-toggle:hover {
	background: var(--ncb-accent-hover);
	transform: scale(1.05);
}

.ncb-chat-floating .ncb-chat-panel {
	position: absolute;
	bottom: 0;
	right: 0;
}

.ncb-chat-floating.ncb-open .ncb-chat-panel {
	display: flex !important;
}
