/*
==========================================================
BibliApp Pilipinas — Brand Refresh
Inspired by the Pinoy Bible Cover
==========================================================
*/

/* ======================================================
   GOOGLE FONTS
====================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ======================================================
   COLOR SYSTEM — from the Pinoy Bible cover
====================================================== */
:root {
    /* Core brand */
    --brand-dark:    #0F1218;   /* Cover 1 near-black */
    --brand-gold:    #E8A020;   /* Cover 1 orange brush */
    --brand-blue:    #1A4A8A;   /* "BIBLE" deep blue letter */
    --brand-red:     #C93030;   /* "BIBLE" red letter */
    --brand-green:   #1E7A3C;   /* "BIBLE" green letter */

    /* UI semantic */
    --primary:       #E8A020;   /* gold/orange CTA */
    --primary-dark:  #C4841A;
    --primary-light: #FDF3E0;

    --secondary:     #1A4A8A;   /* blue links/accents */
    --secondary-dark:#123270;

    --danger:        #C93030;
    --success:       #1E7A3C;
    --warning:       #F0B429;

    /* Surface */
    --surface:       #FFFFFF;
    --bg:            #FAF6EE;   /* warm parchment — Bible page feel */
    --bg-dark:       #0F1218;
    --sidebar-bg:    #FEFCF8;

    /* Text */
    --text:          #1C1C1E;
    --text-muted:    #6B6B6B;
    --text-inverse:  #FFFFFF;

    /* Borders & shadow */
    --border:        #E4DDD0;
    --shadow-sm:     0 1px 4px rgba(0,0,0,.08);
    --shadow:        0 4px 20px rgba(0,0,0,.10);
    --shadow-lg:     0 12px 40px rgba(0,0,0,.16);

    /* Layout */
    --navbar-height: 64px;
    --radius:        12px;
    --radius-lg:     20px;
    --transition:    .22s ease;
}

/* ======================================================
   BASE
====================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--secondary-dark); text-decoration: none; }

/* ======================================================
   TYPOGRAPHY
====================================================== */
h1, h2, h3, .display {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ======================================================
   NAVBAR
====================================================== */
.navbar {
    min-height: var(--navbar-height);
    background: var(--brand-dark) !important;
    position: sticky;
    top: 0;
    z-index: 1200;
    box-shadow: 0 2px 16px rgba(0,0,0,.30);
    border-bottom: 2px solid var(--brand-gold);
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #FFFFFF !important;
    letter-spacing: .01em;
}

.navbar-brand span.ang {
    font-style: italic;
    color: var(--brand-gold);
    margin-right: 2px;
}


/* Navbar brand italic "Ang" in gold */
.navbar-brand .ang {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--brand-gold);
    margin-right: 2px;
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #FFFFFF !important;
    letter-spacing: .02em;
}

/* Nav buttons */
.navbar .btn-outline-light {
    border-color: rgba(255,255,255,.25);
    color: rgba(255,255,255,.85);
    font-size: .82rem;
    font-weight: 500;
    padding: .32rem .75rem;
    transition: var(--transition);
}
.navbar .btn-outline-light:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.55);
    color: #fff;
}
.navbar .btn-danger {
    background: var(--brand-red);
    border: none;
}

/* ======================================================
   BUTTONS
====================================================== */
.btn { border-radius: 10px; font-weight: 500; transition: var(--transition); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--brand-dark);
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--brand-dark);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* ======================================================
   CARDS
====================================================== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: var(--surface);
    margin-bottom: 20px;
}
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

/* ======================================================
   ALERTS
====================================================== */
.alert { border: none; border-radius: var(--radius); }

/* ======================================================
   SIDEBAR
====================================================== */
#sidebarColumn {
    padding: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border) !important;
}

.sidebar-sticky {
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
}

.sidebar-sticky::-webkit-scrollbar { width: 5px; }
.sidebar-sticky::-webkit-scrollbar-track { background: transparent; }
.sidebar-sticky::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 20px;
}

