@charset "UTF-8";

/* =========================================================
   BACKEND
   ========================================================= */
.wp-admin .wrap #qcode_logo{
	position:absolute;
	width:35%;
	max-width:120px;
	right:20px;
	top:20px;
}

/* =========================================================
   KEYFRAMES (definiti una sola volta)
   ========================================================= */
@keyframes qpwa-slide-up {
	from { opacity:0; transform:translateY(20px); }
	to { opacity:1; transform:translateY(0); }
}

@keyframes qpwa-spin {
	from { transform:rotate(0deg); }
	to { transform:rotate(360deg); }
}

@keyframes qpwa-fadein {
	from { opacity:0; transform:translateY(-8px); }
	to { opacity:1; transform:translateY(0); }
}

/* =========================================================
   PRELOAD OVERLAY
   ========================================================= */
.qpwa-preload-spinner{
	display:flex;
	justify-content:center;
	align-items:center;
	margin-bottom:-10px;
}

.qpwa-preload-spinner img{
	width:80px;
	height:auto;
	animation:qpwa-spin 5s linear infinite;
	filter: invert(1) sepia(1) saturate(50) hue-rotate(90deg);
}

#qpwa-preload {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.6);
	backdrop-filter: blur(6px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qpwa-preload-box {
	background: #111;
	color: #fff;
	padding: 30px;
	border-radius: 14px;
	width: 320px;
	text-align: center;
	box-shadow: 0 20px 40px rgba(0,0,0,.4);
}

.qpwa-preload-current-file{
	display: block;
	padding-top: 10px;
	width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.qpwa-preload-bar {
	height: 8px;
	background: #333;
	border-radius: 8px;
	overflow: hidden;
	margin: 20px 0;
}

.qpwa-preload-progress {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg,#00c9ff,#92fe9d);
	transition: width .25s ease;
}

.qpwa-preload-percent {
	font-size: 14px;
	opacity: .8;
}

.qpwa-preload-actions {
	margin-top: 20px;
	display: flex;
	justify-content: space-between;
}

.qpwa-preload-actions button {
	background: none;
	border: 1px solid #555;
	color: #fff;
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
}

/* =========================================================
   INSTALL BANNER
   ========================================================= */
.qpwa-install-banner {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9999;
	min-width:33vw;
	background: var(--qpwa-banner-bg, #000);
	color: var(--qpwa-banner-text, #fff);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0,0,0,.3);
	font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.qpwa-install-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	gap: 12px;
}

.qpwa-install-text {
	font-size: 14px;
	line-height: 1.4;
	flex: 1;
}

.qpwa-install-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.qpwa-install,
.qpwa-close {
	border: none;
	border-radius: 8px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
}

.qpwa-install {
	background: #fff;
	color: #000;
}

.qpwa-close {
	background: transparent;
	color: inherit;
	font-size: 16px;
}

/* =========================================================
   POPUP AGGIORNAMENTI
   ========================================================= */
.qpwa-update-popup {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: rgba(30, 30, 30, 0.95);
	color: #fff;
	border-radius: 12px;
	padding: 16px 20px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	z-index: 10001;
	display: none;
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	animation: qpwa-slide-up 0.3s ease;
	max-width: 320px;
}

.qpwa-update-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
}

.qpwa-update-text {
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* rimuovi pseudo-elemento che creava doppia icona */
.qpwa-update-text::before {
	content: "" !important;
	display: none !important;
}

.qpwa-update-text span {
	font-size: 16px;
}

.qpwa-update-hide {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #fff;
	border-radius: 6px;
	padding: 6px 12px;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.qpwa-update-hide:hover {
	background: rgba(255, 255, 255, 0.25);
	border-color: rgba(255, 255, 255, 0.5);
}

/* =========================================================
   SETTINGS BACKEND - TABS
   ========================================================= */
.qpwa-settings .nav-tab-wrapper{
	border-bottom: 1px solid #3b3a3a !important;
}
.qpwa-settings .nav-tab{
	border: 1px solid #3b3a3a !important;
	border-bottom:none;
	margin-bottom:-1px;
	padding: 4px 24px;
	text-transform:uppercase;
	font-size:1em;
	font-weight:300;
	-webkit-border-radius: 8px 8px 0 0;
	-moz-border-radius: 8px 8px 0 0;
	border-radius: 8px 8px 0 0;
}
.qpwa-settings .nav-tab:focus,
.qpwa-settings .nav-tab:active {
	outline: none;
	box-shadow: none;
}
.qpwa-settings .nav-tab.nav-tab-active{
	border-bottom: 1px solid #f0f0f1 !important;
	color:#000000;
}

/* =========================================================
   SETTINGS BACKEND - FORM INPUTS
   ========================================================= */
.qpwa-settings input[type="number"],
.qpwa-settings input[type="text"],
.qpwa-settings input[type="email"],
.qpwa-settings input[type="password"],
.qpwa-settings select,
.qpwa-settings .regular-text{
	min-height:30px !important;
	width:100% !important;
	max-height:40px !important;
	max-width:500px;
	background-color:#ffffff !important;
	border:1px solid #434343;
	padding:0 8px;
	line-height: 1;
	font-size:16px;
	font-weight: 400 !important;
}
.qpwa-settings textarea{
	width:100% !important;
	max-width:500px;
	background-color:#ffffff !important;
	border:1px solid #434343;
	padding: 8px;
	line-height: 1;
	font-size:16px;
	font-weight: 400 !important;
}

/* =========================================================
   SETTINGS BACKEND - CHECKBOX SWITCH STYLE
   ========================================================= */
.qpwa-settings input[type="checkbox"]:focus,
.qpwa-settings input[type="checkbox"]:active {
	outline: none !important;
	box-shadow: none !important;
}
.qpwa-settings input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	width: 36px;
	height: 20px;
	background-color: #e5e5ea;
	border-radius: 14px;
	position: relative;
	cursor: pointer;
	transition: background-color 0.25s ease;
	outline: none;
	margin: 4px 10px 4px 0;
}
.qpwa-settings input[type="checkbox"]::before {
	content: "";
	position: absolute;
	top: 1px;
	left: 1px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,0.3);
	transition: transform 0.25s ease;
}
.qpwa-settings input[type="checkbox"]:checked {
	background-color: #34c759;
	outline: none;
	margin: 4px 10px 4px 0;
}
.qpwa-settings input[type="checkbox"]:checked::before {
	top: 4px;
	left: 1px;
	transform: translateX(20px);
}
.qpwa-settings input[type="checkbox"]:focus-visible {
	box-shadow: 0 0 0 2px rgba(52,199,89,0.35);
}

/* =========================================================
   SETTINGS BACKEND - INCLUDED PAGES LIST
   ========================================================= */
.qpwa-settings #qpwa_included_pages td{
	width:100% !important;
	max-width:500px;
	border:1px solid #434343;
	background:white;
	display:block;
	max-height:350px !important;
	overflow:hidden !important;
	overflow-y:auto !important;
}
.qpwa-settings #qpwa_included_pages td label{
	border-bottom: 1px solid #e2e2e2 !important;
}

/* =========================================================
   ADMIN STYLES - METABOX
   ========================================================= */
.wp-admin .qpwa-meta-hint { font-size:12px; color:#666; margin-top:6px; }
.wp-admin .qpwa-meta-active { color:#0a7; font-weight:600; }
.wp-admin .qpwa-meta-warning { color:#c33; font-weight:600; }

.qpwa-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	vertical-align: middle;
}

.qpwa-switch input { opacity: 0; width: 0; height: 0; }

.qpwa-slider {
	position: absolute;
	cursor: pointer;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: #ccc;
	transition: .2s;
	border-radius: 24px;
}

.qpwa-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .2s;
	border-radius: 50%;
}

.qpwa-switch input:checked + .qpwa-slider { background-color: #2271b1; }
.qpwa-switch input:checked + .qpwa-slider:before { transform: translateX(20px); }

.qpwa-hint { font-size:12px; color:#646970; margin-top:4px; max-width:520px; }
.qpwa-settings .form-table tr { border-bottom:1px solid #eee; }
.qpwa-settings .form-table th { width:260px; font-weight:600; }

.qpwa-badge {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 11px;
	line-height: 1.4;
	margin-right: 4px;
}

.qpwa-badge-lock { background:#f0f6fc; color:#0969da; }
.qpwa-badge-pwa { background:#fef7e0; color:#9a6700; }

.qpwa-settings .submit { margin-top:20px; }

.qpwa-alert {
	position: fixed;
	top: 20px;
	right: 20px;
	background: rgba(30,30,30,0.95);
	color: #fff;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	box-shadow: 0 8px 24px rgba(0,0,0,.25);
	z-index: 10000;
	animation: qpwa-fadein .25s ease;
}

/* =========================================================
   SETTINGS - MENU POSITION PREVIEW (miniatura nel backend)
   ========================================================= */
.qpwa-menu-preview-wrap {
	display: block;
	margin-top:0 !important;
	margin-bottom:20px !important;
}
.qpwa-menu-preview-device {
	position: relative;
	width: 160px;
	height: 100px;
	background: #d0d0d0;
	border-radius: 8px;
	border: 2px solid #999;
	overflow: hidden;
}
.qpwa-menu-preview-nav {
	position: absolute;
	display: flex;
	gap: 2px;
	background: #222;
	border-radius: 4px;
	padding: 3px 6px;
}
.qpwa-menu-preview-nav::after {
	content: "\2302  \2039  \2191  \2193";
	color: #fff;
	font-size: 10px;
	font-family: sans-serif;
	white-space: nowrap;
	display: flex;
	align-items: center;
	letter-spacing: 3px;
}

/* Preview: in basso centrato */
.qpwa-mp-bottom-center {
	bottom: 6px;
	left: 50%;
	transform: translateX(-50%);
	flex-direction: row;
}
/* Preview: in basso a sinistra */
.qpwa-mp-bottom-left {
	bottom: 6px;
	left: 6px;
	flex-direction: row;
}
/* Preview: laterale sinistra */
.qpwa-mp-left {
	top: 50%;
	left: 4px;
	transform: translateY(-50%);
	flex-direction: column;
	padding: 6px 3px;
}
.qpwa-mp-left::after {
	writing-mode: vertical-lr;
	text-orientation: mixed;
	letter-spacing: 4px;
}
/* Preview: laterale destra */
.qpwa-mp-right {
	top: 50%;
	right: 4px;
	transform: translateY(-50%);
	flex-direction: column;
	padding: 6px 3px;
}
.qpwa-mp-right::after {
	writing-mode: vertical-lr;
	text-orientation: mixed;
	letter-spacing: 4px;
}

/* =========================================================
   PWA MENU - FRONTEND NAVIGATION (dentro la PWA installata)
   ========================================================= */
.qpwa-menu {
	position: fixed;
	z-index: 99999;
	display: flex;
	gap: 0;
	background: rgba(0, 0, 0, 0.92);
	border-radius: 12px;
	padding: 0;
	box-shadow: 0 4px 20px rgba(0,0,0,0.4);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	touch-action: manipulation;
}

.qpwa-menu-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 0;
	margin: 0;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s ease;
	position: relative;
}

.qpwa-menu-btn:active {
	background: rgba(255,255,255,0.15);
}

.qpwa-menu-btn svg {
	pointer-events: none;
}

/* separatore tra pulsanti orizzontali */
.qpwa-pos-bottom-center .qpwa-menu-btn + .qpwa-menu-btn::before,
.qpwa-pos-bottom-left .qpwa-menu-btn + .qpwa-menu-btn::before {
	content: "";
	position: absolute;
	left: 0;
	top: 8px;
	bottom: 8px;
	width: 1px;
	background: rgba(255,255,255,0.15);
}

/* separatore tra pulsanti verticali */
.qpwa-pos-left .qpwa-menu-btn + .qpwa-menu-btn::before,
.qpwa-pos-right .qpwa-menu-btn + .qpwa-menu-btn::before {
	content: "";
	position: absolute;
	top: 0;
	left: 8px;
	right: 8px;
	height: 1px;
	background: rgba(255,255,255,0.15);
}

/* --- POSIZIONE: In basso centrato (default) --- */
.qpwa-menu.qpwa-pos-bottom-center {
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	flex-direction: row;
}
.qpwa-menu.qpwa-pos-bottom-center .qpwa-menu-btn:first-child { border-radius: 12px 0 0 12px; }
.qpwa-menu.qpwa-pos-bottom-center .qpwa-menu-btn:last-child { border-radius: 0 12px 12px 0; }

/* --- POSIZIONE: In basso a sinistra --- */
.qpwa-menu.qpwa-pos-bottom-left {
	bottom: 20px;
	left: 20px;
	flex-direction: row;
}
.qpwa-menu.qpwa-pos-bottom-left .qpwa-menu-btn:first-child { border-radius: 12px 0 0 12px; }
.qpwa-menu.qpwa-pos-bottom-left .qpwa-menu-btn:last-child { border-radius: 0 12px 12px 0; }

/* --- POSIZIONE: Laterale sinistra --- */
.qpwa-menu.qpwa-pos-left {
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	flex-direction: column;
}
.qpwa-menu.qpwa-pos-left .qpwa-menu-btn:first-child { border-radius: 12px 12px 0 0; }
.qpwa-menu.qpwa-pos-left .qpwa-menu-btn:last-child { border-radius: 0 0 12px 12px; }

/* --- POSIZIONE: Laterale destra --- */
.qpwa-menu.qpwa-pos-right {
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	flex-direction: column;
}
.qpwa-menu.qpwa-pos-right .qpwa-menu-btn:first-child { border-radius: 12px 12px 0 0; }
.qpwa-menu.qpwa-pos-right .qpwa-menu-btn:last-child { border-radius: 0 0 12px 12px; }

/* =========================================================
   PWA MODE - NASCONDI MENU SITO (tema Salient)
   Solo quando la classe qpwa-active e presente sul body
   ========================================================= */

body.qpwa-active #header-outer,
body.qpwa-active header#top,
body.qpwa-active #header-space,
body.qpwa-active #mobile-menu {
	display: none !important;
}


/* compenso per header rimosso */
body.qpwa-active {
	padding-top: 0 !important;
	margin-top: 0 !important;
}
body.qpwa-active #ajax-content-wrap,
body.qpwa-active .container-wrap {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* =========================================================
   VIDEO PLAYER FULLSCREEN CUSTOM
   ========================================================= */
.qpwa-video-overlay {
	position: fixed;
	inset: 0;
	background: #000;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qpwa-video-overlay video {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.qpwa-video-controls {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 0;
	background: rgba(0, 0, 0, 0.92);
	border-radius: 12px;
	padding: 0 4px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.4);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	touch-action: manipulation;
	min-width: 260px;
	max-width: 90vw;
}

.qpwa-vc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 48px;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.qpwa-vc-btn:active {
	background: rgba(255,255,255,0.15);
	border-radius: 8px;
}

.qpwa-vc-btn svg {
	pointer-events: none;
}

.qpwa-vc-timeline {
	flex: 1;
	height: 48px;
	display: flex;
	align-items: center;
	padding: 0 6px;
	min-width: 0;
}

.qpwa-vc-timeline input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 4px;
	background: rgba(255,255,255,0.25);
	border-radius: 2px;
	outline: none;
	cursor: pointer;
}

.qpwa-vc-timeline input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	background: #fff;
	border-radius: 50%;
	border: none;
	box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.qpwa-vc-timeline input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	background: #fff;
	border-radius: 50%;
	border: none;
}

/* === LANGUAGE PICKER nel PWAMenu === */
.qpwa-lang-picker {
	position: relative;
}
.qpwa-lang-label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.5px;
}
.qpwa-lang-dropdown {
	position: absolute;
	bottom: 100%;
	right: 0;
	flex-direction: column;
	background: rgba(30, 30, 30, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 8px;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
	border: 1px solid rgba(255, 255, 255, 0.1);
}
.qpwa-lang-opt {
	background: none;
	border: none;
	color: #fff;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	letter-spacing: 0.5px;
	transition: background 0.2s;
}
.qpwa-lang-opt:hover {
	background: rgba(255, 255, 255, 0.15);
}
.qpwa-lang-opt + .qpwa-lang-opt {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}
/* =========================================================
   PDF VIEWER FULLSCREEN
   ========================================================= */
.qpwa-pdf-overlay {
	position: fixed;
	inset: 0;
	background: #1a1a1a;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.qpwa-pdf-title {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 10px 16px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	background: rgba(0,0,0,0.6);
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	z-index: 2;
	/* Nascosto per ora: rimuovere questa riga per mostrare il titolo */
	display: none;
}

.qpwa-pdf-canvas-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: auto;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 20px 10px 100px 10px;
	box-sizing: border-box;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y pinch-zoom;
}

.qpwa-pdf-canvas {
	display: block;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0,0,0,0.5);
	max-width: none;
	height: auto;
}

.qpwa-pdf-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(26,26,26,0.85);
	pointer-events: none;
}

