/**
 * Editor styles for Answer Card block.
 *
 * These styles are only loaded in the block editor.
 *
 * @package ProvimediaGeoWidget
 */

// Main editor container
.geo-widget-editor {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 16px;
}

// Field labels
.geo-widget-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1e1e1e;
	margin-bottom: 4px;
}

// Field wrapper
.geo-widget-field {
	margin-bottom: 20px;

	.components-base-control {
		margin-bottom: 0;
	}

	&:last-of-type {
		margin-bottom: 0;
	}
}

// Word count indicator with traffic light colors
.geo-widget-word-count {
	display: inline-block;
	font-size: 12px;
	padding: 2px 8px;
	border-radius: 3px;
	margin-top: 4px;

	// Gray - Too short (< 40 words)
	&--short {
		background: #f0f0f0;
		color: #757575;
	}

	// Green - Ideal (40-80 words)
	&--ideal {
		background: #d4edda;
		color: #155724;
	}

	// Yellow - Getting long (81-120 words)
	&--warning {
		background: #fff3cd;
		color: #856404;
	}

	// Red - Too long (> 120 words)
	&--over {
		background: #f8d7da;
		color: #721c24;
	}
}

// Repeater rows for bullet points
.geo-widget-repeater-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 8px;

	.components-base-control {
		flex: 1;
		margin-bottom: 0;
	}
}

// Source entry rows
.geo-widget-source-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 12px;
	margin-bottom: 12px;
}

// Source fields grid layout
.geo-widget-source-fields {
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;

	// URL field spans full width
	> :nth-child(2) {
		grid-column: 1 / -1;
	}
}

// Remove button styling
.geo-widget-remove-btn {
	flex-shrink: 0;
	margin-top: 2px;

	&.is-destructive {
		color: #cc1818;
	}
}

// Add button styling
.geo-widget-add-btn {
	margin-top: 4px;
}

// Error state for invalid URL inputs
.geo-widget-input-error {
	.components-text-control__input {
		border-color: #cc1818;
	}
}
