/* ===== Tour stage (highlight ring) ===== */
.mo-sps-tour-stage {
	position: fixed;
	z-index: 999998;
	border-radius: 6px;
	box-shadow:
		inset 0 0 0 2px rgba(27, 155, 161, 0.65),
		0 0 0 6px rgba(27, 155, 161, 0.18),
		0 0 0 100vmax rgba(0, 0, 0, 0.5);
	pointer-events: none;
	opacity: 0;
	transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.2s ease;
}

.mo-sps-tour-stage--visible {
	opacity: 1;
}

/* ===== Popover card ===== */
.mo-sps-tour-popover {
	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	width: min(400px, calc(100vw - 32px));
	padding: 20px 20px 16px;

	background: #fff;
	/* Strong teal top accent + subtle sides */
	border-top: 3px solid #1b9ba1;
	border-left: 1px solid rgba(27, 155, 161, 0.28);
	border-right: 1px solid rgba(27, 155, 161, 0.28);
	border-bottom: 1px solid rgba(27, 155, 161, 0.28);
	border-radius: 10px;
	box-shadow:
		0 0 0 1px rgba(27, 155, 161, 0.08),
		0 20px 48px rgba(0, 0, 0, 0.18),
		0 6px 18px rgba(0, 0, 0, 0.08);

	color: #1d2327;
	font-family: inherit;
	opacity: 0;
	transform: translateY(6px);
	transition: top 0.3s ease, left 0.3s ease, opacity 0.22s ease, transform 0.25s ease;
}

/* ===== Caret ===== */
.mo-sps-tour-popover::before {
	content: "";
	position: absolute;
	width: 0;
	height: 0;
	border: 9px solid transparent;
	pointer-events: none;
}

.mo-sps-tour-popover[data-side="top"]::before {
	bottom: -17px;
	left: var(--mo-sps-tour-caret-x, 50%);
	transform: translateX(-50%);
	border-top-color: #fff;
	filter: drop-shadow(0 2px 1px rgba(27, 155, 161, 0.2));
}

/* When popover is below the target the caret points up — colour it to match the accent stripe */
.mo-sps-tour-popover[data-side="bottom"]::before {
	top: -20px;
	left: var(--mo-sps-tour-caret-x, 50%);
	transform: translateX(-50%);
	border-bottom-color: #1b9ba1;
	filter: none;
}

.mo-sps-tour-popover[data-side="left"]::before {
	right: -17px;
	top: var(--mo-sps-tour-caret-y, 50%);
	transform: translateY(-50%);
	border-left-color: #fff;
	filter: drop-shadow(2px 0 1px rgba(27, 155, 161, 0.2));
}

.mo-sps-tour-popover[data-side="right"]::before {
	left: -17px;
	top: var(--mo-sps-tour-caret-y, 50%);
	transform: translateY(-50%);
	border-right-color: #fff;
	filter: drop-shadow(-2px 0 1px rgba(27, 155, 161, 0.2));
}

/* Entry animation per side */
.mo-sps-tour-popover[data-side="top"]    { transform: translateY(6px); }
.mo-sps-tour-popover[data-side="bottom"] { transform: translateY(-6px); }
.mo-sps-tour-popover[data-side="left"]   { transform: translateX(6px); }
.mo-sps-tour-popover[data-side="right"]  { transform: translateX(-6px); }

.mo-sps-tour-popover--visible {
	opacity: 1;
	transform: translateY(0);
}

.mo-sps-tour-popover--visible[data-side="top"],
.mo-sps-tour-popover--visible[data-side="bottom"],
.mo-sps-tour-popover--visible[data-side="left"],
.mo-sps-tour-popover--visible[data-side="right"] {
	transform: none;
}

/* ===== Close button ===== */
.mo-sps-tour-popover-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: #9aa0a6;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.mo-sps-tour-popover-close:hover,
.mo-sps-tour-popover-close:focus {
	background: rgba(0, 0, 0, 0.07);
	color: #1d2327;
	outline: none;
}

/* ===== Body (icon + text) ===== */
.mo-sps-tour-popover-body {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding-right: 18px;
	margin-bottom: 18px;
}

