/**
 * CIX Connect — Enterprise Theme Engine (floating panel)
 */

.cix-theme-engine {
	--cix-te-panel-w: min(380px, calc(100vw - 24px));
	position: fixed;
	z-index: 100050;
	font-family: Inter, system-ui, sans-serif;
}

.cix-te-fab {
	position: fixed;
	right: 20px;
	bottom: 88px;
	z-index: 100051;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 1px solid rgba(255, 106, 0, 0.45);
	border-radius: 999px;
	background: linear-gradient(135deg, rgba(255, 106, 0, 0.95), rgba(229, 95, 0, 0.95));
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	box-shadow: 0 8px 32px rgba(255, 106, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cix-te-fab:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 40px rgba(255, 106, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.45);
}

.cix-te-fab i {
	font-size: 1.1rem;
}

.cix-te-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: var(--cix-te-panel-w);
	max-height: min(88vh, 720px);
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(10, 14, 26, 0.82);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 106, 0, 0.08) inset;
	overflow: hidden;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.cix-te-panel[hidden] {
	display: none !important;
}

.cix-te-panel.is-collapsed .cix-te-body,
.cix-te-panel.is-collapsed .cix-te-tabs,
.cix-te-panel.is-collapsed .cix-te-preview-canvas,
.cix-te-panel.is-collapsed .cix-te-foot {
	display: none;
}

.cix-te-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	cursor: grab;
	user-select: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(0, 0, 0, 0.2);
}

.cix-te-head:active {
	cursor: grabbing;
}

.cix-te-head strong {
	display: block;
	color: #fff;
	font-size: 0.95rem;
}

.cix-te-head small {
	color: #94a3b8;
	font-size: 0.72rem;
}

.cix-te-head-actions {
	display: flex;
	gap: 4px;
}

.cix-te-icon-btn {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
	color: #e2e8f0;
	cursor: pointer;
	transition: background 0.15s;
}

.cix-te-icon-btn:hover {
	background: rgba(255, 106, 0, 0.25);
	color: #fff;
}

.cix-te-preview-canvas {
	position: relative;
	height: 100px;
	margin: 10px 12px 0;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.cix-te-preview-bg {
	position: absolute;
	inset: 0;
	transition: background 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.cix-te-preview-mini {
	position: relative;
	z-index: 1;
	display: flex;
	height: 100%;
	padding: 10px;
	gap: 8px;
	align-items: stretch;
}

.cix-te-mini-sidebar {
	width: 36px;
	border-radius: 8px;
	background: rgba(13, 18, 32, 0.85);
	border: 1px solid rgba(255, 106, 0, 0.25);
	transition: background 0.2s, opacity 0.2s;
}

.cix-te-mini-card {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 8px 10px;
	border-radius: 8px;
	background: rgba(21, 29, 47, 0.75);
	border: 1px solid rgba(255, 106, 0, 0.2);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
	transition: background 0.2s, box-shadow 0.2s;
}

.cix-te-mini-title {
	font-size: 0.7rem;
	font-weight: 600;
	color: #fff;
}

.cix-te-mini-btn {
	align-self: flex-start;
	padding: 4px 10px;
	border: none;
	border-radius: 6px;
	background: #ff6a00;
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	cursor: default;
	box-shadow: 0 0 12px rgba(255, 106, 0, 0.4);
}

.cix-te-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 8px 12px 0;
}

.cix-te-tab {
	flex: 1 1 auto;
	min-width: 0;
	padding: 6px 8px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: #94a3b8;
	font-size: 0.7rem;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.15s, background 0.15s;
}

.cix-te-tab:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

.cix-te-tab.is-active {
	color: #fff;
	background: rgba(255, 106, 0, 0.22);
	box-shadow: 0 0 12px rgba(255, 106, 0, 0.2);
}

.cix-te-body {
	flex: 1;
	overflow-y: auto;
	padding: 10px 14px 12px;
	scrollbar-width: thin;
}

.cix-te-pane {
	display: none;
}

.cix-te-pane.is-active {
	display: block;
}

.cix-te-label {
	display: flex;
	justify-content: space-between;
	margin: 10px 0 4px;
	font-size: 0.72rem;
	font-weight: 600;
	color: #cbd5e1;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.cix-te-label span {
	color: #ff6a00;
	font-weight: 700;
	text-transform: none;
}

.cix-te-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.cix-te-row input[type="color"] {
	width: 44px;
	height: 36px;
	padding: 2px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
}

.cix-te-row .form-control {
	flex: 1;
	background: rgba(255, 255, 255, 0.95);
	color: #111;
	border-color: rgba(255, 255, 255, 0.2);
}

.cix-te-pane .form-range {
	accent-color: #ff6a00;
}

.cix-te-pane .form-select {
	background: rgba(255, 255, 255, 0.95);
	color: #111;
}

.cix-te-hint {
	margin-top: 12px;
	font-size: 0.72rem;
	color: #64748b;
	line-height: 1.4;
}

.cix-te-preset-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.cix-te-preset-btn {
	padding: 10px 8px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	color: #e2e8f0;
	font-size: 0.72rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.cix-te-preset-btn:hover {
	border-color: rgba(255, 106, 0, 0.5);
	background: rgba(255, 106, 0, 0.12);
	box-shadow: 0 0 16px rgba(255, 106, 0, 0.15);
}

.cix-te-foot {
	padding: 10px 14px 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(0, 0, 0, 0.25);
}

.cix-te-status {
	display: block;
	margin-bottom: 8px;
	font-size: 0.7rem;
	color: #94a3b8;
}

.cix-te-status.is-draft {
	color: #fbbf24;
}

.cix-te-status.is-applied {
	color: #4ade80;
}

.cix-te-foot-btns,
.cix-te-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
}

.cix-theme-toolbar .btn-primary {
	background: #ff6a00 !important;
	border-color: #e55f00 !important;
	color: #fff !important;
	font-weight: 700;
}

.cix-settings-save-indicator.is-preview {
	color: #fbbf24;
}

.cix-theme-designer-head {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	padding-bottom: 12px;
}

.cix-te-foot-btns .btn-primary {
	background: #ff6a00 !important;
	border-color: #e55f00 !important;
	color: #fff !important;
	font-weight: 700;
	border-radius: 10px;
	padding: 8px 16px;
}

.cix-te-foot-btns .btn-outline-light {
	border-radius: 10px;
	font-weight: 600;
}

#cix-te-grad-angle-wrap {
	transition: opacity 0.2s;
}

#cix-te-grad-angle-wrap.is-hidden {
	display: none;
}

@media (max-width: 991px) {
	.cix-te-panel {
		right: 12px;
		left: 12px;
		width: auto;
		max-height: 70vh;
	}
}

@media (max-width: 575px) {
	.cix-te-fab {
		right: 12px;
		bottom: 16px;
		padding: 14px 16px;
	}

	.cix-te-fab span {
		display: none;
	}

	.cix-theme-engine.is-open .cix-te-panel {
		right: 0;
		left: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		max-height: 85vh;
		border-radius: 20px 20px 0 0;
		animation: cix-te-slide-up 0.3s ease;
	}

	.cix-theme-engine.is-open::before {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: -1;
	}
}

@keyframes cix-te-slide-up {
	from {
		transform: translateY(100%);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
