/**
 * Heatmap Detail Page Styles
 *
 * @package OptiBehaviorPro
 * @since 1.5.0
 */

/* Main Container */
.opti-heatmap-detail-wrap {
	background: #f9fafb;
	padding: 20px;
	margin: 0;
}

/* Main content container */
.opti-heatmap-main-container {
	/* Let WordPress handle scrolling */
}

.heatmap-canvas-wrapper {
	/* Let content flow naturally */
}

/* Header */
.opti-heatmap-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	margin-bottom: 16px;
	border: 1px solid #e5e7eb;
}

.opti-heatmap-breadcrumb .back-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #6366f1;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: color 0.2s;
}

.opti-heatmap-breadcrumb .back-link:hover {
	color: #6366f1;
}

.opti-heatmap-title h1 {
	font-size: 24px;
	font-weight: 600;
	margin: 8px 0 4px 0;
	color: #111827;
}

.opti-heatmap-title .recordings-count {
	color: #6b7280;
	font-size: 16px;
	font-weight: 400;
}

.opti-heatmap-title .page-url {
	margin-top: 4px;
}

.opti-heatmap-title .page-url a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #6b7280;
	font-size: 13px;
	text-decoration: none;
	transition: color 0.2s;
}

.opti-heatmap-title .page-url a:hover {
	color: #6366f1;
}

.opti-heatmap-title .page-url .edit-page-link {
	margin-left: 12px;
	padding: 4px 10px;
	background: #f3f4f6;
	border-radius: 4px;
	color: #4b5563;
	font-size: 12px;
	font-weight: 500;
	transition: all 0.2s;
}

.opti-heatmap-title .page-url .edit-page-link:hover {
	background: #6366f1;
	color: #fff;
}

.opti-heatmap-title .page-url .edit-page-link svg {
	width: 14px;
	height: 14px;
}

.opti-heatmap-actions .button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
	border-color: #6366f1 !important;
	color: #fff !important;
	text-shadow: none !important;
	box-shadow: 0 1px 2px rgba(99, 102, 241, 0.2) !important;
	font-weight: 500;
	transition: all 0.2s;
}

.opti-heatmap-actions .button:hover {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
	border-color: #4f46e5 !important;
	box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3) !important;
}

.opti-heatmap-actions .button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}


.opti-heatmap-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.opti-reset-heatmap-form {
	margin: 0;
}

.opti-heatmap-actions .opti-reset-heatmap-button {
	background: #fff !important;
	border-color: #dc2626 !important;
	color: #dc2626 !important;
	box-shadow: 0 1px 2px rgba(220, 38, 38, 0.12) !important;
}

.opti-heatmap-actions .opti-reset-heatmap-button:hover,
.opti-heatmap-actions .opti-reset-heatmap-button:focus {
	background: #dc2626 !important;
	border-color: #dc2626 !important;
	color: #fff !important;
	box-shadow: 0 2px 4px rgba(220, 38, 38, 0.25) !important;
}

/* Download button spinning animation */
#download-heatmap .spin {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* Filters Bar */
.opti-heatmap-filters-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 24px;
	background: #fff;
	border-radius: 6px;
	margin-bottom: 16px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filters-label {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #374151;
	font-weight: 500;
	font-size: 13px;
	flex-shrink: 0;
}

.filters-label i {
	width: 16px;
	height: 16px;
	color: #6b7280;
}

.filters-controls {
	display: flex;
	align-items: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	flex: 1;
}

.filter-group {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	flex-shrink: 0;
	/* Override WordPress admin form-field defaults */
	width: auto !important;
	max-width: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
}

