/**
 * Global mobile “app shell” — not the theme’s default responsive layout.
 * Active at max-width: 1024px. Desktop unchanged.
 */

/* --- Hide app chrome on large screens --- */
#vjob-mobile-app-chrome,
#vjob-app-tabbar {
	display: none;
}

@media screen and (max-width: 1024px) {
	/* Show our chrome + sticky tab bar */
	#vjob-mobile-app-chrome {
		display: block;
	}

	#vjob-app-tabbar {
		display: flex;
	}

	html,
	body {
		overflow-x: hidden;
		max-width: 100%;
	}

	/* Kill “responsive website” chrome: marquee, theme header, title strip */
	#zeytooon,
	#wt-header,
	.wt-appavailable,
	.preloader-outer,
	.elementor-location-header {
		display: none !important;
	}

	/* Default Workreap title / breadcrumb strip — app uses top bar instead */
	.wt-innerbannerholder,
	.wt-innerbanner,
	.wt-breadcrumb,
	.wt-breadcrumbs {
		display: none !important;
	}

	/* Keep homepage hero builders if they are NOT inside titlebar */
	/* (If your home hero disappears, set that row to Elementor full-width or disable default titlebar for the front page.) */

	/* Main column: app-like canvas */
	body {
		background: #eceff4 !important;
		padding-bottom: 0 !important;
	}

	#wt-wrapper {
		padding-top: 0 !important;
	}

	/* Space for top bar + sticky tab bar */
	#wt-main,
	main#wt-main,
	body .wt-main {
		padding-top: calc(52px + env(safe-area-inset-top, 0px)) !important;
		min-height: 50vh;
		padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* --- Injected top bar --- */
	.vjob-mobile-app-chrome {
		position: relative;
		z-index: 1020;
	}

	.vjob-app-topbar {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 1020;
		display: flex;
		align-items: center;
		gap: 10px;
		min-height: 52px;
		padding: env(safe-area-inset-top, 0px) 12px 0 12px;
		background: linear-gradient(180deg, #1b2838 0%, #15202b 100%);
		color: #f1f5f9;
		box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
	}

	.vjob-app-topbar__menu {
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 12px;
		background: rgba(255, 255, 255, 0.1);
		color: inherit;
		cursor: pointer;
	}

	.vjob-app-topbar__menu-icon {
		display: block;
		width: 20px;
		height: 2px;
		background: currentColor;
		box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
		border-radius: 1px;
	}

	.vjob-app-topbar__brand {
		flex: 1;
		min-width: 0;
		display: flex;
		align-items: center;
		gap: 10px;
		color: inherit;
		text-decoration: none;
	}

	.vjob-app-topbar__logo {
		width: 36px;
		height: 36px;
		object-fit: contain;
		border-radius: 8px;
		background: rgba(255, 255, 255, 0.08);
	}

	.vjob-app-topbar__title {
		font-size: 1.02rem;
		font-weight: 700;
		letter-spacing: 0.02em;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.vjob-app-topbar__actions {
		display: flex;
		align-items: center;
		gap: 6px;
		flex-shrink: 0;
		max-width: 46%;
	}

	.vjob-app-topbar__action {
		flex-shrink: 0;
		padding: 8px 10px;
		border-radius: 10px;
		background: rgba(255, 255, 255, 0.14);
		color: #fff !important;
		text-decoration: none !important;
		font-size: 0.78rem;
		font-weight: 600;
		white-space: nowrap;
	}

	.vjob-app-topbar__action--secondary {
		background: transparent;
		border: 1px solid rgba(255, 255, 255, 0.38);
	}

	/* Backdrop */
	.vjob-app-backdrop {
		position: fixed;
		inset: 0;
		z-index: 1024;
		background: rgba(10, 15, 22, 0.48);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.25s ease;
	}

	html.vjob-mobile-drawer-open .vjob-app-backdrop {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	/* Drawer — under modals (Bootstrap ~1050) */
	.vjob-app-drawer {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1030;
		width: min(90vw, 300px);
		height: 100%;
		max-height: 100dvh;
		background: #fff;
		box-shadow: 8px 0 40px rgba(0, 0, 0, 0.15);
		transform: translateX(-108%);
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
		display: flex;
		flex-direction: column;
	}

	html.vjob-mobile-drawer-open .vjob-app-drawer {
		transform: translateX(0);
	}

	.vjob-app-drawer__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 16px 12px;
		border-bottom: 1px solid #e5e9f0;
	}

	.vjob-app-drawer__head-title {
		font-size: 1.1rem;
		font-weight: 700;
		color: #1a2332;
	}

	.vjob-app-drawer__close {
		width: 40px;
		height: 40px;
		border: 0;
		border-radius: 10px;
		background: #eef2f7;
		font-size: 1.5rem;
		line-height: 1;
		cursor: pointer;
		color: #1a2332;
	}

	.vjob-app-drawer__nav {
		flex: 1;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
		padding: 12px 10px 24px;
	}

	.vjob-app-drawer__list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.vjob-app-drawer__list > li {
		margin: 0 0 4px;
	}

	.vjob-app-drawer__list > li > a {
		display: block;
		padding: 14px 14px;
		border-radius: 12px;
		color: #1a2332;
		text-decoration: none !important;
		font-weight: 600;
		font-size: 0.95rem;
	}

	.vjob-app-drawer__list > li > a:hover,
	.vjob-app-drawer__list > li > a:focus {
		background: #eef2f7;
	}

	.vjob-app-drawer__list .sub-menu {
		list-style: none;
		margin: 4px 0 0;
		padding: 0 0 0 12px;
	}

	.vjob-app-drawer__list .sub-menu a {
		display: block;
		padding: 10px 12px;
		font-size: 0.88rem;
		font-weight: 500;
		color: #4a5568;
		text-decoration: none !important;
		border-radius: 8px;
	}

	/* Strip full site chrome: footer, sidebars, Elementor footers, old PWA bottom plugin */
	#wt-footer,
	.elementor-location-footer,
	aside#wt-sidebar,
	.sidebar-section,
	.wt-sidebar.page-dynamic-sidebar {
		display: none !important;
	}

	#pwaforwp-nbfp-menu-wrapper,
	.pwaforwp-nav-menu-class {
		display: none !important;
	}

	/* Sticky bottom tab bar (Browse jobs · Search freelancers · … · Support · Post job) */
	.vjob-app-tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1040;
		display: flex;
		justify-content: space-around;
		align-items: stretch;
		min-height: 58px;
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
		margin: 0;
		background: #0b1220;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
		box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
		-webkit-tap-highlight-color: transparent;
	}

	.vjob-app-tabbar__item {
		flex: 1 1 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-width: 0;
		padding: 4px 2px;
		color: rgba(255, 255, 255, 0.5) !important;
		text-decoration: none !important;
		font-size: 9px;
		font-weight: 700;
		letter-spacing: 0.02em;
		line-height: 1.15;
		text-align: center;
	}

	.vjob-app-tabbar__item.is-active {
		color: #7dd3fc !important;
	}

	.vjob-app-tabbar__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 26px;
		height: 26px;
		color: inherit;
	}

	.vjob-app-tabbar__icon svg {
		display: block;
		width: 22px;
		height: 22px;
	}

	.vjob-app-tabbar__label {
		display: block;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* Containers: less “boxed website”, more full bleed */
	#wt-main .container {
		padding-left: 12px;
		padding-right: 12px;
	}

	/* Standalone installed PWA */
	@media (display-mode: standalone) {
		.vjob-app-topbar {
			padding-top: max(env(safe-area-inset-top), 8px);
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.vjob-app-drawer,
	.vjob-app-backdrop {
		transition: none !important;
	}
}
