/* ==========================================================================
   ALJANIA BIBLIOTECA VIRTUAL PRO - STYLESHEET
   ========================================================================== */

:root {
	--abv-navy: #1a2b4c;
	--abv-navy-dark: #0f1a30;
	--abv-gold: #c59b27;
	--abv-gold-hover: #b0871d;
	--abv-bg-gray: #f4f6f9;
	--abv-border: #e2e8f0;
	--abv-text: #2d3748;
	--abv-text-muted: #718096;
	--abv-danger: #e53e3e;
	--abv-success: #38a169;
}

.abv-portal-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--abv-text);
	background: var(--abv-bg-gray);
	min-height: 800px;
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* --------------------------------------------------
   1. INSTITUTIONAL HEADER BAR
   -------------------------------------------------- */
.abv-portal-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: linear-gradient(135deg, var(--abv-navy-dark) 0%, var(--abv-navy) 100%);
	color: #fff;
	padding: 20px 28px;
	border-radius: 10px;
	margin-bottom: 24px;
	box-shadow: 0 6px 16px rgba(15,26,48,0.25);
}

.abv-portal-brand {
	display: flex;
	align-items: center;
	gap: 18px;
}

.abv-brand-icon {
	width: 52px;
	height: 52px;
	background: rgba(197, 155, 39, 0.2);
	border: 2px solid var(--abv-gold);
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: var(--abv-gold);
}

.abv-brand-tag {
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--abv-gold);
	font-weight: 700;
	display: block;
	margin-bottom: 2px;
}

.abv-brand-title {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	color: #fff;
}

.abv-brand-sub {
	margin: 2px 0 0 0;
	font-size: 13px;
	color: #cbd5e0;
}

.abv-portal-user-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.abv-user-pill {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(255,255,255,0.1);
	padding: 6px 14px;
	border-radius: 30px;
	border: 1px solid rgba(255,255,255,0.15);
}

.abv-user-avatar {
	font-size: 22px;
	color: var(--abv-gold);
}

.abv-user-info {
	display: flex;
	flex-direction: column;
}

.abv-user-name {
	font-size: 13px;
	font-weight: 600;
	color: #fff;
}

.abv-user-role-tag {
	font-size: 11px;
	color: #a0aec0;
}

/* BUTTONS */
.abv-btn {
	padding: 9px 18px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}

.abv-btn-gold {
	background: var(--abv-gold);
	color: var(--abv-navy-dark);
}
.abv-btn-gold:hover {
	background: var(--abv-gold-hover);
}

.abv-btn-navy {
	background: var(--abv-navy);
	color: #fff;
}
.abv-btn-navy:hover {
	background: var(--abv-navy-dark);
}

.abv-btn-ghost {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255,255,255,0.25);
}
.abv-btn-ghost:hover {
	background: rgba(255,255,255,0.1);
}

.abv-btn-block {
	width: 100%;
	justify-content: center;
}

/* --------------------------------------------------
   2. AUTH LANDING CARD
   -------------------------------------------------- */
.abv-auth-landing {
	display: flex;
	justify-content: center;
	padding: 40px 0;
}

.abv-auth-box {
	background: #fff;
	width: 100%;
	max-width: 440px;
	padding: 36px;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.08);
	border: 1px solid var(--abv-border);
}

.abv-auth-header {
	text-align: center;
	margin-bottom: 24px;
}

.abv-auth-icon {
	width: 60px;
	height: 60px;
	background: #feefc3;
	color: #b0871d;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	margin: 0 auto 16px auto;
}

.abv-auth-header h2 {
	margin: 0 0 6px 0;
	font-size: 18px;
	font-weight: 800;
	color: var(--abv-navy);
}

.abv-auth-header p {
	margin: 0;
	font-size: 13px;
	color: var(--abv-text-muted);
}

.abv-field {
	margin-bottom: 18px;
}

.abv-field label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--abv-text);
	margin-bottom: 6px;
}

.abv-field input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--abv-border);
	border-radius: 6px;
	font-size: 14px;
	box-sizing: border-box;
}

