/* PLR Downloads Site - Frontend Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0f766e;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Top bar */
.top-bar {
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}
.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar a { color: var(--muted); }

/* Header */
.site-header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { height: 40px; width: auto; }
.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}
.logo-tagline { font-size: 12px; color: var(--muted); }
.search-form {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-form input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    width: 240px;
}
.search-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.search-form button:hover { opacity: 0.9; }

/* Nav */
.main-nav {
    background: var(--primary);
    color: white;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-wrap: wrap;
}
.nav-inner > a, .nav-inner > div > a {
    color: white;
    text-decoration: none;
    padding: 14px 18px;
    display: block;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}
.nav-inner > a:hover, .nav-inner > div > a:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}
.nav-dropdown { position: relative; }
.nav-dropdown:hover .dropdown-menu { display: block; }

/* Professional Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    min-width: 240px;
    z-index: 200;
    border-radius: 12px;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid rgba(0,0,0,0.05);
    animation: dropdownFade 0.2s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-menu a {
    color: #334155 !important;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border-bottom: none !important;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dropdown-menu a:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    color: #059669 !important;
    transform: translateX(4px);
}
.dropdown-menu a:last-child {
    border-bottom: none;
}

/* Mobile menu */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--primary);
}

/* Main */
.main-content {
    flex: 1;
    padding: 32px 0;
}

/* Hero search section - centered, moderate size */
.hero-search {
    text-align: center;
    padding: 30px 20px 20px;
    margin-bottom: 24px;
}
.hero-search h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-search p {
    color: #047857;
    font-size: 13px;
    margin-bottom: 18px;
}
.search-bar-large {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}
.search-bar-large .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #10b981;
    pointer-events: none;
}
.search-bar-large input {
    width: 100%;
    padding: 12px 110px 12px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.search-bar-large input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18);
}
.search-bar-large button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.search-bar-large button:hover {
    opacity: 0.92;
    transform: translateY(-50%) scale(1.03);
}

/* Horizontal category tabs - large border radius, pop hover */
.category-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 0 14px;
    margin-bottom: 28px;
    justify-content: center;
    flex-wrap: wrap;
    scrollbar-width: thin;
    scrollbar-color: #d1fae5 transparent;
}
.category-tabs::-webkit-scrollbar { height: 6px; }
.category-tabs::-webkit-scrollbar-track { background: transparent; }
.category-tabs::-webkit-scrollbar-thumb { background: #d1fae5; border-radius: 3px; }

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 999px; /* fully rounded pill */
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    cursor: pointer;
}
.cat-tab:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35);
    text-decoration: none;
}
.cat-tab.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}
.cat-tab.active:hover {
    color: white;
    transform: translateY(-3px) scale(1.05);
}
.cat-tab .tab-emoji { font-size: 15px; }
.cat-tab .tab-count {
    background: rgba(0,0,0,0.08);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.cat-tab:hover .tab-count,
.cat-tab.active .tab-count {
    background: rgba(255,255,255,0.25);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}
.page-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* Book grid - 4 columns on desktop */
.books-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
@media (min-width: 560px) {
    .books-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .books-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
    .books-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Popular niches section at bottom */
.popular-niches-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #d1fae5 100%);
    border-radius: 16px;
    padding: 36px 28px;
    margin: 40px 0;
    text-align: center;
    border: 1px solid #a7f3d0;
}
.popular-niches-section h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.popular-niches-section .subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
}
.popular-niches-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto;
}
.popular-niches-cloud a {
    background: white;
    color: var(--text);
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.popular-niches-cloud a:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    text-decoration: none;
}
.popular-niches-cloud a .count {
    background: var(--bg);
    color: var(--muted);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.popular-niches-cloud a:hover .count {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* Book card - rectangular (portrait), no shadow on cover, with POP effect */
.book-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.book-card:hover {
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.18);
    text-decoration: none;
    transform: translateY(-6px) scale(1.03);
    border-color: #10b981;
}
.book-cover-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.book-cover {
    width: 100%;
    max-width: 180px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #f1f5f9;
    transition: transform 0.3s ease;
    border-radius: 4px;
}
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding: 8px;
}
.book-card:hover .book-cover { transform: scale(1.05); }

