/**
 * Elementor Comparison Table — Editor Styles
 * Styles that apply only within the Elementor editor interface
 * Version: 1.0.0
 */

/* ============================================
   DISABLE INTERACTION IN EDITOR PREVIEW
   Prevents clicking links/buttons while editing
   ============================================ */
.elementor-editor-active .ect-wrap {
	pointer-events: none;
}

/* Re-enable pointer events on interactive elements
   so editors can still click buttons if needed */
.elementor-editor-active .ect-wrap a,
.elementor-editor-active .ect-wrap button {
	pointer-events: auto;
}

/* Ensure table fills container in editor */
.elementor-editor-active .ect-table {
	min-width: 100%;
}

/* ============================================
   EDITOR TOOLBAR — Import/Export tools
   ============================================ */
.ect-editor-tools {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	margin: 0 0 15px;
	background: linear-gradient(135deg, #f6f7f7 0%, #ffffff 100%);
	border: 1px solid #dcdcde;
	border-radius: 6px;
}

.ect-editor-tools-header {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 600;
	color: #3c434a;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ect-editor-tools-header i {
	font-size: 14px;
	color: #2271b1;
}

.ect-editor-tools-actions {
	display: flex;
	gap: 8px;
}

.ect-editor-tools .button {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	padding: 6px 12px;
	height: auto;
	min-height: 32px;
	border-radius: 4px;
	border: 1px solid #c3c4c7;
	background-color: #ffffff;
	color: #3c434a;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: background-color 0.15s ease, border-color 0.15s ease,
		color 0.15s ease, box-shadow 0.15s ease;
}

.ect-editor-tools .button:hover {
	background-color: #f6f7f7;
	border-color: #2271b1;
	color: #2271b1;
}

.ect-editor-tools .button:active {
	background-color: #f0f0f1;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.ect-editor-tools .button i {
	font-size: 12px;
}

.ect-editor-tools .ect-btn-import {
	background-color: #2271b1;
	border-color: #2271b1;
	color: #ffffff;
}

.ect-editor-tools .ect-btn-import:hover {
	background-color: #135e96;
	border-color: #135e96;
	color: #ffffff;
}

.ect-editor-tools .ect-btn-import:active {
	background-color: #0f4d7a;
	border-color: #0f4d7a;
}

/* ============================================
   IMPORT/EXPORT DIALOG
   ============================================ */
.ect-import-export {
	padding: 24px;
	min-width: 460px;
	max-width: 560px;
	box-sizing: border-box;
}

/* Dialog header overrides */
.dialog-type-lightbox .dialog-header,
.dialog-lightbox-widget .dialog-header,
.dialog-lightbox-header,
.elementor-dialog-message .dialog-header {
	padding: 18px 24px !important;
	border-bottom: 1px solid #e8e8e8 !important;
	background-color: #ffffff !important;
}

.dialog-type-lightbox .dialog-header .dialog-title,
.dialog-lightbox-widget .dialog-header .dialog-title,
.dialog-lightbox-header .dialog-title,
.elementor-dialog-message .dialog-header .dialog-title {
	font-size: 16px !important;
	font-weight: 600 !important;
	color: #1d2327 !important;
}

.dialog-type-lightbox .dialog-message,
.dialog-lightbox-widget .dialog-message,
.dialog-lightbox-message,
.elementor-dialog-message .dialog-message {
	padding: 0 !important;
}

.ect-import-export-intro {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	margin: 0 0 22px;
	background-color: #f6f7f7;
	border-left: 3px solid #2271b1;
	border-radius: 0 4px 4px 0;
	font-size: 12px;
	line-height: 1.5;
	color: #3c434a;
}

.ect-import-export-intro i {
	font-size: 14px;
	color: #2271b1;
	margin-top: 1px;
	flex-shrink: 0;
}

.ect-import-export-field {
	margin-bottom: 16px;
}

.ect-import-export-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #3c434a;
	margin-bottom: 6px;
}

.ect-import-export-file {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	background-color: #f6f7f7;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ect-import-export-file:hover {
	border-color: #2271b1;
	background-color: #f0f6fc;
}

.ect-import-export-file input[type="file"] {
	font-size: 12px;
	color: #3c434a;
	max-width: 180px;
}

.ect-import-export-file input[type="file"]::file-selector-button {
	font-size: 12px;
	font-weight: 500;
	padding: 4px 10px;
	margin-right: 8px;
	border: 1px solid #2271b1;
	border-radius: 3px;
	background-color: #2271b1;
	color: #ffffff;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ect-import-export-file input[type="file"]::file-selector-button:hover {
	background-color: #135e96;
	border-color: #135e96;
}