.abv-auth-footer-notice {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--abv-border);
	font-size: 12px;
	color: var(--abv-text-muted);
	display: flex;
	gap: 10px;
	line-height: 1.5;
}

/* --------------------------------------------------
   3. SEARCH & CATEGORY PILLS BAR
   -------------------------------------------------- */
.abv-search-section {
	background: #fff;
	padding: 20px;
	border-radius: 10px;
	margin-bottom: 24px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
	border: 1px solid var(--abv-border);
}

.abv-search-bar {
	position: relative;
	margin-bottom: 16px;
}

.abv-search-bar .search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--abv-text-muted);
	font-size: 16px;
}

.abv-search-bar input {
	width: 100%;
	padding: 12px 16px 12px 46px;
	border: 2px solid var(--abv-border);
	border-radius: 8px;
	font-size: 14px;
	transition: border-color 0.2s;
	box-sizing: border-box;
}
.abv-search-bar input:focus {
	border-color: var(--abv-navy);
	outline: none;
}

.abv-category-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.abv-pill {
	padding: 7px 14px;
	border-radius: 20px;
	background: #edf2f7;
	color: #4a5568;
	border: 1px solid transparent;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.abv-pill:hover {
	background: #e2e8f0;
}

.abv-pill.active {
	background: var(--abv-navy);
	color: #fff;
}

/* --------------------------------------------------
   4. BOOKS CATALOG GRID
   -------------------------------------------------- */
.abv-books-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 20px;
}

.abv-book-card {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--abv-border);
	box-shadow: 0 4px 12px rgba(0,0,0,0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
}

.abv-book-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.abv-book-cover-wrap {
	position: relative;
	height: 240px;
	background: #edf2f7;
	overflow: hidden;
}

.abv-book-cover {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.abv-book-cover-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 48px;
	color: #cbd5e0;
}

.abv-btn-fav {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255,255,255,0.9);
	border: none;
	color: #cbd5e0;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
	transition: all 0.2s ease;
}
.abv-btn-fav.active, .abv-btn-fav:hover {
	color: var(--abv-gold);
}

.abv-book-source-tag {
	position: absolute;
	bottom: 8px;
	left: 8px;
}

.abv-book-source-tag span {
	font-size: 10px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 4px;
	text-transform: uppercase;
}

.tag-local { background: rgba(26, 43, 76, 0.9); color: #fff; }
.tag-paid { background: rgba(197, 155, 39, 0.95); color: #000; }
.tag-free { background: rgba(56, 161, 105, 0.9); color: #fff; }

.abv-book-info {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.abv-book-carrera {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--abv-gold-hover);
	margin-bottom: 4px;
}

.abv-book-title {
	margin: 0 0 6px 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--abv-navy);
	line-height: 1.3;
}

.abv-book-author {
	margin: 0 0 10px 0;
	font-size: 12px;
	color: var(--abv-text-muted);
}

.abv-book-meta {
	font-size: 11px;
	color: #a0aec0;
	display: flex;
	justify-content: space-between;
	margin-bottom: 14px;
}

.abv-book-footer {
	margin-top: auto;
}

.abv-btn-read {
	width: 100%;
	padding: 9px;
	background: var(--abv-navy);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.abv-btn-read:hover {
	background: var(--abv-gold);
	color: var(--abv-navy-dark);
}

.abv-btn-read.disabled {
	background: #cbd5e0;
	color: #718096;
	cursor: not-allowed;
}

/* --------------------------------------------------
   5. CANVAS PROTECTED READER MODAL & WATERMARK
   -------------------------------------------------- */
.abv-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(15, 26, 48, 0.85);
	backdrop-filter: blur(4px);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}

.abv-modal-overlay.active {
	display: flex;
}

.abv-reader-container {
	width: 95%;
	height: 94%;
	background: #fff;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.abv-reader-header {
	background: var(--abv-navy-dark);
	color: #fff;
	padding: 12px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.abv-reader-title-box {
	display: flex;
	align-items: center;
	gap: 12px;
}

.abv-reader-title-box h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
}

.abv-reader-badge {
	font-size: 11px;
	color: var(--abv-gold);
}

.abv-reader-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

.abv-reader-btn {
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.2);
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	cursor: pointer;
}
.abv-reader-btn:hover {
	background: rgba(255,255,255,0.25);
}

.abv-page-num-box {
	font-size: 13px;
	margin: 0 6px;
}

.abv-divider {
	width: 1px;
	height: 20px;
	background: rgba(255,255,255,0.2);
	margin: 0 4px;
}

.abv-reader-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	margin-left: 12px;
}

