/* ==========================================================================
   UnoDock — Admin Panel
   ========================================================================== */

#udock-app, #udock-app * {
	box-sizing: border-box;
}

/* The Iris color picker (wp-color-picker) popup is built with WordPress
   core's own fixed-pixel layout math, which assumes content-box sizing.
   Forcing border-box on it throws off its width calculations and makes
   the alpha/transparency slider wrap onto its own line instead of sitting
   beside the color square — so it's excluded from the reset above. */
#udock-app .iris-picker,
#udock-app .iris-picker * {
	box-sizing: content-box;
}

.udock-wrap {
	margin: 20px 20px 20px 0;
	max-width: 1100px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #1e1e2e;
}

/* Header */
.udock-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 18px 24px;
	margin-bottom: 18px;
	box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.udock-header-left {
	display: flex;
	align-items: center;
	gap: 14px;
}
.udock-header-logo {
	height: 44px;
	width: auto;
	display: block;
}
.udock-header h1 {
	font-size: 18px;
	margin: 0;
	line-height: 1.2;
}
.udock-header-subtitle {
	font-size: 12px;
	font-weight: 400;
	color: #6b7280;
	margin-left: 6px;
}
.udock-header p {
	margin: 0;
	font-size: 12px;
	color: #6b7280;
}
.udock-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}
.udock-save-status {
	font-size: 13px;
	color: #16a34a;
	opacity: 0;
	transition: opacity .25s ease;
}
.udock-save-status.show { opacity: 1; }
.udock-save-status.error { color: #dc2626; }

/* Buttons */
.udock-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 8px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: all .15s ease;
}
.udock-btn-primary {
	background: #199AFC;
	color: #fff;
}
.udock-btn-primary:hover { background: #0f7fd6; }
.udock-btn-outline {
	background: #fff;
	border-color: #d1d5db;
	color: #374151;
}
.udock-btn-outline:hover { border-color: #199AFC; color: #199AFC; }

/* Enable bar toggle in header */
.udock-enable-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-right: 6px;
}
.udock-enable-label {
	font-size: 12px;
	font-weight: 600;
	color: #374151;
}

/* Checkbox list (replaces multi-select for page visibility) */
.udock-checkbox-list {
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 6px 4px;
}
.udock-checkbox-list label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	font-size: 13px;
	font-weight: 400;
	border-radius: 6px;
	cursor: pointer;
}
.udock-checkbox-list label:hover { background: #f3f4f6; }
.udock-checkbox-list input[type="checkbox"] { margin: 0; }
.udock-checkbox-list-empty {
	padding: 10px;
	font-size: 12px;
	color: #9ca3af;
}

/* Tabs */
.udock-tabs {
	display: flex;
	gap: 4px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 6px;
	margin-bottom: 18px;
}
.udock-tab {
	flex: 1;
	background: transparent;
	border: none;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #6b7280;
	cursor: pointer;
	transition: all .15s ease;
}
.udock-tab:hover { color: #199AFC; }
.udock-tab.active {
	background: #199AFC;
	color: #fff;
}

/* Panels */
.udock-panel { display: none; }
.udock-panel.active { display: block; }

.udock-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 22px 24px;
	margin-bottom: 16px;
}
.udock-card h3 {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 700;
}
.udock-panel-head { margin-bottom: 14px; }
.udock-panel-head h2 { margin: 0 0 4px; font-size: 16px; }
.udock-panel-head p { margin: 0; color: #6b7280; font-size: 13px; }

/* Grids */
.udock-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.udock-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.udock-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }

.udock-field { margin-bottom: 14px; }
.udock-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}
.udock-hint { font-weight: 400; color: #9ca3af; }

.udock-input, select.udock-input, .udock-field select, .udock-field input[type="text"], .udock-field input[type="number"] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 13px;
}
.udock-field input[type="range"] { width: 100%; }
.udock-range-val { color: #199AFC; font-weight: 700; }

/* Switch toggle */
.udock-switch-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 0;
	border-bottom: 1px solid #f1f5f9;
}
.udock-switch-row:last-child { border-bottom: none; }
.udock-switch-row-compact { border-bottom: none; padding: 0; margin-bottom: 14px; }
.udock-switch-row strong { font-size: 13px; }
.udock-switch-row p { margin: 2px 0 0; font-size: 12px; color: #6b7280; }

.udock-switch {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
}
.udock-switch input { opacity: 0; width: 0; height: 0; }
.udock-slider {
	position: absolute;
	cursor: pointer;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: #d1d5db;
	border-radius: 22px;
	transition: .2s;
}
.udock-slider:before {
	position: absolute;
	content: "";
	height: 16px; width: 16px;
	left: 3px; bottom: 3px;
	background-color: #fff;
	border-radius: 50%;
	transition: .2s;
}
.udock-switch input:checked + .udock-slider { background-color: #199AFC; }
.udock-switch input:checked + .udock-slider:before { transform: translateX(18px); }

/* Radio row */
.udock-radio-row { display: flex; gap: 20px; font-size: 13px; }
.udock-radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 400; }

/* Color swatch (wp-color-picker wraps this) */
/* Color swatch button — a modern, clean circle with no text label. */
.wp-picker-container {
	display: inline-flex;
	align-items: center;
}
.wp-picker-container .wp-color-result.wp-color-result {
	width: 30px;
	height: 30px;
	min-width: 30px;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50%;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 1.5px #d1d5db, 0 2px 5px rgba(0, 0, 0, 0.12);
	overflow: visible;
	transition: box-shadow .15s ease, transform .15s ease;
}
.wp-picker-container .wp-color-result.wp-color-result:hover {
	box-shadow: 0 0 0 1.5px #16E2F5, 0 3px 8px rgba(0, 0, 0, 0.18);
	transform: scale(1.06);
}
.wp-picker-container .wp-color-result.wp-color-result:focus {
	box-shadow: 0 0 0 1.5px #16E2F5, 0 0 0 4px rgba(22, 226, 245, 0.25);
}
.wp-picker-container .wp-color-result-text {
	display: none !important;
}

/* Buttons list */
.udock-buttons-list { margin-bottom: 16px; }
.udock-button-item {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	margin-bottom: 10px;
	overflow: hidden;
}
.udock-button-item.udock-sorting-placeholder {
	background: #eff6ff;
	border: 2px dashed #61D6FA;
}
.udock-button-item-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: #f9fafb;
	cursor: default;
}
.udock-drag-handle { cursor: grab; color: #9ca3af; }
.udock-button-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #e5e7eb;
	color: #4b5563;
	font-size: 11px;
	font-weight: 700;
	flex-shrink: 0;
}
.udock-button-number.udock-is-featured {
	background: linear-gradient(135deg, #16E2F5, #D462FF);
	color: #ffffff;
}
.udock-button-icon-preview {
	width: 30px; height: 30px;
	border-radius: 8px;
	background: #eef2ff;
	color: #199AFC;
	display: flex; align-items: center; justify-content: center;
	font-size: 14px;
}
.udock-button-item-label { flex: 1; font-weight: 600; font-size: 13px; }
.udock-button-toggle, .udock-button-remove {
	background: none; border: none; cursor: pointer; color: #6b7280;
	padding: 4px;
	border-radius: 6px;
}
.udock-button-toggle:hover { background: #e5e7eb; }
.udock-button-remove:hover { background: #fee2e2; color: #dc2626; }
.udock-button-item.open .udock-button-toggle { transform: rotate(180deg); }

.udock-button-item-body {
	display: none;
	padding: 18px 16px;
	border-top: 1px solid #f1f5f9;
}
.udock-button-item.open .udock-button-item-body { display: block; }

.udock-icon-picker-btn {
	width: 100%;
	display: flex; align-items: center; gap: 8px;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 13px;
}
.udock-icon-picker-btn:hover { border-color: #199AFC; }
.udock-icon-picker-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(22, 226, 245, 0.35);
}
.udock-icon-picker-btn:active {
	transform: scale(0.96);
}

.udock-b-url-wrap, .udock-b-page-wrap { transition: opacity .15s ease; }

/* Icon picker modal */
.udock-modal-overlay {
	display: none;
	position: fixed; inset: 0;
	background: rgba(17, 24, 39, .55);
	z-index: 100000;
	align-items: center;
	justify-content: center;
}
.udock-modal-overlay.open { display: flex; }
.udock-modal {
	background: #fff;
	width: 520px;
	max-width: 92vw;
	max-height: 80vh;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: column;
}
.udock-modal-head {
	display: flex; align-items: center; justify-content: space-between;
	margin-bottom: 12px;
}
.udock-modal-head h3 { margin: 0; font-size: 15px; }
.udock-modal-close { background: none; border: none; cursor: pointer; color: #6b7280; }
.udock-icon-grid {
	margin-top: 12px;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 8px;
	overflow-y: auto;
	padding-right: 4px;
}
.udock-icon-option {
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 10px 4px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 10px;
	color: #6b7280;
	border: 1px solid transparent;
}
.udock-icon-option i { font-size: 16px; color: #374151; }
.udock-icon-option:hover { background: #f3f4f6; }
.udock-icon-option.selected { border-color: #199AFC; background: #eff6ff; }
.udock-icon-option:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(22, 226, 245, 0.35);
}
.udock-icon-option:active {
	transform: scale(0.92);
}

/* Preview */
.udock-preview-frame {
	width: 320px;
	margin: 0 auto;
	border: 10px solid #1f2937;
	border-radius: 32px;
	overflow: hidden;
	height: 560px;
	position: relative;
	background: #f3f4f6;
}
.udock-preview-bar {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	display: flex;
	align-items: stretch;
}
.udock-preview-btn {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	position: relative;
}
.udock-preview-btn-clickable {
	cursor: pointer;
	border-radius: 10px;
	transition: background .15s ease;
}
.udock-preview-btn-clickable:hover {
	background: rgba(22, 226, 245, 0.08);
}
.udock-preview-label {
	position: relative;
	padding-bottom: 3px;
}
.udock-preview-label-active::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background: var(--udock-preview-underline, #16E2F5);
	border-radius: 2px;
	transform-origin: left;
	animation: udock-preview-underline-grow 0.4s ease forwards;
}
@keyframes udock-preview-underline-grow {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

@media (max-width: 782px) {
	.udock-grid-4, .udock-grid-3, .udock-grid-2 { grid-template-columns: 1fr; }
	.udock-icon-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Divider inside the button card */
.udock-card-divider {
	height: 1px;
	background: #f1f5f9;
	margin: 16px 0;
}

/* Featured button options (visually indented) */
.udock-icon-bg-options {
	margin-left: 54px;
	padding-left: 14px;
	border-left: 2px solid #eef2ff;
}
.udock-b-circle-color-wrap { margin-top: 10px; }

/* Brand footer + PRO upsell */
.udock-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	background: #0b0f19;
	border-radius: 12px;
	padding: 36px 36px;
	margin-top: 24px;
	flex-wrap: wrap;
	min-height: 110px;
}
.udock-footer-brand {
	display: flex;
	align-items: center;
	gap: 16px;
}
.udock-footer-logo {
	height: 64px;
	width: auto;
	display: block;
}
.udock-footer-link {
	color: #9ca3af;
	font-size: 12px;
	text-decoration: none;
}
.udock-footer-link:hover { color: #16E2F5; }
.udock-footer-upsell {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.udock-footer-upsell p {
	margin: 0;
	color: #e5e7eb;
	font-size: 13px;
}
.udock-footer-upsell strong {
	background: linear-gradient(90deg, #16E2F5, #D462FF);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}
.udock-btn-upgrade {
	background: linear-gradient(90deg, #16E2F5, #D462FF);
	color: #0b0f19;
	white-space: nowrap;
}
.udock-btn-upgrade:hover {
	opacity: 0.9;
}

/* ---------------------------------------------------------
 * Global focus/click feedback fix (replaces the browser's default
 * square outline on every interactive element inside the panel)
 * ------------------------------------------------------- */
#udock-app button:focus,
#udock-app input:focus,
#udock-app select:focus,
#udock-app .udock-icon-option:focus,
#udock-app .udock-tab:focus {
	outline: none !important;
	box-shadow: 0 0 0 3px rgba(22, 226, 245, 0.35);
}
#udock-app button:active,
#udock-app .udock-icon-option:active {
	transform: scale(0.96);
}
#udock-app input[type="checkbox"]:focus,
#udock-app input[type="radio"]:focus {
	outline: none !important;
	box-shadow: 0 0 0 2px rgba(22, 226, 245, 0.35);
}

/* ---------------------------------------------------------
 * Featured button size bar (5 positions)
 * ------------------------------------------------------- */
.udock-size-bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 32px;
	padding: 0 4px;
}
.udock-size-bar-track {
	position: absolute;
	left: 4px;
	right: 4px;
	top: 50%;
	height: 3px;
	background: #e5e7eb;
	border-radius: 2px;
	transform: translateY(-50%);
}
.udock-size-bar-dot {
	position: relative;
	z-index: 1;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid #d1d5db;
	cursor: pointer;
	padding: 0;
	transition: all .15s ease;
}
.udock-size-bar-dot:hover {
	border-color: #16E2F5;
}
.udock-size-bar-dot.active {
	background: linear-gradient(135deg, #16E2F5, #D462FF);
	border-color: transparent;
	width: 18px;
	height: 18px;
}

/* ---------------------------------------------------------
 * PRO badges & locked controls
 * ------------------------------------------------------- */
.udock-locked {
	opacity: 0.55;
	pointer-events: none;
}
.udock-locked-wrap {
	position: relative;
	cursor: pointer;
}
.udock-locked-wrap .udock-locked {
	pointer-events: none;
}
.udock-templates-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
.udock-template-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.udock-template-preview {
	position: relative;
	height: 90px;
	border-radius: 10px;
	overflow: visible;
	background: #f3f4f6;
	display: flex;
	align-items: flex-end;
}
.udock-template-pro {
	border-color: #D462FF;
	box-shadow: 0 0 0 1px rgba(212, 98, 255, 0.25);
}
.udock-pro-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	background: linear-gradient(90deg, #16E2F5, #D462FF);
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .04em;
	padding: 3px 8px;
	border-radius: 20px;
}
/* Inline variant (next to a label/title): overrides the absolute positioning above. */
.udock-inline-badge {
	position: static;
	display: inline-block;
	vertical-align: middle;
	margin-left: 6px;
	font-size: 9px;
	padding: 2px 6px;
}
.udock-template-preview .udock-preview-bar {
	width: 100%;
	display: flex;
	align-items: stretch;
}
.udock-template-name {
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}
.udock-template-apply {
	width: 100%;
	justify-content: center;
}

/* ---------------------------------------------------------
 * Version tag
 * ------------------------------------------------------- */
.udock-version-tag {
	text-align: center;
	font-size: 11px;
	color: #9ca3af;
	margin-top: 14px;
}

/* ---------------------------------------------------------
 * Floating "Save changes" button — always visible, follows scroll
 * ------------------------------------------------------- */
.udock-floating-save {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 999;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #199AFC;
	color: #ffffff;
	border: none;
	border-radius: 30px;
	padding: 13px 22px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(25, 154, 252, 0.35);
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.udock-floating-save:hover {
	background: #0f7fd6;
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(25, 154, 252, 0.45);
}
.udock-floating-save:active {
	transform: translateY(0);
}
.udock-floating-save .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

@media (max-width: 782px) {
	.udock-floating-save {
		right: 16px;
		bottom: 16px;
		padding: 12px 18px;
	}
}
