/* ==========================================================================
   Rosukh — app-like mobile shell
   Tab bar, sticky header, install prompt, "My courses" list.
   Brand: navy #164E78 / ink #092132 / green #B6D88B / canvas #F3F3F3
   ========================================================================== */

:root {
	--rapp-navy: #164E78;
	--rapp-navy-deep: #103755;
	--rapp-ink: #092132;
	--rapp-muted: #4A6378;
	--rapp-green: #B6D88B;
	--rapp-tint: #E4EEF6;
	--rapp-surface: #FFFFFF;
	--rapp-line: rgba(16, 55, 85, 0.1);
	--rapp-tabbar-h: 64px;
	--rapp-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

::selection {
	background: var(--rapp-green);
	color: var(--rapp-ink);
}

/* Tab bar is a phone pattern: hidden on tablet and desktop */
.rosukh-tabbar,
.rosukh-install {
	display: none;
}

@media (max-width: 767px) {

	body.rosukh-has-tabbar {
		padding-bottom: calc(var(--rapp-tabbar-h) + env(safe-area-inset-bottom, 0px));
	}

	/* ---------- Bottom tab bar ---------- */
	.rosukh-tabbar {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 9990;
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		padding: 0 6px env(safe-area-inset-bottom, 0px);
		background: var(--rapp-surface);
		border-top: 1px solid var(--rapp-line);
		box-shadow: 0 -8px 24px rgba(9, 33, 50, 0.07);
		transition: transform 0.28s var(--rapp-ease);
		font-family: "Bahij TheSansArabic", system-ui, sans-serif;
	}

	body.rosukh-typing .rosukh-tabbar {
		transform: translateY(110%);
	}

	.rosukh-tab {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: var(--rapp-tabbar-h);
		padding: 6px 2px;
		color: var(--rapp-muted);
		text-decoration: none !important;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
	}

	.rosukh-tab-icon {
		display: grid;
		place-items: center;
		width: 56px;
		height: 30px;
		border-radius: 15px;
		transition: background-color 0.25s var(--rapp-ease), transform 0.2s var(--rapp-ease);
	}

	.rosukh-tab-icon svg {
		width: 23px;
		height: 23px;
	}

	.rosukh-tab-label {
		font-size: 12px;
		line-height: 1.2;
		font-weight: 500;
		white-space: nowrap;
	}

	.rosukh-tab.is-active {
		color: var(--rapp-navy);
	}

	.rosukh-tab.is-active .rosukh-tab-icon {
		background: var(--rapp-tint);
	}

	.rosukh-tab.is-active .rosukh-tab-icon svg {
		stroke-width: 2.1;
	}

	.rosukh-tab.is-active .rosukh-tab-label {
		font-weight: 700;
	}

	.rosukh-tab:active .rosukh-tab-icon {
		transform: scale(0.9);
		background: var(--rapp-tint);
	}

	.rosukh-tab:focus-visible {
		outline: none;
	}

	.rosukh-tab:focus-visible .rosukh-tab-icon {
		box-shadow: 0 0 0 2px var(--rapp-navy);
	}

	/* ---------- Header: compact, stays at the top of the page (scrolls away) ---------- */
	.elementor-location-header {
		padding-top: env(safe-area-inset-top, 0px);
	}

	.elementor-location-header .elementor-element-82cef96 {
		margin-top: 12px !important;
	}

	/* Login / account live in the tab bar on phones */
	.elementor-location-header .elementor-element-8f144cc {
		display: none !important;
	}

	/* ---------- Install prompt ---------- */
	.rosukh-install {
		position: fixed;
		inset-inline: 12px;
		bottom: calc(var(--rapp-tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
		z-index: 9991;
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 12px;
		background: var(--rapp-surface);
		border-radius: 18px;
		box-shadow: 0 14px 36px rgba(9, 33, 50, 0.2);
		font-family: "Bahij TheSansArabic", system-ui, sans-serif;
		color: var(--rapp-ink);
		opacity: 0;
		transform: translateY(16px);
		transition: opacity 0.35s var(--rapp-ease), transform 0.45s var(--rapp-ease);
	}

	.rosukh-install.is-visible {
		opacity: 1;
		transform: none;
	}

	.rosukh-install img {
		width: 46px;
		height: 46px;
		border-radius: 12px;
		flex-shrink: 0;
	}

	.rosukh-install-text {
		flex: 1;
		min-width: 0;
	}

	.rosukh-install-text strong {
		display: block;
		font-size: 15px;
		line-height: 1.35;
	}

	.rosukh-install-text span {
		display: block;
		font-size: 13px;
		line-height: 1.45;
		color: var(--rapp-muted);
	}

	.rosukh-install-actions {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.rosukh-install button {
		font: inherit;
		font-size: 14px;
		font-weight: 700;
		min-height: 36px;
		padding: 6px 16px;
		border: 0;
		border-radius: 10px;
		cursor: pointer;
	}

	.rosukh-install .is-primary {
		background: var(--rapp-navy);
		color: #FFFFFF;
	}

	.rosukh-install .is-secondary {
		background: transparent;
		color: var(--rapp-muted);
		font-weight: 500;
	}
}

/* Already installed: never offer installation again */
@media (display-mode: standalone) and (max-width: 767px) {
	.rosukh-install {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rosukh-tabbar,
	.rosukh-tab-icon,
	.rosukh-install {
		transition: none !important;
	}
}

/* ==========================================================================
   Account page: keep only the student's name from the LearnDash profile card
   (no avatar, edit link or stats), on every screen size
   ========================================================================== */

body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-avatar,
body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-edit-link,
body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-stats {
	display: none !important;
}

/* ==========================================================================
   Account page (/account/, Elementor page 400) on phones
   ========================================================================== */

@media (max-width: 767px) {

	body.page-id-400 .elementor-element-8b16fb9 {
		--padding-top: 8px;
		--padding-bottom: 24px;
		--padding-left: 16px;
		--padding-right: 16px;
		padding: 8px 16px 24px !important;
		margin-bottom: 0 !important;
	}

	body.page-id-400 .elementor-element-8b16fb9 > .e-con-inner {
		gap: 16px;
	}

	body.page-id-400 .elementor-element-ce991f6 {
		text-align: right;
	}

	body.page-id-400 .elementor-element-ce991f6 .elementor-heading-title,
	body.page-id-400 .elementor-widget-theme-post-title .elementor-heading-title {
		font-size: 26px !important;
		line-height: 1.3 !important;
		text-align: right;
		margin: 4px 0 0;
	}

	/* Cards in the page share one rhythm: no stacked outer margins */
	body.page-id-400 .rosukh-account-channel-card,
	body.page-id-400 .rosukh-tg-account-card {
		margin: 0;
		border-radius: 18px;
	}

	body.page-id-400 .rosukh-account-channel-card {
		padding: 20px 18px;
		gap: 12px;
	}

	body.page-id-400 .rosukh-account-channel-card .rosukh-tg-text h3 {
		font-size: 1.1rem;
		line-height: 1.45;
	}

	/* Keep the join button on one line */
	body.page-id-400 .rosukh-account-channel-card .rosukh-btn-telegram {
		min-height: 48px;
		padding: 12px 16px;
		font-size: 15px;
		white-space: nowrap;
		box-sizing: border-box;
	}

	body.page-id-400 .rosukh-tg-account-card {
		padding: 18px;
		border: 0;
		box-shadow: 0 2px 10px rgba(9, 33, 50, 0.06);
	}

	body.page-id-400 .rosukh-tg-linked-status {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	body.page-id-400 .rosukh-tg-link-action .rosukh-telegram-btn {
		width: 100%;
		min-height: 48px;
		box-sizing: border-box;
	}

	/* ---- LearnDash profile ---- */
	body.page-id-400 .learndash-wrapper.ld-profile {
		font-family: "Bahij TheSansArabic", system-ui, sans-serif;
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary {
		display: flex;
		flex-direction: column;
		gap: 18px;
		margin: 0 0 20px;
		padding: 16px;
		background: var(--rapp-surface);
		border: 0;
		border-radius: 18px;
		box-shadow: 0 2px 10px rgba(9, 33, 50, 0.06);
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-card {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 4px;
		width: 100%;
		margin: 0;
		padding: 0;
		text-align: center;
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-avatar {
		width: 76px;
		height: 76px;
		margin: 0 0 8px;
		border-radius: 50%;
		overflow: hidden;
		box-shadow: 0 0 0 4px var(--rapp-tint);
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-avatar img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-heading {
		font-family: inherit;
		font-size: 1.25rem !important;
		font-weight: 700;
		line-height: 1.4;
		letter-spacing: 0;
		margin: 0;
		color: var(--rapp-ink);
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-edit-link {
		position: static;
		display: inline-flex;
		align-items: center;
		min-height: 36px;
		padding: 4px 14px;
		margin: 0;
		border-radius: 18px;
		background: var(--rapp-tint);
		color: var(--rapp-navy);
		font-size: 13px;
		font-weight: 700;
		text-decoration: none;
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-stats {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 0;
		width: 100%;
		margin: 0;
		padding: 14px 0 0;
		border-top: 1px solid var(--rapp-line);
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-stats .ld-profile-stat {
		width: auto;
		margin: 0;
		padding: 0 2px;
		border: 0;
		text-align: center;
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-stats .ld-profile-stat strong {
		display: block;
		font-size: 1.25rem;
		line-height: 1.3;
		color: var(--rapp-navy);
		font-variant-numeric: tabular-nums;
	}

	body.page-id-400 .learndash-wrapper .ld-profile-summary .ld-profile-stats .ld-profile-stat span {
		display: block;
		font-size: 12px;
		line-height: 1.4;
		color: var(--rapp-muted);
	}

	body.page-id-400 .learndash-wrapper .ld-item-list .ld-section-heading {
		align-items: center;
		margin: 0 0 10px;
		padding: 0;
	}

	body.page-id-400 .learndash-wrapper .ld-item-list .ld-section-heading h3 {
		font-family: inherit;
		font-size: 1.1rem !important;
		font-weight: 700;
		line-height: 1.4;
		letter-spacing: 0;
		margin: 0;
		color: var(--rapp-ink);
	}

	body.page-id-400 .learndash-wrapper .ld-item-list .ld-section-heading .ld-expand-button {
		min-height: 36px;
		padding: 4px 14px;
		border-radius: 18px;
		background: var(--rapp-tint);
		color: var(--rapp-navy);
		font-family: inherit;
		font-size: 13px;
		font-weight: 700;
	}

	body.page-id-400 .learndash-wrapper .ld-item-list .ld-section-heading .ld-expand-button .ld-icon {
		background: transparent;
		color: var(--rapp-navy);
	}

	body.page-id-400 .learndash-wrapper .ld-item-list .ld-section-heading .ld-search-prompt {
		color: var(--rapp-navy);
	}

	body.page-id-400 .learndash-wrapper .ld-alert {
		margin: 0;
		padding: 14px 16px;
		border-radius: 14px;
		border-width: 0;
		background: var(--rapp-surface);
		box-shadow: 0 2px 10px rgba(9, 33, 50, 0.06);
	}

	body.page-id-400 .learndash-wrapper .ld-alert .ld-alert-content {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 0;
	}

	body.page-id-400 .learndash-wrapper .ld-alert .ld-alert-icon {
		position: static;
		flex-shrink: 0;
		width: 32px;
		height: 32px;
		margin: 0;
		transform: none;
		display: grid;
		place-items: center;
		background: transparent;
		color: var(--rapp-navy);
		border: 0;
	}

	body.page-id-400 .learndash-wrapper .ld-alert {
		min-height: 0;
		align-items: center;
	}

	body.page-id-400 .learndash-wrapper .ld-alert .ld-alert-messages {
		flex: 1;
		margin: 0;
		padding: 0;
		font-size: 15px;
		color: var(--rapp-ink);
	}
}

/* ==========================================================================
   [rosukh_my_courses]
   ========================================================================== */

.rosukh-courses {
	font-family: "Bahij TheSansArabic", system-ui, sans-serif;
	color: var(--rapp-ink);
	max-width: 720px;
	margin: 0 auto;
}

.rosukh-course-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rosukh-course {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px;
	background: var(--rapp-surface);
	border-radius: 16px;
	box-shadow: 0 2px 10px rgba(9, 33, 50, 0.06);
	color: inherit;
	text-decoration: none !important;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.2s var(--rapp-ease), box-shadow 0.2s var(--rapp-ease);
}

.rosukh-course:active {
	transform: scale(0.985);
}

@media (hover: hover) {
	.rosukh-course:hover {
		box-shadow: 0 8px 22px rgba(9, 33, 50, 0.1);
	}
}

.rosukh-course:focus-visible {
	outline: 2px solid var(--rapp-navy);
	outline-offset: 2px;
}

.rosukh-course-thumb {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 12px;
	background: var(--rapp-tint) center / cover no-repeat;
	color: var(--rapp-navy);
}

.rosukh-course-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rosukh-course-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.rosukh-course-progress {
	display: block;
	height: 6px;
	border-radius: 3px;
	background: var(--rapp-tint);
	overflow: hidden;
}

.rosukh-course-progress > span {
	display: block;
	height: 100%;
	border-radius: 3px;
	background: var(--rapp-navy);
}

.rosukh-course-meta {
	font-size: 13px;
	color: var(--rapp-muted);
	font-variant-numeric: tabular-nums;
}

.rosukh-course-action {
	flex-shrink: 0;
	padding: 8px 14px;
	border-radius: 10px;
	background: var(--rapp-navy);
	color: #FFFFFF;
	font-size: 14px;
	font-weight: 700;
}

.rosukh-course-action.is-done {
	background: var(--rapp-green);
	color: var(--rapp-ink);
}

.rosukh-courses-empty {
	text-align: center;
	padding: 40px 20px;
	background: var(--rapp-surface);
	border-radius: 20px;
}

.rosukh-courses-empty-icon {
	display: inline-grid;
	place-items: center;
	width: 72px;
	height: 72px;
	border-radius: 22px;
	background: var(--rapp-tint);
	color: var(--rapp-navy);
}

.rosukh-courses-empty-icon svg {
	width: 34px;
	height: 34px;
}

.rosukh-courses .rosukh-courses-empty h2 {
	font-family: inherit;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0;
	margin: 20px 0 8px;
	color: var(--rapp-ink);
}

.rosukh-courses .rosukh-courses-empty p {
	margin: 0 auto 22px;
	max-width: 34ch;
	line-height: 1.75;
	color: var(--rapp-muted);
}

.rosukh-courses-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 26px;
	border-radius: 12px;
	background: var(--rapp-navy);
	color: #FFFFFF !important;
	font-weight: 700;
	text-decoration: none !important;
}

.rosukh-courses-cta:focus-visible {
	outline: 2px solid var(--rapp-navy);
	outline-offset: 3px;
}