.filter-group label {
	font-size: 11px;
	font-weight: 500;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.filter-select {
	padding: 6px 28px 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 13px;
	color: #374151;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 8px center;
	appearance: none;
	cursor: pointer;
	min-width: 130px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:hover {
	border-color: #6366f1;
}

.filter-select:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.filter-select.has-value {
	border-color: #6366f1;
	background-color: #f0f4ff;
}

.button.filter-reset-btn,
#reset-filters {
	display: inline-flex !important;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	font-size: 13px;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
	border: 1px solid #6366f1 !important;
	color: #fff !important;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
}

#reset-filters {
	margin-left: auto;
}

#refresh-heatmap {
	margin-left: 8px;
}

.button.filter-reset-btn:hover,
#reset-filters:hover {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
	border-color: #4f46e5 !important;
	box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3) !important;
}

.button.filter-reset-btn i,
.button.filter-reset-btn svg {
	width: 14px;
	height: 14px;
}

/* Device Stats Bar */
.opti-device-stats-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 24px;
	background: #f0f4ff;
	border-radius: 6px;
	margin-bottom: 16px;
	border: 1px solid #d6e4ff;
	flex-wrap: wrap;
	gap: 12px;
}

.device-type-controls {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	flex: 1;
	min-width: 0;
}

.device-switcher {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

.device-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	height: 36px;
	box-sizing: border-box;
}

.device-btn:hover {
	background: #f9fafb;
	border-color: #6366f1;
}

.device-btn.active {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	border-color: #6366f1;
	color: #fff;
}

.device-btn i {
	width: 14px;
	height: 14px;
}

.device-label {
	font-size: 13px;
}

.device-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 18px;
	padding: 0 5px;
	background: #374151;
	color: #fff;
	border-radius: 9px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}

.device-btn.active .device-count {
	background: #4f46e5;
}

.quick-stats {
	display: flex;
	gap: 20px;
	align-items: center;
	flex-shrink: 0;
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	white-space: nowrap;
}

.stat-label {
	color: #6b7280;
	font-weight: 400;
}

.stat-value {
	color: #111827;
	font-weight: 600;
}

/* Type Tabs */
.opti-heatmap-tabs {
	display: flex;
	gap: 6px;
	align-items: center;
	flex-shrink: 0;
}

.heatmap-tab {
	padding: 6px 10px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	height: 36px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	box-sizing: border-box;
}

.heatmap-tab i {
	width: 14px;
	height: 14px;
}

.heatmap-tab:hover {
	border-color: #6366f1;
	background: #f9fafb;
}

.heatmap-tab.active {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	border-color: #6366f1;
	color: #fff;
}

/* Main Container */
.opti-heatmap-main-container {
	padding: 0 24px;
	margin-bottom: 16px;
}

.heatmap-canvas-wrapper {
	position: relative;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	min-height: 600px;
	overflow: hidden;
	width: 100%;
}

/* Loading State */
.heatmap-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 600px;
	height: 600px;
	gap: 16px;
	position: relative;
	background: #fff;
	z-index: 100;
	width: 100%;
}

.loading-spinner {
	width: 48px;
	height: 48px;
	border: 4px solid #e5e7eb;
	border-top-color: #6366f1;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.heatmap-loading p {
	color: #6b7280;
	font-size: 15px;
}

/* Heatmap Container */
#heatmap-container {
	display: none;
	position: relative;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin: 20px auto;
	overflow: hidden;
	/* Remove max-width constraint to allow full-width heatmaps for scroll visualization */
	/* max-width: 100%; */
}

/* Center mobile/tablet heatmap views */
#heatmap-container.mobile-view,
#heatmap-container.tablet-view {
	margin-left: auto;
	margin-right: auto;
}

#heatmap-container.visible {
	display: block !important;
}

/* When heatmap container is shown via inline style, hide loading */
.heatmap-canvas-wrapper:has(#heatmap-container[style*="display: block"]) .heatmap-loading,
.heatmap-canvas-wrapper:has(#heatmap-container[style*="display:block"]) .heatmap-loading {
	display: none !important;
}

/* Heatmap Overlay - ensure it's visible above iframe */
#heatmap-overlay {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	z-index: 10 !important;
	pointer-events: none !important;
}