/* Solid teal icon bubble */
.mo-sps-tour-popover-icon {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: linear-gradient(135deg, #1b9ba1 0%, #156b70 100%);
	box-shadow: 0 3px 10px rgba(27, 155, 161, 0.35);
	flex-shrink: 0;
}

.mo-sps-tour-popover-icon-glyph {
	width: 22px;
	height: 22px;
	font-size: 22px;
	line-height: 1;
	color: #fff;
}

.mo-sps-tour-popover-content {
	flex: 1 1 auto;
	min-width: 0;
}

.mo-sps-tour-popover-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: #1d2327;
	letter-spacing: -0.01em;
}

.mo-sps-tour-popover-description {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: #50575e;
}

/* ===== Footer ===== */
.mo-sps-tour-popover-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-top: 14px;
	border-top: 1px solid #f0f0f1;
}

.mo-sps-tour-popover-footer-start {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

/* ===== PRO badge (inline in title) ===== */
.mo-sps-tour-pro-badge {
	display: inline-block;
	vertical-align: middle;
	margin-left: 7px;
	padding: 2px 7px;
	background: linear-gradient(135deg, #f5a623 0%, #d4860e 100%);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	border-radius: 4px;
	line-height: 1.5;
	white-space: nowrap;
	box-shadow: 0 1px 4px rgba(213, 134, 14, 0.35);
}

/* Gold left accent for PRO steps */
.mo-sps-tour-popover--pro {
	border-left: 3px solid #f5a623;
}

/* ===== "Unlock with Premium" footer link ===== */
.mo-sps-tour-popover-unlock {
	display: none;
	align-items: center;
	gap: 5px;
	padding: 4px 0;
	background: transparent;
	border: 0;
	color: #c87d0e;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	text-decoration: none;
	transition: color 0.15s ease;
	white-space: nowrap;
}

.mo-sps-tour-popover-unlock:hover,
.mo-sps-tour-popover-unlock:focus {
	color: #a06208;
	outline: none;
	text-decoration: underline;
}

.mo-sps-tour-lock-icon {
	font-size: 13px;
	line-height: 1;
}

/* Skip link */
.mo-sps-tour-popover-skip {
	padding: 4px 0;
	background: transparent;
	border: 0;
	color: #1b9ba1;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	text-decoration: none;
	transition: color 0.15s ease;
	white-space: nowrap;
}

.mo-sps-tour-popover-skip:hover,
.mo-sps-tour-popover-skip:focus {
	color: #156b70;
	outline: none;
	text-decoration: underline;
}

/* ===== Progress dots ===== */
.mo-sps-tour-popover-step-count {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
	line-height: 1;
}

.mo-sps-tour-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #d1d5db;
	flex-shrink: 0;
	transition: width 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}

.mo-sps-tour-dot--active {
	width: 20px;
	border-radius: 4px;
	background: #1b9ba1;
}

/* ===== Action buttons ===== */
.mo-sps-tour-popover-buttons {
	display: inline-flex;
	flex-shrink: 0;
	gap: 6px;
}

.mo-sps-tour-popover-btn {
	padding: 7px 16px;
	background: transparent;
	color: #50575e;
	border: 1px solid #c8d0d6;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.mo-sps-tour-popover-btn:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(27, 155, 161, 0.35);
}

.mo-sps-tour-popover-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.mo-sps-tour-popover-btn-hidden {
	visibility: hidden;
}

.mo-sps-tour-popover-btn-back:hover,
.mo-sps-tour-popover-btn-back:focus {
	background: rgba(27, 155, 161, 0.08);
	color: #1b9ba1;
	border-color: #1b9ba1;
}

.mo-sps-tour-popover-btn-next {
	background: #1b9ba1;
	border-color: #1b9ba1;
	color: #fff;
	box-shadow: 0 2px 6px rgba(27, 155, 161, 0.28);
}

.mo-sps-tour-popover-btn-next:hover,
.mo-sps-tour-popover-btn-next:focus {
	background: #156b70;
	border-color: #156b70;
	color: #fff;
	box-shadow: 0 3px 10px rgba(27, 155, 161, 0.38);
}

/* ===== Pointer-event rules ===== */
body.mo-sps-tour-active * {
	pointer-events: none;
}

body.mo-sps-tour-active .mo-sps-tour-active-element,
body.mo-sps-tour-active .mo-sps-tour-active-element *,
body.mo-sps-tour-active .mo-sps-tour-popover,
body.mo-sps-tour-active .mo-sps-tour-popover * {
	pointer-events: auto;
}

/* Keep highlighted controls above the dim overlay without changing their layout. */
body.mo-sps-tour-active .mo-sps-tour-active-element {
	position: relative;
	z-index: 999997;
}

/* Hide the server-rendered toolbar until JS moves the button into the heading row */
.mo-sps-tab-toolbar {
	display: none;
}

/* Hide companion buttons until JS moves them into the button group */
.mo-sps-setup-guide-btn {
	display: none;
}

/* ===== Button group (Tour + companion buttons at top-right) ===== */
.mo-sps-tab-btn-group {
	position: absolute;
	top: 14px;
	right: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.mo-sps-tab-btn-group .mo-sps-setup-guide-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 13px;
	background: linear-gradient(135deg, #33b8be 0%, #1b9ba1 100%);
	color: #fff !important;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 2px 7px rgba(27, 155, 161, 0.38);
	transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mo-sps-tab-btn-group .mo-sps-setup-guide-btn .dashicons {
	color: #fff !important;
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

.mo-sps-tab-btn-group .mo-sps-setup-guide-btn:hover,
.mo-sps-tab-btn-group .mo-sps-setup-guide-btn:focus {
	background: linear-gradient(135deg, #1b9ba1 0%, #156b70 100%);
	color: #fff !important;
	box-shadow: 0 4px 14px rgba(27, 155, 161, 0.5);
	transform: translateY(-1px);
	outline: none;
	text-decoration: none !important;
}

/* ===== Tab heading row (h1 + tour button side by side) ===== */
.mo-sps-tab-heading-row {
	padding-top: 4px;
	padding-bottom: 2px;
	margin-bottom: 2px;
}

.mo-sps-tab-heading-row h1 {
	margin: 0 !important;
}

/* Consistent heading style across all tabs — matches Connection tab weight/size */
.mo-ms-tab-content h1,
.mo-sps-ai-v2 h1 {
	font-size: 20px !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	color: #1d2327;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* ===== "Take a Tour" trigger button ===== */
.mo-sps-start-tour-button {
	display: inline-flex !important;
	align-items: center;
	gap: 5px;
	padding: 6px 13px !important;
	background: linear-gradient(135deg, #33b8be 0%, #1b9ba1 100%) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	box-shadow: 0 2px 7px rgba(27, 155, 161, 0.38);
	position: relative;
	transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
	cursor: pointer;
}

.mo-sps-start-tour-button a {
	color: #fff !important;
	text-decoration: none !important;
}

.mo-sps-start-tour-button .dashicons {
	color: #fff !important;
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

.mo-sps-start-tour-button:hover,
.mo-sps-start-tour-button:focus {
	background: linear-gradient(135deg, #1b9ba1 0%, #156b70 100%) !important;
	color: #fff !important;
	box-shadow: 0 4px 14px rgba(27, 155, 161, 0.5);
	transform: translateY(-1px);
	outline: none;
}

/* Pulse ring — draws the eye on first load */
.mo-sps-start-tour-button::after {
	content: "";
	position: absolute;
	top: -3px;
	right: -3px;
	bottom: -3px;
	left: -3px;
	border-radius: 9px;
	animation: mo-sps-tour-btn-pulse 2.8s ease-out infinite;
	pointer-events: none;
}

@keyframes mo-sps-tour-btn-pulse {
	0%   { box-shadow: 0 0 0 0   rgba(27, 155, 161, 0.55); }
	65%  { box-shadow: 0 0 0 8px rgba(27, 155, 161, 0);    }
	100% { box-shadow: 0 0 0 0   rgba(27, 155, 161, 0);    }
}
