/**
 * GoValid Form Builder styles.
 *
 * @package GoValid_QR
 */

/* --------------------------------------------------------
   Title input
   -------------------------------------------------------- */
.govalid-fb-title-input {
	font-size: 20px;
	font-weight: 600;
	border: 1px solid transparent;
	background: transparent;
	padding: 4px 8px;
	border-radius: var(--gv-radius);
	color: var(--gv-gray-900);
	width: 300px;
	transition: border-color var(--gv-transition), background var(--gv-transition);
}

.govalid-fb-title-input:hover,
.govalid-fb-title-input:focus {
	border-color: var(--gv-gray-300);
	background: #fff;
	outline: none;
}

/* --------------------------------------------------------
   Status Badge
   -------------------------------------------------------- */
.govalid-fb-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	padding: 2px 10px;
	border-radius: 20px;
	letter-spacing: 0.5px;
}

.govalid-fb-badge--draft {
	background: var(--gv-gray-100);
	color: var(--gv-gray-600);
}

.govalid-fb-badge--published {
	background: var(--gv-success-light);
	color: var(--gv-success);
}

/* --------------------------------------------------------
   Header actions
   -------------------------------------------------------- */
.govalid-fb-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

/* --------------------------------------------------------
   Three-column layout
   -------------------------------------------------------- */
.govalid-fb-layout {
	display: grid;
	grid-template-columns: 220px 1fr 280px;
	gap: 16px;
	min-height: 500px;
}

/* --------------------------------------------------------
   Palette (left column)
   -------------------------------------------------------- */
.govalid-fb-palette {
	background: #fff;
	border: 1px solid var(--gv-gray-200);
	border-radius: var(--gv-radius-lg);
	padding: 16px;
	box-shadow: var(--gv-shadow-sm);
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 120px);
	position: sticky;
	top: 32px;
}

.govalid-fb-palette h3 {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--gv-gray-600);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	flex-shrink: 0;
}

/* Palette search */
.govalid-fb-palette-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	flex-shrink: 0;
}

.govalid-fb-palette-search-wrap .dashicons {
	position: absolute;
	left: 8px;
	font-size: 15px;
	width: 15px;
	height: 15px;
	color: var(--gv-gray-400);
	pointer-events: none;
}

.govalid-fb-palette-search-wrap input {
	width: 100%;
	padding: 6px 10px 6px 28px;
	border: 1px solid var(--gv-gray-200);
	border-radius: 6px;
	font-size: 12px;
	color: var(--gv-gray-700);
	background: var(--gv-gray-50);
	box-sizing: border-box;
	outline: none;
	transition: border-color var(--gv-transition);
}

.govalid-fb-palette-search-wrap input:focus {
	border-color: var(--gv-primary);
	background: #fff;
}

/* Scrollable palette body */
.govalid-fb-palette-scroll {
	overflow-y: auto;
	flex: 1;
	min-height: 0;
	margin: 0 -4px;
	padding: 0 4px;
}

.govalid-fb-palette-scroll::-webkit-scrollbar {
	width: 4px;
}

.govalid-fb-palette-scroll::-webkit-scrollbar-track {
	background: transparent;
}

.govalid-fb-palette-scroll::-webkit-scrollbar-thumb {
	background: var(--gv-gray-200);
	border-radius: 4px;
}

.govalid-fb-palette-scroll:hover::-webkit-scrollbar-thumb {
	background: var(--gv-gray-300);
}

/* Category labels */
.govalid-fb-palette-cat-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--gv-gray-400);
	padding: 8px 2px 4px;
	margin-top: 4px;
}

.govalid-fb-palette-category:first-child .govalid-fb-palette-cat-label {
	padding-top: 0;
	margin-top: 0;
}

.govalid-fb-palette-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border: 1px solid var(--gv-gray-200);
	border-radius: var(--gv-radius);
	margin-bottom: 4px;
	cursor: grab;
	font-size: 12px;
	font-weight: 500;
	color: var(--gv-gray-700);
	background: var(--gv-gray-50);
	transition: all var(--gv-transition);
	user-select: none;
}

.govalid-fb-palette-item:hover {
	border-color: var(--gv-primary);
	background: var(--gv-primary-light);
	color: var(--gv-primary);
}

.govalid-fb-palette-item .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
}

