/* Glassy Modern Style */
:root {
	--primary-color: #000000;
	--secondary-color: #8b5cf6;
	--accent-color: #ec4899;
	--glass-bg: rgba(0, 0, 0, 0.05);
	--glass-border: rgba(0, 0, 0, 0.1);
	--glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
	--text-primary: #000000;
	--text-secondary: rgba(0, 0, 0, 0.7);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "Vazirmatn", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	background: #ffffff;
	min-height: 100vh;
	color: var(--text-primary);
	overflow-x: hidden;
}

/* Ensure Vazirmatn is used for all text elements */
* {
	font-family: inherit;
}

/* Override for specific elements that should use Vazirmatn */
p,
span,
div,
h1,
h2,
h3,
h4,
h5,
h6,
button,
a,
label,
input,
textarea,
select,
.navbar-brand,
.nav-link,
.modal-body,
.support-modal-content {
	font-family: "Vazirmatn", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Background Animation - Disabled for white background */
body::before {
	display: none;
}

/* Glass Card Effect */
.glass-card {
	background: var(--glass-bg);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 20px;
	border: 1px solid var(--glass-border);
	box-shadow: var(--glass-shadow);
	transition: all 0.3s ease;
}

.glass-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
	border-color: rgba(255, 255, 255, 0.3);
}

/* Navigation */
.glass-navbar {
	background: rgba(255, 255, 255, 0.95) !important;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	padding: 1rem 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
	font-size: 1.5rem;
	color: var(--text-primary) !important;
}

.nav-link {
	color: var(--text-secondary) !important;
	transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
	color: var(--text-primary) !important;
}

/* Main Content */
.main-content {
	padding-top: 20px;
	min-height: 100vh;
}

/* Adjust padding when breadcrumb is present */
.breadcrumb-container + .main-content {
	padding-top: 20px;
}

/* Book Card */
.book-card {
	cursor: pointer;
	height: 100%;
	overflow: hidden;
	overflow: visible;
	border-radius: 20px;
}

.book-card .glass-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
}

.book-cover {
	width: 100%;
	height: 300px;
	object-fit: contain;
	background: rgba(0, 0, 0, 0.02);
	padding: 0;
}

.book-title {
	padding: 0;
	text-align: center;
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--text-primary);
	background: rgba(0, 0, 0, 0.02);
}

/* Section Title */
.section-title {
	font-size: 1.75rem;
	font-weight: 700;
	margin-bottom: 1.5rem;
	color: var(--text-primary);
	text-shadow: none;
}

/* Media Card */
.media-card {
	cursor: pointer;
	margin-bottom: 1rem;
}

.media-card .glass-card {
	padding: 1.25rem;
}

.media-icon {
	font-size: 2rem;
	margin-right: 1rem;
}

.media-title {
	font-size: 1.1rem;
	font-weight: 500;
	color: var(--text-primary);
	margin: 0;
}

/* PDF Card */
.pdf-card {
	cursor: pointer;
	margin-bottom: 1rem;
}

.pdf-card .glass-card {
	padding: 1.25rem;
}

/* Audio Player Container */
.audio-player-container {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1050;
	padding: 1rem;
	animation: slideUp 0.3s ease;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
}

@keyframes slideUp {
	from {
		transform: translateY(100%);
	}
	to {
		transform: translateY(0);
	}
}

.audio-player-container .glass-card {
	max-width: 600px;
	margin: 0 auto;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.audio-player-container .btn-link {
	color: #000000 !important;
}

.audio-player-container .progress-bar {
	background-color: #000000 !important;
}

/* Video Player */
.video-player-container {
	position: relative;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	background: rgba(0, 0, 0, 0.8);
	border-radius: 20px;
	overflow: hidden;
}

.video-player-container video {
	width: 100%;
	height: auto;
}

/* Video Thumbnail */
.video-thumbnail-container {
	position: relative;
	width: 100%;
	height: 200px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	cursor: pointer;
	transition: transform 0.3s ease;
}

.video-thumbnail-container:hover .video-thumbnail {
	transform: scale(1.05);
}

.video-thumbnail-fallback {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.05);
	color: rgba(0, 0, 0, 0.3);
}

