/* ===== ABCBooks Design System — Redesign ===== */
:root {
    --primary: #1a237e;
    --primary-dark: #0d1457;
    --primary-light: #3949ab;
    --accent: #2979ff;
    --accent-hover: #1565c0;
    --gold: #f9a825;
    --gold-light: #ffd54f;
    --text-dark: #1a1a2e;
    --text-body: #374151;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg-page: #f4f6f9;
    --bg-white: #ffffff;
    --bg-soft: #f8f9fc;
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    --success: #00c853;
    --success-dark: #00a843;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.18);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ===== LAYOUT ===== */
.abc-layout { min-height: 100vh; display: flex; flex-direction: column; }
.abc-main { flex: 1; }

/* ===== HEADER ===== */
.abc-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.abc-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 68px;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}

.abc-brand { display: flex; align-items: center; }
.abc-logo { height: 44px; }

.abc-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.abc-nav-links .nav-link {
    color: var(--text-body);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.abc-nav-links .nav-link:hover {
    color: var(--primary);
    background: #eef2ff;
}

.abc-nav-links .nav-admin { color: var(--primary); font-weight: 600; }

.nav-user-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

.nav-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #eef2ff;
    color: var(--primary);
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abc-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
}

.abc-mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem;
    gap: 0.25rem;
}

.abc-mobile-menu.open { display: flex; }

.abc-mobile-menu a,
.abc-mobile-menu .mobile-logout {
    color: var(--text-body);
    padding: 0.75rem 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #0d1457 0%, #1a237e 40%, #283593 70%, #1565c0 100%);
    color: #fff;
    padding: 6rem 2rem 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(41,121,255,0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(249,168,37,0.15) 0%, transparent 50%);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-page);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--gold-light);
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero h1 span {
    background: linear-gradient(90deg, var(--gold-light), #fff9c4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.88;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    position: relative;
    z-index: 1;
}

.hero-stat { text-align: center; }
.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gold-light);
    line-height: 1;
}
.hero-stat-label {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(41,121,255,0.35);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(41,121,255,0.45);
}

.btn-white {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.btn-white:hover {
    background: #f0f4ff;
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline-light {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.12);
    border-color: #fff;
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover {
    background: var(--accent);
    color: #fff;
}

.btn-outline-dark {
    background: transparent;
    color: var(--text-dark);
    border-color: #cbd5e0;
}
.btn-outline-dark:hover {
    background: #f0f4ff;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    box-shadow: 0 4px 14px rgba(0,200,83,0.3);
}
.btn-success:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
    color: #fff;
    transform: translateY(-2px);
}

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 0.42rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.9rem 2.2rem; font-size: 1.05rem; border-radius: 10px; }

/* ===== SECTION ===== */
.section {
    padding: 5rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-tag {
    display: inline-block;
    background: #eef2ff;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.6rem;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* ===== BOOK CARDS ===== */
.books-section {
    padding: 4rem 2rem;
    max-width: 1320px;
    margin: 0 auto;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1.25rem;
}

.book-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.book-card-cover {
    width: 100%;
    /* Real book covers are portrait; the whole cover is shown (object-fit: contain), never cropped. */
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.4s ease;
    padding: 0;
}

.book-card:hover .book-card-cover img { transform: scale(1.03); }

.book-cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    padding: 1.5rem;
}

.book-cover-placeholder i { font-size: 3.5rem; opacity: 0.5; margin-bottom: 1rem; }

.book-cover-placeholder span {
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    opacity: 0.9;
}

.book-card-body {
    padding: 0.75rem 0.9rem 0.35rem;
    flex: 1;
}

.book-card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--text-dark);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    font-size: 0.87rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.book-card-price {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
}

.book-card-footer { padding: 0.55rem 0.9rem 0.9rem; }