/* Sidebar list items */
.sidebar-sticky .list-group-item {
    border: none;
    border-radius: 8px !important;
    padding: .42rem .75rem;
    font-size: .88rem;
    color: var(--text);
    background: transparent;
}
.sidebar-sticky .list-group-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.sidebar-sticky h5 {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 8px 4px;
    margin: 0;
}

/* Sidebar collapsed */
#sidebarColumn.sidebar-collapsed { display: none !important; }

/* Mobile book menu (offcanvas). Bootstrap's offcanvas defaults to a
   fixed 400px width, which is wider than most phone screens — it
   ends up covering the entire viewport with no visible backdrop
   strip left to tap, forcing a second tap on the hamburger icon to
   close it instead. Capping the width leaves a visible, tappable
   backdrop on the right (clicking the backdrop already closes an
   offcanvas by default — no JS/behavior change needed, just room to
   reach it). */
#bookMenu {
    width: min(82vw, 320px);
}

/* ======================================================
   CONTENT COLUMN
====================================================== */
#contentColumn { align-self: flex-start; }

/* ======================================================
   FOOTER
====================================================== */
footer {
    border-top: 2px solid var(--brand-gold);
    padding: 32px 0 20px;
}
footer h5 {
    font-family: 'Playfair Display', serif;
    color: var(--brand-dark);
    font-weight: 700;
}
footer a { color: var(--brand-blue); }
footer a:hover { color: var(--brand-dark); }

/* Only this box (the Quick Links list) is darkened — the rest of the
   footer keeps the page's normal light background (bg-light, set in
   the template) instead of the whole footer being one solid dark
   block. */
.footer-links-box {
    background: var(--brand-dark);
    border-radius: 10px;
    padding: 14px 18px;
}
.footer-links-box a { color: var(--brand-gold); }
.footer-links-box a:hover { color: #fff; }

/* ======================================================
   LANDING HERO
====================================================== */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background:
        linear-gradient(160deg, #0F1218 0%, #1A2A4A 50%, #2A1A08 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23E8A020' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
}

.hero-ang {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 2.2rem;
    color: var(--brand-gold);
    margin-bottom: -12px;
    position: relative;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: .02em;
    position: relative;
}

.hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 16px auto 32px;
    color: rgba(255,255,255,.75);
    position: relative;
}

.hero .btn {
    margin: 6px;
    min-width: 160px;
    padding: .65rem 1.6rem;
    position: relative;
}

/* Gold divider */
.gold-divider {
    width: 60px;
    height: 3px;
    background: var(--brand-gold);
    margin: 16px auto;
    border-radius: 2px;
}

/* ======================================================
   FEATURE CARDS (landing)
====================================================== */
.feature-card {
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--brand-gold);
}
.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

/* ======================================================
   DASHBOARD
====================================================== */
.dashboard-header {
    background: linear-gradient(135deg, var(--brand-dark) 0%, #1A2A4A 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--brand-gold);
}
.dashboard-header h2 { font-family: 'Playfair Display', serif; font-weight: 700; }
.dashboard-header p { margin-bottom: 0; opacity: .8; }

.dashboard-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}
.dashboard-card h5 {
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--brand-dark);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
}
.empty-state i { font-size: 2.8rem; margin-bottom: 12px; }

/* ======================================================
   CONTINUE READING
====================================================== */
.continue-reading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.continue-reading-book { font-size: 1.3rem; font-weight: 700; }
.continue-reading-chapter { color: var(--text-muted); }
.continue-reading .btn { min-width: 160px; }

/* ======================================================
   PROGRESS
====================================================== */
.progress-widget { margin-bottom: 18px; }
.progress-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: .9rem;
}
.progress { height: 10px; border-radius: 30px; background: var(--border); }
.progress-bar { border-radius: 30px; background: var(--brand-gold); }

/* ======================================================
   RECENT ACTIVITY
====================================================== */
.activity-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}
.activity-link {
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    padding: 4px 6px;
    margin: 0 -6px;
    transition: background var(--transition);
}
.activity-link:hover { filter: brightness(.96); color: inherit; }

