/**
 * GravityView Elementor Widget Styles
 */

/* Icon in Elementor panel */
.elementor-element-wrapper .gk-gravityview-icon {
	width: 28px;
	height: 28px;
	display: inline-block;
	background-image: url(../images/gravityview-icon.svg);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
}

/* Preview styles */
.elementor-widget-gk_elementor_gravityview .elementor-widget-empty-icon {
	background: none;
	border: none;
	margin-bottom: 10px;
}

.elementor-widget-gk_elementor_gravityview .elementor-widget-empty-icon::before {
	content: "";
	display: block;
	width: 120px;
	height: 120px;
	margin: 0 auto;
	background-image: url(../images/gravityview-icon.svg);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
}

/* Editor widget wrapper */
.elementor-editor-active .elementor-widget-gk_elementor_gravityview {
	position: relative;
}

.elementor-editor-active .elementor-widget-gk_elementor_gravityview .gv-container {
	cursor: pointer;
}

.gravityview-elementor-preview {
	font-size: 0.8em;
	background-color: #fff;
	min-height: 1.5em;
	padding: 10px 20px;
	box-sizing: content-box;
	margin-bottom: 10px;
	border-radius: 4px 4px 0 0;
}

.gravityview-elementor-preview p {
	margin: 0;
	text-align: left;
}

.gravityview-elementor-preview button {
	background: none !important;
	color: var(--wp--preset--color--foreground) !important;
	border: none;
	padding: 0;
	margin: 0;
	display: inline-block;
	cursor: default;
	font-size: 1em;
	line-height: 1.5;
	box-sizing: content-box;
	box-shadow: none;
}

.gravityview-elementor-preview button:hover {
	text-decoration: underline;
	box-shadow: none;
}

.gravityview-elementor-preview em {
	display: none;
}

.gravityview-elementor-preview a:link,
.gravityview-elementor-preview a:visited,
.gravityview-elementor-preview a:active {
	color: var(--wp--preset--color--foreground) !important;
	text-decoration: none;
	float: right;
	padding-right: 20px;
}

.gravityview-elementor-preview a:hover {
	color: var(--wp--preset--color--foreground);
	text-decoration: underline;
}

.gravityview-elementor-preview .dashicons {
	text-decoration: none;
	line-height: 1.15;
	margin: 0 0.2em;
}

.gravityview-elementor-preview .dashicons.dashicons-admin-page {
	margin-right: 0;
}

.gravityview-elementor-preview-debug-output {
	padding: 0.5em 0;
	box-sizing: content-box;
	display: block;
	clear: both;
}

.gravityview-elementor-preview-debug-output-code {
	background-color: #f0f0f0;
	padding: 10px;
	border-radius: 5px;
	white-space: collapse;
}

/**
 * Modify behavior when the widget is not selected.
 */
.elementor-element-editable .gravityview-elementor-preview em {
	display: inline-block;
}

.elementor-element-editable .gravityview-elementor-preview button {
	cursor: pointer;
}

/* Panel Header Preview Toggle Wrapper */
#gv-elementor-preview-toggle-wrapper {
	display: block; /* Allows centering */
	width: 100%;
	margin: -1px auto 0;
	padding: 0 0 0;
	border-radius: 0;
}

#elementor-panel-header + #gv-elementor-preview-toggle-wrapper {
	border-bottom: none;
}

/* Panel Header Preview Toggle Group (Inner) */
#gv-elementor-preview-toggle-group {
	display: inline-flex; /* Back to inline-flex for button layout */
	border: none;
	border-radius: 0;
	overflow: hidden; /* Ensure border-radius clips children */
	width: 100%;
}

#gv-elementor-preview-toggle-group button {
	display: inline-flex; /* Use flex for alignment */
	align-items: center; /* Vertically center icon and text */
	justify-content: center; /* Center text */
	gap: 5px; /* Space between icon and text */
	border: none;
	padding: 12px 12px;
	background-color: #fff; /* Default background */
	cursor: pointer;

	/* line-height: 1; Remove, flex handles alignment */
	font-size: 12px; /* Match Elementor UI */
	color: rgb(12, 13, 14);
	width: 50%;
	border-top: 1px solid #fff;
	border-bottom: 1px solid #a4afb7;
	opacity: 0.7;

	/* Smooth transition for all state changes */
	transition: all 0.2s ease;
}

#gv-elementor-preview-toggle-group button:hover {
	background-color: #f0f0f1; /* Elementor UI hover */
}

/* Focus styles for keyboard navigation - a11y enhancement */
#gv-elementor-preview-toggle-group button:focus-visible {
	outline: 2px solid #5eead4; /* Teal outline matching highlight color */
	outline-offset: -2px; /* Keep the outline within the button */
	box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.5); /* Additional subtle glow */
	opacity: 1;
	background-color: #f5f5f5; /* Slightly different from hover */
	color: #000; /* Ensure text contrast */
	z-index: 1; /* Ensure focused button appears above others */
}

#gv-elementor-preview-toggle-group button[data-state="single"] {
	border-left: 1px solid #a4afb7; /* Separator */
}

#gv-elementor-preview-toggle-group button.gv-preview-toggle-active {
	border-top: 1px solid #a4afb7;
	background-color: #fff;

	/* border-top: 1px solid #a4afb7; */
	border-bottom-color: #fff;
	opacity: 1;
}

/* Ensure focus is visible when button is also active */
#gv-elementor-preview-toggle-group button.gv-preview-toggle-active:focus-visible {
	outline: 2px solid #3f9e8c; /* Darker teal for active+focus state */
	background-color: #fff;
}

/* Zone highlighting styles for panel header items */
.elementor-panel-heading[data-gv-highlight-enabled="true"] {
	cursor: pointer;
}

.elementor-panel-heading[data-gv-highlight-enabled="true"]:hover {
	background-color: hsla(171, 77%, 49%, 0.3);
}

/** Layout-specific styles */
.elementor-widget-container .gv-map-canvas {
	background: #f8fafc;
	border: 2px dashed #cbd5e1;
	min-height: 200px;
	width: 100%;
	border-radius: 5px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	color: #64748b;
}

.elementor-widget-container .gv-map-canvas::before {
	content: "🗺️";
	font-size: 48px;
	margin-bottom: 12px;
	opacity: 0.6;
}

.elementor-widget-container .gv-map-canvas::after {
	content: attr(data-placeholder-text);
	font-size: 1em;
	font-weight: 500;
	text-align: center;
}