/* ==========================================================================
   Eye-Friendly Dark Theme (Catppuccin Mocha / Tokyo Night Inspired)
   Soft contrast, zero harsh glare, optimized for prolonged reading comfort
   ========================================================================== */

:root, .navy, .coal, @media (prefers-color-scheme: dark) {
    /* Main Background & Text */
    --bg: #1e1e2e;
    --fg: #cdd6f4;

    /* Sidebar Navigation */
    --sidebar-bg: #181825;
    --sidebar-fg: #bac2de;
    --sidebar-non-existant: #585b70;
    --sidebar-active: #89b4fa;
    --sidebar-spacer: #313244;
    --sidebar-header-border-color: #313244;

    /* Links & Accents */
    --links: #89b4fa;
    --icons: #89b4fa;
    --icons-hover: #b4befe;
    --footnote-highlight: #89b4fa;

    /* Code & Syntax */
    --inline-code-color: #f38ba8;
    --search-mark-bg: #45475a;

    /* UI Elements & Popups */
    --theme-popup-bg: #181825;
    --theme-popup-border: #313244;
    --theme-hover: #313244;
    --overlay-bg: rgba(17, 17, 27, 0.7);

    /* Quotes & Callouts */
    --quote-bg: #24273a;
    --quote-border: #89b4fa;
    --warning-border: #fab387;

    /* Tables */
    --table-header-bg: #26273b;
    --table-border-color: #313244;
    --table-alternate-bg: #181825;

    /* Search Bar */
    --searchbar-border-color: #313244;
    --searchbar-bg: #24273a;
    --searchbar-fg: #cdd6f4;
    --searchbar-shadow-color: #11111b;
    --searchresults-header-fg: #a6adc8;
    --searchresults-border-color: #313244;
    --searchresults-li-bg: #1e1e2e;

    /* Scrollbars */
    --scrollbar: #45475a;

    --color-scheme: dark;
}

/* Light Theme Enhancements for Eye Comfort (Soft Warm White, Not Blinding) */
.light {
    --bg: #fafafa;
    --fg: #2c3e50;
    --sidebar-bg: #f3f4f6;
    --sidebar-fg: #334155;
    --sidebar-active: #2563eb;
    --links: #2563eb;
    --table-header-bg: #e2e8f0;
    --table-border-color: #cbd5e1;
    --table-alternate-bg: #f8fafc;
}

/* Code Block Enhancements */
pre {
    border-radius: 8px;
    border: 1px solid var(--sidebar-spacer);
}

/* Table Polish */
table {
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

table th {
    padding: 10px 14px;
    font-weight: 600;
}

table td {
    padding: 9px 14px;
}

/* Custom Footer with Disclaimer */
.custom-book-footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--sidebar-non-existant, #888);
}

.custom-book-footer hr {
    border: 0;
    border-top: 1px solid var(--sidebar-spacer, #313244);
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.custom-book-footer p {
    margin: 0;
    letter-spacing: 0.3px;
    font-weight: 500;
}
