﻿/**
 * PWA Suite — Install Prompt Banner
 *
 * A non-intrusive, accessible banner that invites users to install the PWA.
 * Slides in from the bottom. Dismissed state persists via JS localStorage.
 *
 * Security note: no dynamic content is injected into this stylesheet.
 * All banner text is set via PHP (wp_localize_script) and inserted as
 * textContent (never innerHTML) in install-banner.js.
 */

/* ============================================================
   Banner container
   ============================================================ */

.pwa-suite-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99999;

	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;

	background: #1e1e2e;
	color: #fff;
	box-shadow: 0 -2px 16px rgba(0, 0, 0, .35);

	/* Slide-up animation */
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);

	/* Ensure banner is readable on all backgrounds */
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

.pwa-suite-banner.is-visible {
	transform: translateY(0);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
	.pwa-suite-banner {
		transition: none;
	}
}

/* ============================================================
   App icon
   ============================================================ */

.pwa-suite-banner__icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	object-fit: contain;
	background: rgba(255, 255, 255, .1);
}

/* ============================================================
   Text block
   ============================================================ */

.pwa-suite-banner__text {
	flex: 1;
	min-width: 0; /* allow text to shrink on small screens */
}

.pwa-suite-banner__title {
	font-weight: 700;
	font-size: 15px;
	margin: 0 0 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pwa-suite-banner__desc {
	font-size: 13px;
	opacity: .8;
	margin: 0;
}

/* ============================================================
   Action buttons
   ============================================================ */

.pwa-suite-banner__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.pwa-suite-banner__install {
	padding: 8px 18px;
	background: #4f8ef7;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
	white-space: nowrap;
}

.pwa-suite-banner__install:hover {
	background: #3a78e0;
}

.pwa-suite-banner__install:active {
	transform: scale(.97);
}

.pwa-suite-banner__install:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.pwa-suite-banner__dismiss {
	padding: 6px;
	background: transparent;
	color: rgba(255, 255, 255, .7);
	border: none;
	border-radius: 4px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s ease;
	/* Provide a minimum tap target of 44×44 px for touch */
	min-width: 36px;
	min-height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pwa-suite-banner__dismiss:hover {
	color: #fff;
}

.pwa-suite-banner__dismiss:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* ============================================================
   Responsive — stack vertically on very narrow screens
   ============================================================ */

@media (max-width: 420px) {
	.pwa-suite-banner {
		flex-wrap: wrap;
		padding: 12px 16px;
	}

	.pwa-suite-banner__text {
		flex-basis: calc(100% - 60px);
	}

	.pwa-suite-banner__actions {
		flex-basis: 100%;
		justify-content: flex-end;
		margin-top: 8px;
	}
}

/* ============================================================
   Dark-mode aware — keep contrast on dark OS themes
   ============================================================ */

@media (prefers-color-scheme: dark) {
	.pwa-suite-banner {
		background: #111122;
	}
}