#heatmap-overlay canvas {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	z-index: 10 !important;
}

/* Iframe styling - remove scrollbars from iframe */
#heatmap-iframe {
	pointer-events: none !important;
	user-select: none !important;
	overflow: hidden !important;
}

/* No Data State */
.heatmap-no-data {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 600px;
	height: 600px;
	gap: 12px;
	position: relative;
	background: #fff;
	width: 100%;
}

.heatmap-no-data i {
	width: 64px;
	height: 64px;
	color: #9ca3af;
}

.heatmap-no-data p {
	color: #6b7280;
	font-size: 15px;
	text-align: center;
	max-width: 400px;
}

/* Stats Panel */
.opti-stats-panel {
	padding: 0 24px 24px 24px;
}

.stats-panel-inner {
	background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
	padding: 24px;
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.stats-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e5e7eb;
}

.stats-title-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.stats-title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.stats-title .ai-icon {
	width: 22px;
	height: 22px;
	color: #8b5cf6;
	flex-shrink: 0;
}

.stats-title h2 {
	font-size: 18px;
	font-weight: 600;
	color: #111827;
	margin: 0;
	line-height: 1.3;
}

.stats-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #8b5cf6;
	background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
	border-radius: 4px;
}

.stats-subtitle {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
	font-weight: 400;
}

.stats-header h2 {
	font-size: 18px;
	font-weight: 600;
	color: #111827;
	margin: 0;
}

.view-toggle {
	display: flex;
	gap: 4px;
	background: #f3f4f6;
	padding: 2px;
	border-radius: 6px;
}

.view-btn {
	padding: 6px 16px;
	background: transparent;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: #6b7280;
	transition: all 0.2s;
}

.view-btn.active {
	background: #fff;
	color: #111827;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stats-content {
	position: relative;
	min-height: 200px;
}

.stats-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
}

.stats-loading .loading-spinner {
	width: 32px;
	height: 32px;
}

/* Top Elements List */
.top-elements-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.element-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	background: #f9fafb;
	border-radius: 6px;
	transition: background 0.2s;
}

.element-item:hover {
	background: #f3f4f6;
}

.element-rank {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #6366f1;
	color: #fff;
	border-radius: 50%;
	font-size: 14px;
	font-weight: 600;
	flex-shrink: 0;
}

.element-details {
	flex: 1;
}

.element-selector {
	font-size: 14px;
	font-weight: 500;
	color: #111827;
	margin-bottom: 4px;
	font-family: 'Courier New', monospace;
}

.element-stats {
	font-size: 13px;
	color: #6b7280;
}

.no-data {
	text-align: center;
	color: #9ca3af;
	padding: 40px 20px;
	font-size: 14px;
}

/* Coming Soon Message */
.opti-behavior-coming-soon {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 24px;
	text-align: center;
	min-height: 180px;
}

.opti-behavior-coming-soon .coming-soon-icon {
	width: 40px;
	height: 40px;
	color: #9ca3af;
	margin-bottom: 16px;
	opacity: 0.7;
}

.opti-behavior-coming-soon p {
	margin: 0;
	font-size: 15px;
	color: #6b7280;
	font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1280px) {
	.opti-heatmap-header {
		flex-wrap: wrap;
	}

	.opti-heatmap-title {
		flex: 1 1 100%;
		margin-bottom: 12px;
	}

	.quick-stats {
		flex-wrap: wrap;
	}
}

@media (max-width: 768px) {
	.opti-heatmap-detail-wrap {
		padding: 12px;
		margin-left: -12px;
	}

	.opti-heatmap-header,
	.opti-device-stats-bar,
	.opti-heatmap-main-container,
	.opti-stats-panel {
		padding-left: 16px;
		padding-right: 16px;
	}

	.opti-heatmap-tabs {
		padding-left: 16px;
		padding-right: 16px;
		overflow-x: auto;
	}

	.device-switcher {
		flex-wrap: wrap;
	}

	.device-btn {
		flex: 1;
		min-width: 100px;
	}

	.quick-stats {
		gap: 12px;
	}

	.stat-item {
		font-size: 12px;
	}
}

