/* ===== books-page.css — books.html page-specific styles ===== */
/* Extracted from books.html <style> block for CSP #325 */

.books-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
}
@media (min-width: 640px) { .books-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .books-grid { grid-template-columns: repeat(3, 1fr); } }

.books-list { grid-template-columns: 1fr !important; gap: 8px !important; }

.search-mode-toggle {
    display: flex;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.mode-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    color: var(--muted);
    transition: all 0.15s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.mode-btn.active-keyword { background: var(--gold); color: var(--bg-deep); }
.mode-btn.active-ai { background: rgba(245,158,11,0.12); color: var(--gold); }
.mode-btn:hover:not(.active-keyword):not(.active-ai) { background: var(--glass-bg); }

#aiUnderstandingBanner {
    background: rgba(245,158,11,0.08);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text);
}
#aiUnderstandingBanner.show { display: flex; }
#aiUnderstandingText { color: var(--text); }

#paginationBar button {
    background: rgba(245,158,11,0.12);
    border: 1px solid var(--glass-border);
    color: var(--gold);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.15s;
    font-family: 'Inter', sans-serif;
}
#paginationBar button:disabled { opacity: 0.3; cursor: default; }
#paginationBar button:not(:disabled):hover { opacity: 0.75; }
#paginationBar span { color: rgba(249,250,251,0.4); font-size: 0.85rem; }

.page-result-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.2s;
}
.page-result-card:hover { border-color: var(--gold); }
.matched-term { background: rgba(201, 162, 39, 0.25); font-weight: 600; border-radius: 2px; padding: 0 1px; }

.skeleton { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 900px) {
    .filter-sidebar { display: none; }
    .filter-sidebar.open { display: block; }
    .filter-toggle { display: flex !important; }
}

.filter-toggle { display: none; }

.book-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}
.book-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.15); }

.book-cover {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1f2937, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    position: relative;
    overflow: hidden;
}
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-body {
    padding: 1rem;
}
.book-body h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.book-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.book-desc {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-btn {
    display: inline-block;
    padding: 6px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.book-btn:hover { background: #059669; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.75rem;
}
.badge-gold {
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.25);
    color: var(--gold);
}
.badge-muted {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--muted);
}
.badge-green {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--accent);
}
.badge-red {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #EF4444;
}

