/* Menhaj Courses — Frontend Journey */
:root {
	--ast-global-color-0: #1d7477;
	--ast-global-color-1: #bda480;
	--ast-global-color-2: #1b484d;
	--menhaj-primary: var(--ast-global-color-0);
	--menhaj-accent: var(--ast-global-color-1);
	--menhaj-dark: var(--ast-global-color-2);
	--menhaj-primary-light: rgba(29, 116, 119, 0.1);
	--menhaj-bg: #f5f8f8;
	--menhaj-card: #ffffff;
	--menhaj-text: var(--menhaj-dark);
	--menhaj-muted: #5a7a7c;
	--menhaj-border: #d4e4e4;
	--menhaj-success: #1d7477;
	--menhaj-danger: #c0392b;
	--menhaj-radius: 16px;
	--menhaj-shadow: 0 4px 24px rgba(27, 72, 77, 0.08);
}

.menhaj-course-page {
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
	background: var(--menhaj-bg);
	font-family: 'Tajawal', sans-serif;
}

.menhaj-course-page #wpadminbar {
	display: none !important;
}

.menhaj-app {
	position: fixed;
	inset: 0;
	display: flex;
	direction: rtl;
	background: var(--menhaj-bg);
	color: var(--menhaj-text);
	z-index: 99999;
}

/* Sidebar */
.menhaj-sidebar {
	width: 300px;
	min-width: 300px;
	background: var(--menhaj-card);
	border-left: 1px solid var(--menhaj-border);
	display: flex;
	flex-direction: column;
	transition: transform 0.3s ease;
	z-index: 10;
}

.menhaj-sidebar-header {
	padding: 20px 16px 12px;
	border-bottom: 1px solid var(--menhaj-border);
}

.menhaj-sidebar-header h2 {
	margin: 0 0 4px;
	font-size: 1.1rem;
}

.menhaj-sidebar-header p {
	margin: 0;
	font-size: 0.85rem;
	color: var(--menhaj-muted);
}

.menhaj-journey-label {
	font-size: 0.75rem;
	color: var(--menhaj-muted);
	margin-bottom: 8px;
}

.menhaj-journey-list {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
	list-style: none;
	margin: 0;
}

.menhaj-journey-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 16px;
	cursor: pointer;
	transition: background 0.15s;
	border-right: 3px solid transparent;
}

.menhaj-journey-item:hover {
	background: #f8fafc;
}

.menhaj-journey-item.is-active {
	background: var(--menhaj-primary-light);
	border-right-color: var(--menhaj-primary);
}

.menhaj-journey-item.is-done .menhaj-journey-dot {
	background: var(--menhaj-success);
	border-color: var(--menhaj-success);
	color: #fff;
}

.menhaj-journey-item.is-locked {
	opacity: 0.5;
	cursor: not-allowed;
}

.menhaj-journey-dot {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid var(--menhaj-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	flex-shrink: 0;
	margin-top: 2px;
}

.menhaj-journey-info strong {
	display: block;
	font-size: 0.85rem;
}

.menhaj-journey-info span {
	font-size: 0.75rem;
	color: var(--menhaj-muted);
}

/* Main content */
.menhaj-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
}

.menhaj-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	background: var(--menhaj-card);
	border-bottom: 1px solid var(--menhaj-border);
	gap: 12px;
}

.menhaj-topbar-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	min-width: 0;
}

.menhaj-brand {
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--menhaj-primary);
	line-height: 1.2;
}

.menhaj-topbar-title {
	font-weight: 500;
	font-size: 0.85rem;
	color: var(--menhaj-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.menhaj-menu-btn,
.menhaj-topbar-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	font-size: 1.2rem;
	color: var(--menhaj-text);
}

.menhaj-menu-btn:hover,
.menhaj-topbar-btn:hover {
	background: #f1f5f9;
}

.menhaj-progress-bar {
	height: 4px;
	background: var(--menhaj-border);
}

.menhaj-progress-fill {
	height: 100%;
	background: var(--menhaj-primary);
	transition: width 0.4s ease;
}

.menhaj-stations {
	flex: 1;
	overflow-y: auto;
	scroll-snap-type: y mandatory;
	-webkit-overflow-scrolling: touch;
}

.menhaj-station {
	min-height: 100%;
	scroll-snap-align: start;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 20px 80px;
	box-sizing: border-box;
}

.menhaj-station-inner {
	width: 100%;
	max-width: 640px;
}

.menhaj-station-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--menhaj-primary-light);
	color: var(--menhaj-primary);
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 12px;
}

.menhaj-station h1 {
	margin: 0 0 8px;
	font-size: 1.75rem;
	line-height: 1.3;
}

.menhaj-station h2 {
	margin: 0 0 16px;
	font-size: 1rem;
	font-weight: 400;
	color: var(--menhaj-muted);
}

.menhaj-station-content {
	font-size: 1rem;
	line-height: 1.8;
	margin-bottom: 24px;
}

.menhaj-station-content p {
	margin: 0 0 12px;
}

/* Video */
.menhaj-video-wrap {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	background: #000;
	border-radius: var(--menhaj-radius);
	overflow: hidden;
	margin-bottom: 16px;
	box-shadow: var(--menhaj-shadow);
}

.menhaj-video-wrap iframe,
.menhaj-video-wrap video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.menhaj-transcript-toggle {
	background: none;
	border: 1px solid var(--menhaj-border);
	border-radius: 8px;
	padding: 8px 16px;
	cursor: pointer;
	font-size: 0.9rem;
	margin-bottom: 12px;
	color: var(--menhaj-text);
}

