/**
 * WeKnowIran PWA — front-end app shell styles.
 * All selectors are namespaced with .wki- to avoid clashing with Elementor.
 */

:root {
	--wki-font: Inter, Arial, Helvetica, sans-serif;
	--wki-bg: #06152d;
	--wki-theme: #06152d;
	--wki-accent: #f4c15a;
	--wki-text: #ffffff;
	--wki-splash: #06152d;
	--wki-splash-text: #ffffff;
	--wki-splash-accent: #f4c15a;
	--wki-on-accent: #04101f;
	--wki-radius: 18px;
	--wki-nav-h: 62px;
	--wki-sat: env(safe-area-inset-top, 0px);
	--wki-sab: env(safe-area-inset-bottom, 0px);
	--wki-sal: env(safe-area-inset-left, 0px);
	--wki-sar: env(safe-area-inset-right, 0px);
	--wki-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

/* ------------------------------------------------------------- splash */

#wki-splash {
	position: fixed;
	inset: 0;
	z-index: 2147483600;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wki-splash);
	color: var(--wki-splash-text);
	font-family: var(--wki-font);
	opacity: 1;
	transition: opacity .45s ease, visibility .45s ease;
	padding: 24px;
	padding-top: calc(24px + var(--wki-sat));
	padding-bottom: calc(24px + var(--wki-sab));
}

#wki-splash.wki-hide {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

html.wki-splash-on,
html.wki-splash-on body {
	overflow: hidden !important;
}

.wki-splash-inner {
	text-align: center;
	max-width: 320px;
	animation: wki-splash-in .6s cubic-bezier(.2, .8, .3, 1) both;
}

.wki-splash-logo {
	width: 112px;
	height: 112px;
	object-fit: contain;
	display: block;
	margin: 0 auto 20px;
	border-radius: 24px;
	animation: wki-pop .7s cubic-bezier(.2, .9, .3, 1.2) both;
}

.wki-splash-title {
	font-size: 21px;
	font-weight: 700;
	letter-spacing: .01em;
	margin-bottom: 8px;
	color: var(--wki-splash-text);
}

.wki-splash-tagline {
	font-size: 14px;
	opacity: .72;
	line-height: 1.7;
	margin-bottom: 4px;
}

.wki-splash-loader {
	margin: 26px auto 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
}

.wki-loader-ring {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2.5px solid rgba(255, 255, 255, .16);
	border-top-color: var(--wki-splash-accent);
	animation: wki-spin .8s linear infinite;
}

.wki-loader-dots span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wki-splash-accent);
	display: block;
	animation: wki-bounce 1.2s ease-in-out infinite;
}

.wki-loader-dots span:nth-child(2) { animation-delay: .16s; }
.wki-loader-dots span:nth-child(3) { animation-delay: .32s; }

.wki-loader-bar {
	width: 132px;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .14);
	overflow: hidden;
	display: block;
}

.wki-loader-bar i {
	display: block;
	width: 42%;
	height: 100%;
	border-radius: 3px;
	background: var(--wki-splash-accent);
	animation: wki-slide 1.1s ease-in-out infinite;
}

@keyframes wki-spin { to { transform: rotate(360deg); } }
@keyframes wki-bounce {
	0%, 80%, 100% { transform: scale(.6); opacity: .5; }
	40% { transform: scale(1); opacity: 1; }
}
@keyframes wki-slide {
	0% { transform: translateX(-110%); }
	100% { transform: translateX(340%); }
}
@keyframes wki-pop {
	0% { transform: scale(.75); opacity: 0; }
	100% { transform: scale(1); opacity: 1; }
}
@keyframes wki-splash-in {
	0% { transform: translateY(10px); opacity: 0; }
	100% { transform: translateY(0); opacity: 1; }
}

/* --------------------------------------------------------- onboarding */

.wki-onboard {
	position: fixed;
	inset: 0;
	z-index: 2147483500;
	background: var(--wki-bg);
	color: var(--wki-text);
	font-family: var(--wki-font);
	display: flex;
	flex-direction: column;
	opacity: 0;
	transition: opacity .35s ease;
}

.wki-onboard.wki-in { opacity: 1; }

.wki-onboard-top {
	display: flex;
	justify-content: flex-end;
	padding: calc(14px + var(--wki-sat)) 18px 0;
	min-height: 46px;
}

.wki-onboard-skip {
	background: none;
	border: 0;
	color: inherit;
	opacity: .6;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	padding: 8px 12px;
	border-radius: 8px;
}

.wki-onboard-skip:hover { opacity: 1; }

.wki-onboard-track {
	flex: 1;
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.wki-onboard-track::-webkit-scrollbar { display: none; }

.wki-slide {
	min-width: 100%;
	width: 100%;
	max-width: 100%;
	flex: 0 0 100%;
	box-sizing: border-box;
	overflow: hidden;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 10px 26px 20px;
	gap: 18px;
}

.wki-slide > * { max-width: 100%; }

.wki-slide-media {
	width: min(72vw, 260px, 34vh);
	height: min(72vw, 260px, 34vh);
	border-radius: 26px;
	overflow: hidden;
	background: rgba(255, 255, 255, .05);
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, .09);
	flex-shrink: 0;
}

