:root {
	--bg: #0d1117;
	--bg-card: #161b22;
	--bg-elevated: #21262d;
	--fg: #f0f6fc;
	--fg-muted: #8b949e;
	--border: #30363d;
	--accent: #388bfd;
	--accent-glow: rgba(56, 139, 253, 0.25);
	--warning: #e3b341;
	--success: #3fb950;
	--danger: #f85149;
	--cyan: #39c5cf;
	--purple: #bc8cff;
	--radius: 12px;
	--radius-sm: 8px;
	--font-base: 'Segoe UI', system-ui, -apple-system, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	--font-dyslexic: 'Comic Sans MS', 'OpenDyslexic', 'Segoe UI', cursive, sans-serif;
	--slide-font-size: 1rem;
	--space: 1.25rem;
}

/* Accessible Themes for DUA */
body.theme-light {
	--bg: #f6f8fa;
	--bg-card: #ffffff;
	--bg-elevated: #eaeef2;
	--fg: #1f2328;
	--fg-muted: #57606a;
	--border: #d0d7de;
	--accent: #0969da;
	--accent-glow: rgba(9, 105, 218, 0.15);
	--warning: #9a6700;
	--success: #1a7f37;
	--danger: #cf222e;
	--cyan: #057a85;
	--purple: #8250df;
}

body.theme-high-contrast {
	--bg: #000000;
	--bg-card: #0c0c0c;
	--bg-elevated: #1a1a1a;
	--fg: #ffff00;
	--fg-muted: #ffffff;
	--border: #ffff00;
	--accent: #00ffff;
	--accent-glow: rgba(0, 255, 255, 0.4);
	--warning: #ffaa00;
	--success: #00ff66;
	--danger: #ff3333;
	--cyan: #00ffff;
	--purple: #ff88ff;
}

body.theme-sepia {
	--bg: #f4ecd8;
	--bg-card: #ede3cb;
	--bg-elevated: #e2d6b7;
	--fg: #3d3024;
	--fg-muted: #725d48;
	--border: #caba9c;
	--accent: #944d18;
	--accent-glow: rgba(148, 77, 24, 0.15);
	--warning: #9e6400;
	--success: #2b7538;
	--danger: #aa261b;
	--cyan: #176b74;
	--purple: #6f3b8a;
}

body.font-dyslexic {
	font-family: var(--font-dyslexic) !important;
}

body.font-lg {
	--slide-font-size: 1.15rem;
}

body.font-xl {
	--slide-font-size: 1.3rem;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-base);
	font-size: var(--slide-font-size);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
}

/* Technical blueprint background overlay */
.app-container {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background-image: 
		radial-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.3));
	background-size: 24px 24px, 100% 100%;
}

/* Header & Controls */
.top-header {
	border-bottom: 1px solid var(--border);
	background: var(--bg-card);
	padding: 0.75rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: blur(8px);
}

