/* ============================================================
   ACBIZ LEARN — Digital Library Styles
   ============================================================ */

/* ── Library Hero ─────────────────────────────────────────────── */
.lib-hero {
    background: linear-gradient(135deg, rgba(13,110,253,.12), rgba(111,66,193,.08));
    border-bottom: 1px solid var(--border);
    padding: 48px 0 40px;
}
.lib-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}
.lib-hero-title {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    margin: 4px 0 8px;
    letter-spacing: -0.5px;
}
.lib-hero-sub {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0;
    line-height: 1.6;
}

/* ── Search ── */
.lib-search-form  { flex: 1; min-width: 280px; max-width: 480px; }
.lib-search-wrap  { display: flex; align-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 4px 4px 4px 14px; gap: 8px; }
.lib-search-icon  { color: var(--text-muted); flex-shrink: 0; }
.lib-search-input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 14px; font-family: inherit; padding: 8px 0; }
.lib-search-input::placeholder { color: rgba(255,255,255,.3); }
.lib-search-btn   { background: var(--primary); color: #fff; border: none; border-radius: 9px; padding: 8px 18px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.lib-search-btn:hover { background: var(--primary-dark); }

/* ── Body layout ── */
.lib-body { padding-top: 28px; padding-bottom: 60px; }

/* ── Recently Read Strip ── */
.lib-recent { margin-bottom: 28px; }
.lib-section-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.lib-recent-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.lib-recent-card {
    display: flex; align-items: center; gap: 10px;
    background: var(--dark-3); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px;
    text-decoration: none; flex-shrink: 0; min-width: 200px; max-width: 240px;
    transition: border-color .15s;
}
.lib-recent-card:hover { border-color: rgba(255,255,255,.18); }
.lib-recent-thumb { width: 36px; height: 48px; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.lib-recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib-recent-title { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-recent-meta  { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* ── Type tabs ── */
.lib-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; overflow-x: auto; padding-bottom: 2px; }
.lib-type-tab {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 12px; font-weight: 600;
    padding: 7px 14px; border-radius: 100px;
    text-decoration: none; white-space: nowrap; transition: all .15s;
}
.lib-type-tab:hover { color: #fff; border-color: rgba(255,255,255,.18); }
.lib-type-tab.active { background: rgba(13,110,253,.12); border-color: rgba(13,110,253,.35); color: #60a5fa; }
.lib-type-count { background: rgba(255,255,255,.08); font-size: 10px; padding: 1px 6px; border-radius: 100px; }

/* ── Layout ── */
.lib-layout { display: grid; grid-template-columns: 200px 1fr; gap: 28px; }

/* ── Sidebar ── */
.lib-sidebar { flex-shrink: 0; }
.lib-filter-group { margin-bottom: 18px; }
.lib-filter-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.lib-filter-select {
    width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 8px; color: #fff; font-size: 12px; font-family: inherit;
    padding: 8px 10px; outline: none; cursor: pointer;
}
.lib-filter-select:focus { border-color: rgba(13,110,253,.4); }
.lib-filter-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.lib-filter-check input { accent-color: var(--primary); }
.lib-clear-btn { display: block; font-size: 11px; color: #f87171; text-decoration: none; margin-top: 12px; }
.lib-sidebar-links { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.lib-sidebar-link { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; padding: 6px 0; transition: color .15s; }
.lib-sidebar-link:hover { color: #fff; }

/* ── Results info ── */
.lib-results-info { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.lib-results-info strong { color: #fff; }
.lib-clear-link { color: #60a5fa; margin-left: 8px; text-decoration: none; font-size: 12px; }

/* ── Grid ── */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* ── Cards ── */
.lib-card {
    background: var(--dark-3); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.lib-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.25); }

.lib-card-thumb {
    position: relative; height: 140px;
    background: linear-gradient(135deg, rgba(13,110,253,.1), rgba(111,66,193,.1));
    overflow: hidden; flex-shrink: 0;
}
.lib-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib-card-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; }

.lib-type-badge {
    position: absolute; top: 8px; left: 8px;
    font-size: 10px; font-weight: 700; padding: 3px 8px;
    border-radius: 100px; background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(4px);
}
.lib-type-ebook       { background: rgba(13,110,253,.7); }
.lib-type-journal     { background: rgba(111,66,193,.7); }
.lib-type-research    { background: rgba(25,135,84,.7); }
.lib-type-notes       { background: rgba(245,166,35,.7); color: #000; }
.lib-type-study_guide { background: rgba(220,53,69,.7); }
.lib-type-past_paper  { background: rgba(13,202,240,.7); color: #000; }

.lib-bookmark-btn {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,.55); border: none; cursor: pointer;
    font-size: 14px; border-radius: 6px; padding: 4px 6px;
    color: rgba(255,255,255,.5); transition: all .15s; line-height: 1;
}
.lib-bookmark-btn:hover, .lib-bookmark-btn.active { color: #f5a623; background: rgba(0,0,0,.7); }

.lib-featured-badge {
    position: absolute; bottom: 8px; right: 8px;
    font-size: 9px; font-weight: 700; padding: 2px 7px;
    border-radius: 100px; background: rgba(245,166,35,.85); color: #000;
}

.lib-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lib-card-title { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.4; }
.lib-card-title a { color: inherit; text-decoration: none; }
.lib-card-title a:hover { color: #60a5fa; }
.lib-card-author { font-size: 11px; color: var(--text-muted); }
.lib-card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 10px; color: var(--text-muted); }
.lib-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.lib-price-free   { font-size: 13px; font-weight: 800; color: #4ade80; }
.lib-price-paid   { font-size: 13px; font-weight: 800; color: #fff; }
.lib-price-original { font-size: 10px; font-weight: 400; color: var(--text-muted); text-decoration: line-through; margin-left: 4px; }
.lib-card-action-btn {
    font-size: 11px; font-weight: 700; color: #60a5fa;
    text-decoration: none; padding: 5px 10px;
    background: rgba(13,110,253,.1); border-radius: 7px;
    border: 1px solid rgba(13,110,253,.2); transition: all .15s;
}
.lib-card-action-btn:hover { background: rgba(13,110,253,.2); }

/* ── Pagination ── */
.lib-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.lib-page-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    font-size: 13px; font-weight: 600; text-decoration: none;
    background: var(--dark-3); color: var(--text-muted); border: 1px solid var(--border);
    transition: all .15s;
}
.lib-page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.lib-page-btn:hover:not(.active) { color: #fff; }

/* ── Empty ── */
.lib-empty { text-align: center; padding: 60px 24px; }

/* ── Toast ── */
.lib-toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--dark-3); border: 1px solid rgba(245,166,35,.3);
    color: #fff; font-size: 13px; font-weight: 600;
    padding: 12px 20px; border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    transform: translateY(20px); opacity: 0; pointer-events: none;
    transition: all .25s; z-index: 9999;
}
.lib-toast.show { transform: translateY(0); opacity: 1; }

/* ── Detail page ── */
.lib-detail-grid { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.lib-detail-cover { border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.lib-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.lib-detail-cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 64px; min-height: 280px; }
.lib-detail-action-card { background: var(--dark-3); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.lib-detail-price { font-size: 26px; font-weight: 900; color: #fff; }
.lib-detail-price.free { color: #4ade80; font-size: 22px; }
.lib-detail-price-note { font-size: 12px; color: var(--text-muted); margin-top: -4px; }
.lib-detail-bookmark-btn {
    width: 100%; text-align: center; background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1); border-radius: 9px;
    color: var(--text-muted); font-size: 13px; font-weight: 600;
    font-family: inherit; padding: 9px; cursor: pointer; transition: all .15s;
}
.lib-detail-bookmark-btn:hover, .lib-detail-bookmark-btn.active { color: #f5a623; border-color: rgba(245,166,35,.35); background: rgba(245,166,35,.08); }
.lib-detail-meta-list { margin-top: 4px; display: flex; flex-direction: column; gap: 0; }
.lib-detail-meta-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.lib-detail-meta-row span { color: var(--text-muted); }
.lib-detail-meta-row strong { color: #fff; text-align: right; }
.lib-detail-title { font-size: 26px; font-weight: 900; color: #fff; margin: 0 0 8px; line-height: 1.25; letter-spacing: -0.5px; }
.lib-detail-author { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.lib-detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.lib-tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 100px; background: rgba(255,255,255,.06); color: var(--text-muted); text-decoration: none; border: 1px solid var(--border); transition: all .15s; }
.lib-tag:hover { color: #fff; border-color: rgba(255,255,255,.2); }
.lib-detail-desc { font-size: 14px; color: var(--text-muted); line-height: 1.8; margin-bottom: 24px; }
.lib-detail-section { margin-bottom: 28px; }
.lib-detail-section-title { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 14px; }
.lib-detail-learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lib-detail-learn-item { font-size: 13px; color: var(--text-muted); display: flex; gap: 8px; align-items: flex-start; }

/* ── Tags ── */
.lib-tag { font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════
   READER LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.lbr-page { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; background: #0a0e1a; overflow: hidden; }

.lbr-topbar {
    display: flex; align-items: center; gap: 14px;
    background: #131929; border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 10px 20px; flex-shrink: 0; z-index: 10;
}
.lbr-back {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    color: #fff; text-decoration: none; flex-shrink: 0; transition: all .15s;
}
.lbr-back:hover { background: rgba(255,255,255,.12); }
.lbr-title {
    flex: 1; font-size: 14px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center; gap: 8px;
}
.lbr-author { font-weight: 400; color: var(--text-muted); }
.lbr-topbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.lbr-page-info { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.lbr-lib-link { font-size: 12px; font-weight: 600; color: #60a5fa; text-decoration: none; }

.lbr-body { flex: 1; overflow: hidden; position: relative; }
.lbr-pdf-wrap { width: 100%; height: 100%; }
.lbr-pdf-frame { width: 100%; height: 100%; border: none; display: block; }

.lbr-no-file, .lbr-epub-wrap, .lbr-video-wrap {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; padding: 40px; text-align: center;
}
.lbr-epub-card {
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px; padding: 40px; max-width: 480px; width: 100%;
}
.lbr-video-wrap video, .lbr-video-wrap audio { outline: none; }

/* ── Responsive ── */
@media(max-width: 900px) {
    .lib-layout { grid-template-columns: 1fr; }
    .lib-sidebar { order: -1; }
    .lib-detail-grid { grid-template-columns: 1fr; }
    .lib-detail-cover { max-width: 200px; }
}
@media(max-width: 600px) {
    .lib-hero { padding: 28px 0 24px; }
    .lib-hero-title { font-size: 22px; }
    .lib-grid { grid-template-columns: 1fr 1fr; }
    .lib-detail-learn-grid { grid-template-columns: 1fr; }
    .lbr-author { display: none; }
}
@media(max-width: 400px) {
    .lib-grid { grid-template-columns: 1fr; }
}
