/**
 * Premium Styling for Study Notes Hub Frontend (Restored Pills & Compact Grid Layout)
 * Modern cards, category-specific colorful themes, slim social footer, and theme footer hide overrides.
 */

:root {
	--primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	--primary-hover-gradient: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
	--whatsapp-color: #25D366;
	--whatsapp-hover: #20ba59;
	--telegram-color: #0088cc;
	--telegram-hover: #0077b3;
	--background-card: #ffffff;
	--text-primary: #1e293b;
	--text-secondary: #475569;
	--text-muted: #64748b;
	--border-light: #e2e8f0;
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Hide theme footers when hub is present */
#colophon, 
.site-footer, 
.ast-theme-footer, 
footer.site-footer,
footer:not(.notes-hub-footer) {
	display: none !important;
}

.study-notes-hub-container {
	font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--text-primary);
	max-width: 1100px;
	margin: 0 auto;
	padding: 15px;
	background: #f8fafc;
	border-radius: 16px;
	box-sizing: border-box;
}

/* ==========================================
 * 1. HUB HEADER (COMPACT & MODERN)
 * ========================================== */
.notes-hub-header {
	text-align: center;
	padding: 50px 30px 40px;
	background: linear-gradient(135deg, #111827 0%, #030712 100%);
	border-radius: 24px;
	color: #ffffff;
	margin: 0 auto 30px;
	max-width: 650px;
	box-shadow: var(--shadow-lg);
	position: relative;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.notes-hub-header::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 65%);
	pointer-events: none;
}

.notes-hub-logo {
	font-size: 3.2rem;
	margin-bottom: 15px;
	display: block;
	animation: float 3s ease-in-out infinite;
}

@keyframes float {
	0% { transform: translateY(0px); }
	50% { transform: translateY(-8px); }
	100% { transform: translateY(0px); }
}

.notes-hub-title {
	font-size: 32px;
	font-weight: 850;
	color: #ffffff;
	margin: 0 0 12px 0;
	letter-spacing: -0.5px;
}

.notes-hub-subtitle {
	font-size: 13.5px;
	color: #94a3b8;
	max-width: 550px;
	margin: 0 auto 25px;
	font-weight: 400;
	line-height: 1.55;
}

/* Search bar design */
.notes-search-wrapper {
	position: relative;
	max-width: 440px;
	margin: 0 auto;
	z-index: 2;
}

.notes-search-wrapper .search-icon {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 15px;
	opacity: 0.6;
}

#notes-search-input {
	width: 100%;
	padding: 10px 40px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 30px;
	font-size: 14px;
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(8px);
	color: #ffffff;
	transition: all 0.25s ease;
	outline: none;
	box-sizing: border-box;
}

#notes-search-input::placeholder {
	color: #94a3b8;
}

#notes-search-input:focus {
	background: #ffffff;
	color: #0f172a;
	border-color: #6366f1;
	box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

#notes-search-input:focus ~ .search-icon {
	color: #6366f1;
	opacity: 1;
}

.clear-search-btn {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 20px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

.clear-search-btn:hover {
	color: #f1f5f9;
}


/* ==========================================
 * 2. CATEGORY PILLS FILTER (AT TOP)
 * ========================================== */
.notes-categories-filter {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 25px;
	padding: 0 5px;
}

.filter-pill {
	background-color: #ffffff;
	border: 1px solid #e2e8f0;
	color: var(--text-secondary);
	padding: 8px 18px;
	border-radius: 25px;
	font-size: 13px;
	font-weight: 550;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: var(--shadow-sm);
}

.filter-pill:hover {
	border-color: #6366f1;
	color: #6366f1;
	transform: translateY(-1px);
}

.filter-pill.active {
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
	color: #ffffff;
	border-color: transparent;
	box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}


/* ==========================================
 * 3. NOTES GRID & COLORFUL CARDS (Testbook Style)
 * ========================================== */
.notes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 20px;
	margin-bottom: 40px;
}

.note-card {
	background-color: var(--background-card);
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	padding: 18px;
	box-shadow: var(--shadow-sm);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	position: relative;
	min-height: 240px;
	box-sizing: border-box;
}

.note-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}