.brand-badge {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.tech-icon {
	background: linear-gradient(135deg, var(--accent), var(--cyan));
	color: #fff;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 1.1rem;
	box-shadow: 0 2px 8px var(--accent-glow);
}

.brand-title {
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: -0.01em;
	display: flex;
	flex-direction: column;
}

.brand-sub {
	font-size: 0.75rem;
	color: var(--fg-muted);
	font-weight: 400;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

/* DUA Bar */
.dua-badge {
	background: rgba(57, 197, 207, 0.15);
	color: var(--cyan);
	border: 1px solid var(--cyan);
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

/* Buttons and Controls */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.5rem 0.85rem;
	border-radius: var(--radius-sm);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	color: var(--fg);
	transition: all 0.15s ease;
	user-select: none;
}

.btn:hover {
	filter: brightness(1.15);
	border-color: var(--accent);
}

.btn-primary {
	background: var(--accent);
	color: #ffffff;
	border-color: var(--accent);
	box-shadow: 0 2px 6px var(--accent-glow);
}

.btn-cyan {
	background: var(--cyan);
	color: #0d1117;
	border-color: var(--cyan);
	font-weight: 700;
}

.btn-warning {
	background: var(--warning);
	color: #0d1117;
	border-color: var(--warning);
}

.btn-sm {
	padding: 0.3rem 0.55rem;
	font-size: 0.8rem;
}

.btn-icon {
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 50%;
}

.btn-active {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

/* Layout */
.main-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	flex: 1;
	height: calc(100vh - 65px);
	overflow: hidden;
}

@media (max-width: 900px) {
	.main-layout {
		grid-template-columns: 1fr;
		height: auto;
		overflow: visible;
	}
	.sidebar {
		display: none;
	}
	.sidebar.mobile-open {
		display: block;
		position: fixed;
		inset: 60px 0 0 0;
		z-index: 100;
		background: var(--bg-card);
	}
}

/* Sidebar Navigator */
.sidebar {
	border-right: 1px solid var(--border);
	background: var(--bg-card);
	overflow-y: auto;
	padding: 1rem 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.sidebar-heading {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--fg-muted);
	padding: 0.5rem 0.5rem 0.25rem;
	font-weight: 700;
}

.slide-nav-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem 0.75rem;
	border-radius: var(--radius-sm);
	color: var(--fg);
	text-decoration: none;
	background: transparent;
	border: 1px solid transparent;
	font-size: 0.85rem;
	text-align: left;
	cursor: pointer;
	width: 100%;
	transition: all 0.15s ease;
}

.slide-nav-item:hover {
	background: var(--bg-elevated);
	border-color: var(--border);
}

.slide-nav-item.active {
	background: rgba(56, 139, 253, 0.15);
	border-color: var(--accent);
	color: var(--accent);
	font-weight: 700;
}

.slide-number-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: var(--bg-elevated);
	font-size: 0.75rem;
	font-family: var(--font-mono);
	font-weight: 700;
}

.slide-nav-item.active .slide-number-chip {
	background: var(--accent);
	color: #fff;
}

/* Presentation Canvas */
.canvas-area {
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding: 1.5rem;
	position: relative;
	background: var(--bg);
}

.slide-viewport {
	max-width: 1000px;
	width: 100%;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	flex: 1;
}

/* Slide Card */
.slide-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	padding: 2rem;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-height: 520px;
}

.slide-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	border-bottom: 2px solid var(--border);
	padding-bottom: 1rem;
}

.slide-tag {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--accent);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.slide-title {
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.2;
	margin: 0.35rem 0 0 0;
	color: var(--fg);
}

.slide-subtitle {
	font-size: 1.05rem;
	color: var(--fg-muted);
	margin-top: 0.25rem;
}

/* DUA Box (Multiple representations & tips) */
.dua-box {
	background: rgba(57, 197, 207, 0.08);
	border-left: 4px solid var(--cyan);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	padding: 0.85rem 1rem;
	font-size: 0.9rem;
}

.dua-box-title {
	font-weight: 700;
	color: var(--cyan);
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 0.3rem;
}

/* Grid Columns for Slides */
.slide-grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1.25rem;
}

.slide-grid-3 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
}

/* Concept Cards */
.concept-card {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 1.2rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.concept-card-highlight {
	border-color: var(--accent);
	background: rgba(56, 139, 253, 0.07);
}

.concept-card-warning {
	border-color: var(--warning);
	background: rgba(227, 179, 65, 0.07);
}

.concept-card-success {
	border-color: var(--success);
	background: rgba(63, 185, 80, 0.07);
}

.concept-title {
	font-weight: 700;
	font-size: 1.1rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Formula Presentation Cards (DUA Multi-sensory Representation) */
.formula-hero {
	background: linear-gradient(135deg, rgba(56, 139, 253, 0.12), rgba(188, 140, 255, 0.12));
	border: 2px solid var(--accent);
	border-radius: var(--radius);
	padding: 1.5rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}

.formula-display {
	font-family: var(--font-mono);
	font-size: 2rem;
	font-weight: 800;
	color: var(--cyan);
	letter-spacing: 0.05em;
	padding: 0.5rem 1.5rem;
	background: var(--bg-card);
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.var-pill-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 0.5rem;
}

.var-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	font-size: 0.8rem;
	font-family: var(--font-mono);
	background: var(--bg-card);
	border: 1px solid var(--border);
}

.var-pill strong {
	color: var(--accent);
}

/* Tables for SI vs SAE */
.table-container {
	overflow-x: auto;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
}

.tech-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	text-align: left;
}