/* Lucide Icons Support */
.lucide {
	display: inline-block;
	width: 16px;
	height: 16px;
	stroke-width: 2;
}

/* ==========================================
   Multi-Select Dropdown Styles
   ========================================== */

.filter-multiselect {
	position: relative;
}

.multiselect-dropdown {
	position: relative;
	min-width: 140px;
}

.multiselect-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 10px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	color: #374151;
	min-width: 130px;
	transition: border-color 0.2s, box-shadow 0.2s;
	height: 32px;
	box-sizing: border-box;
}

.multiselect-trigger:hover {
	border-color: #6366f1;
}

.multiselect-dropdown.open .multiselect-trigger {
	border-color: #6366f1;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.multiselect-dropdown.has-selection .multiselect-trigger {
	border-color: #6366f1;
	background-color: #f0f4ff;
}

.multiselect-label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dropdown-arrow {
	width: 12px !important;
	height: 12px !important;
	color: #6b7280;
	flex-shrink: 0;
	transition: transform 0.2s;
}

.multiselect-dropdown.open .dropdown-arrow {
	transform: rotate(180deg);
}

.multiselect-menu {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	display: none;
	min-width: 200px;
	max-height: 320px;
	overflow: hidden;
	flex-direction: column;
}

.multiselect-dropdown.open .multiselect-menu {
	display: flex;
}

.multiselect-search {
	padding: 8px;
	border-bottom: 1px solid #e5e7eb;
}

.multiselect-search-input {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 13px;
	outline: none;
	box-sizing: border-box;
}

.multiselect-search-input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.multiselect-options {
	flex: 1;
	overflow-y: scroll;
	padding: 8px 0;
	max-height: 280px;
}

.multiselect-option {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 8px 12px;
	cursor: pointer;
	transition: background-color 0.15s;
	margin: 0;
	font-weight: normal;
}

.multiselect-option:hover {
	background: #f3f4f6;
}

.multiselect-option input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0;
	cursor: pointer;
	accent-color: #6366f1;
}

.multiselect-option .option-label {
	flex: 1;
	font-size: 13px;
	color: #374151;
}

.multiselect-option .country-flag {
	font-size: 16px;
	line-height: 1;
	flex-shrink: 0;
}

.multiselect-option .browser-icon-wrapper {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	max-width: 18px !important;
}

.multiselect-option .browser-icon-wrapper svg,
.multiselect-option .browser-icon-wrapper svg.browser-icon {
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	max-width: 18px !important;
	flex-shrink: 0 !important;
	display: block !important;
}

.multiselect-option .browser-icon {
	width: 18px !important;
	height: 18px !important;
	flex-shrink: 0 !important;
}

.multiselect-empty {
	padding: 16px 12px;
	text-align: center;
	color: #9ca3af;
	font-size: 13px;
}

.multiselect-actions {
	display: flex;
	gap: 8px;
	padding: 8px;
	border-top: 1px solid #e5e7eb;
	background: #f9fafb;
}

.multiselect-actions button {
	flex: 1;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.multiselect-clear {
	background: #fff;
	border: 1px solid #d1d5db;
	color: #6b7280;
}

.multiselect-clear:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.multiselect-apply {
	background: #6366f1;
	border: 1px solid #6366f1;
	color: #fff;
}

.multiselect-apply:hover {
	background: #4f46e5;
	border-color: #4f46e5;
}

/* Selected count badge in trigger */
.multiselect-dropdown.has-selection .multiselect-label {
	color: #6366f1;
	font-weight: 500;
}

/* Scrollbar styling for options */
.multiselect-options::-webkit-scrollbar {
	width: 6px;
}

.multiselect-options::-webkit-scrollbar-track {
	background: #f3f4f6;
}

.multiselect-options::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 3px;
}