.form-select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}
.form-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}
.form-input:focus { border-color: var(--accent); outline: none; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.hidden { display: none !important; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: #059669; }

.surface {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.back-to-top {
    position: fixed; bottom: 2rem; right: 2rem;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 99;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: #059669; }

/* === Phase 2: Inline-Style-Klassen (T13) === */
.bk-main-pad { padding-top: 24px; padding-bottom: 40px; }
.bk-mb-16 { margin-bottom: 16px; }
.bk-breadcrumb { margin-bottom: 16px; font-size: 0.85rem; color: rgba(249,250,251,0.4); }
.bk-link-muted { color: var(--muted); }
.bk-gold-bold { color: var(--gold); font-weight: 500; }
.bk-header-stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.bk-page-title { font-family: 'Syne', sans-serif; font-size: 2.5rem; font-weight: 700; color: var(--text); margin: 0; }
.bk-subtitle { color: var(--muted); margin-top: 4px; }
.bk-col-gap-8 { display: flex; flex-direction: column; gap: 8px; }
.bk-search-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bk-search-wrap { flex: 1; min-width: 200px; position: relative; }
.bk-search-input { width: 100%; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 8px; padding: 10px 14px 10px 36px; color: var(--text); font-size: 14px; font-family: 'Inter', sans-serif; }
.bk-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: rgba(249,250,251,0.4); }
.bk-nowrap { white-space: nowrap; }
.bk-ai-icon { width: 20px; height: 20px; color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.bk-terms-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bk-col-gap-32 { display: flex; flex-direction: column; gap: 32px; }
.bk-content-row { display: flex; gap: 32px; flex-direction: row; align-items: flex-start; }
.bk-filter-sidebar { width: 240px; flex-shrink: 0; padding: 24px; position: sticky; top: 104px; align-self: flex-start; }
.bk-filter-title { font-weight: 600; color: var(--text); margin-bottom: 16px; font-size: 1rem; }
.bk-mb-20 { margin-bottom: 20px; }
.bk-filter-heading { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.bk-filter-label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.bk-accent-gold { accent-color: var(--gold); }
.bk-cat-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.bk-sort-select { width: 100%; font-size: 0.85rem; }

/* === Phase 2: Inline-Style-Klassen (T14) === */
.bk-main-section { flex: 1; min-width: 0; }
.bk-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bk-book-count { color: rgba(249,250,251,0.4); font-size: 0.85rem; }
.bk-view-btns { display: flex; gap: 8px; }
.bk-view-btn-pad { padding: 6px 8px; line-height: 1; }
.bk-icon-16 { width: 16px; height: 16px; display: block; }
.bk-pagination-bar { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 2rem 0; }
.bk-search-pagination { display: none; margin-top: 12px; gap: 8px; justify-content: center; align-items: center; }
.bk-search-nav-btn { padding: 6px 14px; background: var(--gold); color: var(--bg-deep); border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.bk-search-page-info { padding: 6px 8px; color: rgba(249,250,251,0.4); font-size: 13px; }

/* === Phase 2: Inline-Style-Klassen (T15) — Restliche style= aus books.html === */
.bk-grid-empty { color: rgba(249,250,251,0.4); text-align: center; padding: 48px 0; grid-column: 1/-1; }
.bk-upload-panel { display: none; position: fixed; bottom: 24px; right: 24px; background: var(--glass-bg); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); border: 1px solid var(--gold); border-radius: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); padding: 24px; max-width: 400px; z-index: 40; max-height: 400px; overflow-y: auto; }
.bk-upload-title { font-weight: 700; color: var(--text); font-family: 'Syne', sans-serif; font-size: 1.2rem; }
.bk-close-btn { background: none; border: none; color: rgba(249,250,251,0.4); cursor: pointer; font-size: 1.2rem; }
.bk-upload-form { display: flex; flex-direction: column; gap: 12px; }
.bk-file-input { font-size: 0.85rem; color: var(--text); background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 8px; padding: 10px; font-family: 'Inter', sans-serif; }
.bk-input-label { font-size: 0.8rem; color: rgba(249,250,251,0.4); margin-bottom: 4px; display: block; }
.bk-hint-text { font-size: 0.75rem; color: rgba(249,250,251,0.4); margin-top: 4px; }
.bk-full-width { width: 100%; }
.bk-status-text { font-size: 0.85rem; }

/* === Phase 2b: JS innerHTML Style-Klassen (T28k-9a) === */
.bk-mt-8 { margin-top: 8px; }
.bk-progress-label { font-size: 0.75rem; color: rgba(249,250,251,0.4); margin-bottom: 4px; }
.bk-progress-track { width: 100%; background: var(--glass-border); border-radius: 999px; height: 6px; overflow: hidden; }
.bk-progress-bar { background: var(--gold); height: 6px; border-radius: 999px; width: 0%; }
.bk-cover-initial { font-size: 48px; font-family: 'Scheherazade New', serif; }
.bk-badge-corner { position: absolute; top: 12px; left: 12px; }
.bk-badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.bk-page-count { font-size: 13px; color: rgba(249,250,251,0.4); margin-bottom: 12px; }
.bk-preparing-text { font-size: 13px; color: rgba(249,250,251,0.4); }

/* === Phase 2b: JS innerHTML Style-Klassen (T28k-9b) === */
.bk-result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bk-result-title { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.bk-result-meta { margin-left: 8px; font-size: 0.75rem; color: rgba(249,250,251,0.4); }
.bk-result-read-btn { font-size: 0.8rem; color: var(--gold); flex-shrink: 0; }
.bk-result-snippet { font-size: 0.85rem; color: var(--text); line-height: 1.6; }
.bk-result-terms-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.bk-term-tag { background: rgba(245,158,11,0.12); color: var(--gold); border: 1px solid var(--glass-border); font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; }
.bk-empty-grid { color: rgba(249,250,251,0.4); text-align: center; padding: 48px 0; grid-column: 1/-1; }
.bk-analyzing-grid { color: rgba(249,250,251,0.4); text-align: center; padding: 32px 0; grid-column: 1/-1; }
.bk-result-col { grid-column: 1/-1; display: flex; flex-direction: column; gap: 12px; }
.bk-result-meta-sm { font-size: 0.85rem; color: rgba(249,250,251,0.4); margin-bottom: 8px; }
.bk-error-grid { color: #EF4444; text-align: center; padding: 48px 0; grid-column: 1/-1; }

/* ===== AUTH GATE MODAL ===== */
.ag-overlay { display:none;position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,0.75);align-items:center;justify-content:center; }
.ag-box { background:#1F2937;border:1px solid #374151;border-radius:14px;padding:28px 24px 22px;max-width:360px;width:90%;text-align:center;position:relative; }
.ag-close { position:absolute;top:12px;right:14px;background:none;border:none;color:#6B7280;font-size:18px;cursor:pointer; }
.ag-icon { font-size:36px;margin-bottom:12px; }
.ag-title { font-size:16px;font-weight:700;color:#F9FAFB;margin:0 0 6px; }
.ag-subtitle { font-size:13px;color:#9CA3AF;margin:0 0 18px;line-height:1.5; }
.ag-plans { display:flex;gap:8px;margin-bottom:18px; }
.ag-plan { flex:1;border:1px solid #374151;border-radius:8px;padding:10px 4px;background:#111827;text-align:center; }
.ag-plan-label { font-size:9px;font-weight:700;color:#9CA3AF;text-transform:uppercase;letter-spacing:.06em; }
.ag-plan-price { font-size:15px;font-weight:700;color:#F9FAFB;margin:4px 0 2px; }
.ag-plan-note { font-size:9px;color:#6B7280; }
.ag-actions { display:flex;gap:10px; }
.ag-btn-primary { flex:1;padding:10px 0;background:#CA8A04;color:#111827;border-radius:8px;font-size:13px;font-weight:700;text-decoration:none;display:block; }
.ag-btn-secondary { flex:1;padding:10px 0;background:transparent;color:#9CA3AF;border:1px solid #374151;border-radius:8px;font-size:13px;text-decoration:none;display:block; }

.ag-plan { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.ag-plan-selected { border-color: #CA8A04 !important; background: rgba(202,138,4,0.08) !important; }
.ag-plan-selected .ag-plan-label { color: #CA8A04; }
.ag-auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ag-tab { flex: 1; padding: 8px; border: 1px solid #374151; background: transparent; color: #9CA3AF; border-radius: 6px; font-size: 13px; cursor: pointer; }
.ag-tab-active { background: #CA8A04; color: #111827; border-color: #CA8A04; font-weight: 600; }
.ag-form { display: flex; flex-direction: column; gap: 8px; }
.ag-input { width: 100%; box-sizing: border-box; background: #111827; border: 1px solid #374151; color: #F9FAFB; padding: 9px 12px; border-radius: 6px; font-size: 13px; }
.ag-input:focus { outline: none; border-color: #CA8A04; }
.ag-btn-full { width: 100%; margin-top: 4px; }
.ag-error { color: #EF4444; font-size: 12px; min-height: 16px; }
.ag-btn-back { margin-top: 10px; background: none; border: none; color: #6B7280; font-size: 12px; cursor: pointer; padding: 0; }
.ag-btn-back:hover { color: #9CA3AF; }
#agEmailField { display: block; }
