/* Bootstrap theme overrides for wave-networks-core */

/* =============================================
   Color mode overrides
   ============================================= */

/*
 * Sidebar: default dark appearance (fallback when no child-app theme loaded).
 * No !important here — child-app themes load after this and should be able
 * to override these defaults with their own sidebar styling.
 */
#sidebar {
    background-color: #212529;
    color: #fff;
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

#sidebar .nav-link:hover {
    color: #fff;
}

#sidebar .nav-link.active {
    color: #fff;
}

/*
 * Sidebar ADA compliance: when the sidebar has data-bs-theme="dark" (admin app),
 * force solid dark background and light text to meet WCAG contrast.
 * Scoped to #sidebar[data-bs-theme="dark"] so child-app themes that don't
 * set data-bs-theme on the sidebar can style it freely.
 */
#sidebar[data-bs-theme="dark"] {
    background-color: #212529 !important;
    color: #fff !important;
}

#sidebar[data-bs-theme="dark"] .sidebar-brand-text,
#sidebar[data-bs-theme="dark"] .sidebar-brand-icon {
    color: #fff !important;
}

#sidebar[data-bs-theme="dark"] .nav-link,
#sidebar[data-bs-theme="dark"] .nav-link .sidebar-text,
#sidebar[data-bs-theme="dark"] .nav-link .sidebar-icon {
    color: rgba(255, 255, 255, 0.85) !important;
}

#sidebar[data-bs-theme="dark"] .nav-link:hover,
#sidebar[data-bs-theme="dark"] .nav-link:hover .sidebar-text,
#sidebar[data-bs-theme="dark"] .nav-link:hover .sidebar-icon {
    color: #fff !important;
}

#sidebar[data-bs-theme="dark"] .nav-link.active,
#sidebar[data-bs-theme="dark"] .nav-link.active .sidebar-text,
#sidebar[data-bs-theme="dark"] .nav-link.active .sidebar-icon {
    color: #fff !important;
}

/*
 * badge.bg-light in dark mode: prevent bright white rectangle.
 * Used e.g. for shard badges in the users table.
 */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .badge.text-dark {
    color: var(--bs-body-color) !important;
}

/*
 * Top navbar form controls: ensure legibility in light mode.
 * Some themes redefine --bs-body-color to white globally, making
 * form text invisible on a light navbar. Only override in light mode
 * and only for the navbar controls, not the whole page.
 */
[data-bs-theme="light"] #topNav .form-select,
[data-bs-theme="light"] #topNav .form-control {
    color: #212529 !important;
}

/*
 * Notification dropdown: force dark text in light mode so the list is
 * readable even when a child-app theme has overridden --bs-body-color
 * to white globally. Dropdown-menu inherits the navbar context.
 */
[data-bs-theme="light"] #notifDropdown,
[data-bs-theme="light"] #notifDropdown .dropdown-item,
[data-bs-theme="light"] #notifDropdown .dropdown-item .fw-semibold {
    color: #212529 !important;
}

[data-bs-theme="light"] #notifDropdown .text-muted {
    color: #6c757d !important;
}

[data-bs-theme="light"] #notifDropdown .dropdown-item:hover,
[data-bs-theme="light"] #notifDropdown .dropdown-item:focus {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}