.video-play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.6);
	border-radius: 50%;
	width: 60px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	pointer-events: none;
}

.video-play-overlay i {
	font-size: 2rem;
	color: #ffffff;
	margin-left: 3px; /* Slight offset for visual centering */
}

.video-thumbnail-container:hover .video-play-overlay {
	background: rgba(0, 0, 0, 0.8);
	transform: translate(-50%, -50%) scale(1.1);
}

/* Loading Spinner */
.loading-spinner {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 400px;
}

.spinner-border {
	width: 3rem;
	height: 3rem;
	border-width: 0.3em;
	border-color: #000000;
	border-right-color: transparent;
}

/* Buttons */
.btn-glass {
	background: var(--glass-bg);
	backdrop-filter: blur(10px);
	border: 1px solid var(--glass-border);
	color: var(--text-primary);
	transition: all 0.3s ease;
}

.btn-glass:hover {
	background: rgba(0, 0, 0, 0.1);
	color: var(--text-primary);
	transform: translateY(-2px);
}

/* Primary Button Override */
.btn-primary,
.btn-primary:focus,
.btn-primary:active {
	background-color: #000000 !important;
	border-color: #000000 !important;
	color: #ffffff !important;
}

.btn-primary:hover {
	background-color: #333333 !important;
	border-color: #333333 !important;
	color: #ffffff !important;
}

/* Responsive */
@media (max-width: 768px) {
	.main-content {
		padding-top: 80px;
	}

	.book-cover {
		height: 250px;
	}

	.section-title {
		font-size: 1.5rem;
	}

	.pdf-toolbar {
		top: 60px;
	}

	.pdf-canvas-container {
		/* 	margin-top: 70px; */
		padding: 10px;
	}

	.pdf-toolbar .d-flex {
		font-size: 0.85rem;
	}

	.pdf-toolbar .btn-sm {
		padding: 0.25rem 0.5rem;
		font-size: 0.8rem;
	}

	#gotoPage {
		width: 70px !important;
	}
}

/* PDF Viewer */
.pdf-viewer-main {
	padding: 0 !important;
	margin: 0 !important;
	height: calc(100vh - 80px); /* Default - will be adjusted by JS */
	width: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: fixed;
	top: 80px; /* Default - will be adjusted by JS */
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1; /* Below navbar (navbar z-index is typically 1030) */
}

.pdf-viewer-main #pdfViewer {
	width: 100%;
	height: 100%;
	border: none;
}

/* PDF Loading Indicator */
.pdf-loading-indicator {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.95);
	z-index: 100;
}

.pdf-loading-content {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.pdf-loading-content .spinner-border {
	width: 3rem;
	height: 3rem;
}

.pdf-loading-content p {
	font-size: 1.1rem;
	font-weight: 500;
	color: #333;
}

.pdf-loading-content .progress {
	border-radius: 10px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.1);
}

.pdf-loading-content .progress-bar {
	background: var(--primary-color, #007bff);
}

#pdfPagesContainer {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.pdf-page-container {
	position: relative;
	margin: 0 auto 20px auto;
	transition: transform 0.2s ease-out;
	will-change: transform;
}

.pdf-page-canvas {
	max-width: 100%;
	height: auto;
	display: block;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	background: #ffffff;
}

/* Audio List Item */
.audio-item {
	cursor: pointer;
	margin-bottom: 1rem;
	transition: all 0.3s ease;
}

.audio-item:hover {
	transform: translateX(5px);
}

.audio-item.active {
	background: rgba(0, 0, 0, 0.1);
}

/* Video Grid */
.video-grid-item {
	margin-bottom: 2rem;
	cursor: pointer;
}

.video-grid-item .glass-card {
	overflow: hidden;
}

/* Error Message */
.error-message {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: #dc2626;
	padding: 1rem;
	border-radius: 10px;
	margin: 1rem 0;
}

/* Empty State */
.empty-state {
	text-align: center;
	padding: 3rem;
	color: var(--text-secondary);
}

.empty-state i {
	font-size: 4rem;
	margin-bottom: 1rem;
	opacity: 0.5;
}

/* Text Color Overrides for White Background */
.text-white {
	color: #000000 !important;
}

.text-white-50 {
	color: rgba(0, 0, 0, 0.7) !important;
}

