/* ==========================================================================
   UCDREAMS TOOLS - WEBSITE AI CHATBOT BUILDER & EMBED GENERATOR
   100% Mobile Responsive & Ultra-Lightweight AI Studio
   ========================================================================== */

.ucd-cb-wrapper {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto 60px;
	padding: 0 16px;
	box-sizing: border-box;
	overflow-x: hidden;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ucd-cb-wrapper * {
	box-sizing: border-box;
}

/* Mobile Toggle Bar (Sticky/Tab Switcher on mobile) */
.ucd-cb-mobile-toggle {
	display: none;
	width: 100%;
	background: #f1f5f9;
	padding: 5px;
	border-radius: 12px;
	margin-bottom: 20px;
	gap: 6px;
}

[data-theme="dark"] .ucd-cb-mobile-toggle,
body.dark-mode .ucd-cb-mobile-toggle {
	background: #1e293b;
}

.ucd-cb-m-btn {
	flex: 1;
	padding: 10px 14px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: #64748b;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: all 0.2s ease;
}

[data-theme="dark"] .ucd-cb-m-btn,
body.dark-mode .ucd-cb-m-btn {
	color: #94a3b8;
}

.ucd-cb-m-btn.is-active {
	background: #ffffff;
	color: #0f172a;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .ucd-cb-m-btn.is-active,
body.dark-mode .ucd-cb-m-btn.is-active {
	background: #334155;
	color: #ffffff;
}

/* Two Column Studio Grid */
.ucd-cb-studio {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: 28px;
	align-items: start;
	width: 100%;
}

@media (max-width: 960px) {
	.ucd-cb-mobile-toggle {
		display: flex;
	}
	.ucd-cb-studio {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
}

/* Configurator Card */
.ucd-cb-card {
	min-width: 0;
	width: 100%;
	background: var(--color-surface, #ffffff);
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 20px;
	padding: 24px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .ucd-cb-card,
body.dark-mode .ucd-cb-card {
	background: #111827;
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.ucd-cb-card-header {
	margin-bottom: 22px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--color-border, #e2e8f0);
}

[data-theme="dark"] .ucd-cb-card-header,
body.dark-mode .ucd-cb-card-header {
	border-color: #1e293b;
}

.ucd-cb-badge {
	display: inline-block;
	background: rgba(197, 69, 62, 0.1);
	color: #C5453E;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.ucd-cb-card-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 6px 0;
	color: var(--color-heading, #0f172a);
}

[data-theme="dark"] .ucd-cb-card-title,
body.dark-mode .ucd-cb-card-title {
	color: #f1f5f9;
}

.ucd-cb-card-desc {
	font-size: 13px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

/* Two inputs row */
.ucd-cb-row-2 {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 14px;
}

@media (max-width: 580px) {
	.ucd-cb-row-2 {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}
}

/* Form Groups & Inputs */
.ucd-cb-form-group {
	margin-bottom: 16px;
	width: 100%;
}

.ucd-cb-label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--color-heading, #0f172a);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

[data-theme="dark"] .ucd-cb-label,
body.dark-mode .ucd-cb-label {
	color: #f1f5f9;
}

.ucd-cb-input,
.ucd-cb-textarea,
.ucd-cb-select {
	width: 100%;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid var(--color-border, #e2e8f0);
	background: var(--color-surface, #ffffff);
	color: var(--color-heading, #0f172a);
	font-size: 13.5px;
	outline: none;
	transition: border-color 0.2s;
	font-family: inherit;
}

[data-theme="dark"] .ucd-cb-input,
[data-theme="dark"] .ucd-cb-textarea,
[data-theme="dark"] .ucd-cb-select,
body.dark-mode .ucd-cb-input,
body.dark-mode .ucd-cb-textarea,
body.dark-mode .ucd-cb-select {
	background: #1e293b;
	border-color: #334155;
	color: #f8fafc;
}

.ucd-cb-input:focus,
.ucd-cb-textarea:focus,
.ucd-cb-select:focus {
	border-color: #C5453E;
}

.ucd-cb-textarea {
	line-height: 1.5;
	resize: vertical;
	min-height: 130px;
}

/* Color Swatches Grid */
.ucd-cb-colors {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.ucd-cb-color-btn {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform 0.2s, border-color 0.2s;
	padding: 0;
	position: relative;
}

.ucd-cb-color-btn.is-active {
	border-color: #0f172a;
	transform: scale(1.12);
}

[data-theme="dark"] .ucd-cb-color-btn.is-active,
body.dark-mode .ucd-cb-color-btn.is-active {
	border-color: #ffffff;
}

.ucd-cb-color-picker {
	width: 34px;
	height: 34px;
	padding: 0;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	background: transparent;
}

/* Prompt Templates Chips */
.ucd-cb-templates-row {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.ucd-cb-tmpl-btn {
	background: rgba(0, 0, 0, 0.04);
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 11.5px;
	font-weight: 600;
	color: #475569;
	cursor: pointer;
	transition: all 0.15s ease;
}

[data-theme="dark"] .ucd-cb-tmpl-btn,
body.dark-mode .ucd-cb-tmpl-btn {
	background: #1e293b;
	border-color: #334155;
	color: #cbd5e1;
}

.ucd-cb-tmpl-btn:hover {
	background: #C5453E;
	color: #ffffff;
	border-color: #C5453E;
}

/* Engine Selector Cards */
.ucd-cb-engine-selector {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px;
}

@media (max-width: 600px) {
	.ucd-cb-engine-selector {
		grid-template-columns: minmax(0, 1fr);
	}
}

.ucd-cb-engine-card {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px;
	border-radius: 12px;
	border: 2px solid var(--color-border, #e2e8f0);
	background: #f8fafc;
	cursor: pointer;
	transition: all 0.2s ease;
}

[data-theme="dark"] .ucd-cb-engine-card,
body.dark-mode .ucd-cb-engine-card {
	background: #1e293b;
	border-color: #334155;
}

.ucd-cb-engine-card input[type="radio"] {
	margin-top: 3px;
	cursor: pointer;
}

.ucd-cb-engine-card.is-active {
	border-color: #C5453E;
	background: rgba(197, 69, 62, 0.04);
}

[data-theme="dark"] .ucd-cb-engine-card.is-active,
body.dark-mode .ucd-cb-engine-card.is-active {
	background: rgba(197, 69, 62, 0.12);
	border-color: #C5453E;
}

.ucd-cb-engine-body {
	flex: 1;
}

.ucd-cb-engine-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	margin-bottom: 4px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--color-heading, #0f172a);
}

[data-theme="dark"] .ucd-cb-engine-title,
body.dark-mode .ucd-cb-engine-title {
	color: #f1f5f9;
}

.ucd-cb-badge-free {
	font-size: 10px;
	background: #10B981;
	color: #ffffff;
	padding: 2px 6px;
	border-radius: 4px;
	font-weight: 700;
}

.ucd-cb-badge-llm {
	font-size: 10px;
	background: #2563EB;
	color: #ffffff;
	padding: 2px 6px;
	border-radius: 4px;
	font-weight: 700;
}

.ucd-cb-engine-desc {
	font-size: 11.5px;
	color: #64748b;
	margin: 0;
	line-height: 1.45;
}

/* Embed Code Snippet */
.ucd-cb-code-box {
	background: #0f172a;
	color: #e2e8f0;
	border-radius: 12px;
	padding: 16px;
	font-family: 'Fira Code', Consolas, Monaco, monospace;
	font-size: 12px;
	position: relative;
	overflow-x: auto;
	margin-bottom: 8px;
	line-height: 1.5;
	max-width: 100%;
}

.ucd-cb-copy-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #2563eb;
	color: #fff;
	border: none;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: background 0.2s;
	z-index: 5;
}

.ucd-cb-copy-btn:hover {
	background: #1d4ed8;
}

/* RIGHT COLUMN: Simulator & Mockup */
.ucd-cb-preview-col {
	min-width: 0;
	width: 100%;
	position: sticky;
	top: 80px;
}

@media (max-width: 960px) {
	.ucd-cb-preview-col {
		position: static;
	}
}

.ucd-cb-preview-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.ucd-cb-device-btns {
	display: flex;
	gap: 6px;
}

.ucd-cb-device-btn {
	padding: 6px 12px;
	border-radius: 6px;
	border: 1px solid var(--color-border, #e2e8f0);
	background: var(--color-surface, #ffffff);
	color: #64748b;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 5px;
}

[data-theme="dark"] .ucd-cb-device-btn,
body.dark-mode .ucd-cb-device-btn {
	background: #1e293b;
	border-color: #334155;
	color: #94a3b8;
}

.ucd-cb-device-btn.is-active {
	background: #C5453E;
	color: #ffffff;
	border-color: #C5453E;
}

/* Mockup Window */
.ucd-cb-mockup {
	width: 100%;
	max-width: 100%;
	background: #ffffff;
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
	height: 580px;
	display: flex;
	flex-direction: column;
	position: relative;
	transition: width 0.3s ease;
}

[data-theme="dark"] .ucd-cb-mockup,
body.dark-mode .ucd-cb-mockup {
	background: #0f172a;
	border-color: rgba(255, 255, 255, 0.1);
}

.ucd-cb-mockup.is-mobile {
	max-width: 360px;
	margin: 0 auto;
}

@media (max-width: 500px) {
	.ucd-cb-mockup {
		height: 480px;
		border-radius: 14px;
	}
	.ucd-cb-mockup.is-mobile {
		max-width: 100%;
	}
}

.ucd-cb-mockup-topbar {
	background: #f1f5f9;
	padding: 10px 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

[data-theme="dark"] .ucd-cb-mockup-topbar,
body.dark-mode .ucd-cb-mockup-topbar {
	background: #1e293b;
	border-color: #334155;
}

.ucd-cb-mockup-dots {
	display: flex;
	gap: 5px;
}

.ucd-cb-mockup-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
}

.ucd-cb-mockup-url {
	flex: 1;
	background: #ffffff;
	border-radius: 6px;
	padding: 3px 10px;
	font-size: 11px;
	color: #64748b;
	text-align: center;
	font-family: monospace;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

[data-theme="dark"] .ucd-cb-mockup-url,
body.dark-mode .ucd-cb-mockup-url {
	background: #0f172a;
	color: #94a3b8;
}

/* Mockup Canvas */
.ucd-cb-mockup-canvas {
	flex: 1;
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
	padding: 20px;
	display: flex;
	flex-direction: column;
}

[data-theme="dark"] .ucd-cb-mockup-canvas,
body.dark-mode .ucd-cb-mockup-canvas {
	background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.ucd-cb-dummy-hero {
	margin-top: 16px;
	text-align: center;
}

.ucd-cb-dummy-title {
	width: 60%;
	height: 16px;
	background: #e2e8f0;
	border-radius: 6px;
	margin: 0 auto 12px;
}

.ucd-cb-dummy-text {
	height: 9px;
	background: #f1f5f9;
	border-radius: 4px;
	margin: 0 auto 8px;
}

.ucd-cb-dummy-badge {
	display: inline-block;
	margin-top: 14px;
	padding: 6px 12px;
	background: rgba(197, 69, 62, 0.08);
	color: #C5453E;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
}

/* Simulated In-Canvas Floating Widget */
.ucd-cb-canvas-widget-area {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: auto;
}

.ucd-sim-launcher {
	position: absolute;
	bottom: 16px;
	right: 16px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: none;
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
	transition: transform 0.2s ease;
	z-index: 10;
}

.ucd-sim-launcher:hover {
	transform: scale(1.08);
}

.ucd-sim-panel {
	position: absolute;
	bottom: 76px;
	right: 16px;
	width: 320px;
	max-width: calc(100% - 32px);
	height: 420px;
	max-height: calc(100% - 90px);
	background: #ffffff;
	color: #1e293b;
	border-radius: 16px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 20;
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px) scale(0.96);
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ucd-sim-panel.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
	.ucd-sim-panel {
		left: 10px !important;
		right: 10px !important;
		bottom: 70px !important;
		width: calc(100% - 20px) !important;
		max-width: none !important;
		height: 380px !important;
	}
}

.ucd-sim-header {
	padding: 12px 14px;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.ucd-sim-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ucd-sim-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
}

.ucd-sim-close {
	background: transparent;
	border: none;
	color: #ffffff;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
}

.ucd-sim-body {
	flex: 1;
	padding: 12px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fafafa;
}

.ucd-sim-bubble {
	max-width: 84%;
	padding: 8px 12px;
	border-radius: 12px;
	font-size: 12.5px;
	line-height: 1.45;
	word-break: break-word;
}

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

.ucd-sim-user {
	align-self: flex-end;
	color: #ffffff;
	border-bottom-right-radius: 2px;
}

.ucd-sim-typing {
	display: flex;
	gap: 4px;
	padding: 6px 10px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	width: fit-content;
}

.ucd-sim-typing span {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #94a3b8;
	animation: ucdBlink 1.4s infinite both;
}

.ucd-sim-typing span:nth-child(2) { animation-delay: 0.2s; }
.ucd-sim-typing span:nth-child(3) { animation-delay: 0.4s; }

.ucd-sim-footer {
	padding: 8px 10px;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ucd-sim-input {
	flex: 1;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	color: #0f172a;
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 12px;
	outline: none;
}

.ucd-sim-send {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Features Grid */
.ucd-cb-features-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
	margin-top: 40px;
}

.ucd-cb-feat-card {
	background: var(--color-surface, #ffffff);
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .ucd-cb-feat-card,
body.dark-mode .ucd-cb-feat-card {
	background: #111827;
	border-color: rgba(255, 255, 255, 0.08);
}

.ucd-cb-feat-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: rgba(197, 69, 62, 0.1);
	color: #C5453E;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
}

.ucd-cb-feat-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 8px 0;
	color: var(--color-heading, #0f172a);
}

[data-theme="dark"] .ucd-cb-feat-title,
body.dark-mode .ucd-cb-feat-title {
	color: #f1f5f9;
}

.ucd-cb-feat-desc {
	font-size: 13.5px;
	color: #64748b;
	line-height: 1.55;
	margin: 0;
}

@keyframes ucdBlink {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}
