/* Vidasa Library — public styles */
:root { --vidasa-accent: #6a3fb5; }


/* ---------- Layout shell ---------- */
.vidasa-library-page { max-width: 1300px; margin: 0 auto; }

.vidasa-library-hero { text-align: center; padding: 30px 10px 20px; }
.vidasa-library-hero h1 { margin: 0 0 4px; font-size: 28px; }
.vidasa-library-hero p { margin: 0 0 20px; color: #666; }

.vidasa-search-bar { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }
.vidasa-search-bar input[type="text"] { flex: 1 1 auto; padding: 12px 16px; border: 1px solid #d7d7d7; border-radius: 8px; font-size: 15px; }

.vidasa-library-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 0 6px; }
.vidasa-results-count { flex: 1 1 auto; color: #666; font-size: 14px; }
.vidasa-sort-select select { padding: 8px 10px; border-radius: 6px; border: 1px solid #d7d7d7; margin-left: 6px; }
.vidasa-mobile-filters-btn { display: none; }

.vidasa-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.vidasa-chip { display: inline-flex; align-items: center; background: #f1edfa; color: var(--vidasa-accent, #4b2e91); border-radius: 20px; padding: 5px 8px 5px 12px; font-size: 12px; font-weight: 600; }
.vidasa-chip button { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 4px; }

.vidasa-library-columns { display: flex; gap: 20px; align-items: flex-start; }
.vidasa-library-sidebar { flex: 0 0 200px; width: 200px; max-width: 200px; position: sticky; top: 20px; }
.vidasa-library-main { flex: 1 1 0%; min-width: 0; }
.no-sidebar .vidasa-library-sidebar { display: none; }

.vidasa-filters-backdrop { display: none; }

/* ---------- Filters panel ---------- */
.vidasa-filters-panel { background: #fff; border: 1px solid #ececec; border-radius: 10px; padding: 16px; }
.vidasa-filters-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.vidasa-filters-header h3 { margin: 0; font-size: 16px; }
.vidasa-filters-close { display: none; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; }

.vidasa-filter-group { border-top: 1px solid #f0f0f0; padding: 14px 0; }
.vidasa-filter-group:first-child { border-top: 0; padding-top: 4px; }
.vidasa-filter-group h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: #555; }
.vidasa-filter-options { display: flex; flex-direction: column; gap: 6px; }
.vidasa-filter-scroll { max-height: 180px; overflow-y: auto; padding-right: 4px; }
.vidasa-checkbox-row, .vidasa-radio-row { font-size: 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.vidasa-checkbox-child { margin-left: 18px; font-size: 13px; color: #555; }
.vidasa-price-range { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.vidasa-price-range input { width: 0; flex: 1 1 auto; padding: 7px 8px; border: 1px solid #d7d7d7; border-radius: 6px; }

.vidasa-filters-footer { display: flex; gap: 10px; margin-top: 14px; }
.vidasa-filters-footer .button { flex: 1 1 50%; text-align: center; }

/* ---------- Results ---------- */
.vidasa-loading-placeholder, .vidasa-no-results { padding: 40px 0; text-align: center; color: #888; }

.vidasa-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 24px 0; }

.vidasa-book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.vidasa-book-card { position: relative; background: #fff; border: 1px solid #ececec; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s ease, transform .15s ease; }
.vidasa-book-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-2px); }
.vidasa-book-card.vidasa-book-expired { opacity: .7; }

.vidasa-book-cover { position: relative; display: block; }
.vidasa-book-cover img { width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: cover; display: block; }
.vidasa-book-cover-placeholder { width: 100%; aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; background: #f2f2f2; font-size: 40px; color: #999; }

/* Favorite (heart) toggle — top-right of the cover on cards, so it
   never collides with the Free/Paid badge which sits top-left. */
.vidasa-favorite-btn {
	position: absolute; top: 8px; right: 8px; z-index: 2;
	width: 30px; height: 30px; padding: 0;
	display: flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,.9); border: none; border-radius: 50%;
	cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2);
	transition: transform .1s ease;
}
.vidasa-favorite-btn:hover { transform: scale(1.08); }
.vidasa-favorite-btn svg { fill: none; stroke: #888; stroke-width: 1.8; transition: fill .15s ease, stroke .15s ease; }
.vidasa-favorite-btn.is-favorite svg { fill: #e63950; stroke: #e63950; }
.vidasa-favorite-btn:disabled { opacity: .6; cursor: default; }

/* Larger, inline variant used next to the title on the single book page. */
.vidasa-favorite-btn-large {
	position: static; display: inline-flex; vertical-align: middle;
	margin-inline-start: 8px; width: 34px; height: 34px;
	background: #f5f5f5; box-shadow: none;
}
.vidasa-favorite-btn-large svg { stroke: #999; }
.vidasa-favorite-btn-large.is-favorite { background: #fdeaec; }
.vidasa-favorite-btn-large.is-favorite svg { fill: #e63950; stroke: #e63950; }
.vidasa-book-cover-placeholder.large { aspect-ratio: 3 / 4; height: auto; }

.vidasa-badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.vidasa-badge-free { background: #2e7d32; color: #fff; }
.vidasa-badge-paid { background: #555; color: #fff; }
.vidasa-badge-expired { background: #c62828; color: #fff; }

.vidasa-book-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.vidasa-book-title { font-size: 15px; margin: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vidasa-book-title a { color: inherit; text-decoration: none; }
.vidasa-book-author, .vidasa-book-lang, .vidasa-book-plan, .vidasa-book-expiry { font-size: 12px; color: #666; margin: 0; }

.vidasa-book-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.vidasa-tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: #f0f0f0; color: #555; }
.vidasa-tag-lang { background: #eef4ff; color: #2952a3; }
.vidasa-tag-cat { background: #fdf1e7; color: #a15c1e; }

.vidasa-book-access-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.vidasa-flag { font-size: 10px; color: #2e7d32; background: #edf9ee; border-radius: 10px; padding: 2px 7px; }

.vidasa-book-price { font-weight: 700; margin: 4px 0; }
.vidasa-price-unavailable { font-weight: 400; color: #999; font-size: 12px; }

.vidasa-btn-read { display: inline-block; width: 100%; text-align: center; margin-top: auto; }
.vidasa-btn-request-card { display: inline-block; width: 100%; text-align: center; margin-top: 6px; }
.vidasa-flag-card { color: #8a5a00; background: #fff4df; }

.vidasa-progress-bar { background: #eee; border-radius: 6px; height: 6px; margin: 8px 0 4px; overflow: hidden; }
.vidasa-progress-fill { background: var(--vidasa-accent, #6a3fb5); height: 100%; }

/* My Library tabs (Continue Reading / Purchased / Favorites / Completed) */
.vidasa-library-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 20px; border-bottom: 1px solid #ececec; padding-bottom: 0; }
.vidasa-tab-btn {
	background: none; border: none; border-bottom: 2px solid transparent;
	padding: 8px 4px; margin-bottom: -1px; font-size: 14px; font-weight: 600;
	color: #777; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.vidasa-tab-btn:hover { color: #333; }
.vidasa-tab-btn.is-active { color: var(--vidasa-accent, #6a3fb5); border-bottom-color: var(--vidasa-accent, #6a3fb5); }
.vidasa-tab-count { background: #f0f0f0; color: #666; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.vidasa-tab-btn.is-active .vidasa-tab-count { background: var(--vidasa-accent, #6a3fb5); color: #fff; }
.vidasa-tab-panel[hidden] { display: none; }

@media (max-width: 480px) {
	.vidasa-library-tabs { gap: 2px; }
	.vidasa-tab-btn { font-size: 12.5px; padding: 7px 3px; }
	.vidasa-tab-count { font-size: 10px; padding: 1px 6px; }
}
.vidasa-progress-text { font-size: 11px; color: #888; }

.vidasa-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.vidasa-category-card { display: block; padding: 16px; border: 1px solid #ececec; border-radius: 8px; text-decoration: none; }
.vidasa-category-name { display: block; font-weight: 600; }
.vidasa-category-count { font-size: 12px; color: #888; }

/* ---------- Responsive breakpoints ---------- */
@media (max-width: 1199px) {
	.vidasa-book-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
	.vidasa-mobile-filters-btn { display: inline-flex; align-items: center; gap: 6px; }

	.vidasa-library-columns { display: block; }
	.vidasa-library-sidebar {
		position: fixed; top: 0; right: 0; bottom: 0; width: 85%; max-width: 340px;
		background: #fff; z-index: 1000; padding: 16px; overflow-y: auto;
		transform: translateX(100%); transition: transform .25s ease; box-shadow: -4px 0 20px rgba(0,0,0,.15);
	}
	.vidasa-library-sidebar.is-open { transform: translateX(0); }
	.vidasa-filters-panel { border: 0; padding: 0; }
	.vidasa-filters-close { display: block; }

	.vidasa-filters-backdrop {
		display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4);
		z-index: 999; opacity: 0; pointer-events: none; transition: opacity .25s ease;
	}
	.vidasa-filters-backdrop.is-visible { opacity: 1; pointer-events: auto; }

	.vidasa-book-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

@media (max-width: 420px) {
	/* Keep 2 books side by side even on narrow phones (was collapsing
	   to a single stacked column here) — just tighten spacing, text
	   and button size so two cards fit comfortably. */
	.vidasa-book-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.vidasa-book-body { padding: 8px 9px 10px; gap: 3px; }
	.vidasa-book-title { font-size: 12.5px; }
	.vidasa-book-author, .vidasa-book-lang, .vidasa-book-plan, .vidasa-book-expiry { font-size: 10.5px; }
	.vidasa-tag { font-size: 9px; padding: 1px 6px; }
	.vidasa-flag { font-size: 9px; padding: 1px 6px; }
	.vidasa-book-price { font-size: 13px; margin: 2px 0; }
	.vidasa-btn-read { padding: 6px 4px; font-size: 12px; }
	.vidasa-btn-request-card { padding: 6px 4px; font-size: 12px; }
	.vidasa-badge { font-size: 9px; padding: 2px 6px; top: 6px; left: 6px; }

	.vidasa-library-hero h1 { font-size: 22px; }
}

/* ---------- Page padding: pages had no horizontal padding at all,
   so content ran edge-to-edge on phones. Desktop is unaffected since
   .vidasa-library-page already centers within max-width. ---------- */
@media (max-width: 600px) {
	.vidasa-library-page,
	.vidasa-single-book,
	.vidasa-user-library,
	.vidasa-purchase-history,
	.vidasa-reading-history {
		padding-left: 14px;
		padding-right: 14px;
		box-sizing: border-box;
	}
}

/* ---------- Single book header: side-by-side on laptop, stacked and
   centered on mobile so the cover doesn't get squeezed next to the
   text at a fixed 260px width. ---------- */
@media (max-width: 640px) {
	.vidasa-book-header { flex-direction: column; gap: 16px; }
	.vidasa-book-cover-large { flex: 0 0 auto; max-width: 200px; margin: 0 auto; }
	.vidasa-book-meta { text-align: left; }
}

/* ---------- Reader: tighter toolbar and shorter canvas area so the
   whole control bar and page fit a phone screen without excess
   scrolling. Button text labels are hidden below 480px so the icons
   alone keep the toolbar usable at 320px without wrapping into a
   tall stack. ---------- */
@media (max-width: 600px) {
	.vidasa-reader-toolbar { gap: 4px; padding: 6px; }
	.vidasa-reader-toolbar .vr-btn { padding: 8px 10px; font-size: 12px; }
	.vidasa-page-jump-input { width: 40px; }
	.vidasa-reader-canvas-wrap:not(.vidasa-reader-canvas-wrap--fullscreen) { max-height: 65vh; padding: 6px; }
	.vidasa-reader-watermark { font-size: 9px; }
}
@media (max-width: 480px) {
	.vr-btn-label { display: none; }
	.vidasa-page-indicator { width: 100%; order: -1; margin-right: 0; margin-bottom: 4px; }
}

/* ---------- Wide tables (plans, purchase/reading history) were fixed
   width and could overflow a phone's viewport. Let them scroll
   horizontally instead of breaking the page layout. ---------- */
@media (max-width: 480px) {
	.vidasa-plans-table, .vidasa-table { display: block; overflow-x: auto; white-space: nowrap; }
}


/* Single book */
.vidasa-book-header { display: flex; gap: 30px; flex-wrap: wrap; margin-bottom: 30px; }
.vidasa-book-cover-large { flex: 0 0 260px; }
.vidasa-book-cover-large img { width: 100%; border-radius: 8px; }
.vidasa-book-meta { flex: 1 1 320px; }
.vidasa-book-facts { list-style: none; margin: 12px 0; padding: 0; }
.vidasa-book-facts li { margin-bottom: 4px; font-size: 14px; }

.vidasa-whatsapp-btn { display: inline-block; margin-top: 14px; padding: 10px 18px; background: #25D366; color: #fff; border-radius: 6px; text-decoration: none; font-weight: 600; }

.vidasa-notice { padding: 12px 16px; border-radius: 6px; background: #eef4ff; margin-bottom: 16px; }
.vidasa-notice-success { background: #e8f5e9; }
.vidasa-notice-warning { background: #fff8e1; }

.vidasa-purchase-section { border-top: 1px solid #eee; margin-top: 30px; padding-top: 20px; }
.vidasa-plan-options { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.vidasa-plan-option { border: 2px solid #e0e0e0; border-radius: 8px; padding: 12px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.vidasa-plan-option input { margin-bottom: 4px; }
.vidasa-plan-price { font-weight: 700; }

.vidasa-bank-details { margin: 20px 0; }
.vidasa-bank-card { border: 1px solid #eee; border-radius: 8px; padding: 14px; margin-bottom: 12px; background: #fafafa; }

/* ---------- Buy modal (single book "Get Reading Access") ---------- */
.vidasa-modal { position: fixed; inset: 0; background: rgba(20,15,35,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100000; }
.vidasa-modal-box { background: #fff; border-radius: 12px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.vidasa-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #eee; }
.vidasa-modal-header h3 { margin: 0; font-size: 16px; }
.vidasa-modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #888; padding: 0 4px; }
.vidasa-modal-close:hover { color: #333; }
.vidasa-modal-body { padding: 20px; }
.vidasa-modal-footer { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid #eee; }

.vidasa-ref-box { background: #f1edfa; border-radius: 8px; padding: 14px 16px; text-align: center; margin-bottom: 16px; }
.vidasa-ref-box p { margin: 0 0 6px; font-size: 12px; color: #6a5a8a; }
.vidasa-ref-code { font-family: monospace; font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--vidasa-accent, #6a3fb5); }

.vidasa-buy-amount-row { display: flex; justify-content: space-between; align-items: center; background: #f8f6fc; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.vidasa-buy-amount-row strong { color: var(--vidasa-accent, #6a3fb5); }

.vidasa-upload-area { display: block; text-align: center; border: 2px dashed #ddd; border-radius: 10px; padding: 24px 16px; cursor: pointer; margin-bottom: 12px; }
.vidasa-upload-area:hover, .vidasa-upload-area.dragging { border-color: var(--vidasa-accent, #6a3fb5); background: #f8f6fc; }
.vidasa-upload-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.vidasa-upload-area p { margin: 2px 0; }

.vidasa-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.vidasa-table th, .vidasa-table td { text-align: left; padding: 10px; border-bottom: 1px solid #eee; }

.vidasa-status { padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: #eee; }
.vidasa-status-approved, .vidasa-status-paid { background: #e8f5e9; color: #2e7d32; }
.vidasa-status-rejected { background: #ffebee; color: #c62828; }
.vidasa-status-pending_payment, .vidasa-status-payment_submitted, .vidasa-status-under_review { background: #fff8e1; color: #8d6e00; }
.vidasa-status-pending { background: #fff8e1; color: #8d6e00; }
.vidasa-status-suspended { background: #fff3e0; color: #a15c1e; }
.vidasa-status-revoked, .vidasa-status-expired { background: #f0f0f1; color: #555; }

/* ---------- Library card ---------- */
.vidasa-card-status, .vidasa-card-request { background: #fff; border: 1px solid #ececec; border-radius: 10px; padding: 16px 18px; margin-bottom: 20px; }
.vidasa-card-box { border: 1px solid #ececec; border-radius: 8px; padding: 12px 14px; }
.vidasa-card-number { font-family: monospace; letter-spacing: 0.5px; color: #555; }

.vidasa-subscription-hero { text-align: center; margin-bottom: 20px; }
.vidasa-subscription-plan { border: 1px solid #ececec; border-radius: 10px; padding: 20px; margin: 20px 0; text-align: center; }
.vidasa-subscription-price { font-size: 28px; font-weight: 700; margin: 6px 0 14px; }
.vidasa-subscription-benefits { list-style: none; padding: 0; margin: 0 0 10px; text-align: left; max-width: 360px; margin-left: auto; margin-right: auto; }
.vidasa-subscription-benefits li { padding: 4px 0 4px 24px; position: relative; }
.vidasa-subscription-benefits li::before { content: "✓"; position: absolute; left: 0; color: #46b450; font-weight: 700; }
.vidasa-bank-accounts { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.vidasa-bank-account { border: 1px solid #ececec; border-radius: 8px; padding: 10px 14px; }
.vidasa-payment-status-paid { color: #46b450; }
.vidasa-payment-status-pending { color: #dba617; }
.vidasa-payment-status-failed { color: #dc3232; }
.vidasa-card-active { border-color: #2e7d32; }
.vidasa-card-suspended { border-color: #a15c1e; }
.vidasa-card-expired, .vidasa-card-revoked { border-color: #999; opacity: .8; }
.vidasa-plans-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.vidasa-plans-table th, .vidasa-plans-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0f0f0; }

/* Reader */
/* "Full width" here means the actual screen width, not just the width
   of whatever narrower content column the active theme centers posts
   in — themes commonly cap post content at ~800-1200px, which is why
   making the reader itself 100% of ITS container wasn't enough. This
   breaks the whole Read Online section out of that column so it spans
   edge-to-edge on any screen, phone or desktop, regardless of theme. */
.vidasa-reader-section {
	margin-top: 20px;
	width: 100vw;
	max-width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	box-sizing: border-box;
	padding-left: 12px;
	padding-right: 12px;
}
/* ---------- Reader — shared chrome ----------
   Toolbar buttons, page-jump input and the full-screen overlay
   behaviour are shared in spirit between the canvas reader (this
   file) and the flipbook/dFlip reader (reader-flip.css). Keeping the
   class names identical (.vr-btn, .vidasa-page-jump-input,
   .vidasa-reader-close, .vidasa-reader-fullscreen-active) means both
   engines look and behave the same way to the reader. */
#vidasa-reader.vidasa-reader-shell { width: 100%; max-width: 100%; box-sizing: border-box; user-select: none; }
.vidasa-reader-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	padding: 8px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 8px;
	box-sizing: border-box;
}
.vr-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 40px;
	min-width: 40px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	color: #333;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	box-sizing: border-box;
	touch-action: manipulation;
}
.vr-btn:hover { background: #f5f5f5; }
.vr-btn.is-active { background: var(--vidasa-accent, #6a3fb5); border-color: var(--vidasa-accent, #6a3fb5); color: #fff; }
.vidasa-page-jump { display: inline-flex; align-items: center; gap: 4px; }
.vidasa-page-jump-input,
.vidasa-page-jump-input[type="number"] { width: 56px; min-height: 40px; text-align: center; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 13px; }
.vidasa-page-indicator, .vidasa-flip-page-indicator { font-size: 13px; color: #555; margin-right: auto; white-space: nowrap; }

/* Normal (non-fullscreen) reading area for the canvas engine. Full
   width of its section, comfortable default height, scrolls its own
   pages vertically rather than the whole document — the "comfortable
   reading mode that works without full screen" the reader always has. */
.vidasa-reader-canvas-wrap {
	text-align: center;
	background: #333;
	padding: 10px;
	border-radius: 6px;
	overflow-y: auto;
	overflow-x: hidden;
	max-height: 80vh;
	width: 100%;
	box-sizing: border-box;
	position: relative;
	scroll-behavior: smooth;
}
/* Continuous scroll: every page stacks full-width, one after another —
   this is what makes the reader feel like scrolling down a real book
   instead of clicking through pages one at a time. */
.vidasa-reader-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.vidasa-reader-page { width: 100%; min-width: 0; }
.vidasa-reader-canvas-wrap canvas { max-width: 100%; height: auto; display: block; margin: 0 auto; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.vidasa-reader-watermark { position: absolute; top: 8px; right: 16px; color: rgba(255,255,255,.5); font-size: 11px; pointer-events: none; z-index: 2; }
.vidasa-reader-loading, .vidasa-reader-error { padding: 40px; text-align: center; color: #ccc; }
.vidasa-preview-limit-notice, .vidasa-preview-limit-msg { margin-top: 10px; padding: 12px; background: #fff8e1; border-radius: 6px; text-align: center; }

.vidasa-reader-close {
	position: absolute;
	top: 10px;
	right: 14px;
	z-index: 5;
	width: 40px;
	height: 40px;
	min-width: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(255,255,255,.15);
	color: #fff;
	font-size: 18px;
	line-height: 40px;
	text-align: center;
	cursor: pointer;
	padding: 0;
}
.vidasa-reader-close:hover { background: rgba(255,255,255,.3); }

/* Full-viewport reading overlay for the CANVAS engine — mirrors the
   flipbook reader's .vidasa-reader-fullscreen-active in reader-flip.css.
   Applied to the whole #vidasa-reader widget, which reader.js also
   moves to a direct child of <body> at the same time (see
   enterFullscreen() there) so this is never trapped inside a themed
   ancestor's transform/filter/perspective — the root cause of a
   "full screen" reader that only fills a small boxed-in area instead
   of the real screen. !important guards these specific
   layout-critical properties against theme stylesheets that might
   otherwise target #vidasa-reader with higher specificity. */
#vidasa-reader.vidasa-reader-fullscreen-active {
	position: fixed !important;
	inset: 0 !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	max-width: 100vw !important;
	height: 100dvh !important;
	height: 100vh !important;
	margin: 0 !important;
	transform: none !important;
	z-index: 2147483000 !important;
	/* Clean device-background reading mode — no large black box
	   around the page (see .vidasa-reader-canvas-wrap override below,
	   which drops its own dark background while fullscreen). */
	background: #f4f4f5;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#vidasa-reader.vidasa-reader-fullscreen-active .vidasa-reader-toolbar {
	background: rgba(255,255,255,.06);
	border-color: rgba(255,255,255,.12);
	flex-shrink: 0;
}
#vidasa-reader.vidasa-reader-fullscreen-active .vr-btn,
#vidasa-reader.vidasa-reader-fullscreen-active .vidasa-page-indicator,
#vidasa-reader.vidasa-reader-fullscreen-active .vidasa-page-jump-input {
	background: rgba(255,255,255,.08);
	color: #f2f2f2;
	border-color: rgba(255,255,255,.18);
}
#vidasa-reader.vidasa-reader-fullscreen-active .vidasa-reader-canvas-wrap {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	border-radius: 0;
	/* Drop the wrap's normal dark reading-canvas background while
	   fullscreen so the page sits cleanly against the overlay's own
	   background instead of inside a black box. */
	background: transparent;
}
body.vidasa-reader-open { overflow: hidden; }

/* ---------- Buttons (scoped fallback so the plugin looks right even
   without theme button styling) ---------- */
.vidasa-library-page .button,
.vidasa-single-book .button,
.vidasa-user-library .button,
.vidasa-purchase-history .button,
.vidasa-reading-history .button,
.vidasa-register .button {
	display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid #ccc;
	background: #fff; color: #333; text-decoration: none; cursor: pointer; font-size: 13px; text-align: center;
}
.vidasa-library-page .button-primary,
.vidasa-single-book .button-primary,
.vidasa-user-library .button-primary,
.vidasa-purchase-history .button-primary,
.vidasa-reading-history .button-primary,
.vidasa-register .button-primary {
	background: var(--vidasa-accent, #6a3fb5); border-color: var(--vidasa-accent, #6a3fb5); color: #fff;
}
.vidasa-page-btn { min-width: 36px; }

.vidasa-plans-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.vidasa-plans-table th, .vidasa-plans-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; }
.vidasa-plans-table th { font-size: 12px; text-transform: uppercase; color: #888; }
.vidasa-plan-row td label { cursor: pointer; }

/* ---------- Registration ---------- */
.vidasa-register { max-width: 460px; margin: 0 auto; }
.vidasa-register .vidasa-form-row { margin-bottom: 14px; }
.vidasa-register label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.vidasa-register input[type="text"],
.vidasa-register input[type="tel"],
.vidasa-register input[type="password"] {
	width: 100%; padding: 9px 12px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font-size: 14px;
}
.vidasa-register .vidasa-otp-row { display: flex; gap: 8px; align-items: flex-start; }
.vidasa-register .vidasa-otp-row input { flex: 1; }
.vidasa-register .vidasa-plan-choice { border: 1px solid #ececec; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; display: block; }
.vidasa-register .vidasa-plan-choice input { margin-right: 8px; }
.vidasa-register .vidasa-plan-choice strong { display: inline; }
.vidasa-register .vidasa-plan-choice .description { display: block; margin-top: 4px; font-size: 12px; color: #888; }
.vidasa-register .vidasa-field-hint { font-size: 12px; color: #888; margin-top: 4px; }
.vidasa-register .vidasa-otp-status { font-size: 12px; margin-top: 6px; }
.vidasa-register .vidasa-otp-status.is-ok { color: #2e7d32; }
.vidasa-register .vidasa-otp-status.is-error { color: #b3261e; }
.vidasa-register fieldset { border: none; padding: 0; margin: 0 0 14px; }
.vidasa-register fieldset[disabled] { opacity: .5; }

/* ================= Dashboard ([vidasa_dashboard]) ================= */
.vidasa-status-active { background: #e8f5e9; color: #2e7d32; }

.vidasa-dashboard { max-width: 1100px; margin: 0 auto; }

.vidasa-dash-welcome { margin-bottom: 18px; }
.vidasa-dash-welcome h1 { font-size: 26px; margin: 0 0 4px; }
.vidasa-dash-subtitle { color: #777; margin: 0 0 14px; }
.vidasa-dash-search { display: flex; max-width: 480px; gap: 0; }
.vidasa-dash-search input[type="text"] { flex: 1; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px 0 0 8px; font-size: 14px; }
.vidasa-dash-search button { padding: 10px 20px; border: none; border-radius: 0 8px 8px 0; background: var(--vidasa-accent, #6a3fb5); color: #fff; cursor: pointer; font-weight: 600; }

.vidasa-dash-plan-card { background: #faf8ff; border: 1px solid #e6dfff; border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.vidasa-dash-plan-card-empty { background: #fff8e1; border-color: #ffe9a8; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.vidasa-dash-plan-card-empty p { margin: 0; }
.vidasa-dash-plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.vidasa-dash-plan-head strong { font-size: 16px; }
.vidasa-dash-plan-bar { max-width: 320px; height: 8px; }
.vidasa-dash-plan-expiry { color: #777; font-size: 13px; margin: 4px 0 10px; }

.vidasa-dash-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.vidasa-dash-quick-actions a {
	flex: 1 1 130px; text-align: center; background: #fff; border: 1px solid #ececec; border-radius: 10px;
	padding: 12px 10px; font-weight: 600; font-size: 13.5px; color: #333; text-decoration: none;
	transition: box-shadow .15s ease, transform .15s ease;
}
.vidasa-dash-quick-actions a:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }

.vidasa-dash-section { margin-bottom: 30px; }
.vidasa-dash-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.vidasa-dash-section-head h2 { font-size: 18px; margin: 0; }
.vidasa-dash-view-all { font-size: 13px; font-weight: 600; color: var(--vidasa-accent, #6a3fb5); text-decoration: none; white-space: nowrap; }
.vidasa-dash-view-all:hover { text-decoration: underline; }

.vidasa-book-strip {
	display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px;
	scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.vidasa-book-strip .vidasa-book-card { flex: 0 0 160px; scroll-snap-align: start; }

@media (max-width: 480px) {
	.vidasa-dash-welcome h1 { font-size: 21px; }
	.vidasa-dash-search { max-width: 100%; }
	.vidasa-dash-quick-actions a { flex: 1 1 45%; font-size: 12.5px; padding: 10px 6px; }
	.vidasa-book-strip .vidasa-book-card { flex-basis: 128px; }
	.vidasa-dash-section-head h2 { font-size: 16px; }
}

/* ---------------- Book Seller Dashboard ---------------- */

.vidasa-seller-dash { max-width: 980px; margin: 0 auto; }

.vidasa-seller-dash-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.vidasa-seller-dash-head h1 { font-size: 24px; margin: 0 0 4px; }
.vidasa-seller-dash .vidasa-dash-subtitle { margin: 0; color: #666; font-size: 14px; }

.vidasa-btn {
	display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid #d7d7d7;
	background: #fff; color: #222; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
	line-height: 1.2; white-space: nowrap;
}
.vidasa-btn-primary { background: var(--vidasa-accent, #6a3fb5); border-color: var(--vidasa-accent, #6a3fb5); color: #fff; }
.vidasa-btn-primary:hover { opacity: .92; }
.vidasa-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.vidasa-btn-outline { border-color: var(--vidasa-accent, #6a3fb5); color: var(--vidasa-accent, #6a3fb5); background: #fff; }

.vidasa-seller-commission-bar {
	display: flex; gap: 24px; flex-wrap: wrap; background: #f8f6fc; border: 1px solid #e6dfff;
	border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
}
.vidasa-seller-commission-bar strong { color: var(--vidasa-accent, #6a3fb5); margin-left: 6px; }
.vidasa-seller-commission-label { color: #555; }

.vidasa-seller-summary-grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 22px;
}
.vidasa-seller-summary-card {
	background: #fff; border: 1px solid #ececec; border-radius: 10px; padding: 14px 16px;
	display: flex; flex-direction: column; gap: 4px;
}
.vidasa-seller-summary-card-accent { background: #f8f6fc; border-color: #e6dfff; }
.vidasa-seller-summary-value { font-size: 20px; font-weight: 700; color: #222; }
.vidasa-seller-summary-label { font-size: 12.5px; color: #777; }

.vidasa-seller-section { background: #fff; border: 1px solid #ececec; border-radius: 10px; padding: 18px 20px; margin-bottom: 20px; }
.vidasa-seller-section h2 { font-size: 17px; margin: 0 0 14px; }

.vidasa-seller-upload-panel { border-color: #e6dfff; background: #faf8ff; }

.vidasa-upload-progress { margin-top: 12px; max-width: 420px; }
.vidasa-upload-progress-bar { background: #e9e4f5; border-radius: 6px; height: 8px; overflow: hidden; }
.vidasa-upload-progress-fill { background: var( --vidasa-accent, #6a3fb5 ); height: 100%; width: 0%; transition: width 0.2s ease; }
.vidasa-upload-progress-text { display: block; margin-top: 6px; font-size: 12.5px; color: #666; }

.vidasa-seller-books-list { display: flex; flex-direction: column; gap: 12px; }
.vidasa-seller-book-row {
	display: flex; align-items: center; gap: 14px; border: 1px solid #ececec; border-radius: 10px; padding: 10px 12px;
	flex-wrap: wrap;
}
.vidasa-seller-book-cover { flex: 0 0 48px; width: 48px; }
.vidasa-seller-book-cover img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.vidasa-seller-book-cover .vidasa-book-cover-placeholder { width: 48px; height: 64px; font-size: 20px; border-radius: 6px; }
.vidasa-seller-book-info { flex: 1 1 220px; min-width: 0; }
.vidasa-seller-book-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.vidasa-seller-book-title-row strong { font-size: 14.5px; word-break: break-word; }
.vidasa-seller-book-meta { font-size: 12.5px; color: #777; display: flex; flex-wrap: wrap; gap: 6px; }
.vidasa-seller-book-action { flex: 0 0 auto; margin-left: auto; }
.vidasa-seller-book-waiting { font-size: 12.5px; color: #8d6e00; }

.vidasa-seller-empty { text-align: center; padding: 30px 10px; color: #666; }
.vidasa-seller-empty p { margin: 0 0 14px; }

.vidasa-seller-earnings-grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
}
.vidasa-seller-earnings-grid > div { display: flex; flex-direction: column; gap: 4px; }
.vidasa-seller-earnings-grid strong { font-size: 16px; }

.vidasa-seller-bank-status { font-size: 14px; margin: 0 0 14px; }

.vidasa-seller-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.vidasa-seller-form-row { display: flex; flex-direction: column; gap: 5px; }
.vidasa-seller-form-row label { font-size: 13px; font-weight: 600; color: #444; }
.vidasa-seller-form-row input {
	width: 100%; padding: 10px 12px; border: 1px solid #d7d7d7; border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.vidasa-seller-form .vidasa-btn { align-self: flex-start; }

.vidasa-seller-payout-summary { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; margin-bottom: 14px; color: #444; }
.vidasa-seller-payout-summary span:first-child { font-weight: 600; }

.vidasa-seller-payout-history { display: flex; flex-direction: column; gap: 10px; }
.vidasa-seller-payout-row {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 1px solid #ececec; border-radius: 8px;
	padding: 10px 12px; font-size: 13.5px;
}
.vidasa-seller-payout-amount { font-weight: 700; }
.vidasa-seller-payout-note { color: #c62828; width: 100%; font-size: 12.5px; }

@media (max-width: 640px) {
	.vidasa-seller-dash-head { flex-direction: column; align-items: stretch; }
	.vidasa-seller-dash-head .vidasa-btn { width: 100%; text-align: center; }
	.vidasa-seller-summary-grid { grid-template-columns: repeat(2, 1fr); }
	.vidasa-seller-book-row { flex-direction: column; align-items: flex-start; }
	.vidasa-seller-book-action { margin-left: 0; width: 100%; }
	.vidasa-seller-book-action .vidasa-btn { width: 100%; text-align: center; }
	.vidasa-seller-form { max-width: 100%; }
	.vidasa-seller-form-row input { font-size: 16px; } /* prevents iOS zoom-on-focus */
	.vidasa-seller-payout-row { flex-direction: column; align-items: flex-start; }
}