.multiselect-options::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}

/* Responsive adjustments for multi-select */
@media (max-width: 768px) {
	.multiselect-menu {
		min-width: 180px;
	}

	.multiselect-trigger {
		min-width: 110px;
	}
}

/* Loading state for multi-select dropdowns */
.multiselect-dropdown.loading .multiselect-trigger {
	cursor: wait;
	opacity: 0.7;
}

.multiselect-dropdown.loading .multiselect-label {
	color: #9ca3af;
	font-style: italic;
}

.multiselect-dropdown.loading .dropdown-arrow {
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 0.5; }
	50% { opacity: 1; }
}

.multiselect-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	color: #6b7280;
	font-size: 13px;
	gap: 8px;
}

.loading-spinner-small {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #e5e7eb;
	border-top-color: #6366f1;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.multiselect-empty {
	padding: 12px 15px;
	color: #9ca3af;
	font-size: 13px;
	text-align: center;
	font-style: italic;
}

/* PRO Badge Styles */
.heatmap-tab .pro-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 6px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	border-radius: 3px;
	letter-spacing: 0.5px;
}

.heatmap-tab.pro-only {
	opacity: 0.7;
	cursor: not-allowed;
	position: relative;
}

.heatmap-tab.pro-only:hover {
	opacity: 1;
	background: #f9fafb;
	border-color: #6366f1;
}

.heatmap-tab.disabled {
	pointer-events: auto;
}

/* PRO Tooltip Popup */
.heatmap-tab .pro-tooltip {
	display: none;
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	width: 280px;
	padding: 14px 16px;
	background: #1f2937;
	color: #f3f4f6;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	z-index: 9999;
	text-align: left;
	white-space: normal;
	pointer-events: auto;
}

.heatmap-tab .pro-tooltip::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-bottom-color: #1f2937;
}

.heatmap-tab.pro-only:hover .pro-tooltip {
	display: block;
}

.heatmap-tab .pro-tooltip a {
	display: inline-block;
	margin-top: 8px;
	color: #818cf8;
	font-weight: 600;
	text-decoration: none;
	font-size: 13px;
}

.heatmap-tab .pro-tooltip a:hover {
	color: #a5b4fc;
	text-decoration: underline;
}

/* Pro Feature Notice */
.heatmap-pro-feature-notice {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 600px;
	padding: 40px;
	text-align: center;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
}

.heatmap-pro-feature-notice i {
	width: 64px;
	height: 64px;
	margin-bottom: 20px;
	opacity: 0.9;
}

.heatmap-pro-feature-notice h3 {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 16px 0;
	color: #fff;
}

.heatmap-pro-feature-notice p {
	font-size: 16px;
	line-height: 1.6;
	max-width: 600px;
	margin: 0;
	opacity: 0.95;
}

.heatmap-pro-feature-notice strong {
	font-weight: 600;
	color: #fff;
}

/* ==========================================
   Scroll Heatmap Legend
   ========================================== */

.scroll-heatmap-legend {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 60px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	z-index: 20;
	border: 1px solid #e5e7eb;
}

.scroll-heatmap-legend .legend-gradient {
	height: 200px;
	width: 100%;
	background: linear-gradient(
		to bottom,
		rgba(220, 20, 20, 0.9) 0%,      /* Hot Red - Maximum scroll reach */
		rgba(255, 69, 0, 0.85) 10%,      /* Orange-Red */
		rgba(255, 140, 0, 0.8) 20%,      /* Dark Orange */
		rgba(255, 255, 0, 0.75) 35%,     /* Yellow */
		rgba(50, 205, 50, 0.7) 50%,      /* Lime Green */
		rgba(64, 224, 208, 0.65) 65%,    /* Turquoise */
		rgba(100, 149, 237, 0.6) 80%,    /* Cornflower Blue */
		rgba(135, 206, 250, 0.55) 90%,   /* Sky Blue */
		rgba(173, 216, 230, 0.5) 100%    /* Light Blue - Low scroll reach */
	);
	position: relative;
}

