/* ===========================================
   Sånn Tour Styles (Shepherd.js customization)
   =========================================== */

/* Modal Overlay - dims everything except the highlighted element */
.shepherd-modal-overlay-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9998;
	pointer-events: none;
}

.shepherd-modal-overlay-container.shepherd-modal-is-visible path {
	fill: rgba(0, 0, 0, 0.5);
	transition: fill 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================================
   Tour Popup (scoped to .sann-tour)
   =========================================== */

/* Tour Element */
.sann-tour.shepherd-element {
	background: #f5f5f5; /* Very dim grey background */
	border-radius: var(--md-sys-shape-corner-medium);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	max-width: 500px;
	width: 90%;
	z-index: 9999;
	animation: sann-tour-pop-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	transform-origin: center;
	overflow: visible;
	position: relative;
}

/* Center modal when no element is attached (no attachTo property) */
.sann-tour.shepherd-element[style*='left: 50%'] {
	position: fixed !important;
	left: 50% !important;
	top: 50% !important;
	transform: translate(-50%, -50%) !important;
	margin: 0 !important;
}

@keyframes sann-tour-pop-in {
	0% {
		opacity: 0;
		transform: scale(0.95) translateY(8px);
	}
	100% {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* Header - Uses space theme color */
.sann-tour .shepherd-header {
	padding: var(--md-sys-spacing-4) var(--md-sys-spacing-5);
	background-color: var(
		--theme-color,
		#4a9eff
	); /* Space theme color with fallback */
	border-radius: var(--md-sys-shape-corner-medium)
		var(--md-sys-shape-corner-medium) 0 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

/* Remove lightbulb icon */
.sann-tour .shepherd-header::before {
	display: none;
}

.sann-tour .shepherd-title {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(
		--theme-contrast-color,
		white
	); /* Space contrast color with fallback */
	margin: 0;
	flex: 1;
	text-align: left;
	letter-spacing: 0;
}

/* Cancel Icon - Hidden (replaced with "Skip tour" button) */
.sann-tour .shepherd-cancel-icon {
	display: none !important;
}

/* Text - White content area */
.sann-tour .shepherd-text {
	padding: var(--md-sys-spacing-4) var(--md-sys-spacing-5);
	font-size: 0.95rem;
	color: var(--md-sys-color-on-surface);
	line-height: 1.5;
	background-color: #ffffff; /* White content area on dim grey box */
}

/* Footer */
.sann-tour .shepherd-footer {
	padding: var(--md-sys-spacing-4) var(--md-sys-spacing-5);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--md-sys-spacing-2);
	border-top: none;
	margin-top: 0;
	background-color: #ffffff; /* White footer on dim grey box */
	border-radius: 0 0 var(--md-sys-shape-corner-medium)
		var(--md-sys-shape-corner-medium);
}

/* Footer button group (Back/Next buttons) */
.sann-tour .shepherd-footer > .shepherd-buttons {
	display: flex;
	gap: var(--md-sys-spacing-2);
	margin-left: auto;
}

/* Buttons */
.sann-tour .shepherd-button {
	border: none;
	border-radius: var(--md-sys-shape-corner-small);
	cursor: pointer;
	padding: var(--md-sys-spacing-2) var(--md-sys-spacing-5);
	min-height: 36px;
	font-weight: 500;
	font-size: 0.9rem;
	transition: all 0.2s ease;
	letter-spacing: 0;
}

.sann-tour .shepherd-button:active {
	transform: scale(0.98);
}

/* Primary Button - Uses space theme color */
.sann-tour .shepherd-button-primary {
	background-color: var(
		--theme-color,
		#4a9eff
	); /* Space theme color with fallback */
	color: var(
		--theme-contrast-color,
		white
	); /* Space contrast color with fallback */
	border: none;
}

.sann-tour .shepherd-button-primary:hover {
	background-color: var(
		--bright-theme-color,
		#3a8eef
	); /* Slightly lighter on hover */
}

.sann-tour .shepherd-button-primary:active {
	opacity: 0.9; /* Slightly transparent on active */
}

/* Secondary Button - Outlined with space theme color */
.sann-tour .shepherd-button-secondary {
	background-color: transparent;
	color: var(--theme-color, #4a9eff); /* Space theme color with fallback */
	border: 1px solid var(--theme-color, #4a9eff); /* Space theme color with fallback */
}

.sann-tour .shepherd-button-secondary:hover {
	background-color: var(
		--light-theme-color,
		rgba(0, 123, 255, 0.05)
	); /* Light theme color with fallback */
}

.sann-tour .shepherd-button-secondary:active {
	background-color: var(
		--bright-theme-color,
		rgba(0, 123, 255, 0.1)
	); /* Bright theme color with fallback */
}

/* Skip Button - Text link style */
.sann-tour .shepherd-button-skip {
	background-color: transparent;
	color: var(--md-sys-color-on-surface-variant);
	border: none;
	font-weight: 400;
	padding: var(--md-sys-spacing-2);
	min-height: auto;
	opacity: 0.7;
}

.sann-tour .shepherd-button-skip:hover {
	background-color: transparent;
	color: var(--md-sys-color-on-surface);
	opacity: 1;
	text-decoration: underline;
}

.sann-tour .shepherd-button-skip:active {
	opacity: 0.8;
}

/* Arrow - Dynamic positioning with blue color */
.sann-tour .shepherd-arrow {
	display: block !important;
	width: 0;
	height: 0;
	position: absolute;
	z-index: 1;
}

/* Arrow shape - blue color matching header */
.sann-tour .shepherd-arrow::before {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border-style: solid;
}

/* Arrow pointing up (modal below element) - positioned at bottom edge */
.sann-tour[data-popper-placement^='top'] .shepherd-arrow {
	bottom: -12px;
	left: 50%;
	transform: translateX(-50%);
}

.sann-tour[data-popper-placement^='top'] .shepherd-arrow::before {
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-top: 12px solid var(--theme-color, #4a9eff); /* Space theme color with fallback */
	border-bottom: none;
}

/* Arrow pointing down (modal above element) - positioned at top edge (floor-line of header) */
.sann-tour[data-popper-placement^='bottom'] .shepherd-arrow {
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
}

.sann-tour[data-popper-placement^='bottom'] .shepherd-arrow::before {
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-bottom: 12px solid var(--theme-color, #4a9eff); /* Space theme color with fallback */
	border-top: none;
}

/* Arrow pointing left (modal to the right of element) - positioned on right edge */
.sann-tour[data-popper-placement^='right'] .shepherd-arrow {
	right: -12px;
	top: 50%;
	transform: translateY(-50%);
}

.sann-tour[data-popper-placement^='right'] .shepherd-arrow::before {
	border-top: 12px solid transparent;
	border-bottom: 12px solid transparent;
	border-right: 12px solid var(--theme-color, #4a9eff); /* Space theme color with fallback */
	border-left: none;
}

/* Arrow pointing right (modal to the left of element) - positioned on left edge */
.sann-tour[data-popper-placement^='left'] .shepherd-arrow {
	left: -12px;
	top: 50%;
	transform: translateY(-50%);
}

.sann-tour[data-popper-placement^='left'] .shepherd-arrow::before {
	border-top: 12px solid transparent;
	border-bottom: 12px solid transparent;
	border-left: 12px solid var(--theme-color, #4a9eff); /* Space theme color with fallback */
	border-right: none;
}

/* Hide arrow when modal is centered (no attachTo) */
.sann-tour.shepherd-element[style*='left: 50%'] .shepherd-arrow {
	display: none !important;
}

/* Progress indicator - Percentage bar */
.sann-tour .shepherd-progress {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--md-sys-spacing-2);
	padding: var(--md-sys-spacing-3) var(--md-sys-spacing-5);
	background-color: #ffffff; /* White progress area on dim grey box */
}

.sann-tour .shepherd-progress-bar-container {
	width: 100%;
	height: 8px;
	background-color: var(--md-sys-color-surface-variant);
	border-radius: var(--md-sys-shape-corner-full);
	overflow: hidden;
	position: relative;
}

.sann-tour .shepherd-progress-bar-fill {
	height: 100%;
	background-color: var(
		--theme-color,
		#4a9eff
	); /* Space theme color with fallback */
	border-radius: var(--md-sys-shape-corner-full);
	transition: width 0.3s ease;
}

.sann-tour .shepherd-progress-percentage {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--theme-color, #4a9eff); /* Space theme color with fallback */
	margin-top: var(--md-sys-spacing-1);
}