/* ABC Bible */
.bible-page { width: min(1440px, 100%); margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.bible-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.25rem; }
.bible-page-heading h1 { margin: 0 0 0.4rem; color: var(--navy, #14213d); }
.bible-page-heading p { margin: 0; color: var(--text-muted); }
.bible-offline-note { display: flex; align-items: center; gap: 0.55rem; padding: 0.65rem 0.85rem; border: 1px solid #cce7d5; border-radius: 0.65rem; background: #f2fbf5; color: #176b36; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.bible-library-frame { overflow: hidden; min-height: 780px; border: 1px solid #dce3ee; border-radius: 0.85rem; background: #fff; box-shadow: 0 12px 30px rgba(20, 33, 61, 0.1); }
.bible-library-frame iframe { display: block; width: 100%; height: calc(100vh - 13rem); min-height: 780px; border: 0; }

/* ===== BOOK DETAIL ===== */
.book-detail {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

.breadcrumb-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: color var(--transition);
}
.breadcrumb-back:hover { color: var(--primary); }

.book-detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

.book-detail-cover {
    position: sticky;
    top: 90px;
}

.book-detail-cover img {
    width: 100%;
    max-width: 320px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    display: block;
}

.book-detail-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.book-detail-author {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.book-detail-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.75rem;
    letter-spacing: -0.02em;
}

.book-detail-desc {
    color: var(--text-body);
    line-height: 1.85;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.book-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f0f4ff;
    color: var(--primary);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ===== FEATURES SECTION ===== */
.features-section {
    background: var(--bg-white);
    padding: 5rem 2rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    border: 1px solid transparent;
}

.feature-card:hover {
    background: #f8f9ff;
    border-color: #e8eaf6;
    transform: translateY(-3px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.5rem;
    color: var(--primary);
}

.feature-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.6rem;
}

.feature-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* ===== PDF PROCESSING PROGRESS ===== */
.pdf-progress-banner {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.pdf-progress-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.pdf-progress-pct {
    margin-left: auto;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold-light);
}

.pdf-progress-track {
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-light), #fff9c4);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.pdf-progress-banner small {
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg-page); }

.admin-sidebar {
    width: 240px;
    background: #050d2e; /* ABC Ministries admin colour */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: #050d2e;
}

.admin-logo { width: 42px; height: auto; }

.admin-brand span {
    font-weight: 700;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.02em;
}

.admin-nav { padding: 0.75rem 0; flex: 1; }

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 1.5rem;
    color: #dbe5fa;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    border-left: 3px solid transparent;
    letter-spacing: 0.01em;
}

.admin-nav-item:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #45b4ff;
}

.admin-nav-item i { width: 18px; text-align: center; font-size: 0.9rem; opacity: 0.8; }
.admin-nav hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 0.5rem 1rem; }

.admin-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-white);
    padding: 0 1.5rem;
    height: 60px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 0;
    z-index: 99;
}

.admin-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary);
    padding: 0.25rem;
}

.admin-page-title { font-weight: 700; color: var(--text-dark); font-size: 1.05rem; }
.admin-user { margin-left: auto; font-size: 0.85rem; color: var(--text-muted); }
.admin-main-content { padding: 1.75rem; flex: 1; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
}

.stat-card-primary::before { background: var(--primary); }
.stat-card-success::before { background: var(--success); }
.stat-card-warning::before { background: var(--warning); }
.stat-card-danger::before { background: var(--danger); }

.stat-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.2rem;
    opacity: 0.06;
    color: var(--primary);
}

/* ===== TABLE ===== */
.table-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    overflow: hidden;
}

.abc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.abc-table thead th {
    background: #fafafa;
    padding: 0.9rem 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-align: left;
}

.abc-table tbody td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-body);
}

.abc-table tbody tr:last-child td { border-bottom: none; }
.abc-table tbody tr:hover { background: #fafbff; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-primary { background: #eef2ff; color: var(--primary); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f3f4f6; color: #4b5563; }

/* ===== CARD ===== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fafafa;
}

.card-body { padding: 1.5rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.2rem; }

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    display: block;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(41,121,255,0.12);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

/* ===== PDF READER ===== */
.pdf-reader-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #2c2c2c;
    z-index: 9999;
}

.pdf-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #1a1a1a;
    padding: 0 1.25rem;
    height: 52px;
    flex-shrink: 0;
    border-bottom: 1px solid #333;
    color: #fff;
}

.pdf-back-btn {
    color: rgba(255,255,255,0.8);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    transition: color 0.2s;
}
.pdf-back-btn:hover { color: #fff; }

.pdf-title {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.pdf-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.pdf-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.2s;
}
.pdf-btn:hover { background: rgba(255,255,255,0.2); }

.pdf-zoom-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    min-width: 42px;
    text-align: center;
}

