/**
 * The installed app's standalone mode has no browser chrome at all - no
 * address bar, no back button - so a page reached by tapping a link with
 * no way back (the All Access Pass, the Course Catalogue, ...) can strand
 * someone there. This bar is the fix: Back / Home / Forward, fixed to the
 * bottom of the screen, shown only inside the installed app and only on
 * pages that don't already have Student Dashboard Pro's own tab bar.
 *
 * Visual language matches this plugin's own floating QR scan button
 * (assets/js/sws-pwa-qr-scanner.js: #235af3 SWS blue, safe-area-aware
 * bottom offset) rather than attempting a byte-for-byte clone of the
 * vendor dashboard's own mobile tab bar - that bar's exact styling lives
 * in vendor CSS this plugin has no hook into, and literally reusing its
 * markup isn't possible outside a page that renders the [lmsc_dashboard]
 * shortcode in the first place (see class-sws-pwa-navbar.php's docblock).
 */
#sws-pwa-navbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999990;
	display: flex;
	align-items: stretch;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	box-shadow: 0 -2px 10px rgba(15, 30, 45, 0.08);
	padding-bottom: env(safe-area-inset-bottom);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#sws-pwa-navbar .sws-pwa-navbar__btn {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 8px 4px 6px;
	min-height: 52px;
	color: #4a5b6b !important;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
}

#sws-pwa-navbar .sws-pwa-navbar__btn:active {
	background: #f2f8fd;
}

#sws-pwa-navbar .sws-pwa-navbar__btn svg {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

/* The center Home/Log In button reads as the primary action - SWS blue,
   both icon and label, where Back/Forward stay neutral gray. */
#sws-pwa-navbar .sws-pwa-navbar__btn--primary {
	color: #235af3 !important;
}

/* Added to <body> only by the bar's own script, only once it actually
   inserts the bar (standalone + eligible page) - so a normal browser tab
   visit is never affected. Keeps the bar from covering the page's own
   last bit of content. */
body.sws-pwa-has-navbar {
	padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
}

/* v1.8.1 - never sit on top of the cookie-consent banner. Complianz's banner
   (z-index 99999, fixed to the bottom of the screen) keeps its Acknowledge /
   Deny / Preferences buttons in the same strip this bar occupies, and this
   bar's higher z-index left those buttons mostly covered - in the installed
   app (which starts with no saved consent) that made the banner very hard to
   answer. Complianz adds .cmplz-show to the banner only while it is open and
   removes it when answered (confirmed in its own cookiebanner/js/complianz.js),
   so the bar simply steps aside until then and returns right after. */
body:has(.cmplz-cookiebanner.cmplz-show) #sws-pwa-navbar {
	display: none !important;
}
