/* Protected Course & Resource Manager -- frontend styles.
   Deliberately minimal/neutral so the active theme or Elementor styling
   controls final look and feel; only structural + accessibility rules
   live here, all class names are prefixed to avoid collisions. */

.pcr-notice {
	padding: 12px 16px;
	border-radius: 4px;
	background: #f0f6fc;
	border: 1px solid #c3d9ed;
}

.pcr-notice--error {
	background: #fcf0f1;
	border-color: #e5b3b8;
}

.pcr-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	text-decoration: none;
	font-weight: 600;
}

.pcr-btn--primary {
	background: #2271b1;
	color: #fff;
}

.pcr-btn--secondary {
	background: #f0f0f1;
	color: #1d2327;
}

/* Library grid */
.pcr-library__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
	margin-top: 16px;
}

.pcr-library__item {
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.pcr-library__thumb img {
	width: 100%;
	height: auto;
	display: block;
}

.pcr-library__details {
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.pcr-library__product-title {
	margin: 0;
	font-size: 16px;
}

/* Product resource page */
.pcr-product-resources__header {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	margin-bottom: 24px;
}

.pcr-product-resources__header img {
	max-width: 180px;
	height: auto;
	border-radius: 6px;
}

.pcr-product-resources__title {
	margin-top: 0;
}

.pcr-back-link {
	display: inline-block;
	margin-bottom: 16px;
}

.pcr-resource-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pcr-resource-card {
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	padding: 16px;
}

.pcr-resource-card__header {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 10px;
}

.pcr-resource-card__thumb img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 4px;
}

.pcr-resource-card__title {
	margin: 0 0 4px;
	font-size: 16px;
}

.pcr-resource-card__description {
	font-size: 14px;
	opacity: 0.85;
}

/* Modal / viewer */
.pcr-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
}

.pcr-modal.pcr-modal--open {
	display: block;
}

.pcr-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

.pcr-modal__dialog {
	position: relative;
	max-width: 900px;
	width: 92%;
	margin: 4vh auto;
	background: #fff;
	border-radius: 6px;
	padding: 16px;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
}

.pcr-modal__close {
	position: absolute;
	top: 8px;
	right: 12px;
	font-size: 28px;
	line-height: 1;
	background: none;
	border: none;
	cursor: pointer;
}

.pcr-modal__title {
	font-weight: 700;
	margin-bottom: 8px;
	padding-right: 30px;
}

.pcr-modal__body {
	flex: 1;
	overflow: auto;
}

/* PDF viewer */
.pcr-pdf-viewer__toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	border-bottom: 1px solid #eee;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.pcr-pdf-toolbar__spacer {
	flex: 1;
}

.pcr-pdf-viewer__canvas-wrap {
	overflow: auto;
	text-align: center;
	background: #525659;
	padding: 16px;
	border-radius: 4px;
	min-height: 300px;
	max-height: 75vh;
	scroll-behavior: smooth;
}

.pcr-pdf-pages {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.pcr-pdf-page {
	min-height: 400px; /* placeholder height before the canvas renders, avoids scroll jumps */
	display: flex;
	align-items: center;
	justify-content: center;
}

.pcr-pdf-canvas,
.pcr-pdf-page canvas {
	max-width: 100%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	background: #fff;
}

/* Video / audio */
.pcr-video-viewer__embed {
	position: relative;
	padding-top: 56.25%;
}

.pcr-video-viewer__embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.pcr-video-element {
	width: 100%;
	height: auto;
}

.pcr-audio-element {
	display: block;
	width: 100%;
	margin-top: 10px;
}

.pcr-audio-element:not([src]) {
	display: none;
}
