:root {
	--success: #28a745;
	--warning: #ffc107;
	--error: #dc3545;
	--info: #1bb9d1;
	--bg: #000201;
	--text: #f2f2f2;
	--accent1: #59dafb;
	--accent2: #a5fb59;
}
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
body {
	font-family: Satoshi, Satoshi Variable, system-ui, Segoe UI, Roboto,
		sans-serif;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
}
section {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
}
section.hidden {
	display: none !important;
	opacity: 0;
}
#onboardingSection {
	display: block;
	z-index: 10;
}
/* Ensure hidden state always wins for onboarding */
#onboardingSection.hidden {
	display: none !important;
}
#menuSection:not(.hidden),
#cameraSection:not(.hidden) {
	display: block !important;
}
.container {
	max-width: 1200px;
	margin: 75px auto;
	padding: 20px;
}
.flex {
	display: flex;
}
.grid {
	display: grid;
	gap: 30px;
	grid-template-columns: 1fr 1fr;
	align-items: start;
}
.slider {
	height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	padding: 20px;
}
.sliderContent {
	max-width: 820px;
	width: 100%;
	text-align: center;
	position: relative;
}
.progress-indicator {
	position: absolute;
	top: -60px;
	right: 0;
	color: var(--accent1);
	font-weight: 600;
	opacity: 0.85;
}
.progress-bar {
	position: absolute;
	top: -20px;
	left: 0;
	right: 0;
	height: 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}
.progress-fill {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--accent1), var(--accent2));
	transition: width 0.25s ease;
}
.cCard {
	display: none;
	background: #0f1211;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 48px 36px;
	margin: 16px 20px;
	min-height: 300px;
}
.cCard.active {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.cCard h2 {
	font-size: 2.2rem;
	color: var(--accent1);
	margin-bottom: 16px;
}
.cCard p {
	font-size: 1.1rem;
	line-height: 1.6;
	opacity: 0.9;
}
.btnBar {
	margin-top: 28px;
	display: flex;
	align-items: center;
	gap: 14px;
}
.navBtn {
	width: 28px;
	height: 6px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: rgba(255, 255, 255, 0.25);
	cursor: pointer;
	transition: background 0.15s ease;
}
.navBtn:hover {
	background: var(--accent2);
}
.navBtn.active {
	background: var(--accent1);
}
.navBtn.visited {
	background: rgba(165, 251, 89, 0.55);
}
.navBtn.visited.active {
	background: var(--accent1);
}
.arrowBtn {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: transparent;
	color: var(--text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
}
.arrowBtn:hover {
	background: rgba(255, 255, 255, 0.12);
}
.startBtn {
	background: var(--accent1);
	color: #001315;
	border: 0;
	padding: 12px 22px;
	font-size: 1.05rem;
	font-weight: 700;
	border-radius: 10px;
	cursor: pointer;
	margin-top: 12px;
	transition: background 0.15s ease;
}
.prefBtn {
    outline: var(--accent1) solid 2px;
    background: var(--bg);
	color: var(--accent);
	border: 0;
	padding: 12px 22px;
	font-size: 1.05rem;
	font-weight: 700;
	border-radius: 10px;
	cursor: pointer;
	margin-top: 12px;
	transition: all 0.5s ease;
}
.prefBtn:hover {
    background: var(--accent1);
    color: #001315;
}
.startBtn:hover {
	background: #7ae0ff;
}
.startBtn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
#menuSection {
	background: var(--bg);
	position: relative;
}
#menuSection .container.menu {
	height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 20px;
}
#menuSection .container.menu h1 {
	color: var(--accent1);
	font-size: 2.6rem;
	margin-bottom: 12px;
}
#menuSection .container.menu p {
	max-width: 640px;
	text-align: center;
	opacity: 0.9;
	margin-bottom: 28px;
}
.exerciseGrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	width: 100%;
	max-width: 1000px;
	padding: 10px;
}
.exerciseCard {
	background: #0f1211;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	padding: 24px;
	text-align: center;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.exerciseCard:hover {
	background: #121615;
	border-color: rgba(89, 218, 251, 0.5);
}
.exerciseCard h3 {
	color: var(--accent2);
	margin-bottom: 10px;
}
.exerciseCard p {
	opacity: 0.85;
}
.backBtn {
	position: absolute;
	top: 30px;
	left: 30px;
	background: rgba(255, 255, 255, 0.1);
	color: var(--text);
	border: 1px solid rgba(255, 255, 255, 0.2);
	padding: 10px 20px;
	border-radius: 10px;
	cursor: pointer;
    z-index: 3;
}
.backBtn:hover {
	background: var(--accent1);
	color: #001315;
	border-color: var(--accent1);
}
#cameraSection {
	background: var(--bg);
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
}
.video-container {
	position: relative;
	padding: 5px;
}
.card {
	background: #0f1211;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
}
#webcam,
#output {
	width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}
#webcam {
	position: absolute;
	top: 20px;
	left: 20px;
	opacity: 0;
}
#output {
	position: relative;
	z-index: 1;
}
.feedback-container {
	background: transparent;
}
.feedback-text {
	font-size: 1.1rem;
	font-weight: 600;
	padding: 16px;
	background: var(--info);
	border-radius: 10px;
	text-align: center;
	margin-bottom: 20px;
}
.feedback-text.success {
	background: var(--success);
}
.feedback-text.warning {
	background: var(--warning);
}
.instructions {
	background: #0f1211;
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: 16px;
	border-radius: 10px;
}
.instructions h3 {
	color: var(--accent1);
	margin-bottom: 8px;
	font-size: 1.1rem;
}
.instructions p {
	color: #c9c9c9;
	line-height: 1.6;
}
.camera-controls {
	position: absolute;
	bottom: 12px;
	left: 20px;
	right: 20px;
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	pointer-events: none;
    z-index: 2;
}
.camera-controls label {
	pointer-events: all;
	background: rgba(0, 0, 0, 0.5);
	color: var(--text);
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	font-size: 0.9rem;
}
.record-btn {
	pointer-events: all;
	background: var(--error);
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}
.record-btn:hover {
	background: #b52d3c;
}
.record-btn.recording {
	background: var(--success);
	animation: pulse 1.5s infinite;
}
.recording-status {
	pointer-events: all;
	background: rgba(220, 53, 69, 0.2);
	color: var(--error);
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px solid var(--error);
	font-size: 0.9rem;
	font-weight: 600;
}
@keyframes pulse {
	0% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
	100% {
		opacity: 1;
	}
}
@media (max-width: 768px) {
	.grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.container {
		padding: 15px;
	}
	.video-container,
	.feedback-container {
		padding: 15px;
	}
	.exerciseGrid {
		grid-template-columns: 1fr;
		padding: 10px;
	}
	#menuSection h1 {
		font-size: 2rem;
	}
}
