﻿/* ===================================================================
   3D Wealth Digital Toolbox - Wizard Styles
   Client-side wizard navigation components
   =================================================================== */

/* Wizard Container */
#wizard-Container {
	min-height: 80vh;
}

/* Wizard Progress Section */
.wizard-progress-section {
	padding: 1rem 0;
	background-color: #f8f9fa;
	border-radius: 0.5rem;
	margin-bottom: 1.5rem;
}

/* Step row — a self-contained stepper. The connecting line is drawn as
   pseudo-elements of this row, anchored to the circle's own vertical center
   (--circle-size / 2), so nothing above it (dev nav, headers, Dev vs
   Production) can shift it. JS measures the real first/last/active circle
   centers and sets the three custom properties below. */
.step-container {
	--circle-size: 50px;
	--line-thickness: 6px;
	--track-start: calc(var(--circle-size) / 2); /* left inset  = first circle center */
	--track-end: calc(var(--circle-size) / 2);   /* right inset = last circle center  */
	--progress-fill: 0px;                          /* first center -> active center     */
	position: relative;
	display: flex;
	justify-content: space-between;
}

	/* Track + fill, centered on the circle row and clamped to the first/last
	   circle centers so there is no stub past either end. */
	.step-container::before,
	.step-container::after {
		content: "";
		position: absolute;
		top: calc(var(--circle-size) / 2);
		height: var(--line-thickness);
		transform: translateY(-50%);
		border-radius: 999px;
		z-index: 0;
	}

	.step-container::before {
		left: var(--track-start);
		right: var(--track-end);
		background-color: #e9ecef;
	}

	.step-container::after {
		left: var(--track-start);
		width: var(--progress-fill);
		background-color: var(--bs-primary);
		background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
		background-size: 1rem 1rem;
		animation: progressStripes 1s linear infinite;
		transition: width 0.4s ease;
	}

@keyframes progressStripes {
	from { background-position: 1rem 0; }
	to { background-position: 0 0; }
}

/* Step Indicators */
.step-indicator {
	position: relative;
	z-index: 1; /* keep circles above the connecting line */
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 0;
	transition: all 0.3s ease;
	/* Reset <button> default styles so it renders like a <div> */
	background: none;
	border: none;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	text-align: center;
}

.step-circle {
	width: var(--circle-size);
	height: var(--circle-size);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 1.1rem;
	transition: all 0.3s ease;
	border: 3px solid #dee2e6;
	background-color: #fff;
	color: var(--bs-gray-600);
	position: relative;
}

/* Completed Step */
.step-indicator.completed .step-circle {
	background-color: #28a745;
	border-color: #28a745;
	color: #fff;
	box-shadow: 0 2px 8px rgba(var(--bs-primary), 0.3);
}

	.step-indicator.completed .step-circle i {
		font-size: 1.5rem;
	}

/* Active Step */
.step-indicator.active .step-circle {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #fff;
	box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.25);
	transform: scale(1.1);
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%, 100% {
		box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.2);
	}

	50% {
		box-shadow: 0 0 0 8px rgba(var(--bs-primary-rgb), 0.1);
	}
}

/* Upcoming Step */
.step-indicator.upcoming .step-circle {
	background-color: #fff;
	border-color: #dee2e6;
	color: #767676;
}

