/* Urdu Books Manager - Frontend Styles */

.ubm-books-grid {
	display: grid;
	gap: 24px;
	margin: 24px 0;
}

.ubm-columns-1 { grid-template-columns: 1fr; }
.ubm-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ubm-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ubm-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
	.ubm-columns-3,
	.ubm-columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.ubm-columns-2,
	.ubm-columns-3,
	.ubm-columns-4 {
		grid-template-columns: 1fr;
	}
}

.ubm-book-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: transform 0.2s, box-shadow 0.2s;
}

.ubm-book-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.ubm-book-cover img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	display: block;
}

.ubm-book-info {
	padding: 16px;
}

.ubm-book-title {
	margin: 0 0 8px;
	font-size: 1.15rem;
	line-height: 1.4;
}

.ubm-book-title a {
	color: #1a1a2e;
	text-decoration: none;
}

.ubm-book-title a:hover {
	color: #0f766e;
}

.ubm-book-author {
	color: #6b7280;
	margin: 0 0 8px;
	font-size: 0.95rem;
}

.ubm-book-isbn {
	font-size: 0.85rem;
	color: #9ca3af;
	margin: 0 0 12px;
}

.ubm-book-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* Buttons */
.ubm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	border: none;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
	line-height: 1.3;
}

.ubm-btn-read {
	background: #0f766e;
	color: #fff;
}

.ubm-btn-read:hover {
	background: #0d655e;
	color: #fff;
}

.ubm-btn-download {
	background: #1e40af;
	color: #fff;
}

.ubm-btn-download:hover {
	background: #1e3a8a;
	color: #fff;
}

.ubm-btn-large {
	padding: 14px 28px;
	font-size: 1.05rem;
}

.ubm-btn-outline {
	background: transparent;
	border: 2px solid #0f766e;
	color: #0f766e;
}

.ubm-btn-outline:hover {
	background: #0f766e;
	color: #fff;
}

.ubm-btn-whatsapp {
	background: #25d366;
	color: #fff;
}

.ubm-btn-whatsapp:hover {
	background: #1da851;
	color: #fff;
}

.ubm-btn-facebook {
	background: #1877f2;
	color: #fff;
}

.ubm-btn-facebook:hover {
	background: #1464d0;
	color: #fff;
}

/* Single book page */
.ubm-single-book {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 16px;
}

.ubm-single-header {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 32px;
	margin-bottom: 32px;
}

@media (max-width: 768px) {
	.ubm-single-header {
		grid-template-columns: 1fr;
	}
}

.ubm-single-cover img {
	width: 100%;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ubm-single-title {
	margin: 0 0 20px;
	font-size: 2rem;
	line-height: 1.3;
}

.ubm-meta-table-front {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 24px;
}

.ubm-meta-table-front th,
.ubm-meta-table-front td {
	padding: 8px 12px;
	text-align: start;
	border-bottom: 1px solid #f3f4f6;
}

.ubm-meta-table-front th {
	color: #6b7280;
	font-weight: 600;
	width: 140px;
	white-space: nowrap;
}

.ubm-single-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.ubm-single-description {
	margin-bottom: 32px;
	line-height: 1.7;
}

.ubm-reader-section {
	margin-top: 40px;
}

.ubm-reader-section h2 {
	margin-bottom: 16px;
}

.ubm-online-reader {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: #f9fafb;
}

.ubm-pdf-viewer {
	width: 100%;
	height: 80vh;
	min-height: 500px;
	border: none;
	display: block;
}

/* Archive */
.ubm-archive-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px;
}

.ubm-archive-header {
	margin-bottom: 32px;
	text-align: center;
}

.ubm-archive-header h1 {
	font-size: 2.2rem;
	margin-bottom: 8px;
}

.ubm-no-books {
	text-align: center;
	color: #6b7280;
	padding: 40px;
}

/* Share Modal */
.ubm-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.ubm-modal.is-open {
	display: flex;
}

.ubm-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.ubm-modal-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 32px;
	max-width: 440px;
	width: 100%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	text-align: center;
	animation: ubmModalIn 0.25s ease;
}

@keyframes ubmModalIn {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(10px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.ubm-modal-close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 1.6rem;
	cursor: pointer;
	color: #9ca3af;
	line-height: 1;
}

.ubm-modal-close:hover {
	color: #374151;
}

.ubm-modal-title {
	margin: 0 0 12px;
	font-size: 1.4rem;
}

.ubm-modal-desc {
	color: #6b7280;
	margin: 0 0 24px;
	line-height: 1.5;
}

.ubm-share-buttons {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.ubm-share-buttons .ubm-btn {
	width: 100%;
}

.ubm-btn-confirm-share {
	width: 100%;
}

.ubm-step-download .ubm-btn-download-final {
	width: 100%;
}

.ubm-icon {
	font-size: 1.1rem;
}

/* RTL / Urdu support */
[dir="auto"] {
	unicode-bidi: plaintext;
}

.ubm-book-title,
.ubm-single-title,
.ubm-book-author {
	font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif;
}
