/* ============================================================
   THEME VARIABLES (DARK MODE DEFAULT)
   ============================================================ */

:root {
    --bg: #0d0d0d;
    --text: #f5f5f5;
    --text-secondary: #d4d4d4;

    --gold: #d4af37;
    --panel: #050505;
    --input-bg: #111111;
    --shadow-gold: rgba(212,175,55,0.45);

    --link: #d4af37;
    --link-hover: #f7d774;
    --highlight-bg: #222;
    --highlight-text: #ffffff;

    --card-bg: #0a0a23;
    --border-color: #d4af37;

    --toggle-bg: var(--gold);
    --toggle-text: #000;
    --toggle-shadow: rgba(212,175,55,0.65);
}

/* ============================================================
   LIGHT THEME VARIABLES
   ============================================================ */

:root.light {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #333333;

    --gold: #b8860b;
    --panel: #f5f5f5;
    --input-bg: #ffffff;
    --shadow-gold: rgba(184,134,11,0.35);

    --link: #0056b3;
    --link-hover: #003d80;
    --highlight-bg: #e6f0ff;
    --highlight-text: #000000;

    --card-bg: #f2f2f2;
    --border-color: #0a0a23;

    --toggle-bg: var(--gold);
    --toggle-text: #000;
    --toggle-shadow: rgba(184,134,11,0.55);
}

/* ============================================================
   GLOBAL THEME APPLICATION
   ============================================================ */

html, body {
    transition: background 0.35s ease, color 0.35s ease;
}

body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    font-family: 'Georgia', serif;
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover {
    color: var(--link-hover);
}

/* ============================================================
   UNIVERSAL GOLD BUTTON STYLE
   ============================================================ */

.gold-btn {
    padding: 12px 22px;
    background: var(--toggle-bg);
    color: var(--toggle-text);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 12px var(--toggle-shadow);
    transition: all 0.25s ease;
    display: inline-block;
}

.gold-btn:hover {
    background: var(--link-hover);
    box-shadow: 0 0 18px var(--toggle-shadow);
}

/* Compact version for book menu */
.book-link {
    margin: 6px;
    font-size: 14px;
    padding: 8px 14px;
}

/* Smaller footer buttons */
.footer-btn {
    margin: 4px;
    font-size: 14px;
    padding: 8px 14px;
}

/* ============================================================
   BOOK MENU (GOLD FRAME)
   ============================================================ */

#bookMenu {
    background: var(--card-bg);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 12px 0;
    margin-bottom: 15px;
}

/* ============================================================
   FOOTER (USED ON POLICY PAGES ONLY)
   ============================================================ */

footer {
    background: var(--card-bg);
    color: var(--text);
    padding: 25px 0;
    text-align: center;
    margin-top: 40px;
}

/* Light mode footer overrides */
:root.light footer {
    background: #ffffff !important;
    color: #000 !important;
    border-top: 1px solid #00000020 !important;
}

/* ============================================================
   LIGHT MODE FIXES FOR BIBLE ENGINE
   ============================================================ */

:root.light #bibleResults,
:root.light #bibleResults * {
    color: #111 !important;
    text-shadow: none !important;
}

:root.light .rc-btn {
    background: #ffffff !important;
    color: #000 !important;
    border-color: #000 !important;
}

:root.light .rc-btn:hover {
    background: #000 !important;
    color: #fff !important;
}

:root.light #ot-section,
:root.light #nt-section,
:root.light #ot,
:root.light #nt {
    background: #ffffff !important;
}

:root.light .rc-book,
:root.light .rc-chapter-number,
:root.light .rc-verse-number {
    color: #222 !important;
}

:root.light .rc-chapter-heading,
:root.light .rc-verse-heading {
    color: #333 !important;
}

:root.light .rc-chapter-active,
:root.light .rc-verse-active {
    background: rgba(0,0,0,0.12) !important;
    color: #000 !important;
}

:root.light .rc-language-option {
    color: #222 !important;
    background: #ffffff !important;
}

:root.light .rc-language-active {
    background: rgba(0,0,0,0.12) !important;
    color: #000 !important;
}

/* ============================================================
   LOGO FRAME
   ============================================================ */

.rc-logo-frame {
    width: 100%;
    margin: 3px auto 25px auto;
    padding: 10px;
    border: 3px solid var(--gold);
    border-radius: 14px;
    box-shadow: 0 0 25px var(--shadow-gold);
    text-align: center;
    background: var(--bg);
    animation: fadeIn 0.8s ease-out;
}

.rc-logo-frame img {
    width: 100%;
    max-width: 500px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 12px var(--shadow-gold));
}

/* ============================================================
   GLOBAL LAYOUT
   ============================================================ */

/* neutralized old layout hack */
body > div {
    /* max-width: 100% !important; */
}

/* ============================================================
   LANGUAGE LIST (DIV-BASED)
   ============================================================ */

.rc-language-option {
    cursor: pointer;
    color: var(--gold);
    font-size: 26px;
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 6px;
    transition: background 0.25s ease, color 0.25s ease;
}