/* Step Labels */
.step-label {
	font-size: 0.85rem;
	font-weight: 500;
	color: #6c757d;
	text-align: center;
	min-height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.step-indicator.active .step-label {
	color: var(--bs-primary);
	font-weight: 600;
}

.step-indicator.completed .step-label {
	color: #28a745;
}

.step-indicator.upcoming .step-label {
	color: #636363;
}

/* Wizard Header - LIGHT THEME (Black theme removed) */
.wizard-header {
	background-color: #ffffff;
	border: 1px solid #dee2e6;
	border-radius: 0.5rem;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.wizard-header-content {
	width: 100%;
}

/* Wizard Header Form Controls */
.wizard-header .form-label {
	color: var(--bs-gray-700);
	font-weight: 500;
}

.wizard-header input,
.wizard-header select,
.wizard-header textarea {
	background-color: #ffffff;
	border: 1px solid #ced4da;
	color: #212529;
}

	.wizard-header input:focus,
	.wizard-header select:focus,
	.wizard-header textarea:focus {
		background-color: #ffffff;
		border-color: var(--bs-primary);
		outline: 0;
		box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
	}

	.wizard-header input::placeholder {
		color: var(--bs-gray-600);
	}

/* Wizard Main Content */
#wizard-MainContent {
	display: none;
	animation: fadeIn 0.4s ease-in;
}

/* Wizard Introduction */
#wizard-Introduction {
	animation: fadeIn 0.5s ease-in;
}

#wizard-progress {
	animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

[data-wizard-step] {
	animation: slideIn 0.4s ease-out;
	/*max-height: 66vh;
	overflow-y: auto;*/
}

.step-content {
	/*max-width: 900px;*/
	margin: 0 auto;
	padding: 1rem;
}

.next-steps-instructions {
	background: #f8f9fa;
	padding: 2rem;
	border-radius: var(--bs-border-radius-lg);
	margin-bottom: 2rem;
	border-left: 4px solid var(--bs-primary);
}

	.next-steps-instructions ul {
		list-style-type: none;
		padding-left: 0;
		margin-bottom: 0;
	}

	.next-steps-instructions li {
		padding: 0.75rem 0;
		padding-left: 0px;
		padding-left: 2rem;
		position: relative;
		font-size: 1rem;
		line-height: 1.6;
	}

		.next-steps-instructions li:before {
			content: "✓";
			position: absolute;
			left: 0;
			color: #48bb78;
			font-weight: bold;
			font-size: 1.2rem;
		}

#wizard-StepsContainer {
	display: none;
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateX(30px);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Button States */
button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Step info/instruction banner — replaces Bootstrap's alert alert-info */
.wizard-step-info {
	position: relative;
	padding: 1rem;
	margin-bottom: 1rem;
	color: var(--bs-info-text-emphasis);
	background-color: var(--bs-info-bg-subtle);
	border-radius: var(--bs-border-radius);
	border: 2px solid var(--bs-danger);
	animation: tutorialReadThisPulse 2s ease-in-out infinite;
}

/* Print/Save Button Highlight */
#printButton {
	animation: subtle-glow 2s ease-in-out infinite;
}

@keyframes subtle-glow {
	0%, 100% {
		box-shadow: 0 0 5px rgba(var(--bs-primary-rgb), 0.5);
	}

	50% {
		box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.8);
	}
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
	body:has(#wizard-Container) > .container {
		max-width: 100%;
		padding-left: 0.25rem;
		padding-right: 0.25rem;
	}

	body:has(#wizard-Container) main {
		padding-top: 0.5rem !important;
	}

	body:has(#wizard-Container) #wizard-Container > .container-fluid {
		padding-left: 0.25rem;
		padding-right: 0.25rem;
		padding-top: 0.75rem !important;
		padding-bottom: 0.75rem !important;
	}

	body:has(#wizard-Container) #wizard-Container .card.shadow-lg > .card-body {
		padding: 0.75rem;
	}

	body:has(#wizard-Container) #wizard-Container > .container-fluid > .row,
	body:has(#wizard-Container) .wizard-header .row {
		--bs-gutter-x: 0;
	}

	body:has(#wizard-Container) [data-wizard-step] {
		animation: fadeIn 0.25s ease-out;
	}

	.step-container {
		--circle-size: 40px;
	}

	.step-circle {
		font-size: 0.9rem;
		border-width: 2px;
	}

	.step-indicator.completed .step-circle i {
		font-size: 1.2rem;
	}

	.step-label {
		display: none;
	}

	.wizard-header {
		padding: 1rem;
	}

	#actionButtons {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 0.75rem;
		align-items: stretch !important;
	}

		#actionButtons > div {
			width: 100%;
			min-width: 0;
		}

		#actionButtons > div:last-child {
			display: grid !important;
			grid-template-columns: 1fr;
			gap: 0.5rem !important;
		}

		#actionButtons button {
			width: 100%;
			min-height: 3rem;
			white-space: nowrap;
		}

		#actionButtons:has(#previousButton.d-none) {
			grid-template-columns: 1fr;
		}

		#actionButtons:has(#previousButton.d-none) > div:first-child {
			display: none;
		}

	/* Step 1: cap thumbnail height so it doesn't dominate when stacked */
	.thumbnail-container {
		max-height: 220px;
		width: auto !important;
		object-fit: contain;
	}

	/* Keep the progress section from overflowing on phones */
	.wizard-progress-section {
		padding-left: 0.25rem;
		padding-right: 0.25rem;
		overflow-x: clip;
	}

	.wizard-progress-section .container-fluid {
		padding-left: 0;
		padding-right: 0;
	}
}

