/**
 * Quizpio Pro — certificates view + print sheet (P18).
 * Shared by the front end (host/player final screens) and the admin
 * Sessions detail page; enqueued only where a certificate surface exists.
 */

/* ---- The view overlay ---- */
.qp-pro-certview-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99990;
	background: rgba( 20, 21, 38, 0.55 );
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4vh 16px;
	overflow-y: auto;
}

.qp-pro-certview {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 18px 44px rgba( 20, 21, 38, 0.28 );
	width: 100%;
	max-width: 860px;
	overflow: hidden;
	font-size: 14px;
	color: #1f2430;
}

.qp-pro-certview-head {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	padding: 16px 20px;
	border-bottom: 1px solid #e7e9f2;
}

.qp-pro-certview-head h2 {
	margin: 0;
	font-size: 17px;
	line-height: 1.3;
}

.qp-pro-certview-meta {
	color: #6b7280;
	font-size: 12.5px;
	margin-top: 2px;
}

.qp-pro-certview-spacer { flex: 1; }

.qp-pro-certview-close {
	background: none;
	border: 0;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 4px 8px;
}

.qp-pro-cert-btn {
	display: inline-block;
	border-radius: 999px;
	padding: 9px 20px;
	font-weight: 700;
	font-size: 13.5px;
	cursor: pointer;
	border: 0;
	background: #4f46e5;
	color: #fff;
}

.qp-pro-cert-btn:hover { background: #3730a3; }

.qp-pro-cert-btn[disabled] {
	opacity: 0.55;
	cursor: default;
}

.qp-pro-cert-btn-ghost {
	background: #fff;
	color: #1f2430;
	border: 1px solid #d6d8e4;
}

.qp-pro-cert-btn-ghost:hover { background: #f4f5fa; }

/* OI-33 — Print View's open state.
   Deliberately NOT the solid indigo of .qp-pro-cert-btn: that colour belongs to
   Download, the one button on this screen doing the main job, and a toggle
   borrowing it would compete with it. A tint plus the accent border reads as
   ENGAGED rather than PRIMARY, and visibly parents the range buttons beneath.
   Hooked on the ARIA attribute rather than a class so the accessible state and
   the visible state are one fact and cannot drift apart. */
.qp-pro-cert-btn-ghost[aria-expanded="true"] {
	background: #eef0fb;
	border-color: #4f46e5;
	color: #312e81;
}

.qp-pro-cert-btn-ghost[aria-expanded="true"]:hover { background: #e4e7f8; }

.qp-pro-certview table {
	width: 100%;
	border-collapse: collapse;
}

.qp-pro-certview th,
.qp-pro-certview td {
	text-align: left;
	padding: 10px 20px;
	border-bottom: 1px solid #eef0f6;
}

.qp-pro-certview th {
	color: #6b7280;
	font-size: 11.5px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.qp-pro-certview td.qp-num { text-align: right; }

.qp-pro-certview .qp-pro-cert-rowdl {
	background: #fff;
	color: #4f46e5;
	border: 1.5px solid #4f46e5;
	border-radius: 999px;
	padding: 5px 14px;
	font-weight: 700;
	font-size: 12.5px;
	cursor: pointer;
}

.qp-pro-certview .qp-pro-cert-rowdl:hover { background: #eef0ff; }

.qp-pro-certview-foot {
	padding: 10px 20px 14px;
	color: #6b7280;
	font-size: 12px;
}

.qp-pro-certview-empty {
	padding: 26px 20px;
	color: #6b7280;
	text-align: center;
}

/* Print-range chooser (rosters above one page). */
.qp-pro-cert-ranges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	padding: 10px 20px 4px;
}


/* ---- The print sheet ---- */
.qp-pro-certsheet {
	position: fixed;
	inset: 0;
	z-index: 99995;
	background: #f2f3f7;
	overflow-y: auto;
	padding: 24px 16px 60px;
}

.qp-pro-certsheet-bar {
	max-width: 900px;
	margin: 0 auto 16px;
	display: flex;
	gap: 10px;
	align-items: center;
}

.qp-pro-certsheet-progress {
	color: #6b7280;
	font-size: 13px;
}

.qp-pro-certsheet-page {
	max-width: 900px;
	margin: 0 auto 22px;
	background: #fff;
	box-shadow: 0 6px 18px rgba( 20, 21, 38, 0.12 );
}

.qp-pro-certsheet-page img {
	display: block;
	width: 100%;
	height: auto;
}

/* OI-28: WP's admin bar is fixed at z-index 99999 and overlaps our fixed
   overlays, jamming the toolbar under it. Drop them below the bar (32px
   desktop, 46px on the taller mobile bar). Print is unaffected: the sheet
   goes static and the bar is hidden. */
.admin-bar .qp-pro-certsheet,
.admin-bar .qp-pro-certview-backdrop {
	top: 32px;
}
@media screen and ( max-width: 782px ) {
	.admin-bar .qp-pro-certsheet,
	.admin-bar .qp-pro-certview-backdrop {
		top: 46px;
	}
}

@media print {
	/* Only the sheet prints; one certificate per page. */
	body.qp-pro-printing > :not( .qp-pro-certsheet ) { display: none !important; }
	body.qp-pro-printing .qp-pro-certsheet {
		position: static;
		background: none;
		padding: 0;
		overflow: visible;
	}
	body.qp-pro-printing .qp-pro-certsheet-bar { display: none; }
	body.qp-pro-printing .qp-pro-certsheet-page {
		box-shadow: none;
		margin: 0;
		max-width: none;
		page-break-after: always;
	}
}