.tech-table th {
	background: var(--bg-elevated);
	padding: 0.75rem 1rem;
	font-weight: 700;
	border-bottom: 2px solid var(--border);
	color: var(--fg);
}

.tech-table td {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--border);
	background: var(--bg-card);
}

.tech-table tr:hover td {
	background: var(--bg-elevated);
}

.tech-table .mono {
	font-family: var(--font-mono);
	font-weight: 600;
	color: var(--cyan);
}

/* Interactive Simulation Widgets */
.sim-box {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.sim-track {
	height: 110px;
	background: #0f141c;
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.sim-road {
	height: 24px;
	background: #21262d;
	border-top: 2px dashed #484f58;
	width: 100%;
}

.sim-marks {
	position: absolute;
	top: 6px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	padding: 0 15px;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: #6e7681;
}

.sim-vehicle {
	position: absolute;
	bottom: 24px;
	transition: left 0.05s linear;
	display: flex;
	flex-direction: column;
	align-items: center;
	transform: translateX(-50%);
}

.sim-car-body {
	font-size: 2rem;
	filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.sim-speedometer {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	background: #1f6feb;
	color: #fff;
	padding: 1px 6px;
	border-radius: 4px;
	font-weight: bold;
	white-space: nowrap;
}

/* Graph Visualizer */
.graph-svg-container {
	background: #0d1117;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 0.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Interactive Sliders & Inputs */
.slider-group {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.slider-group label {
	display: flex;
	justify-content: space-between;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--fg-muted);
}

.slider-group input[type="range"] {
	width: 100%;
	accent-color: var(--accent);
	cursor: pointer;
}

/* Bottom Presentation Navigation Bar */
.slide-bottom-bar {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.75rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.progress-bar-container {
	flex: 1;
	height: 8px;
	background: var(--bg-elevated);
	border-radius: 999px;
	overflow: hidden;
	margin: 0 1rem;
}

.progress-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--accent), var(--cyan));
	transition: width 0.3s ease;
}

/* DUA Drawer / Modal */
.dua-drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	z-index: 100;
	display: flex;
	justify-content: flex-end;
	backdrop-filter: blur(4px);
}

.dua-drawer {
	background: var(--bg-card);
	width: 100%;
	max-width: 440px;
	height: 100%;
	border-left: 1px solid var(--border);
	padding: 1.5rem;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
}

.dua-drawer-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border);
	padding-bottom: 1rem;
}

.dua-setting-card {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* Interactive Quiz */
.quiz-option {
	padding: 0.85rem 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg-elevated);
	color: var(--fg);
	font-size: 0.95rem;
	text-align: left;
	cursor: pointer;
	transition: all 0.15s ease;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
}

.quiz-option:hover:not(:disabled) {
	border-color: var(--accent);
	background: rgba(56, 139, 253, 0.1);
}

.quiz-option.selected-correct {
	background: rgba(63, 185, 80, 0.2);
	border-color: var(--success);
	color: var(--success);
	font-weight: 700;
}

.quiz-option.selected-wrong {
	background: rgba(248, 81, 73, 0.2);
	border-color: var(--danger);
	color: var(--danger);
}

/* Audio Wave indicator */
.audio-speaking {
	animation: pulse-ring 1.2s infinite;
}

@keyframes pulse-ring {
	0% {
		box-shadow: 0 0 0 0 rgba(57, 197, 207, 0.6);
	}
	70% {
		box-shadow: 0 0 0 10px rgba(57, 197, 207, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(57, 197, 207, 0);
	}
}

/* Presenter Speaker Notes Drawer */
.speaker-notes-box {
	background: #111a24;
	border: 1px dashed var(--accent);
	border-radius: var(--radius-sm);
	padding: 1rem;
	font-size: 0.88rem;
	color: #a5d6ff;
}

/* Print Sheet Styling */
@media print {
	.top-header, .sidebar, .slide-bottom-bar, .header-actions {
		display: none !important;
	}
	.main-layout {
		display: block;
		height: auto;
	}
	.slide-card {
		box-shadow: none;
		border: 1px solid #000;
		page-break-after: always;
	}
}