.menhaj-transcript {
	display: none;
	background: #f8fafc;
	border-radius: var(--menhaj-radius);
	padding: 16px;
	font-size: 0.9rem;
	line-height: 1.7;
	max-height: 200px;
	overflow-y: auto;
	margin-bottom: 16px;
}

.menhaj-transcript.is-open {
	display: block;
}

/* Quiz */
.menhaj-quiz-intro {
	text-align: center;
	padding: 32px 0;
}

.menhaj-quiz-intro h3 {
	margin: 0 0 8px;
}

.menhaj-quiz-intro p {
	color: var(--menhaj-muted);
	margin: 0 0 20px;
}

.menhaj-quiz-question {
	background: var(--menhaj-card);
	border-radius: var(--menhaj-radius);
	padding: 20px;
	margin-bottom: 16px;
	box-shadow: var(--menhaj-shadow);
}

.menhaj-quiz-question h4 {
	margin: 0 0 14px;
	font-size: 1rem;
}

.menhaj-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 2px solid var(--menhaj-border);
	border-radius: 10px;
	margin-bottom: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.menhaj-option:hover {
	border-color: var(--menhaj-primary);
	background: #f8fafc;
}

.menhaj-option.is-selected {
	border-color: var(--menhaj-primary);
	background: var(--menhaj-primary-light);
}

.menhaj-option.is-correct {
	border-color: var(--menhaj-success);
	background: #f0fdf4;
}

.menhaj-option.is-wrong {
	border-color: var(--menhaj-danger);
	background: #fef2f2;
}

/* Matching */
.menhaj-match-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.menhaj-match-col {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.menhaj-match-item {
	padding: 12px;
	border: 2px solid var(--menhaj-border);
	border-radius: 10px;
	text-align: center;
	cursor: pointer;
	transition: all 0.15s;
	font-size: 0.9rem;
}

.menhaj-match-item.is-selected-left,
.menhaj-match-item.is-selected-right {
	border-color: var(--menhaj-primary);
	background: var(--menhaj-primary-light);
}

.menhaj-match-item.is-matched {
	border-color: var(--menhaj-success);
	background: #f0fdf4;
	opacity: 0.7;
	cursor: default;
}

/* Buttons */
.menhaj-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	border: none;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.1s, opacity 0.15s;
}

.menhaj-btn:active {
	transform: scale(0.97);
}

.menhaj-btn-primary {
	background: var(--menhaj-primary);
	color: #fff;
}

.menhaj-btn-primary:hover {
	background: var(--menhaj-dark);
}

.menhaj-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.menhaj-btn-outline {
	background: transparent;
	border: 2px solid var(--menhaj-border);
	color: var(--menhaj-text);
}

.menhaj-station-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin-top: 24px;
}

/* Nav arrows */
.menhaj-nav-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	padding: 12px;
}

.menhaj-nav-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--menhaj-border);
	border: none;
	cursor: pointer;
	padding: 0;
}

.menhaj-nav-dot.is-active {
	background: var(--menhaj-primary);
	width: 24px;
	border-radius: 4px;
}

/* Toast */
.menhaj-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--menhaj-dark);
	color: #fff;
	padding: 12px 24px;
	border-radius: 999px;
	font-size: 0.9rem;
	z-index: 100000;
	box-shadow: var(--menhaj-shadow);
	animation: menhaj-toast-in 0.3s ease;
}

@keyframes menhaj-toast-in {
	from { opacity: 0; transform: translateX(-50%) translateY(12px); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Onboarding tour */
.menhaj-tour-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100001;
	padding: 20px;
}

.menhaj-tour-card {
	background: var(--menhaj-card);
	border-radius: var(--menhaj-radius);
	padding: 32px 24px;
	max-width: 360px;
	width: 100%;
	text-align: center;
	box-shadow: var(--menhaj-shadow);
}

.menhaj-tour-icon {
	font-size: 3rem;
	margin-bottom: 16px;
}

.menhaj-tour-card p {
	margin: 0 0 20px;
	line-height: 1.6;
	color: var(--menhaj-muted);
}

.menhaj-tour-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-bottom: 16px;
}

.menhaj-tour-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--menhaj-border);
}

.menhaj-tour-dot.is-active {
	background: var(--menhaj-primary);
}

.menhaj-tour-skip {
	background: none;
	border: none;
	color: var(--menhaj-muted);
	cursor: pointer;
	font-size: 0.9rem;
	margin-top: 8px;
}

/* Complete screen */
.menhaj-complete {
	text-align: center;
	padding: 40px 20px;
}

.menhaj-complete-icon {
	font-size: 4rem;
	margin-bottom: 16px;
}

.menhaj-complete h2 {
	margin: 0 0 8px;
}

.menhaj-complete p {
	color: var(--menhaj-muted);
}

.menhaj-quiz-result {
	text-align: center;
	padding: 20px;
}

.menhaj-quiz-result .score {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--menhaj-primary);
}

/* Mobile */
@media (max-width: 768px) {
	.menhaj-sidebar {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		transform: translateX(100%);
		box-shadow: -4px 0 24px rgba(0,0,0,0.1);
	}

	.menhaj-sidebar.is-open {
		transform: translateX(0);
	}

	.menhaj-sidebar-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,0.4);
		z-index: 9;
	}

	.menhaj-station h1 {
		font-size: 1.4rem;
	}

	.menhaj-match-grid {
		grid-template-columns: 1fr;
	}
}