.book-category {
    text-align: center;
    margin-bottom: 6px;
}
.book-category span {
    display: inline-block;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.book-title {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card:hover .book-title { color: var(--primary); }
.book-desc {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}
.book-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}
.book-footer .size { color: #94a3b8; }
.book-footer .view { color: var(--primary); font-weight: 600; }

/* Full-width action button inside the card */
.book-action-btn {
    display: flex;
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    justify-content: center;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
    cursor: pointer;
}
.book-action-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    text-decoration: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
    background: white;
}
.pagination a:hover { background: #f1f5f9; text-decoration: none; }
.pagination .current {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-color: transparent;
}
.pagination .disabled { color: #cbd5e1; cursor: not-allowed; }

/* Sidebar widgets */
.widget {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.widget h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 12px;
    font-weight: 700;
}
.cat-list { list-style: none; }
.cat-list li { padding: 4px 0; font-size: 14px; }
.cat-list .sub { padding-left: 12px; border-left: 2px solid #e2e8f0; margin-left: 4px; margin-top: 2px; }
.cat-list .sub a { font-size: 12px; color: var(--muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a {
    font-size: 12px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.15s;
}
.tag-cloud a:hover { background: var(--primary); color: white; text-decoration: none; }

/* Book detail page */
.book-detail-wrap {
    max-width: 1000px;
    margin: 0 auto;
}
.back-link {
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 12px;
    display: inline-block;
}
.back-link:hover { color: var(--primary); }
.book-detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
}
.book-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
@media (min-width: 768px) {
    .book-detail-grid { grid-template-columns: 1fr 2fr; }
}
.detail-cover-wrap {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.detail-cover {
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #f8fafc;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}
.detail-panel h2 { font-size: 18px; margin-bottom: 16px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table td { padding: 10px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.detail-table tr:nth-child(even) { background: #f8fafc; }
.detail-table td.label {
    font-weight: 600;
    color: var(--muted);
    width: 130px;
}
.detail-yes { color: #16a34a; font-weight: 600; }
.detail-no { color: #dc2626; font-weight: 600; }
.download-btn-wrap { text-align: center; margin-top: 20px; }
.download-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    color: white !important;
    padding: 4px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.download-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
    text-decoration: none;
}
.download-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Premium Buy Button */
.buy-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #a855f7 100%);
    color: white !important;
    padding: 18px 56px;
    font-size: 18px;
    font-weight: 800;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.buy-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #9333ea 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(147, 51, 234, 0.5);
    text-decoration: none;
}

/* Featured/Premium badges */
.book-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
}
.badge-featured {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}
.badge-premium {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    color: white;
}

/* Payment Modal */
.payment-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
    backdrop-filter: blur(4px);
}
.payment-modal-backdrop.show { display: flex; }
.payment-modal {
    background: white;
    border-radius: 16px;
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlide 0.3s ease;
}
@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.payment-modal-header {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    color: white;
    padding: 24px;
    border-radius: 16px 16px 0 0;
    text-align: center;
}
.payment-modal-header h3 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.payment-modal-header p { font-size: 13px; opacity: 0.9; }
.payment-modal-body { padding: 24px; }
.payment-method-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.payment-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: white;
    color: #64748b;
    transition: all 0.2s;
}
.payment-tab.active {
    border-color: #7c3aed;
    background: #faf5ff;
    color: #7c3aed;
}
.payment-tab:hover { border-color: #a855f7; }
.payment-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 14px;
}
.payment-info-box .label { color: #64748b; font-size: 12px; margin-bottom: 4px; }
.payment-info-box .value { font-weight: 700; color: #1e293b; word-break: break-all; }
.payment-info-box .copy-btn {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
}
.payment-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.payment-modal-close:hover { background: rgba(255,255,255,0.3); }

/* Purchase status box on book page */
.purchase-status-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}
.purchase-status-box.approved {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #16a34a;
}
.purchase-status-box .status-icon { font-size: 40px; margin-bottom: 8px; }
.purchase-status-box .status-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.purchase-status-box .status-msg { font-size: 14px; color: #92400e; }
.purchase-status-box.approved .status-msg { color: #166534; }

/* Download countdown */
.download-countdown {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-top: 20px;
}
.download-countdown .countdown-msg {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 12px;
    font-weight: 500;
}
.download-countdown .countdown-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 12px;
}
.download-countdown .countdown-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    min-width: 50px;
    display: inline-block;
}
.download-countdown .countdown-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}
.download-countdown .countdown-progress {
    width: 100%;
    height: 6px;
    background: #fde68a;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
}
.download-countdown .countdown-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    width: 0%;
    transition: width 1s linear;
}
.download-countdown .countdown-ready {
    display: none;
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 12px;
}
.download-countdown .countdown-ready.show {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.download-countdown .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #fde68a;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Article on book detail page */
.book-article {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    margin: 24px 0;
    line-height: 1.8;
    font-size: 15px;
}
.book-article h1, .book-article h2, .book-article h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text);
}
.book-article h1 { font-size: 28px; }
.book-article h2 { font-size: 22px; border-bottom: 2px solid var(--bg); padding-bottom: 8px; }
.book-article h3 { font-size: 18px; }
.book-article p { margin-bottom: 14px; }
.book-article ul, .book-article ol { margin: 12px 0 14px 24px; }
.book-article li { margin-bottom: 6px; }
.book-article img { max-width: 100%; height: auto; border-radius: 6px; margin: 12px 0; }
.book-article a { color: var(--primary); text-decoration: underline; }
.book-article blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--muted);
}
.book-article pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 14px 0;
    font-size: 13px;
}
.book-article code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
}
.book-article pre code { background: transparent; padding: 0; }
.book-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}
.book-article th, .book-article td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.book-article th { background: var(--bg); font-weight: 600; }

.note-box {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    margin: 24px 0;
    font-size: 14px;
    color: #92400e;
    line-height: 1.6;
}