.abv-reader-viewport {
	flex-grow: 1;
	background: #525659;
	overflow: auto;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 20px;
	user-select: none;
	-webkit-user-select: none;
}

.abv-canvas-wrapper {
	position: relative;
	box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

#abv-pdf-canvas {
	display: block;
	background: #fff;
}

/* WATERMARK OVERLAY */
.abv-watermark-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.abv-watermark-text {
	transform: rotate(-35deg);
	font-size: 22px;
	font-weight: 800;
	color: rgba(0, 0, 0, 0.12);
	text-transform: uppercase;
	text-align: center;
	line-height: 1.8;
	width: 140%;
	white-space: pre-wrap;
	user-select: none;
}

.abv-reader-loading {
	position: absolute;
	color: #fff;
	text-align: center;
	font-size: 16px;
	top: 40%;
}
.abv-reader-loading i {
	font-size: 36px;
	margin-bottom: 12px;
}

/* --------------------------------------------------
   6. ADMIN PANEL STYLES
   -------------------------------------------------- */
.abv-admin-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.abv-admin-title {
	color: var(--abv-navy);
	font-weight: 800;
}

.abv-nav-tabs {
	margin-top: 16px;
	margin-bottom: 20px;
}

.abv-card-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.abv-card {
	background: #fff;
	border-radius: 8px;
	border: 1px solid #ccd0d4;
	box-shadow: 0 2px 6px rgba(0,0,0,0.04);
	overflow: hidden;
}

.abv-card-header {
	padding: 14px 20px;
	color: #fff;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.abv-card-header.bg-navy { background: var(--abv-navy); }
.abv-card-header.bg-green { background: var(--abv-success); }

.abv-card-header h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
}

.abv-card-body {
	padding: 20px;
}

.badge {
	font-size: 10px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 4px;
	text-transform: uppercase;
}
.badge-free { background: #e6fffa; color: #234e52; }
.badge-paid { background: #fefcbf; color: #744210; }
.badge-all { background: #c6f6d5; color: #22543d; }
.badge-est { background: #ebf8ff; color: #2b6cb0; }
.badge-doc { background: #feebc8; color: #7b341e; }
.badge-egr { background: #e9d8fd; color: #44337a; }
.badge-local { background: #edf2f7; color: #2d3748; }

.abv-provider-block {
	background: #f8fafc;
	padding: 14px;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	margin-bottom: 14px;
}

.abv-provider-block h4 {
	margin: 0 0 6px 0;
	color: var(--abv-navy);
}

.abv-purchase-link {
	font-size: 12px;
	margin: 0 0 10px 0;
}

.abv-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.abv-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.abv-field-group { margin-bottom: 14px; }
.abv-field-group label { display: block; font-weight: 600; margin-bottom: 4px; }
.abv-field-group input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

.abv-form-footer { margin-top: 20px; }

/* MODAL ADMIN */
.abv-modal-backdrop {
	position: fixed;
	top: 0; left: 0; width: 100vw; height: 100vh;
	background: rgba(0,0,0,0.6);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}
.abv-modal-backdrop.active { display: flex; }

.abv-modal-content {
	background: #fff;
	width: 90%;
	max-width: 680px;
	border-radius: 8px;
	padding: 24px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.abv-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	border-bottom: 1px solid #eee;
	padding-bottom: 10px;
}
.abv-modal-header h3 { margin: 0; color: var(--abv-navy); }
.abv-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; }