/* Badge Header inside Card */
.note-card-badge {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.note-cat-badge {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 3px 8px;
	border-radius: 4px;
}

.note-date {
	font-size: 11px;
	color: var(--text-muted);
}

/* Body Content */
.note-card-body {
	flex-grow: 1;
	margin-bottom: 15px;
	text-align: center;
}

.pdf-icon-wrapper {
	margin-bottom: 12px;
	display: flex;
	justify-content: center;
}

/* Compact Custom PDF Document Icon */
.pdf-icon-doc {
	width: 36px;
	height: 46px;
	border-radius: 3px 12px 3px 3px;
	position: relative;
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
	border-width: 2px;
	border-style: solid;
}

.pdf-icon-doc::before {
	content: '';
	position: absolute;
	top: -2px;
	right: -2px;
	width: 12px;
	height: 12px;
	border-left-width: 2px;
	border-left-style: solid;
	border-bottom-width: 2px;
	border-bottom-style: solid;
	border-radius: 0 10px 0 0;
}

.pdf-extension-tag {
	position: absolute;
	bottom: 5px;
	left: -3px;
	right: -3px;
	color: #ffffff;
	font-size: 8px;
	font-weight: 800;
	text-align: center;
	padding: 1px 0;
	border-radius: 1px;
	letter-spacing: 0.5px;
}

.note-title {
	font-size: 14px;
	font-weight: 650;
	line-height: 1.35;
	color: var(--text-primary);
	margin: 0 0 6px 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 38px;
	margin-top: 0;
}

.note-description {
	font-size: 11.5px;
	color: var(--text-secondary);
	line-height: 1.45;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 34px;
}

/* Footer Section inside Card */
.note-card-footer {
	display: flex;
	gap: 6px;
	align-items: center;
	border-top: 1px solid #f1f5f9;
	padding-top: 12px;
}

.action-buttons {
	display: flex;
	flex: 1;
	gap: 5px;
}

.btn-read-online,
.btn-download {
	flex: 1;
	padding: 8px 6px;
	font-size: 11.5px;
	font-weight: 700;
	border-radius: 6px;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: all 0.2s ease;
	border: 1px solid transparent;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	white-space: nowrap;
}

/* Share Button and Popover */
.share-trigger-wrapper {
	position: relative;
}

.btn-share-trigger {
	background-color: #f8fafc;
	border: 1px solid #e2e8f0;
	color: var(--text-secondary);
	padding: 8px 10px;
	font-size: 11px;
	font-weight: 500;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-share-trigger:hover {
	border-color: #cbd5e1;
	color: var(--text-primary);
	background-color: #f1f5f9;
}

.share-popover {
	display: none;
	position: absolute;
	bottom: 120%;
	right: 0;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: var(--shadow-lg);
	padding: 5px 0;
	width: 125px;
	z-index: 10;
	animation: slideUpFade 0.15s ease-out;
}

.share-popover::after {
	content: '';
	position: absolute;
	top: 100%;
	right: 12px;
	border-width: 5px;
	border-style: solid;
	border-color: #ffffff transparent transparent transparent;
}

@keyframes slideUpFade {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.share-opt {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	color: var(--text-secondary);
	text-decoration: none;
	font-size: 12px;
	font-weight: 550;
	transition: background-color 0.15s ease;
}

.share-opt:hover {
	background-color: #f8fafc;
	color: var(--text-primary);
}

.share-icon-img {
	font-size: 13px;
}


/* ==========================================
 * DYNAMIC CATEGORY ACCENT COLOR PALETTES
 * ========================================== */

/* A. BANKING CATEGORIES (Blue Accent) */
.note-card.accent-banking {
	border-top: 4px solid #3b82f6;
}
.note-card.accent-banking:hover {
	border-color: #3b82f6;
}
.note-card.accent-banking .note-cat-badge {
	color: #1e3a8a;
	background-color: #dbeafe;
}
.note-card.accent-banking .pdf-icon-doc {
	background: #eff6ff;
	border-color: #3b82f6;
}
.note-card.accent-banking .pdf-icon-doc::before {
	border-left-color: #3b82f6;
	border-bottom-color: #3b82f6;
}
.note-card.accent-banking .pdf-extension-tag {
	background-color: #3b82f6;
}
.note-card.accent-banking .btn-read-online {
	background-color: #eff6ff;
	color: #2563eb;
	border-color: #bfdbfe;
}
.note-card.accent-banking .btn-read-online:hover {
	background-color: #dbeafe;
}
.note-card.accent-banking .btn-download {
	background: #2563eb;
	color: #ffffff;
}
.note-card.accent-banking .btn-download:hover {
	background: #1d4ed8;
	box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* B. HINDI & RAJBHASHA CATEGORIES (Orange Accent) */
.note-card.accent-hindi {
	border-top: 4px solid #f97316;
}
.note-card.accent-hindi:hover {
	border-color: #f97316;
}
.note-card.accent-hindi .note-cat-badge {
	color: #7c2d12;
	background-color: #ffedd5;
}
.note-card.accent-hindi .pdf-icon-doc {
	background: #fff7ed;
	border-color: #f97316;
}
.note-card.accent-hindi .pdf-icon-doc::before {
	border-left-color: #f97316;
	border-bottom-color: #f97316;
}
.note-card.accent-hindi .pdf-extension-tag {
	background-color: #f97316;
}
.note-card.accent-hindi .btn-read-online {
	background-color: #fff7ed;
	color: #ea580c;
	border-color: #fed7aa;
}
.note-card.accent-hindi .btn-read-online:hover {
	background-color: #ffedd5;
}
.note-card.accent-hindi .btn-download {
	background: #ea580c;
	color: #ffffff;
}
.note-card.accent-hindi .btn-download:hover {
	background: #c2410c;
	box-shadow: 0 4px 8px rgba(234, 88, 12, 0.2);
}

/* C. ENGLISH CATEGORIES (Teal Accent) */
.note-card.accent-english {
	border-top: 4px solid #0d9488;
}
.note-card.accent-english:hover {
	border-color: #0d9488;
}
.note-card.accent-english .note-cat-badge {
	color: #115e59;
	background-color: #ccfbf1;
}
.note-card.accent-english .pdf-icon-doc {
	background: #f0fdfa;
	border-color: #0d9488;
}
.note-card.accent-english .pdf-icon-doc::before {
	border-left-color: #0d9488;
	border-bottom-color: #0d9488;
}
.note-card.accent-english .pdf-extension-tag {
	background-color: #0d9488;
}
.note-card.accent-english .btn-read-online {
	background-color: #f0fdfa;
	color: #0d9488;
	border-color: #99f6e4;
}
.note-card.accent-english .btn-read-online:hover {
	background-color: #ccfbf1;
}
.note-card.accent-english .btn-download {
	background: #0d9488;
	color: #ffffff;
}
.note-card.accent-english .btn-download:hover {
	background: #0f766e;
	box-shadow: 0 4px 8px rgba(13, 148, 136, 0.2);
}

/* D. OTHER CATEGORIES (Purple Accent) */
.note-card.accent-other {
	border-top: 4px solid #7c3aed;
}
.note-card.accent-other:hover {
	border-color: #7c3aed;
}
.note-card.accent-other .note-cat-badge {
	color: #4c1d95;
	background-color: #f3e8ff;
}
.note-card.accent-other .pdf-icon-doc {
	background: #f5f3ff;
	border-color: #7c3aed;
}
.note-card.accent-other .pdf-icon-doc::before {
	border-left-color: #7c3aed;
	border-bottom-color: #7c3aed;
}
.note-card.accent-other .pdf-extension-tag {
	background-color: #7c3aed;
}
.note-card.accent-other .btn-read-online {
	background-color: #f5f3ff;
	color: #7c3aed;
	border-color: #e9d5ff;
}
.note-card.accent-other .btn-read-online:hover {
	background-color: #f3e8ff;
}
.note-card.accent-other .btn-download {
	background: #7c3aed;
	color: #ffffff;
}
.note-card.accent-other .btn-download:hover {
	background: #6d28d9;
	box-shadow: 0 4px 8px rgba(124, 58, 237, 0.2);
}


/* ==========================================
 * 4. PREMIUM SOCIAL FOOTER (SLIM & MODERN)
 * ========================================== */
.notes-hub-footer {
	margin: 45px auto 0;
	max-width: 650px;
}

.footer-divider {
	height: 1px;
	background: radial-gradient(circle, #e2e8f0 0%, transparent 100%);
	margin-bottom: 25px;
}

.footer-content {
	text-align: center;
	background: linear-gradient(135deg, #111827 0%, #030712 100%);
	color: #ffffff;
	padding: 45px 30px;
	border-radius: 24px;
	box-shadow: var(--shadow-lg);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-join-title {
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 5px 0;
	letter-spacing: -0.2px;
}

.footer-join-subtitle {
	font-size: 12px;
	color: #94a3b8;
	max-width: 600px;
	margin: 0 auto 18px;
	line-height: 1.4;
}

.footer-social-buttons {
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.footer-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 20px;
	text-decoration: none;
	transition: all 0.2s ease;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	color: #ffffff;
}

.footer-btn:hover {
	transform: translateY(-1.5px);
	color: #ffffff;
}

.btn-join-whatsapp {
	background-color: var(--whatsapp-color);
}

.btn-join-whatsapp:hover {
	background-color: var(--whatsapp-hover);
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.btn-join-telegram {
	background-color: var(--telegram-color);
}

.btn-join-telegram:hover {
	background-color: var(--telegram-hover);
	box-shadow: 0 4px 12px rgba(0, 136, 204, 0.25);
}

/* Sharing section */
.footer-sharing-section {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.04);
	padding: 10px 15px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
	margin-bottom: 20px;
}

.footer-share-label {
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.footer-share-row {
	display: flex;
	gap: 6px;
}

.footer-share-btn {
	background-color: rgba(255, 255, 255, 0.06);
	color: #cbd5e1;
	padding: 5px 12px;
	font-size: 11px;
	font-weight: 550;
	border-radius: 15px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.footer-share-btn:hover {
	background-color: rgba(255, 255, 255, 0.12);
	color: #ffffff;
}

.footer-copyright {
	font-size: 11px;
	color: #475569;
	margin: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.04);
	padding-top: 15px;
}


/* ==========================================
 * 5. PDF VIEWER MODAL
 * ========================================== */
.pdf-modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(6px);
	z-index: 999999;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
}

.pdf-modal-container {
	background-color: #ffffff;
	width: 90%;
	height: 90%;
	max-width: 900px;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
	animation: modalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalZoomIn {
	from {
		opacity: 0;
		transform: scale(0.96);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.pdf-modal-header {
	background-color: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	padding: 12px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#pdf-modal-title {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 60%;
}

.pdf-modal-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.btn-fallback-dl {
	background-color: #f1f5f9;
	color: #0f172a;
	border: 1px solid #cbd5e1;
	padding: 6px 12px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 4px;
	text-decoration: none;
	transition: all 0.15s ease;
}

.btn-fallback-dl:hover {
	background-color: #e2e8f0;
}

.pdf-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: #64748b;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.15s ease;
}

.pdf-modal-close:hover {
	color: #0f172a;
}

.pdf-modal-body {
	flex-grow: 1;
	background-color: #525659;
	position: relative;
}

#pdf-viewer-iframe {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	border: none;
}


/* ==========================================
 * 6. TOAST NOTIFICATION
 * ========================================== */
.notes-toast-alert {
	visibility: hidden;
	min-width: 200px;
	background-color: #0f172a;
	color: #ffffff;
	text-align: center;
	border-radius: 20px;
	padding: 10px 18px;
	position: fixed;
	z-index: 1000000;
	left: 50%;
	bottom: 30px;
	transform: translateX(-50%);
	font-size: 13px;
	font-weight: 500;
	box-shadow: 0 5px 15px rgba(0,0,0,0.25);
}

.notes-toast-alert.show {
	visibility: visible;
	animation: fadein 0.4s, fadeout 0.4s 2.6s;
}

@keyframes fadein {
	from { bottom: 0; opacity: 0; }
	to { bottom: 30px; opacity: 1; }
}

@keyframes fadeout {
	from { bottom: 30px; opacity: 1; }
	to { bottom: 0; opacity: 0; }
}


/* ==========================================
 * RESPONSIVE ADJUSTMENTS
 * ========================================== */
@media (max-width: 768px) {
	.notes-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 15px;
	}
	
	.note-card {
		padding: 14px;
		min-height: 220px;
	}
	
	.note-title {
		font-size: 13px;
		height: 35px;
	}
	
	.note-description {
		font-size: 11px;
		height: 30px;
	}
}

@media (max-width: 600px) {
	.notes-hub-title {
		font-size: 22px;
	}
	
	.filter-pill {
		padding: 6px 12px;
		font-size: 11.5px;
	}
	
	.footer-social-buttons {
		flex-direction: column;
		gap: 10px;
	}
	
	.footer-btn {
		width: 100%;
		justify-content: center;
	}
	
	.footer-sharing-section {
		width: 100%;
		box-sizing: border-box;
	}
}