.tags-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
}
.tags-box h3 { font-size: 14px; margin-bottom: 10px; color: var(--muted); }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tags-list a {
    background: #f1f5f9;
    color: var(--text);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.15s;
}
.tags-list a:hover { background: var(--primary); color: white; text-decoration: none; }

.related-section { margin-top: 32px; }
.related-section h2 { font-size: 20px; margin-bottom: 16px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 768px) {
    .related-grid { grid-template-columns: repeat(4, 1fr); }
}
.related-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: box-shadow 0.2s;
}
.related-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); text-decoration: none; }
.related-cover {
    aspect-ratio: 2/3;
    background: #f1f5f9;
    overflow: hidden;
    margin-bottom: 8px;
}
.related-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-title { font-size: 12px; font-weight: 500; text-align: center; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Empty state */
.empty-state {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
}

/* Footer */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    margin-top: auto;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 768px) {
    .footer-inner { grid-template-columns: repeat(3, 1fr); }
}
.site-footer h3 { color: white; font-size: 16px; margin-bottom: 12px; }
.site-footer a { color: #cbd5e1; font-size: 14px; }
.footer-bottom {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
}

/* Mobile */
@media (max-width: 768px) {
    .search-form { display: none; }
    .mobile-toggle { display: block; }
    .header-inner { padding: 12px 16px; }
    .logo-text { font-size: 18px; }
    .nav-inner { display: none; }
    .nav-inner.show { display: flex; flex-direction: column; }
    .nav-inner > a, .nav-inner > div > a { padding: 12px 16px; }
    .mobile-search {
        display: flex !important;
        padding: 12px 16px;
        border-top: 1px solid var(--border);
    }
    .mobile-search input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; }
    .mobile-search button { background: var(--primary); color: white; border: none; padding: 8px 14px; border-radius: 6px; margin-left: 8px; }
}
.mobile-search { display: none; }

/* ============================================================
   RATING SYSTEM — star display + interactive input
   ============================================================ */
.rating-display { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stars-display { display: inline-flex; gap: 2px; }
.stars-display .star {
    font-size: 18px;
    color: #d1d5db;
    line-height: 1;
}
.stars-display .star.filled {
    color: #f59e0b;
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}
.rating-text {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.rating-widget {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.rating-widget-label {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
}
.stars-input {
    display: inline-flex;
    gap: 4px;
}
.star-input {
    font-size: 28px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    user-select: none;
}
.star-input:hover,
.star-input.hover {
    color: #fbbf24;
    transform: scale(1.2);
}
.star-input.selected {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.rating-feedback {
    font-size: 13px;
    font-weight: 600;
    min-width: 100px;
}

/* ============================================================
   PREMIUM BUY BUTTON — distinct gold gradient design
   (different from regular download buttons which are green)
   ============================================================ */
.premium-buy-btn-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #d97706 100%);
    color: white;
    box-shadow:
        0 8px 25px rgba(245, 158, 11, 0.4),
        0 2px 8px rgba(217, 119, 6, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: premiumGlow 2.5s ease-in-out infinite;
}

@keyframes premiumGlow {
    0%, 100% {
        box-shadow:
            0 8px 25px rgba(245, 158, 11, 0.4),
            0 2px 8px rgba(217, 119, 6, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow:
            0 12px 35px rgba(245, 158, 11, 0.6),
            0 4px 12px rgba(217, 119, 6, 0.4),
            0 0 40px rgba(251, 191, 36, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.premium-buy-btn-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}
.premium-buy-btn-detail:hover::before {
    left: 100%;
}

.premium-buy-btn-detail:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 15px 40px rgba(245, 158, 11, 0.55),
        0 5px 15px rgba(217, 119, 6, 0.4),
        0 0 50px rgba(251, 191, 36, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: none;
}

.premium-buy-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.premium-buy-text {
    flex: 1;
    text-align: left;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.premium-buy-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.premium-buy-subtitle {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.premium-buy-arrow {
    font-size: 22px;
    font-weight: 700;
    transition: transform 0.3s ease;
}
.premium-buy-btn-detail:hover .premium-buy-arrow {
    transform: translateX(6px);
}

.premium-price-tag {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #7c3aed 100%);
    color: white;
    font-size: 16px;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 999px;
    margin-left: 8px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    vertical-align: middle;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Premium card button (on homepage cards) — distinct gold */
.book-action-btn.premium-card-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #d97706 100%) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
    animation: premiumPulse 2s ease-in-out infinite;
}
.book-action-btn.premium-card-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #ea580c 50%, #b45309 100%) !important;
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.6) !important;
    animation: none;
}
@keyframes premiumPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35); }
    50% { box-shadow: 0 4px 22px rgba(245, 158, 11, 0.6); }
}

/* ============================================================
   BOOK CARD STATS — views + downloads on cards (homepage)
   ============================================================ */
.book-card .book-stats {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
    align-items: center;
}
.book-card .book-stats .stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.book-card .book-stats .stat-rating {
    color: #f59e0b;
    font-weight: 600;
}