.wki-slide-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wki-slide-media svg {
	width: 42%;
	height: 42%;
	color: var(--wki-accent);
	opacity: .92;
}

.wki-slide h2 {
	font-size: 23px;
	line-height: 1.4;
	margin: 0;
	font-weight: 700;
	color: var(--wki-accent);
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.wki-slide p {
	margin: 0;
	font-size: 15px;
	line-height: 1.85;
	opacity: .8;
	max-width: min(400px, 100%);
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.wki-onboard-bottom {
	padding: 16px 26px calc(24px + var(--wki-sab));
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}

.wki-dots {
	display: flex;
	gap: 7px;
	align-items: center;
}

.wki-dots button {
	width: 7px;
	height: 7px;
	padding: 0;
	border: 0;
	border-radius: 99px;
	background: rgba(255, 255, 255, .26);
	cursor: pointer;
	transition: width .28s ease, background .28s ease;
}

.wki-dots button.wki-active {
	width: 22px;
	background: var(--wki-accent);
}

/* ------------------------------------------------------------ buttons */

.wki-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	font-size: 15px;
	line-height: 1;
	padding: 14px 30px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	transition: transform .15s ease, opacity .15s ease, background .2s ease;
	min-height: 46px;
}

.wki-btn:active { transform: scale(.97); }
.wki-btn:focus-visible { outline: 2px solid var(--wki-accent); outline-offset: 3px; }

.wki-btn-primary {
	background: var(--wki-accent);
	color: var(--wki-on-accent);
	min-width: 190px;
}

.wki-btn-ghost {
	background: rgba(255, 255, 255, .09);
	color: var(--wki-text);
	border: 1px solid rgba(255, 255, 255, .16);
}

.wki-btn-text {
	background: none;
	color: inherit;
	opacity: .65;
	padding: 12px 16px;
	min-width: 0;
}

/* --------------------------------------------------------- install card */

.wki-card {
	position: fixed;
	z-index: 2147483400;
	inset-inline: 14px;
	max-width: 460px;
	margin-inline: auto;
	background: var(--wki-bg);
	color: var(--wki-text);
	font-family: var(--wki-font);
	border-radius: var(--wki-radius);
	box-shadow: var(--wki-shadow);
	border: 1px solid rgba(255, 255, 255, .12);
	padding: 16px;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	transform: translateY(140%);
	opacity: 0;
	transition: transform .45s cubic-bezier(.2, .8, .3, 1), opacity .35s ease;
}

.wki-card.wki-pos-bottom {
	bottom: calc(16px + var(--wki-sab));
}

.wki-card.wki-pos-bottom.wki-with-nav {
	bottom: calc(16px + var(--wki-sab) + var(--wki-nav-h));
}

.wki-card.wki-pos-top {
	top: calc(16px + var(--wki-sat));
	bottom: auto;
	transform: translateY(-140%);
}

.wki-card.wki-in {
	transform: translateY(0);
	opacity: 1;
}

.wki-card-icon {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	object-fit: contain;
	background: rgba(255, 255, 255, .07);
	flex-shrink: 0;
	display: grid;
	place-items: center;
	color: var(--wki-accent);
}

.wki-card-icon svg { width: 24px; height: 24px; }

.wki-card-body { flex: 1; min-width: 0; }

.wki-card-title {
	font-weight: 700;
	font-size: 15px;
	margin-bottom: 4px;
	color: var(--wki-accent);
}

.wki-card-text {
	font-size: 13px;
	line-height: 1.7;
	opacity: .78;
	margin-bottom: 12px;
}

.wki-card-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.wki-card-actions .wki-btn {
	font-size: 14px;
	padding: 10px 20px;
	min-height: 40px;
	min-width: 0;
}

.wki-card-close {
	position: absolute;
	inset-inline-end: 8px;
	top: 8px;
	width: 28px;
	height: 28px;
	border: 0;
	background: rgba(255, 255, 255, .08);
	color: inherit;
	border-radius: 50%;
	cursor: pointer;
	display: grid;
	place-items: center;
	opacity: .7;
	font-size: 15px;
	line-height: 1;
}

.wki-card-close:hover { opacity: 1; }

/* ------------------------------------------------------------ ios hint */

.wki-ios-arrow {
	position: absolute;
	bottom: -9px;
	inset-inline-start: 50%;
	width: 18px;
	height: 18px;
	background: inherit;
	border-inline-end: 1px solid rgba(255, 255, 255, .12);
	border-bottom: 1px solid rgba(255, 255, 255, .12);
	transform: translateX(-50%) rotate(45deg);
}

/* --------------------------------------------------------- bottom nav */

.wki-nav {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 2147483300;
	background: color-mix(in srgb, var(--wki-bg) 92%, transparent);
	backdrop-filter: saturate(180%) blur(18px);
	-webkit-backdrop-filter: saturate(180%) blur(18px);
	border-top: 1px solid rgba(255, 255, 255, .1);
	padding-bottom: var(--wki-sab);
	padding-inline: max(var(--wki-sal), 4px) max(var(--wki-sar), 4px);
	font-family: var(--wki-font);
	transform: translateY(100%);
	transition: transform .35s cubic-bezier(.2, .8, .3, 1);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
	.wki-nav { background: var(--wki-bg); }
}

.wki-nav.wki-in { transform: translateY(0); }
.wki-nav.wki-hidden { transform: translateY(100%); }

.wki-nav-list {
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	height: var(--wki-nav-h);
	margin: 0;
	padding: 0;
	list-style: none;
}

.wki-nav-item {
	flex: 1;
	display: flex;
	min-width: 0;
}

.wki-nav-link {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	color: var(--wki-text);
	opacity: .62;
	text-decoration: none;
	font-size: 10.5px;
	font-weight: 500;
	padding: 6px 2px;
	transition: opacity .2s ease, color .2s ease;
	-webkit-tap-highlight-color: transparent;
	min-width: 0;
}

.wki-nav-link svg {
	width: 22px;
	height: 22px;
	stroke-width: 1.7;
	flex-shrink: 0;
}

.wki-nav-link span {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wki-nav-link:hover { opacity: .85; }

.wki-nav-link.wki-current {
	opacity: 1;
	color: var(--wki-accent);
}

body.wki-has-nav { padding-bottom: calc(var(--wki-nav-h) + var(--wki-sab)) !important; }

/* -------------------------------------------------------------- toast */

.wki-toast {
	position: fixed;
	z-index: 2147483450;
	inset-inline: 14px;
	bottom: calc(18px + var(--wki-sab));
	max-width: 420px;
	margin-inline: auto;
	background: var(--wki-bg);
	color: var(--wki-text);
	font-family: var(--wki-font);
	font-size: 14px;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, .13);
	box-shadow: var(--wki-shadow);
	padding: 13px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	transform: translateY(150%);
	opacity: 0;
	transition: transform .4s cubic-bezier(.2, .8, .3, 1), opacity .3s ease;
}

.wki-toast.wki-with-nav { bottom: calc(18px + var(--wki-sab) + var(--wki-nav-h)); }
.wki-toast.wki-in { transform: translateY(0); opacity: 1; }
.wki-toast-text { flex: 1; line-height: 1.6; }

.wki-toast-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #ef5350;
	flex-shrink: 0;
}