.qpwa-pdf-spinner {
	width: 48px;
	height: 48px;
	border: 4px solid rgba(255,255,255,0.15);
	border-top-color: #fff;
	border-radius: 50%;
	animation: qpwa-spin 1s linear infinite;
}

.qpwa-pdf-error {
	color: #ff6b6b;
	font-size: 14px;
	padding: 20px;
	text-align: center;
}

/* Barra comandi PDF - riusa le classi .qpwa-menu e .qpwa-pos-* */
.qpwa-pdf-menu {
	z-index: 999999;
}

/* Indicatore pagina corrente/totale */
.qpwa-pdf-page-indicator {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 0 8px;
	user-select: none;
	-webkit-user-select: none;
	white-space: nowrap;
}

/* In modalita' verticale (menu laterale left/right) nascondi l'indicatore.
   Per mostrarlo, commentare queste due regole. */
.qpwa-pdf-menu.qpwa-pos-left .qpwa-pdf-page-indicator,
.qpwa-pdf-menu.qpwa-pos-right .qpwa-pdf-page-indicator {
	display: none;
}

/* Separatori tra indicatore e bottoni adiacenti (solo orizzontale) */
.qpwa-pdf-menu.qpwa-pos-bottom-center .qpwa-pdf-page-indicator + .qpwa-menu-btn::before,
.qpwa-pdf-menu.qpwa-pos-bottom-left .qpwa-pdf-page-indicator + .qpwa-menu-btn::before {
	content: "";
	position: absolute;
	left: 0;
	top: 8px;
	bottom: 8px;
	width: 1px;
	background: rgba(255,255,255,0.15);
}