.rc-language-option:hover {
    background: rgba(212,175,55,0.18);
    color: var(--text);
}

.rc-language-active {
    background: rgba(212,175,55,0.28);
    color: var(--text);
    box-shadow: 0 0 6px var(--shadow-gold);
}

/* ============================================================
   GOLD FRAME CONTAINER (MASTER CONTAINER)
============================================================ */

.master-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 25px;
    background: #1a1a1a;
    border: 3px solid #d4af37;
    border-radius: 12px;
    box-sizing: border-box;
}

/* ============================================================
   ⭐ LIGHT MODE FIX — MASTER CONTAINER BACKGROUND
   ============================================================ */
:root.light .master-container {
    background: #ffffff !important;   /* pure white */
    color: #000000 !important;        /* readable text */
    border-color: var(--gold) !important;
}


/* ============================================================
   CENTERED PANEL (INNER WRAPPER)
============================================================ */

.centered-panel {
    width: auto;
    margin: 0 auto;
    text-align: center;
}

/* ============================================================
   SEARCH INPUT + BUTTON — FIXED + CENTERED
============================================================ */

#bibleSearchInput {
    width: 90%;
    max-width: 500px;
    padding: 16px;
    font-size: 1.2rem;
    border: 2px solid var(--gold);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--gold);
    box-shadow: inset 0 0 12px var(--shadow-gold);
    margin: 0 auto;
    display: block;
    text-align: center;
}

#searchButton,
button.searchButton,
button#searchButton {
    width: 90%;
    max-width: 300px;
    margin: 20px auto 0 auto;
    padding: 18px 26px;
    font-size: 1.2rem;
    border-radius: 10px;
    background: var(--gold);
    color: var(--bg);
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 15px var(--shadow-gold);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
}

#searchButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--shadow-gold);
}

#rc-bible-search {
    width: 90%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ============================================================
   Gold glow + focus overrides (latest)
   ============================================================ */

#bibleSearchInput {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
    border: 1px solid var(--gold);
    background-color: var(--input-bg);   /* ⭐ uses theme variable */
    color: var(--text);                  /* ⭐ uses theme variable */
}

#bibleSearchInput:focus {
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.55);
    outline: none;
}

/* Search button stays the same */
#searchButton {
    width: 90%;
    max-width: 300px;
    margin: 20px auto 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* ============================================================
   BOOKS CONTAINER
============================================================ */

.rc-books-container {
    width: 100%;
    margin-top: 25px;
    padding: 18px;
    border: 1px solid var(--gold);
    border-radius: 10px;
    background: var(--panel);
    font-size: 28px;
}

.rc-section-title {
    cursor: pointer;
    font-weight: 600;
    color: var(--gold);
    margin: 12px 0;
    padding: 10px;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: rgba(212,175,55,0.08);
    font-size: 32px;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.rc-book:hover {
    text-decoration: underline;
    background: rgba(212,175,55,0.16); /* gold highlight */
    color: var(--text); /* keep text dark */
}

/* ============================================================
   PROPHETIC SERIES (10 BOOKS ON HOMEPAGE)
============================================================ */

.rc-prophetic-series-container {
    width: 100%;
    margin-top: 25px;
    padding: 18px;
    border: 1px solid var(--gold);
    border-radius: 10px;
    background: var(--panel);
    font-size: 28px;
}

.rc-prophetic-series-title {
    cursor: pointer;
    font-weight: 600;
    color: var(--gold);
    margin: 12px 0;
    padding: 10px;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: rgba(212,175,55,0.08);
    font-size: 32px;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.rc-prophetic-series-title:hover {
    background: rgba(212,175,55,0.16);
    box-shadow: 0 0 10px var(--shadow-gold);
}

/* ============================================================
   PROPHETIC SERIES BOOK BUTTONS
============================================================ */

.rc-prophetic-book {
    cursor: pointer;
    color: var(--gold);
    font-weight: 600;
    display: block;
    margin: 8px 0;
    font-size: 26px;
    padding: 10px 14px;
    border-radius: 6px;
    transition: background 0.25s ease, color 0.25s ease;
}

.rc-prophetic-book:hover {
    background: rgba(212,175,55,0.16);
    color: var(--text); /* stays readable */
}

/* ============================================================
   BIBLE NAVIGATION
============================================================ */

.rc-book {
    cursor: pointer;
    color: var(--gold);
    font-weight: 600;
    display: block;
    margin: 8px 0;
    font-size: 26px;
    transition: color 0.2s ease;
}

.rc-book:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

.rc-section-body {
    display: none;
}

.rc-section-body.open {
    display: block;
}

.rc-chapters {
    display: none;
    margin-left: 15px;
}

.rc-chapters.open {
    display: block;
}

.rc-chapter-number {
    cursor: pointer;
    color: var(--text);
    font-size: 26px;
    font-weight: 600;
    display: inline-block;
    margin-right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.rc-chapter-number:hover {
    text-decoration: underline;
    color: var(--text);
}

.rc-chapter-active {
    background: rgba(212,175,55,0.22);
    color: var(--text);
    box-shadow: 0 0 8px var(--shadow-gold);
}

/* ============================================================
   VERSE CONTAINER
============================================================ */

.rc-verses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    max-width: 100%;
}

/* ============================================================
   VERSE NUMBERS
============================================================ */

.rc-verse-number {
    cursor: pointer;
    color: var(--gold);
    font-size: 24px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    white-space: nowrap;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.rc-verse-number:hover {
    text-decoration: underline;
    color: var(--text);
    transform: scale(1.15);
}

.rc-verse-active {
    background: rgba(212,175,55,0.25);
    color: var(--text);
    animation: glowPulse 1.5s infinite ease-in-out;
}

/* ============================================================
   BREADCRUMB & RESULTS
============================================================ */

.rc-breadcrumb {
    margin-top: 22px;
    font-size: 28px;
    color: var(--gold);
}

.rc-breadcrumb span {
    color: var(--text);
}

#bibleResults {
    margin-top: 18px;
    font-size: 44px;
    line-height: 1.7;
    color: var(--text);
}

/* ============================================================
   ANIMATIONS
============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 15px var(--shadow-gold); }
    50% { box-shadow: 0 0 25px var(--shadow-gold); }
    100% { box-shadow: 0 0 15px var(--shadow-gold); }
}

/* ============================================================
   MOBILE OPTIMIZATION
============================================================ */

@media (max-width: 800px) {
    #bibleSearchInput {
        font-size: 32px;
        padding: 14px;
    }

    #searchButton {
        font-size: 32px;
        padding: 16px;
    }

    .rc-books-container {
        font-size: 24px;
    }

    .rc-section-title {
        font-size: 28px;
    }

    .rc-book {
        font-size: 26px;
    }

    .rc-chapter-number {
        font-size: 22px;
    }

    .rc-verse-number {
        font-size: 20px;
    }

    .rc-breadcrumb {
        font-size: 24px;
    }

    #bibleResults {
        font-size: 36px;
    }
}

