/*
 * Dark theme (SPEC section 1): only what the variables of bb-tokens.css cannot do by themselves.
 * Colours of panels, text, borders and statuses follow [data-bs-theme="dark"] in bb-tokens.css, so a template or style sheet that uses
 * var(--bb-...) is dark automatically. This file only re-colours Bootstrap's own utility classes and components.
 * Light is the default and is not touched by this file.
 */

/* ---- Bootstrap utility classes used in the templates ---- */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bb-card) !important;
    color: var(--bb-text);
    border-color: var(--bb-border);
}

[data-bs-theme="dark"] .text-dark { color: var(--bb-text) !important; }
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary { color: var(--bb-muted) !important; }
[data-bs-theme="dark"] .text-primary { color: var(--bb-accent-text) !important; }

/* ---- Forms ---- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .filled-select,
[data-bs-theme="dark"] .ts-wrapper .ts-control,
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control,
[data-bs-theme="dark"] .ts-dropdown {
    background-color: var(--bb-surface-2) !important;
    color: var(--bb-text) !important;
    border-color: var(--bb-border-strong) !important;
}

[data-bs-theme="dark"] .form-control::placeholder { color: var(--bb-subtle); }

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled {
    background-color: var(--bb-card-2) !important;
    color: var(--bb-muted) !important;
}

/* ---- Buttons that Bootstrap paints light ---- */
[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .filter-btn,
[data-bs-theme="dark"] .sort-btn,
[data-bs-theme="dark"] .pagination-btn,
[data-bs-theme="dark"] .pagination-number,
[data-bs-theme="dark"] .btn-export {
    background-color: var(--bb-surface-2) !important;
    color: var(--bb-text) !important;
    border-color: var(--bb-border-strong) !important;
}

/* ---- Modals, dropdowns, tables, pagination, date pickers ---- */
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .drp-calendar {
    background-color: var(--bb-card);
    color: var(--bb-text);
    border-color: var(--bb-border);
}

[data-bs-theme="dark"] .table {
    --bs-table-color: var(--bb-text);
    --bs-table-border-color: var(--bb-border);
}

[data-bs-theme="dark"] .page-link {
    --bs-pagination-color: var(--bb-text);
    --bs-pagination-bg: var(--bb-card);
    --bs-pagination-disabled-bg: var(--bb-card);
    --bs-pagination-disabled-color: var(--bb-muted);
    --bs-pagination-border-color: var(--bb-border);
    color: var(--bb-text);
    background-color: var(--bb-card);
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: var(--bb-primary-solid);
    color: var(--bb-on-solid);
}

/* ---- Logos switch version with the theme (dark background -> Light Logo) ---- */
.theme-logo-on-dark { display: none; }
[data-bs-theme="dark"] .theme-logo-on-dark { display: inline-block; }
[data-bs-theme="dark"] .theme-logo-on-light { display: none; }

/* ---- Under Review highlight (SPEC section 5): yellow stays yellow with dark text in both themes ---- */
[data-bs-theme="dark"] .bb-changed,
[data-bs-theme="dark"] .bb-changed-note {
    background-color: var(--bb-warning-fill) !important;
    color: #171717 !important;
}