/* ======================================================
   VERSE OF THE DAY
====================================================== */
.verse-card {
    background: linear-gradient(135deg, var(--brand-dark) 0%, #1A2A4A 100%);
    color: white;
    border-left: 4px solid var(--brand-gold);
}
.verse-card blockquote { font-size: 1.15rem; font-style: italic; margin-bottom: 16px; }
.verse-reference { font-weight: 700; color: var(--brand-gold); }

/* ======================================================
   SEARCH
====================================================== */
.search-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.search-result {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.search-result:hover { border-color: var(--brand-gold); }
.search-reference { font-weight: 700; color: var(--secondary); margin-bottom: 6px; }

/* ======================================================
   WIDGET LIST
====================================================== */
.widget-list { list-style: none; padding: 0; margin: 0; }
.widget-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.widget-list li:last-child { border-bottom: none; }

/* ======================================================
   PROFILE
====================================================== */
.profile-photo {
    width: 130px; height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--brand-gold);
    box-shadow: var(--shadow);
}
.profile-photo-placeholder {
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
    background: var(--border);
    font-size: 3rem;
    color: #aaa;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="date"],
.profile-form input[type="number"],
.profile-form input[type="file"],
.profile-form select,
.profile-form textarea {
    width: 100%;
    padding: .5rem .8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,160,32,.18);
}

/* ======================================================
   AUTH PAGES — Login & Register
====================================================== */

/* Page wrapper */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--bg-dark);
}

/* Left panel: Bible cover art */
.auth-cover {
    display: none;
    flex: 0 0 45%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

/* Dark gradient overlay so text is always readable */
.auth-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(15,18,24,.70) 0%,
        rgba(15,18,24,.35) 60%,
        rgba(15,18,24,.20) 100%
    );
}

.auth-cover-text {
    position: relative;
    z-index: 2;
}

@media (min-width: 900px) {
    .auth-cover { display: flex; flex-direction: column; justify-content: flex-end; padding: 48px 40px; }
}

.auth-cover-text .ang {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 2.2rem;
    color: var(--brand-gold);
    margin-bottom: -8px;
}
.auth-cover-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: .04em;
    margin: 0;
    line-height: 1;
}
.auth-cover-text p {
    color: rgba(255,255,255,.7);
    margin-top: 12px;
    font-size: 1rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Right panel: the form */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bg);
    overflow-y: auto;
}

.auth-form-box {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo .ang {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--brand-gold);
    margin-bottom: -4px;
}
.auth-logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0;
    letter-spacing: .04em;
}
.auth-logo p {
    color: var(--text-muted);
    font-size: .9rem;
    margin-top: 4px;
    margin-bottom: 0;
}

/* Auth card */
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 36px 28px;
    border: 1px solid var(--border);
}

.auth-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 6px;
}
.auth-card .auth-subtitle {
    color: var(--text-muted);
    font-size: .88rem;
    margin-bottom: 24px;
}

/* Form field groups */
.auth-field {
    margin-bottom: 18px;
}
.auth-field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: .01em;
}
.auth-field input {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .95rem;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,160,32,.18);
    background: #fff;
}
.auth-field input.is-invalid {
    border-color: var(--danger);
    box-shadow: none;
}
.auth-field input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(201,48,48,.15);
}

/* Field error */
.auth-field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    color: var(--danger);
    margin-top: 5px;
    font-weight: 500;
}
.auth-field-error::before {
    content: '⚠';
    font-size: .75rem;
}

