/* Materials List */
.sjd-materials-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin-top: 20px;
}

.sjd-material-item {
	border: 1px solid #eee;
	padding: 20px;
	border-radius: 8px;
	background: #fff;
	display: flex;
	gap: 15px;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sjd-material-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sjd-material-icon {
	flex-shrink: 0;
}

.sjd-material-icon svg {
	display: block;
}

.sjd-material-content {
	flex: 1;
	min-width: 0;
}

.sjd-material-item h3 {
	margin: 0 0 10px 0;
	font-size: 18px;
	line-height: 1.4;
}

.sjd-material-item h3 a {
	text-decoration: none;
	color: #333;
}

.sjd-material-item h3 a:hover {
	color: #0073aa;
}

.sjd-material-meta {
	display: flex;
	gap: 15px;
	font-size: 14px;
	color: #666;
}

.sjd-material-type {
	font-weight: 600;
	text-transform: uppercase;
	font-size: 12px;
}

.sjd-material-downloads::before {
	content: "📥 ";
}

/* Category Filters */
.sjd-category-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
}

.sjd-filter-btn {
	padding: 10px 20px;
	border: 2px solid #e0e0e0;
	background: #fff;
	color: #333;
	border-radius: 25px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 14px;
	font-weight: 500;
}

.sjd-filter-btn:hover {
	border-color: #0073aa;
	color: #0073aa;
}

.sjd-filter-btn.active {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

/* Loading state */
.sjd-materials-container.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Pagination */
.sjd-pagination {
	margin-top: 30px;
	text-align: center;
}

.sjd-pagination .page-numbers {
	display: inline-block;
	padding: 8px 12px;
	margin: 0 4px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
}

.sjd-pagination .page-numbers:hover,
.sjd-pagination .page-numbers.current {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

/* Single Material */
.sjd-material-container {
	margin-top: 30px;
	border-top: 1px solid #eee;
	padding-top: 20px;
}

/* PDF Viewer */
.sjd-pdf-viewer-container {
	background: #525659;
	padding: 10px;
	border-radius: 8px;
	text-align: center;
}

.sjd-canvas-wrapper {
	overflow: auto;
	margin: 10px 0;
	display: flex;
	justify-content: center;
}

.sjd-pdf-canvas {
	max-width: 100%;
	height: auto;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sjd-pdf-controls {
	margin: 10px 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	/* Increased gap */
	background: rgba(0, 0, 0, 0.2);
	padding: 12px 20px;
	/* Increased padding */
	border-radius: 6px;
	flex-wrap: wrap;
}

.sjd-pdf-nav {
	display: flex;
	align-items: center;
	gap: 20px;
	/* Increased gap between nav buttons */
}

/* High Specificity Selectors to override Theme */
body .sjd-pdf-controls button,
body .sjd-pdf-controls .sjd-download-button,
body .sjd-download-section .sjd-download-button,
a.button.sjd-download-button {
	padding: 10px 20px;
	/* Larger touch target */
	background-color: #8A8635 !important;
	color: #fff !important;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-block;
	line-height: normal;
	margin: 0;
	/* Reset margins */
}

body .sjd-pdf-controls button:hover,
body .sjd-pdf-controls .sjd-download-button:hover,
body .sjd-download-section .sjd-download-button:hover,
a.button.sjd-download-button:hover {
	background-color: #6d6a2a !important;
	color: #fff !important;
	transform: translateY(-1px);
}

body .sjd-pdf-controls button:disabled {
	background-color: #999 !important;
	cursor: not-allowed;
	opacity: 0.7;
	transform: none;
}

.sjd-pdf-page-info {
	color: #fff;
	font-size: 14px;
	font-weight: 500;
}

/* Audio Player */
.sjd-audio-player {
	margin: 20px 0;
}

.sjd-audio-player audio {
	width: 100%;
	max-width: 600px;
}

/* Download Section (for Audio/Other) */
.sjd-download-section {
	margin: 10px 0;
	text-align: center;
}

/* No materials message */
.sjd-no-materials {
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
	.sjd-materials-list {
		grid-template-columns: 1fr;
	}

	.sjd-category-filters {
		justify-content: center;
	}

	.sjd-pdf-controls {
		flex-direction: column;
		gap: 10px;
	}
}

/* =========================================
   New Card Layout (layout="cards")
   ========================================= */

.sjd-layout-cards .sjd-materials-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 30px;
}

.sjd-material-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.sjd-material-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.sjd-card-image {
	position: relative;
	padding-top: 60%;
	/* Aspect ratio 16:9 approx */
	background: #f5f5f5;
	overflow: hidden;
}

.sjd-card-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.sjd-material-card:hover .sjd-card-image img {
	transform: scale(1.05);
}

.sjd-placeholder-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f2f5;
}

.sjd-placeholder-image svg {
	width: 64px;
	height: 64px;
	opacity: 0.5;
}

.sjd-card-content {
	padding: 15px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.sjd-card-content h3 {
	margin: 0;
	font-size: 16px;
	/* Smaller title */
	font-weight: 600;
	line-height: 1.3;
}

.sjd-card-content h3 a {
	text-decoration: none;
	color: #2c3e50;
	transition: color 0.2s;
}

.sjd-card-content h3 a:hover {
	color: #0073aa;
}

.sjd-card-meta {
	display: none;
	/* Hide default meta in card view as chip is moved */
}

/* Format Chips - Absolute Position */
.sjd-format-chip {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sjd-chip-pdf {
	background-color: #ffebee;
	color: #c62828;
}

.sjd-chip-audio,
.sjd-chip-mp3 {
	background-color: #e3f2fd;
	color: #1565c0;
}

.sjd-chip-video,
.sjd-chip-mp4 {
	background-color: #f3e5f5;
	color: #7b1fa2;
}

.sjd-chip-other {
	background-color: #f5f5f5;
	color: #616161;
}