/* Portfolio Grid editor / inspector — Elementor-like dark panels */

.zozo-gb-inspector {
	--zozo-gb-bg: #1f2124;
	--zozo-gb-bg-elevated: #2b2d31;
	--zozo-gb-bg-hover: #34373c;
	--zozo-gb-border: #3c3f44;
	--zozo-gb-text: #e8e8e8;
	--zozo-gb-muted: #a7a7a7;
	--zozo-gb-accent: #92003b;
	--zozo-gb-accent-hover: #b00048;

	.components-base-control__label,
	.components-toggle-control__label,
	.components-panel__body-title,
	.components-panel__body-toggle {
		color: #1e1e1e;
	}

	.components-panel__body-title {
		line-height: 1;
	}

	.components-base-control__label {
		font-size: 11px;
		font-weight: 600;
		line-height: 1.4;
		text-transform: uppercase;
		box-sizing: border-box;
		display: block;
		padding-top: 0px;
		padding-bottom: 0px;
		max-width: 100%;
		z-index: 1;	
	}
	
	.components-toggle-control .components-form-toggle {
		order: 1;
	}

	.components-toggle-control .components-toggle-control__label {
		order: 0;
		font-size: 11px;
		font-weight: 600;
		line-height: 1.4;
		text-transform: uppercase;
		box-sizing: border-box;
	}
}

.zozo-gb-inspector-tabs {
	.components-tab-panel__tabs {
		display: flex;
		padding: 0;
		gap: 0;
		border-bottom: 1px solid #dbdbdb;
	}

	.components-tab-panel__tabs-item {
		flex: 1;
		justify-content: center;
		padding: 12px 8px;
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: #1e1e1e;
		border-radius: 0;
		background: transparent;
	}
}

.zozo-gb-device-selector {
	.components-button-group {
		display: inline-flex;
		overflow: hidden;
		gap: 2px;
	}

	.components-button {
		min-width: 28px;
		height: 28px;
		padding: 0 6px;
		color: var(--zozo-gb-muted, #a7a7a7);
		background: none !important;
		border: none !important;
		outline: none !important;

		&.is-pressed {
			color: #3858e9;
			box-shadow: none;
		}

		&.has-icon {
			.dashicon {
				font-size: 16px;
			}
		}		
	}
}

.zozo-gb-responsive-control {
	margin-bottom: 12px;

	&__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		margin-bottom: 6px;
	}

	&__label {
		font-size: 11px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}

	&__devices {
		display: flex;
		justify-content: flex-end;
		margin-bottom: 6px;
	}
}

.zozo-gb-unit-range {
	margin-bottom: 12px;

	&__row {
		display: flex;
		align-items: flex-start;
		align-items: center;
		gap: 8px;
	}

	&__range {
		flex: 1;
		min-width: 0;
	}

	&__unit {
		width: 72px;
		flex-shrink: 0;

		.components-base-control {
			margin-bottom: 0;
		}
	}
}

.zozo-gb-spacing {
	margin-bottom: 12px;

	&__tools {
		display: flex;
		align-items: center;
		gap: 8px;
		margin-bottom: 8px;

		.components-button {
			height: 40px;
			width: 40px;
			margin-top: 5px;
		}

		.components-base-control {
			margin-bottom: 0;
			flex: 1;
		}
	}

	&__sides {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 6px;

		.components-base-control {
			margin-bottom: 0;
		}

		.components-base-control__label {
			font-size: 10px;
			text-transform: uppercase;
		}
	}
}

.zozo-gb-border {
	margin-bottom: 12px;
}

.zozo-gb-typography__title,
.zozo-gb-alignment .components-base-control__label {
	display: block;
	margin-bottom: 8px;
}

.zozo-gb-typography {
	.components-select-control {
		margin-bottom: 8px;
	}
}