@media (min-width: 768px) and (max-width: 991.98px) {
	.wizard-progress-section {
		overflow-x: clip;
	}

	body:has(#wizard-Container) [data-wizard-step] {
		animation: fadeIn 0.25s ease-out;
	}

	body:has(#wizard-Container) > .container {
		max-width: 100%;
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}

	body:has(#wizard-Container) #wizard-Container > .container-fluid {
		padding-left: 0.25rem;
		padding-right: 0.25rem;
	}

	body:has(.levelup-category-list) #actionButtons {
		margin-top: 0.75rem !important;
		padding-top: 0.75rem !important;
	}
}

/* Responsive Design - Mobile */
@media (max-width: 576px) {
	.wizard-progress-section {
		padding: 0.75rem 0;
	}

	.step-circle {
		font-size: 0.85rem;
	}

	.step-indicator.completed .step-circle i {
		font-size: 1rem;
	}

	.step-label {
		display: none;
	}

	.wizard-header {
		padding: 0.75rem;
	}

	#startButton {
		width: 100%;
		padding: 0.75rem 1rem;
	}

	/* Step 1: smaller thumbnail on very small phones */
	.thumbnail-container {
		max-height: 160px;
	}

	/* Step 3: next-steps list easier to read */
	.next-steps-instructions li {
		font-size: 0.925rem;
	}

	body:has(.levelup-category-list) .step-content {
		padding-bottom: 0.25rem;
	}

	body:has(.levelup-category-list) #actionButtons {
		margin-top: 0.5rem !important;
		padding-top: 0.5rem !important;
	}
}

/* Loading State for PDF Generation */
button.generating-pdf {
	position: relative;
	pointer-events: none;
}

	button.generating-pdf::after {
		content: "";
		position: absolute;
		width: 16px;
		height: 16px;
		top: 50%;
		left: 50%;
		margin-left: -8px;
		margin-top: -8px;
		border: 2px solid #ffffff;
		border-radius: 50%;
		border-top-color: transparent;
		animation: spinner 0.8s linear infinite;
	}

@keyframes spinner {
	to {
		transform: rotate(360deg);
	}
}

/* Validation Error States */
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
	border-color: #dc3545;
	box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.875em;
	color: #dc3545;
}

/* Success States */
.wizard-step-complete {
	border-left: 4px solid #198754;
	background-color: #d1e7dd;
	padding: 1rem;
	border-radius: 0.25rem;
	margin-bottom: 1rem;
}

/* Accessibility - Focus States */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--bs-primary);
	outline-offset: 2px;
}

.step-indicator:focus-visible {
	outline: 2px solid var(--bs-primary, #0d6efd);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Print Styles */
@media print {
	.wizard-progress-section,
	#actionButtons,
	#startSection,
	#wizard-Introduction {
		display: none !important;
	}

	[data-wizard-step] {
		display: block !important;
		page-break-inside: avoid;
	}

	.wizard-header {
		border: none;
		box-shadow: none;
	}
}