.ect-file-name {
	font-size: 12px;
	color: #646970;
	font-style: italic;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ect-import-export-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0;
	color: #646970;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ect-import-export-divider::before,
.ect-import-export-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background-color: #dcdcde;
}

.ect-import-export textarea {
	width: 100%;
	min-height: 180px;
	font-family: "SF Mono", Monaco, Inconsolata, "Fira Code", "Courier New",
		monospace;
	font-size: 12px;
	line-height: 1.5;
	padding: 12px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background-color: #f6f7f7;
	color: #3c434a;
	resize: vertical;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease,
		background-color 0.15s ease;
}

.ect-import-export textarea:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
	background-color: #ffffff;
}

.ect-import-export-actions {
	display: flex;
	justify-content: stretch;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #e8e8e8;
}

.ect-import-export-actions .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1;
	font-size: 13px;
	font-weight: 600;
	padding: 11px 20px;
	height: auto;
	min-height: 42px;
	border-radius: 6px;
	border: none;
	background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(34, 113, 177, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease,
		background 0.15s ease;
	cursor: pointer;
}

.ect-import-export-actions .button:hover {
	background: linear-gradient(135deg, #135e96 0%, #0f4d7a 100%);
	box-shadow: 0 4px 8px rgba(34, 113, 177, 0.35);
	transform: translateY(-1px);
}

.ect-import-export-actions .button:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(34, 113, 177, 0.25);
}

.ect-import-export-actions .button i {
	font-size: 13px;
}

/* ============================================
   COPY BUTTONS
   Small inline copy buttons on repeater rows
   ============================================ */
.ect-copy-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	margin-left: 8px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background-color: #f6f7f7;
	color: #3c434a;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	transition: background-color 0.15s ease, border-color 0.15s ease,
		color 0.15s ease;
	vertical-align: middle;
}

.ect-copy-btn:hover {
	background-color: #2271b1;
	border-color: #2271b1;
	color: #ffffff;
}

.ect-copy-btn:active {
	background-color: #135e96;
	border-color: #135e96;
}

.ect-copy-btn i {
	font-size: 11px;
}

/* ============================================
   EMPTY STATE HINT
   Visual cue when no data is configured
   ============================================ */
.ect-empty-hint {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 24px;
	background-color: #f6f7f7;
	border: 2px dashed #c3c4c7;
	border-radius: 8px;
	color: #646970;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
}

.ect-empty-hint::before {
	content: "\e922";
	font-family: eicons;
	font-size: 36px;
	color: #a7aaad;
	margin-bottom: 12px;
	display: block;
}

.ect-empty-hint-title {
	font-size: 15px;
	font-weight: 600;
	color: #3c434a;
	margin: 0 0 4px;
}

.ect-empty-hint-desc {
	font-size: 13px;
	color: #646970;
	margin: 0;
}

/* ============================================
   REPEATER ROW BADGES
   Inline badges inside repeater item titles
   ============================================ */
.elementor-repeater-row-item-title .ect-item-badge {
	display: inline-block;
	font-size: 9px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 10px;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-left: 6px;
	vertical-align: middle;
}

.elementor-repeater-row-item-title .ect-item-badge-featured {
	background-color: #e6f4ea;
	color: #137333;
}

.elementor-repeater-row-item-title .ect-item-badge-default {
	background-color: #f0f0f1;
	color: #646970;
}

/* ============================================
   EDITOR PREVIEW OVERRIDES
   Ensure proper display in Elementor canvas
   ============================================ */
.elementor-editor-active .ect-table {
	/* Prevent layout shifts during live editing */
	transform: translateZ(0);
}

.elementor-editor-active .ect-badge-wrap {
	/* Ensure badge wrap is visible even when empty */
	background-color: rgba(0, 0, 0, 0.02);
	border-radius: 4px;
}

/* ============================================
   LOADING STATE
   Shown while data is being fetched/imported
   ============================================ */
.ect-loading {
	position: relative;
	pointer-events: none;
	opacity: 0.6;
}

.ect-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: rgba(255, 255, 255, 0.7);
	z-index: 100;
}

/* ============================================
   TOAST NOTIFICATION OVERRIDES
   Fine-tune Elementor toast position for ECT
   ============================================ */
#elementor-toast-container .elementor-toast.ect-toast-success {
	border-left-color: #00d084;
}

#elementor-toast-container .elementor-toast.ect-toast-error {
	border-left-color: #f54b4b;
}