.scroll-heatmap-legend .legend-labels {
	padding: 8px 6px;
	font-size: 10px;
	color: #6b7280;
	background: #f9fafb;
}

.scroll-heatmap-legend .legend-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 4px;
	font-weight: 500;
}

.scroll-heatmap-legend .legend-label:last-child {
	margin-bottom: 0;
}

.scroll-heatmap-legend .legend-title {
	text-align: center;
	padding: 8px 6px;
	font-size: 11px;
	font-weight: 600;
	color: #374151;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.scroll-heatmap-legend .legend-label-text {
	font-size: 9px;
	color: #9ca3af;
}

/* Scroll heatmap legend is now positioned with fixed positioning via inline styles */

/* Responsive adjustments */
@media (max-width: 768px) {
	.scroll-heatmap-legend {
		width: 50px;
		right: 10px;
		top: 10px;
	}

	.scroll-heatmap-legend .legend-gradient {
		height: 150px;
	}

	.scroll-heatmap-legend .legend-title {
		font-size: 9px;
		padding: 6px 4px;
	}
}

/* Cache bust v3 */


/* Shared-style confirmation modal (matches A/B test destructive action modal). */
.opti-ab-confirm-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
	background: rgba(17, 24, 39, 0.55);
	padding: 20px;
}

.opti-ab-confirm-overlay.is-visible {
	display: flex;
	animation: opti-heatmap-modal-fade-in 0.2s ease;
}

.opti-ab-confirm-modal {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.1);
	padding: 36px 32px 32px;
	max-width: 440px;
	width: 100%;
	text-align: center;
	animation: opti-heatmap-modal-slide-in 0.2s ease;
}

.opti-ab-confirm-modal__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: #fee2e2;
	color: #dc2626;
	margin: 0 auto 20px;
}

.opti-ab-confirm-modal__icon svg {
	width: 28px;
	height: 28px;
}

.opti-ab-confirm-modal__title {
	font-size: 18px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 10px;
}

.opti-ab-confirm-modal__message {
	font-size: 14px;
	color: #6c757d;
	line-height: 1.6;
	margin: 0 0 28px;
}

.opti-ab-confirm-modal__actions {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.opti-ab-confirm-modal__btn-cancel,
.opti-ab-confirm-modal__btn-danger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 24px;
	border-radius: 8px;
	border: 1px solid transparent;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 110px;
}

.opti-ab-confirm-modal__btn-cancel {
	background: #fff;
	border-color: #e2e8f0;
	color: #374151;
}

.opti-ab-confirm-modal__btn-cancel:hover,
.opti-ab-confirm-modal__btn-cancel:focus {
	border-color: #6366f1;
	color: #6366f1;
	background: #f5f3ff;
	outline: none;
}

.opti-ab-confirm-modal__btn-danger {
	background: #ef4444;
	border-color: #ef4444;
	color: #fff;
}

.opti-ab-confirm-modal__btn-danger:hover,
.opti-ab-confirm-modal__btn-danger:focus {
	background: #dc2626;
	border-color: #dc2626;
	color: #fff;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
	outline: none;
}

@keyframes opti-heatmap-modal-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes opti-heatmap-modal-slide-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 520px) {
	.opti-ab-confirm-modal {
		padding: 28px 20px 24px;
	}

	.opti-ab-confirm-modal__actions {
		flex-direction: column;
	}

	.opti-ab-confirm-modal__btn-cancel,
	.opti-ab-confirm-modal__btn-danger {
		width: 100%;
	}
}