/* EPUB reader: white page with side buttons to turn pages (the book renders inside an iframe). */
.epub-viewer-area { position: relative; flex: 1; min-height: 0; width: 100%; background: #525659; padding: 12px 56px; }
.epub-page { width: 100%; max-width: 900px; height: 100%; margin: 0 auto; background: #fff; border-radius: 4px; box-shadow: 0 2px 16px rgba(0,0,0,.45); overflow: hidden; }
.epub-loading { padding: 4rem 1.5rem; color: #555; text-align: center; }
.epub-turn { position: absolute; top: 50%; width: 44px; height: 72px; margin-top: -36px; border: 0; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; }
.epub-turn:hover { background: rgba(255,255,255,.26); }
.epub-prev { left: 6px; }
.epub-next { right: 6px; }
@media (max-width: 640px) {
    .epub-viewer-area { padding: 0; }
    .epub-page { border-radius: 0; box-shadow: none; }
    .epub-turn { width: 34px; background: rgba(0,0,0,.12); color: #333; }
}

.pdf-viewer-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #525659;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    width: 100%;
}

.pdf-pages-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transform-origin: top center;
}

.pdf-page-wrapper {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    border-radius: 2px;
    overflow: hidden;
    /* Page fills available width, max A4-ish width */
    width: min(794px, 100%);
}

.pdf-page-img {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: auto;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.pdf-page-num {
    position: absolute;
    bottom: 6px;
    right: 10px;
    background: rgba(0,0,0,0.4);
    color: rgba(255,255,255,0.85);
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 999px;
    pointer-events: none;
    font-family: monospace;
}

/* ===== FOOTER ===== */
.abc-footer {
    background: #2d3748;
    color: rgba(255,255,255,0.8);
    padding: 3.5rem 0 1.5rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.footer-logo { width: 72px; height: auto; margin-bottom: 1rem; }
.footer-tagline { font-size: 0.93rem; color: rgba(255,255,255,0.65); line-height: 1.6; max-width: 240px; }

.footer-col h6 {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.15);
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    padding: 0.3rem 0;
    transition: color var(--transition);
}

.footer-col a:hover { color: #fff; padding-left: 4px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 1.5rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.93rem;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ===== UTILITIES ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-fluid { width: 100%; padding: 0 2rem; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-800 { font-weight: 800; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.me-1 { margin-right: 0.35rem; }
.ms-2 { margin-left: 0.75rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1rem; }
.w-100 { width: 100%; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.01em;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 2rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Blazor */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 0.82rem; margin-top: 0.25rem; }

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0,0,0,.15);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 99999;
    font-size: 0.9rem;
}

#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .abc-nav-links { display: none; }
    .abc-hamburger { display: block; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .admin-sidebar { transform: translateX(-100%); width: 240px; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .admin-menu-toggle { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
    .bible-page { padding: 1.25rem 0.75rem 2rem; }
    .bible-page-heading { align-items: flex-start; flex-direction: column; }
    .bible-offline-note { white-space: normal; }
    .bible-library-frame,
    .bible-library-frame iframe { min-height: 700px; }
    .bible-library-frame iframe { height: calc(100vh - 12rem); }
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .book-detail-grid { grid-template-columns: 1fr; }
    .book-detail-cover { max-width: 220px; margin: 0 auto; position: static; }
    .hero { padding: 4rem 1.5rem 3.5rem; }
    .hero-stats { gap: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .section { padding: 3.5rem 1.5rem; }
    .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-stats { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .features-grid { grid-template-columns: 1fr; }
}

/* Sign-in pages opened from the embedded /library */
.abc-embed-back { display: inline-block; margin: 1rem 1rem 0; color: var(--text-muted); font-size: 0.9rem; text-decoration: none; }

.abc-embedded img[src="/images/logo-2.png"] { display: none; }


/* /reader/{id} hands over to the shared reader; shown only when access is refused. */
.reader-message { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; background: #111; color: #fff; text-align: center; }


/* Admin sections: Website | Bookshop (shared with the bookshop admin). */
.admin-sections { display: flex; gap: 4px; margin: 0 0 14px; padding: 4px; background: rgba(255,255,255,.08); border-radius: 10px; }
.admin-sections a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 7px; color: rgba(255,255,255,.8); font-weight: 600; font-size: .9rem; text-decoration: none; }
.admin-sections a.active { background: #fff; color: #0b1f5c; }
.admin-sections a:not(.active):hover { background: rgba(255,255,255,.14); color: #fff; }

/* Strip above the shop header leading back to the ABC Ministries website. */
.abc-site-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.45rem 1.5rem; background: #0b1f5c; font-size: 0.85rem; }
.abc-site-bar a { color: rgba(255,255,255,.88); text-decoration: none; font-weight: 500; }
.abc-site-bar a:hover { color: #fff; text-decoration: underline; }
.abc-site-bar a i { margin-right: 0.35rem; }
.abc-site-bar-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
@media (max-width: 768px) { .abc-site-bar-links { display: none; } }