/* Navbar Dark Override */
.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
	color: #000000 !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
	color: #000000 !important;
}

/* Audio Player Text Override */
.audio-player-container .text-white,
.audio-player-container .text-white-50 {
	color: #000000 !important;
}

.audio-player-container .text-white-50 {
	color: rgba(0, 0, 0, 0.7) !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
	width: 10px;
}

::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.3);
}

/* Support Modal Styling */
.support-modal-content {
	border-radius: 20px;
	border: none;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.support-modal-content .modal-body {
	padding: 2rem 1.5rem;
}

.support-modal-content .btn-close {
	opacity: 0.5;
}

.support-modal-content .btn-close:hover {
	opacity: 1;
}

.support-modal-content .btn-primary {
	border-radius: 10px;
	font-weight: 600;
	transition: all 0.3s ease;
}

.support-modal-content .btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Download App Button */
.download-app-btn {
	border-radius: 15px;
	font-weight: 600;
	font-size: 1.1rem;
	transition: all 0.3s ease;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.download-app-btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.download-app-btn i {
	font-size: 1.2rem;
}

#downloadAppSection {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Search Box Styling */
.input-group-text.glass-card,
.form-control.glass-card {
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.2);
	color: var(--text-primary);
	transition: all 0.3s ease;
}

.input-group-text.glass-card {
	border-right: none;
}

.form-control.glass-card {
	border-left: none;
}

.input-group:hover .input-group-text.glass-card,
.input-group:hover .form-control.glass-card {
	border-color: rgba(0, 0, 0, 0.4);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-control.glass-card:focus {
	background: #ffffff;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
	color: var(--text-primary);
}

.input-group:focus-within .input-group-text.glass-card {
	border-color: var(--primary-color);
}

.form-control.glass-card::placeholder {
	color: rgba(0, 0, 0, 0.5);
}

.input-group-text.glass-card {
	color: var(--text-primary);
	background: #ffffff;
}

/* PDF Floating Controls */
.pdf-floating-controls {
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-end;
}

.pdf-zoom-btn {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: #000000;
	color: #ffffff;
	border: none;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	cursor: pointer;
	transition: all 0.3s ease;
}

.pdf-zoom-btn:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.pdf-zoom-btn:active {
	transform: scale(0.95);
}

.pdf-goto-page-btn {
	width: auto;
	min-width: 70px;
	height: 50px;
	border-radius: 25px;
	background: #000000;
	color: #ffffff;
	border: none;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0 20px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.pdf-goto-page-btn:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.pdf-goto-page-btn:active {
	transform: scale(0.95);
}

@media (max-width: 768px) {
	.pdf-floating-controls {
		bottom: 20px;
		right: 20px;
		gap: 8px;
	}

	.pdf-zoom-btn {
		width: 45px;
		height: 45px;
		font-size: 1.3rem;
	}

	.pdf-goto-page-btn {
		height: 45px;
		min-width: 65px;
		font-size: 0.85rem;
		padding: 0 16px;
	}
}

/* Floating Refresh Button (FAB) */
.refresh-fab {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--primary-color);
	color: #ffffff;
	border: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	transition: all 0.3s ease;
	font-size: 1.5rem;
}

.refresh-fab:hover {
	background: rgba(0, 0, 0, 0.8);
	transform: scale(1.1);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.refresh-fab:active {
	transform: scale(0.95);
}

.refresh-fab i {
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (max-width: 768px) {
	.refresh-fab {
		width: 50px;
		height: 50px;
		font-size: 1.3rem;
		bottom: 15px;
		right: 15px;
	}
}

/* Breadcrumb Styling */
.breadcrumb-container {
	padding-top: 100px;
	padding-bottom: 1rem;
	background: #ffffff;
}

.breadcrumb {
	background: transparent;
	padding: 0;
	margin: 0;
	font-size: 0.9rem;
}

.breadcrumb-item {
	color: var(--text-secondary);
}

.breadcrumb-item a {
	color: var(--text-secondary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
	color: var(--primary-color);
}

.breadcrumb-item.active {
	color: var(--text-primary);
	font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
	content: "/";
	color: var(--text-secondary);
	padding: 0 0.5rem;
}