/* Brand-colored palette icons */
.govalid-fb-palette-item[data-type="email"] .dashicons { color: #ea4335; }
.govalid-fb-palette-item[data-type="phone"] .dashicons { color: #16a34a; }
.govalid-fb-palette-item[data-type="url"] .dashicons { color: #2563eb; }
.govalid-fb-palette-item[data-type="file"] .dashicons { color: #f59e0b; }
.govalid-fb-palette-item[data-type="camera"] .dashicons { color: #8b5cf6; }
.govalid-fb-palette-item[data-type="date"] .dashicons { color: #0ea5e9; }
.govalid-fb-palette-item[data-type="time"] .dashicons { color: #6366f1; }
.govalid-fb-palette-item[data-type="whatsapp"] .dashicons { color: #25d366; }
.govalid-fb-palette-item[data-type="linkedin"] .dashicons { color: #0a66c2; }
.govalid-fb-palette-item[data-type="facebook"] .dashicons { color: #1877f2; }
.govalid-fb-palette-item[data-type="instagram"] .dashicons { color: #e4405f; }
.govalid-fb-palette-item[data-type="twitter"] .dashicons { color: #000000; }
.govalid-fb-palette-item[data-type="youtube"] .dashicons { color: #ff0000; }
.govalid-fb-palette-item[data-type="tiktok"] .dashicons { color: #000000; }
.govalid-fb-palette-item[data-type="telegram"] .dashicons { color: #26a5e4; }
.govalid-fb-palette-item[data-type="orcid"] .dashicons { color: #a6ce39; }
.govalid-fb-palette-item[data-type="scopus"] .dashicons { color: #e9711c; }
.govalid-fb-palette-item[data-type="google_scholar"] .dashicons { color: #4285f4; }
.govalid-fb-palette-item[data-type="researchgate"] .dashicons { color: #00ccbb; }
.govalid-fb-palette-item[data-type="academia"] .dashicons { color: #41454a; }
.govalid-fb-palette-item[data-type="pubmed"] .dashicons { color: #326599; }
.govalid-fb-palette-item[data-type="web_of_science"] .dashicons { color: #5c2d91; }
.govalid-fb-palette-item[data-type="semantic_scholar"] .dashicons { color: #1857b6; }
.govalid-fb-palette-item[data-type="heading"] .dashicons { color: var(--gv-gray-500); }
.govalid-fb-palette-item[data-type="separator"] .dashicons { color: var(--gv-gray-400); }
.govalid-fb-palette-item[data-type="gender"] .dashicons { color: #ec4899; }
.govalid-fb-palette-item[data-type="image_banner"] .dashicons { color: #f59e0b; }
.govalid-fb-palette-item[data-type="rating"] .dashicons { color: #f59e0b; }
.govalid-fb-palette-item[data-type="signature"] .dashicons { color: #6366f1; }
.govalid-fb-palette-item[data-type="page_break"] .dashicons { color: #0ea5e9; }

/* On hover, icons inherit the primary color */
.govalid-fb-palette-item:hover .dashicons { color: var(--gv-primary); }

/* --------------------------------------------------------
   Canvas (center column)
   -------------------------------------------------------- */
.govalid-fb-canvas-wrap {
	background: var(--gv-gray-50);
	border: 2px dashed var(--gv-gray-200);
	border-radius: var(--gv-radius-lg);
	padding: 16px;
	min-height: 400px;
}

.govalid-fb-canvas {
	min-height: 350px;
}

.govalid-fb-canvas-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 300px;
	color: var(--gv-gray-400);
	text-align: center;
}

.govalid-fb-canvas-empty p {
	margin: 0;
	font-size: 14px;
}

/* Canvas field items */
.govalid-fb-field {
	background: #fff;
	border: 1px solid var(--gv-gray-200);
	border-radius: var(--gv-radius);
	padding: 12px 14px;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	transition: all var(--gv-transition);
	position: relative;
}

.govalid-fb-field:hover {
	border-color: var(--gv-primary);
	box-shadow: var(--gv-shadow);
}

.govalid-fb-field.govalid-fb-field--active {
	border-color: var(--gv-primary);
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Page break divider in canvas */
.govalid-fb-field--pagebreak {
	background: var(--gv-gray-50);
	border-style: dashed;
	border-color: #0ea5e9;
}

.govalid-fb-pagebreak-divider {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
}

.govalid-fb-pagebreak-divider hr {
	flex: 1;
	border: none;
	border-top: 2px dashed #0ea5e9;
	opacity: 0.4;
}

.govalid-fb-pagebreak-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: #0ea5e9;
	white-space: nowrap;
	letter-spacing: 0.5px;
}

.govalid-fb-field-handle {
	cursor: grab;
	color: var(--gv-gray-400);
	flex-shrink: 0;
}

.govalid-fb-field-handle:active {
	cursor: grabbing;
}

.govalid-fb-field-icon {
	color: var(--gv-primary);
	flex-shrink: 0;
}

.govalid-fb-field-info {
	flex: 1;
	min-width: 0;
}

.govalid-fb-field-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--gv-gray-800);
	display: flex;
	align-items: center;
	gap: 6px;
}

.govalid-fb-field-type {
	font-size: 11px;
	color: var(--gv-gray-400);
}

.govalid-fb-required-dot {
	color: var(--gv-danger);
	font-weight: 700;
}

/* Sortable ghost/chosen states */
.govalid-fb-field.sortable-ghost {
	opacity: 0.4;
}

.govalid-fb-field.sortable-chosen {
	box-shadow: var(--gv-shadow-md);
}

/* --------------------------------------------------------
   Properties panel (right column)
   -------------------------------------------------------- */
.govalid-fb-properties {
	background: #fff;
	border: 1px solid var(--gv-gray-200);
	border-radius: var(--gv-radius-lg);
	padding: 16px;
	box-shadow: var(--gv-shadow-sm);
}

.govalid-fb-props-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	color: var(--gv-gray-400);
	text-align: center;
}

.govalid-fb-props-empty p {
	margin: 8px 0 0;
	font-size: 13px;
}

.govalid-fb-props-form h3 {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--gv-gray-800);
}

.govalid-fb-prop-group {
	margin-bottom: 14px;
}

.govalid-fb-prop-group > label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--gv-gray-600);
	margin-bottom: 4px;
}

.govalid-fb-prop-input {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid var(--gv-gray-200);
	border-radius: 6px;
	font-size: 13px;
	color: var(--gv-gray-800);
	transition: border-color var(--gv-transition);
	box-sizing: border-box;
}

.govalid-fb-prop-input:focus {
	border-color: var(--gv-primary);
	outline: none;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* --------------------------------------------------------
   Responsive
   -------------------------------------------------------- */
@media (max-width: 1200px) {
	.govalid-fb-layout {
		grid-template-columns: 180px 1fr 240px;
	}
}

@media (max-width: 960px) {
	.govalid-fb-layout {
		grid-template-columns: 1fr;
	}

	.govalid-fb-palette {
		max-height: 300px;
		position: static;
	}

	.govalid-fb-palette-item {
		margin-bottom: 0;
	}
}