@media (max-width: 400px) {
    #bibleSearchInput {
        font-size: 28px;
        padding: 12px;
    }

    #searchButton {
        font-size: 28px;
        padding: 14px;
    }

    .rc-book {
        font-size: 24px;
    }

    .rc-chapter-number {
        font-size: 20px;
    }

    .rc-verse-number {
        font-size: 18px;
    }

    #bibleResults {
        font-size: 32px;
    }
}

/* ============================================================
   LEGAL LINKS
============================================================ */

.legal-links a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
    padding: 2px 4px;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.legal-links a:hover {
    color: var(--link-hover);
    text-shadow: 0 0 6px var(--shadow-gold);
}

.legal-links {
    margin-top: 12px;
    margin-bottom: 18px;
    line-height: 1.6;
}

/* ============================================================
   MISC LAYOUT
============================================================ */

body, html {
    padding-bottom: env(safe-area-inset-bottom);
    padding-bottom: constant(safe-area-inset-bottom);
}

body {
    padding-bottom: 40px;
}

.section {
    display: none;
    margin-top: 10px;
}

.book {
    background: #222;
    padding: 12px 10px;
    margin: 8px auto;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gold);
    font-weight: bold;
    font-size: 1.4rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.chapters {
    display: none;
    margin-top: 6px;
    text-align: center;
}

.chapters a {
    display: inline-block;
    margin: 6px;
    padding: 8px 12px;
    background: #333;
    color: var(--text);
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
}

/* ============================================================
   PROTECT KEYWORD SEARCH RESULTS BOX (HOMEPAGE ONLY)
   ============================================================ */

#resultsContainer {
    display: block !important;
    position: relative !important;
    z-index: 10 !important;
    min-height: 50px !important;
    padding: 10px !important;
    background: var(--card-bg) !important;
    color: var(--text) !important;
}

/* ============================================================
   ⭐ KEYWORD HIGHLIGHT (FINAL FIX)
   ============================================================ */
.highlight {
    background: rgba(212, 175, 55, 0.35);
    color: var(--gold) !important;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 3px;
}

/* TEXT SIZING */
#booksTitle { font-size: 1.4rem !important; }
.rc-section-title { font-size: 1.2rem !important; padding: 10px !important; }
#bibleResults { font-size: 1.2rem !important; line-height: 1.6 !important; }
#helperText { font-size: 1rem !important; }

/* ⭐ FINAL FIXED FLOATING BAR — ALWAYS VISIBLE ⭐ */
.action-bar {
    position: fixed;
    bottom: 90px; /* safely above TTS bar on all Android devices */
    left: 0;
    width: 100%;
    background: var(--bg-color, #111);
    border-top: 2px solid gold;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    z-index: 999999;
}

.action-btn {
    background: gold;
    color: black;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    border: none;
    font-size: 16px;
}

.hidden {
    display: none;
}