/* Non-field / form-level error */
.auth-error-banner {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 4px solid var(--danger);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: .88rem;
    color: #991B1B;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.auth-error-banner::before { content: '✕'; font-weight: 700; flex-shrink: 0; padding-top: 1px; }

/* Auth submit button */
.auth-submit {
    width: 100%;
    padding: .75rem;
    background: var(--brand-dark);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 8px;
    transition: background var(--transition), transform var(--transition);
    letter-spacing: .01em;
}
.auth-submit:hover {
    background: var(--brand-gold);
    color: var(--brand-dark);
    transform: translateY(-1px);
}
.auth-submit:active { transform: translateY(0); }

/* Divider */
.auth-divider {
    text-align: center;
    margin: 20px 0 16px;
    font-size: .82rem;
    color: var(--text-muted);
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-divider span {
    background: var(--surface);
    padding: 0 10px;
    position: relative;
}

/* Forgot password link, under the password field */
.auth-forgot-link {
    text-align: right;
    margin-top: 6px;
}
.auth-forgot-link a {
    font-size: .82rem;
    color: var(--secondary);
    font-weight: 500;
}
.auth-forgot-link a:hover { color: var(--brand-gold); }

/* Social sign-in / sign-up buttons */
.auth-social-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 6px;
}
.auth-social-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.auth-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.auth-social-btn.auth-social-google { color: #EA4335; }
.auth-social-btn.auth-social-facebook { color: #1877F2; }
.auth-social-btn.auth-social-apple { color: #000; }

/* Footer link row */
.auth-footer-link {
    text-align: center;
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: 14px;
}
.auth-footer-link a {
    color: var(--secondary);
    font-weight: 600;
}
.auth-footer-link a:hover { color: var(--brand-gold); }

/* Mobile logo on small screens (cover hidden) */
@media (max-width: 899px) {
    .auth-logo { display: block; }
}
@media (min-width: 900px) {
    .auth-logo { display: none; }
}

/* ======================================================
   BACK TO TOP
====================================================== */
.back-to-top-wrap {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.back-to-top-btn {
    border-radius: 30px;
    padding: 8px 22px;
    font-weight: 600;
}

/* ======================================================
   RESPONSIVE
====================================================== */
@media (max-width: 992px) {
    .hero { padding: 64px 20px 48px; }
    .hero h1 { font-size: 2.8rem; }
    .dashboard-header { padding: 24px; }
    .continue-reading { display: block; }
    .continue-reading .btn { width: 100%; margin-top: 12px; }
}

@media (max-width: 768px) {
    .dashboard-card { padding: 16px; }
    .auth-card { padding: 28px 20px 22px; }
}

@media (max-width: 576px) {
    .hero h1 { font-size: 2.2rem; }
    .page-title { font-size: 1.65rem; }
}

/* ======================================================
   DARK MODE — full page
====================================================== */
body.dark-mode { background: #15171a; color: #e4e4e4; }
body.dark-mode #sidebarColumn,
body.dark-mode .offcanvas,
body.dark-mode .reader-panel {
    background: #1d1f23 !important;
    border-color: #2c2f33 !important;
    color: #e4e4e4;
}
body.dark-mode .sidebar-sticky .list-group-item { background: transparent; color: #d0d0d0; }
body.dark-mode .sidebar-sticky .list-group-item:hover { background: rgba(232,160,32,.12); color: #e8a020; }
body.dark-mode .card,
body.dark-mode .dashboard-card,
body.dark-mode .feature-card,
body.dark-mode .search-box,
body.dark-mode .search-result { background: #1d1f23; color: #e4e4e4; border-color: #2c2f33; box-shadow: none; }
body.dark-mode .card-header { background: #1d1f23; border-color: #2c2f33; }
body.dark-mode footer { background: #1d1f23; color: #e4e4e4; border-color: var(--brand-gold); }
body.dark-mode footer h5 { color: #fff; }
body.dark-mode footer a { color: #d0d0d0; }
body.dark-mode footer a:hover { color: var(--brand-gold); }
/* Links box stays the darkest surface in the footer even in dark mode,
   so it still reads as a distinct, emphasized area. */
body.dark-mode .footer-links-box { background: #0f1218; }
body.dark-mode .text-muted,
body.dark-mode .page-subtitle { color: #9aa0a6 !important; }
body.dark-mode .activity-link:hover { filter: brightness(1.25); }

/* ======================================================
   VERSE POPOVER — highlight & note prompt
   Uses position:fixed so it always appears near the
   selected text regardless of any ancestor CSS context.
====================================================== */

.verse-popover{
    position:fixed;
    z-index:1100;
    background:#fff;
    border-radius:14px;
    box-shadow:0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10);
    padding:14px;
    display:flex;
    flex-direction:column;
    gap:10px;
    width:270px;
    border:1px solid #e4ddd0;
}

.verse-popover-colors{
    display:flex;
    align-items:center;
    gap:8px;
}

.verse-color-btn{
    width:30px;
    height:30px;
    border-radius:50%;
    cursor:pointer;
    flex-shrink:0;
    transition:transform .15s ease, box-shadow .15s ease;
    padding:0;
    outline:none;
}

.verse-color-btn:hover{
    transform:scale(1.20);
    box-shadow:0 2px 8px rgba(0,0,0,.25);
}

.verse-color-clear{
    font-size:.8rem;
    color:#666;
    display:flex;
    align-items:center;
    justify-content:center;
}

.verse-popover-note-btn{
    width:30px;
    height:30px;
    border-radius:50%;
    border:2px solid #ccc;
    background:#fff;
    color:#555;
    cursor:pointer;
    flex-shrink:0;
    margin-left:4px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:.9rem;
    transition:transform .15s ease, box-shadow .15s ease;
}

.verse-popover-note-btn:hover{
    transform:scale(1.15);
    box-shadow:0 2px 8px rgba(0,0,0,.2);
}

body.dark-mode .verse-popover-note-btn{
    background:#2a2d31;
    border-color:#3a3d41;
    color:#e4e4e4;
}

.verse-popover-note{
    width:100%;
    border:1px solid #e4ddd0;
    border-radius:8px;
    padding:8px 10px;
    font-size:.88rem;
    font-family:'Inter',sans-serif;
    resize:vertical;
    min-height:72px;
    outline:none;
    transition:border-color .2s;
}

.verse-popover-note:focus{
    border-color:var(--brand-gold,#E8A020);
    box-shadow:0 0 0 3px rgba(232,160,32,.15);
}

.verse-popover-actions{
    display:flex;
    justify-content:space-between;
    gap:8px;
}

.verse-popover-actions .btn{
    font-size:.82rem;
    padding:.32rem .75rem;
}

/* Note icon shown after verse text */
.note-icon{
    display:inline-block;
    font-size:.72em;
    margin-left:1px;
    cursor:pointer;
    vertical-align:super;
    transition:transform .15s;
    line-height:1;
}
.note-icon:hover{ transform:scale(1.2); }

/* Dark mode */
body.dark-mode .verse-popover{
    background:#1d1f23;
    color:#e4e4e4;
    border-color:#2c2f33;
    box-shadow:0 8px 32px rgba(0,0,0,.45);
}
body.dark-mode .verse-popover-note{
    background:#2a2d31;
    color:#e4e4e4;
    border-color:#3a3d41;
}

/* ======================================================
   SIDEBAR BOOK ROW — book link + introduction icon
====================================================== */

.sidebar-book-row {
    display: flex;
    align-items: stretch;
}

.sidebar-book-row .book-link {
    flex: 1;
    border-radius: 8px 0 0 8px !important;
    border-right: none !important;
}

.sidebar-intro-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid #e4ddd0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--brand-gold, #E8A020);
    font-size: .85rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.sidebar-intro-btn:hover {
    background: var(--primary-light, #FDF3E0);
    color: var(--primary-dark, #C4841A);
}

body.dark-mode .sidebar-intro-btn {
    border-color: #2c2f33;
    color: var(--brand-gold, #E8A020);
}

body.dark-mode .sidebar-intro-btn:hover {
    background: rgba(232,160,32,.12);
}

/* ======================================================
   PAGE TRANSITION — fade-in + progress bar
====================================================== */

/* Thin gold progress bar at the very top of the page.
   Starts hidden; JS shows it immediately on link click. */
#page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--brand-gold, #E8A020);
    z-index: 9999;
    transition: width 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

#page-progress.loading {
    opacity: 1;
    width: 80%;          /* animate to 80% quickly */
    transition: width 0.6s ease;
}

#page-progress.done {
    width: 100%;
    opacity: 0;
    transition: width 0.1s ease, opacity 0.4s ease 0.1s;
}

/* Content area fades in smoothly on every page load */
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}

#contentColumn {
    animation: contentFadeIn 0.22s ease-out both;
}