/* Shared dark mode, for pages that load /js/theme.js (see the notes there).
   Bootstrap 5.3 switches its own components when <html data-bs-theme="dark">; these rules
   swap its default greys for the ShareholderView slate palette and fix the shared partials.
   Page-specific dark colours stay in each page's own <style>. */

:root[data-bs-theme="dark"] {
    --bs-body-bg: #0F172A;
    --bs-body-bg-rgb: 15, 23, 42;
    --bs-body-color: #CBD5E1;
    --bs-body-color-rgb: 203, 213, 225;
    --bs-emphasis-color: #F8FAFC;
    --bs-emphasis-color-rgb: 248, 250, 252;
    --bs-secondary-color: #94A3B8;
    --bs-secondary-color-rgb: 148, 163, 184;
    --bs-secondary-bg: #1E293B;
    --bs-secondary-bg-rgb: 30, 41, 59;
    --bs-tertiary-color: #64748B;
    --bs-tertiary-bg: #1E293B;
    --bs-tertiary-bg-rgb: 30, 41, 59;
    --bs-heading-color: #F8FAFC;
    --bs-border-color: #334155;
    --bs-border-color-translucent: rgba(148, 163, 184, 0.18);
}

/* Cards and pop-ups sit one step above the page. */
:root[data-bs-theme="dark"] .modal { --bs-modal-bg: #1E293B; }
:root[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-bg: #1E293B; }
:root[data-bs-theme="dark"] .card { --bs-card-bg: #1E293B; }
:root[data-bs-theme="dark"] .form-control,
:root[data-bs-theme="dark"] .form-select { background-color: #0F172A; border-color: #334155; color: #F8FAFC; }
:root[data-bs-theme="dark"] .form-control::placeholder { color: #64748B; }

:root[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #CBD5E1; --bs-btn-border-color: #475569;
    --bs-btn-hover-bg: #334155; --bs-btn-hover-border-color: #475569; --bs-btn-hover-color: #F8FAFC;
}

/* Top navigation bar (partials/navbar.html) on Home and the signed-out pages. It uses
   navbar-light and bg-light, which Bootstrap keeps light. */
:root[data-theme="dark"] #top-navbar .navbar {
    background-color: #0F172A !important;
    border-bottom: 1px solid #1E293B;
    --bs-navbar-color: #CBD5E1;
    --bs-navbar-hover-color: #F8FAFC;
    --bs-navbar-active-color: #F8FAFC;
    --bs-navbar-toggler-border-color: #334155;
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28248, 250, 252, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Phone menu bar (partials/mobile-nav.html) uses bg-light, which Bootstrap keeps light. */
:root[data-theme="dark"] #mobile-nav .navbar {
    background-color: #0F172A !important;
    border-bottom: 1px solid #1E293B;
    color: #F8FAFC;
}
:root[data-theme="dark"] #mobile-nav .navbar-toggler { border-color: #334155; }
:root[data-theme="dark"] #mobile-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28248, 250, 252, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
