/**
 * Changeloger Setup Wizard Styles
 *
 * Beautiful, modern onboarding wizard with glassmorphism and smooth animations.
 *
 * @package Changeloger
 * @since   1.7.0
 */

/* ===== Reset & Base ===== */
#wpcontent {
	padding-left: 0 !important;
}

#wpbody-content {
	padding-bottom: 0;
}

/* Hide WP admin chrome for immersive wizard experience */
#adminmenumain,
#adminmenuback,
#adminmenuwrap,
#wpadminbar,
#wpfooter {
	display: none !important;
}

#wpcontent,
#wpbody {
	margin-left: 0 !important;
}

html.wp-toolbar {
	padding-top: 0 !important;
}

/* ===== Wizard Root ===== */
.cha-setup-wizard {
	min-height: 100vh;
	background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 25%, #2d1b69 50%, #1e3a5f 75%, #0f0f23 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	padding: 40px 20px;
	position: relative;
	overflow: hidden;

	/* Animated background orbs */
	&::before,
	&::after {
		content: "";
		position: absolute;
		border-radius: 50%;
		filter: blur(120px);
		opacity: 0.3;
		animation: cha-float 20s ease-in-out infinite;
		pointer-events: none;
	}

	&::before {
		width: 600px;
		height: 600px;
		background: radial-gradient(circle, #6366f1, transparent);
		top: -200px;
		left: -100px;
	}

	&::after {
		width: 500px;
		height: 500px;
		background: radial-gradient(circle, #a855f7, transparent);
		bottom: -150px;
		right: -100px;
		animation-delay: -10s;
	}
}

@keyframes cha-float {
	0%, 100% { transform: translate(0, 0) scale(1); }
	25% { transform: translate(30px, -30px) scale(1.05); }
	50% { transform: translate(-20px, 20px) scale(0.95); }
	75% { transform: translate(10px, -10px) scale(1.02); }
}

/* ===== Loading Spinner ===== */
.cha-wizard-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;

	& .cha-wizard-spinner {
		width: 40px;
		height: 40px;
		border: 3px solid rgba(255, 255, 255, 0.1);
		border-top-color: #6366f1;
		border-radius: 50%;
		animation: cha-spin 0.8s linear infinite;
	}
}

@keyframes cha-spin {
	to { transform: rotate(360deg); }
}

/* ===== Wizard Container ===== */
.cha-wizard-container {
	width: 100%;
	max-width: 620px;
	position: relative;
	z-index: 1;
}

/* ===== Progress Bar ===== */
.cha-wizard-progress {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 32px;

	& .cha-wizard-progress-step {
		width: 48px;
		height: 4px;
		border-radius: 2px;
		background: rgba(255, 255, 255, 0.12);
		transition: background 0.4s ease, box-shadow 0.4s ease;

		&.active {
			background: #6366f1;
			box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
		}

		&.completed {
			background: #22c55e;
		}
	}
}

/* ===== Card ===== */
.cha-wizard-card {
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 24px;
	padding: 48px;
	box-shadow:
		0 32px 64px rgba(0, 0, 0, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	animation: cha-card-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cha-card-enter {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ===== Step Header ===== */
.cha-wizard-header {
	text-align: center;
	margin-bottom: 36px;

	& .cha-wizard-icon {
		width: 72px;
		height: 72px;
		border-radius: 20px;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 0 auto 20px;
		background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
		border: 1px solid rgba(99, 102, 241, 0.3);

		& svg {
			width: 36px;
			height: 36px;
			color: #a5b4fc;
		}

		& img {
			width: 40px;
			height: 40px;
		}
	}

	& .cha-wizard-done-icon {
		width: 80px;
		height: 80px;
		border-radius: 50%;
		background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
		border: 1px solid rgba(34, 197, 94, 0.3);
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 0 auto 20px;
		animation: cha-check-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

		& svg {
			width: 40px;
			height: 40px;
			color: #4ade80;
		}
	}

	& .cha-wizard-title {
		font-size: 26px;
		font-weight: 700;
		color: #ffffff;
		margin: 0 0 8px;
		line-height: 1.2;
	}

	& .cha-wizard-subtitle {
		font-size: 15px;
		color: rgba(255, 255, 255, 0.55);
		margin: 0;
		line-height: 1.5;
	}
}

@keyframes cha-check-bounce {
	0% { transform: scale(0); opacity: 0; }
	60% { transform: scale(1.1); }
	100% { transform: scale(1); opacity: 1; }
}

/* ===== Form Elements ===== */
.cha-wizard-form-group {
	margin-bottom: 24px;

	& .cha-wizard-label {
		display: block;
		font-size: 13px;
		font-weight: 600;
		color: rgba(255, 255, 255, 0.8);
		margin-bottom: 8px;
		letter-spacing: 0.02em;
	}

	& .cha-wizard-input {
		width: 100%;
		padding: 14px 18px;
		background: rgba(255, 255, 255, 0.06);
		border: 1px solid rgba(255, 255, 255, 0.12);
		border-radius: 12px;
		font-size: 15px;
		color: #ffffff;
		transition: all 0.2s ease;
		outline: none;
		box-sizing: border-box;

		&::placeholder {
			color: rgba(255, 255, 255, 0.3);
		}

		&:focus {
			border-color: rgba(99, 102, 241, 0.5);
			box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
			background: rgba(255, 255, 255, 0.08);
		}
	}

	& .cha-wizard-help {
		font-size: 12px;
		color: rgba(255, 255, 255, 0.4);
		margin-top: 6px;
		line-height: 1.4;
	}

	/* Color Picker */
	& .cha-wizard-color-picker {
		display: flex;
		align-items: center;
		gap: 16px;

		& .cha-wizard-color-swatch {
			width: 48px;
			height: 48px;
			border-radius: 12px;
			border: 2px solid rgba(255, 255, 255, 0.15);
			cursor: pointer;
			transition: transform 0.2s, box-shadow 0.2s;
			flex-shrink: 0;
			padding: 0;
			outline: none;

			&:hover {
				transform: scale(1.08);
				box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
			}
		}

		& .cha-wizard-color-input-wrap {
			position: relative;
			flex: 1;
		}
	}

	& .cha-wizard-color-presets {
		display: flex;
		gap: 10px;
		margin-top: 12px;
		flex-wrap: wrap;

		& .cha-wizard-color-preset {
			width: 36px;
			height: 36px;
			border-radius: 10px;
			border: 2px solid transparent;
			cursor: pointer;
			transition: all 0.2s ease;
			padding: 0;
			outline: none;

			&:hover {
				transform: scale(1.12);
			}

			&.active {
				border-color: #ffffff;
				box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
			}
		}
	}
}

/* ===== Buttons ===== */
.cha-wizard-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 36px;

	& .cha-wizard-actions-right {
		display: flex;
		gap: 10px;
	}
}

.cha-wizard-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
	text-decoration: none;
	line-height: 1.4;
	white-space: nowrap;

	& svg {
		width: 18px;
		height: 18px;
		flex-shrink: 0;
	}

	&.cha-wizard-btn-primary {
		background: #6366f1;
		color: #ffffff;
		box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);

		&:hover {
			background: #3d46d4;
			transform: translateY(-1px);
			box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
			color: #ffffff;
		}

		&:active {
			transform: translateY(0);
		}

		&:disabled {
			opacity: 0.5;
			cursor: not-allowed;
			transform: none;
			box-shadow: none;
		}
	}

	&.cha-wizard-btn-secondary {
		background: rgba(255, 255, 255, 0.08);
		color: rgba(255, 255, 255, 0.7);
		border: 1px solid rgba(255, 255, 255, 0.1);

		&:hover {
			background: rgba(255, 255, 255, 0.12);
			color: #ffffff;
		}
	}

	&.cha-wizard-btn-ghost {
		background: transparent;
		color: rgba(255, 255, 255, 0.5);
		padding: 12px 16px;

		&:hover {
			color: rgba(255, 255, 255, 0.8);
			background: rgba(255, 255, 255, 0.04);
		}
	}

	&.cha-wizard-btn-success {
		background: linear-gradient(135deg, #22c55e, #16a34a);
		color: #ffffff;
		box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);

		&:hover {
			transform: translateY(-1px);
			box-shadow: 0 6px 24px rgba(34, 197, 94, 0.4);
			color: #ffffff;
		}
	}
}

/* ===== Welcome Step Features ===== */
.cha-wizard-features {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 8px;

	& .cha-wizard-feature {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		padding: 14px;
		background: rgba(255, 255, 255, 0.04);
		border-radius: 12px;
		border: 1px solid rgba(255, 255, 255, 0.06);
		transition: background 0.2s;

		&:hover {
			background: rgba(255, 255, 255, 0.07);
		}

		& .cha-wizard-feature-icon {
			width: 36px;
			height: 36px;
			border-radius: 10px;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-shrink: 0;

			& svg {
				width: 18px;
				height: 18px;
			}
		}

		& .cha-wizard-feature-text {

			& h4 {
				font-size: 13px;
				font-weight: 600;
				color: rgba(255, 255, 255, 0.9);
				margin: 0 0 2px;
			}

			& p {
				font-size: 12px;
				color: rgba(255, 255, 255, 0.45);
				margin: 0;
				line-height: 1.4;
			}
		}
	}
}

/* ===== Import Step ===== */
.cha-wizard-import-card {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 24px;
	text-align: center;
	margin-bottom: 8px;

	& .cha-wizard-import-icon {
		width: 56px;
		height: 56px;
		border-radius: 14px;
		background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
		border: 1px solid rgba(34, 197, 94, 0.2);
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 0 auto 16px;

		& svg {
			width: 28px;
			height: 28px;
			color: #4ade80;
		}
	}

	& h4 {
		font-size: 15px;
		font-weight: 600;
		color: rgba(255, 255, 255, 0.9);
		margin: 0 0 6px;
	}

	& p {
		font-size: 13px;
		color: rgba(255, 255, 255, 0.45);
		margin: 0 0 20px;
		line-height: 1.5;
	}
}

/* ===== Status Messages ===== */
.cha-wizard-status {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	margin-top: 16px;
	animation: cha-fade-in 0.3s ease;

	& svg {
		width: 16px;
		height: 16px;
		flex-shrink: 0;
	}

	&.cha-wizard-status-loading {
		background: rgba(99, 102, 241, 0.1);
		color: #a5b4fc;
		border: 1px solid rgba(99, 102, 241, 0.2);
	}

	&.cha-wizard-status-success {
		background: rgba(34, 197, 94, 0.1);
		color: #86efac;
		border: 1px solid rgba(34, 197, 94, 0.2);
	}

	&.cha-wizard-status-error {
		background: rgba(239, 68, 68, 0.1);
		color: #fca5a5;
		border: 1px solid rgba(239, 68, 68, 0.2);
	}
}

@keyframes cha-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ===== Done Step — Next Steps ===== */
.cha-wizard-next-steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 8px;

	& .cha-wizard-next-step {
		display: flex;
		align-items: center;
		gap: 14px;
		padding: 16px 18px;
		background: rgba(255, 255, 255, 0.04);
		border: 1px solid rgba(255, 255, 255, 0.08);
		border-radius: 14px;
		text-decoration: none;
		color: rgba(255, 255, 255, 0.85);
		transition: all 0.2s ease;

		&:hover {
			background: rgba(255, 255, 255, 0.08);
			border-color: rgba(255, 255, 255, 0.15);
			color: #ffffff;
			transform: translateX(4px);

			& .cha-wizard-next-step-arrow {
				transform: translateX(3px);
				color: rgba(255, 255, 255, 0.6);
			}
		}

		& .cha-wizard-next-step-icon {
			width: 40px;
			height: 40px;
			border-radius: 10px;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-shrink: 0;

			& svg {
				width: 20px;
				height: 20px;
			}
		}

		& .cha-wizard-next-step-text {
			flex: 1;

			& h4 {
				font-size: 14px;
				font-weight: 600;
				margin: 0 0 2px;
				color: inherit;
			}

			& p {
				font-size: 12px;
				color: rgba(255, 255, 255, 0.4);
				margin: 0;
			}
		}

		& .cha-wizard-next-step-arrow {
			width: 20px;
			height: 20px;
			color: rgba(255, 255, 255, 0.3);
			flex-shrink: 0;
			transition: transform 0.2s;
		}
	}
}

/* ===== Skip Link ===== */
.cha-wizard-skip-all {
	text-align: center;
	margin-top: 20px;

	& a {
		font-size: 13px;
		color: rgba(255, 255, 255, 0.35);
		text-decoration: none;
		transition: color 0.2s;

		&:hover {
			color: rgba(255, 255, 255, 0.6);
		}
	}
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
	.cha-wizard-card {
		padding: 32px 24px;
	}

	.cha-wizard-features {
		grid-template-columns: 1fr;
	}

	.cha-wizard-header .cha-wizard-title {
		font-size: 22px;
	}

	.cha-wizard-actions {
		flex-direction: column-reverse;
		gap: 8px;

		& .cha-wizard-actions-right {
			width: 100%;
		}
	}

	.cha-wizard-btn {
		flex: 1;
	}
}

/* Hidden native color input — used programmatically */
input[type="color"].cha-wizard-color-native {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
	pointer-events: none;
}