.wki-toast.wki-online .wki-toast-dot { background: #4caf50; }

.wki-toast .wki-btn {
	padding: 8px 16px;
	font-size: 13px;
	min-height: 34px;
	min-width: 0;
}

/* ----------------------------------------------------- top progress bar */

.wki-progress {
	position: fixed;
	top: 0;
	inset-inline-start: 0;
	height: 3px;
	width: 0;
	background: var(--wki-accent);
	z-index: 2147483550;
	transition: width .25s ease, opacity .35s ease;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 0 10px var(--wki-accent);
}

.wki-progress.wki-in { opacity: 1; }

/* --------------------------------------------------- pull to refresh */

.wki-pull {
	position: fixed;
	top: calc(var(--wki-sat) + 6px);
	inset-inline: 0;
	margin-inline: auto;
	z-index: 2147483520;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--wki-bg);
	border: 1px solid rgba(255, 255, 255, .14);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
	display: grid;
	place-items: center;
	opacity: 0;
	transform: translateY(-60px) scale(.8);
	pointer-events: none;
	color: var(--wki-accent);
}

.wki-pull svg { width: 20px; height: 20px; }
.wki-pull.wki-spin svg { animation: wki-spin .8s linear infinite; }

/* ------------------------------------------------------------ helpers */

/* --------------------------------------------- shortcodes in Elementor */

.wki-shortcode-install,
.wki-shortcode-intro {
	font-family: var(--wki-font);
	vertical-align: middle;
}

.wki-shortcode-install[hidden],
.wki-only-app[hidden] { display: none !important; }

.wki-shortcode-install svg { flex-shrink: 0; }

/* ------------------------------------------------------------ helpers */

.wki-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.wki-splash-inner,
	.wki-splash-logo { animation: none !important; }
	.wki-loader-ring,
	.wki-loader-dots span,
	.wki-loader-bar i,
	.wki-pull.wki-spin svg { animation: none !important; }
	#wki-splash,
	.wki-card,
	.wki-nav,
	.wki-toast,
	.wki-onboard { transition-duration: .01ms !important; }
}

/* Never let the app shell show up in print or in page builders. */
@media print {
	#wki-splash,
	.wki-nav,
	.wki-card,
	.wki-toast,
	.wki-onboard,
	.wki-progress,
	.wki-pull { display: none !important; }
}

body.elementor-editor-active .wki-nav,
body.elementor-editor-active .wki-card,
body.elementor-editor-active #wki-splash,
body.elementor-editor-active .wki-onboard { display: none !important; }