.zozo-gb-alignment {
	margin-bottom: 12px;

	.components-button-group {
		display: flex;
		width: 100%;
		border: 1px solid var(--zozo-gb-border, #3c3f44);
		border-radius: 4px;
	}

	.components-button {
		flex: 1;
		justify-content: center;
		background: none;
		border: none;
		height: 36px;
		outline: none;

		&:not(:last-child) {
			border-right: 1px solid var(--zozo-gb-border, #3c3f44);
		}

		&.is-pressed {
			background: #3858e9;
			color: #fff;
			box-shadow: none;
		}
	}
}

.zozo-gb-color-field {
	margin-bottom: 12px;

	.components-base-control__label {
		display: block;
		margin-bottom: 6px;
	}
}

.zozo-gb-popover-control {
	margin-bottom: 12px;

	&__row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		min-height: 32px;
	}

	&__actions {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		flex-shrink: 0;
	}

	.components-base-control__label {
		margin: 0;
	}
}

.zozo-gb-color-control__swatch {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1px solid #c3c4c7;
	border-radius: 2px;
	cursor: pointer;
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #c3c4c7 25%, transparent 25%),
		linear-gradient(-45deg, #c3c4c7 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #c3c4c7 75%),
		linear-gradient(-45deg, transparent 75%, #c3c4c7 75%);
	background-size: 8px 8px;
	background-position: 0 0, 0 4px, 4px -4px, -4px 0;

	&.has-color {
		background-image: none;
	}
}

.zozo-gb-popover.components-popover {
	z-index: 1000000;

	.components-popover__content {
		width: 280px;
		max-height: min(70vh, 520px);
		overflow: auto;
		padding: 12px 14px 8px;
		border-radius: 2px;
	}

	.zozo-gb-popover__title {
		margin: 0 0 12px;
		font-size: 13px;
		font-weight: 600;
		text-transform: uppercase;
	}

	.components-base-control__label,
	.components-range-control__label {
		color: #333;
	}
}

.zozo-gb-color-popover {
	.components-color-picker {
		width: 100%;
	}

	&__palette {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		margin-bottom: 10px;
	}

	&__chip {
		width: 22px;
		height: 22px;
		padding: 0;
		border: 1px solid #c3c4c7;
		border-radius: 2px;
		cursor: pointer;
		overflow: hidden;
	}

	&__clear {
		margin-top: 8px;
	}
}

.zozo-gb-dragdrop {
	margin-bottom: 16px;
	width: 100%;

	.components-base-control__label {
		margin-bottom: 8px;
	}

	&__groups {
		display: flex;
		flex-direction: column;
		gap: 12px;
	}

	&__group {
		width: 100%;
		background: #f0f0f0;
		padding: 10px;
		border-radius: 4px;
		margin-bottom: 12px;
		overflow: hidden;

		&[data-group='disabled'] {
			.zozo-gb-dragdrop__list {
				background: #f7f7f7;
			}
		}

	}

	&__group-title {
		padding-bottom: 8px;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.05em;
	}

	&__list {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 7px;
		min-height: 48px;
		margin: 0;
		padding: 12px;
		list-style: none;
		background: #f0f0f0;
		border: 1px solid #ddd;
		border-radius: 4px;
	}

	&__empty {
		width: 100%;
		margin: 0;
		padding: 14px;
		text-align: center;
		font-size: 11px;
		color: #757575;
	}

	&__item {
		display: inline-flex;
		align-items: center;
		width: auto;
		min-height: 32px;
		margin: 0;
		padding: 0;
		background: #3858e9;
		border: 1px solid #3858e9;
		border-radius: 4px;
		color: #fff;
		cursor: grab;
		user-select: none;
		transition:
			opacity 0.15s ease,
			transform 0.15s ease,
			box-shadow 0.15s ease;

		&.is-dragging {
			opacity: 0.45;
		}

		&.is-drag-over {
			outline: 2px dashed #007cba;
			outline-offset: 3px;
		}
	}

	&__handle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 20px;
		height: 32px;
		padding: 0;
		color: rgba(255, 255, 255, 0.75);
		font-size: 11px;
		line-height: 1;
		cursor: grab;

		&:active {
			cursor: grabbing;
		}
	}

	&__label {
		display: inline-flex;
		align-items: center;
		min-height: 32px;
		padding: 0 8px 0 2px;
		font-size: 12px;
		font-weight: 500;
		line-height: 1;
		color: #fff;
		white-space: nowrap;
	}

	&__actions {
		display: inline-flex;
		align-items: center;
		gap: 0;
		padding-right: 3px;

		.components-button {
			min-width: 24px;
			height: 28px;
			padding: 2px;
			color: #fff;

			&:hover {
				color: #fff;
				background: rgba(255, 255, 255, 0.12);
			}

			&:disabled  {
				opacity: 0.35;
			}
		}
	}
}

.zozo-gb-multiselect {
	margin-bottom: 14px;

	&__list {
		max-height: 180px;
		overflow: auto;
		padding: 8px 0;
	}

	&__empty {
		margin: 0;
		color: var(--zozo-gb-muted, #a7a7a7);
		font-size: 12px;
	}

	.components-checkbox-control {
		margin-bottom: 8px;
	}
}

.zozo-gb-state-control {
	margin-bottom: 16px;
	border: 1px solid var(--zozo-gb-border,#3c3f44);
	border-radius: 6px;
	overflow: hidden;
	background: #fff;

	.zozo-gb-state-tabs {
		display: flex;
		align-items: stretch;
		border-bottom: 1px solid #d5d5d5;
		background: #f7f7f7;
		overflow-x: auto;
	}

	.zozo-gb-state-content {
		padding: 12px 12px 4px;
	}
}

.zozo-gb-state-tabs {

	&__tab {
		display: inline-flex;
		align-items: center;
		flex: 1;
		justify-content: center;
		border-right: 1px solid #e2e2e2;

		&.is-active {
			background: #fff;
		}
	}

	&__tab-button.components-button {
		height: 34px;
		width: 100%;
		display: block;
		border-radius: 0;
		color: #1e1e1e;
		background: #fff;
		box-shadow: none;
		font-size: 11px;
		font-weight: 600;
		line-height: 1.4;

		&.is-pressed {
			background: #3858e9;
			box-shadow: none;
			color: #fff;
		}
	}

	&__icon.components-button {
		min-width: 24px;
		height: 34px;
		padding: 0;
		color: #757575;
		border-radius: 0;

		&:hover {
			color: #1e1e1e;
		}
	}

	&__add.components-button {
		flex: 0 0 auto;
		height: 34px;
		border-radius: 0;
		color: #1e1e1e;
	}

	&__rename {
		margin: 0;
		padding: 4px 6px;

		.components-base-control__field {
			margin-bottom: 0;
		}

		input {
			min-width: 72px;
			height: 26px;
		}
	}

	&__panel {
		padding: 12px 12px 4px;
	}
}

.zozo-gb-image-dimension {
	display: flex;
	gap: 12px;
	margin-top: 12px;

	&__field {
		flex: 1;
		min-width: 0;
	}

	.components-base-control {
		margin-bottom: 0;
	}
}

.zozo-portfolio-grid-preview {
	min-height: 80px;
	padding: 8px;
	border: 1px dashed #c3c4c7;
	background: #fff;
}

/* Soften inspector nesting inside WP sidebar */
.block-editor-block-inspector .zozo-gb-inspector {
	.components-panel__body-toggle.components-button {
		padding: 12px 16px;
	}
}
