/*
 * PowerERM Theme Overrides
 * ========================
 * This file overrides Bootstrap 5 CSS custom properties to apply a custom theme.
 * It loads AFTER bootstrap.css so it takes precedence, but never modifies Bootstrap source.
 * Updating Bootstrap will NOT affect these overrides.
 *
 * To change the theme, update the color values below.
 */

:root,
[data-bs-theme=light] {

    /* ── Primary ── */
    --bs-blue: #0d4374;
    --bs-primary: #0d4374;
    --bs-primary-rgb: 13, 67, 116;
    --bs-primary-text-emphasis: #051b2e;
    --bs-primary-bg-subtle: #cfd9e3;
    --bs-primary-border-subtle: #9fb3c8;
    --bs-link-color: #0d4374;
    --bs-link-color-rgb: 13, 67, 116;
    --bs-link-hover-color: #0a355d;
    --bs-link-hover-color-rgb: 10, 53, 93;

    /* ── Secondary ── */
    /* --bs-secondary: #6c757d; */
    /* --bs-secondary-rgb: 108, 117, 125; */

    /* ── Success ── */
    /* --bs-success: #2fb380; */
    /* --bs-success-rgb: 47, 179, 128; */

    /* ── Info ── */
    /* --bs-info: #3459e6; */
    /* --bs-info-rgb: 52, 89, 230; */

    /* ── Warning ── */
    /* --bs-warning: #f4bd61; */
    /* --bs-warning-rgb: 244, 189, 97; */

    /* ── Danger ── */
    /* --bs-danger: #da292e; */
    /* --bs-danger-rgb: 218, 41, 46; */

    /* ── Dark ── */
    /* --bs-dark: #212529; */
    /* --bs-dark-rgb: 33, 37, 41; */
}

/* ── Component overrides that use hardcoded colors instead of variables ── */

/* Navbar: Bootstrap bg-primary uses hardcoded background in some themes */
.navbar.bg-primary,
.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* Buttons */
.btn-primary {
    --bs-btn-bg: #0d4374;
    --bs-btn-border-color: #0d4374;
    --bs-btn-hover-bg: #0a355d;
    --bs-btn-hover-border-color: #092e52;
    --bs-btn-active-bg: #092e52;
    --bs-btn-active-border-color: #082847;
    --bs-btn-disabled-bg: #0d4374;
    --bs-btn-disabled-border-color: #0d4374;
    --bs-btn-focus-shadow-rgb: 49, 95, 137;
}

.btn-outline-primary {
    --bs-btn-color: #0d4374;
    --bs-btn-border-color: #0d4374;
    --bs-btn-hover-bg: #0d4374;
    --bs-btn-hover-border-color: #0d4374;
    --bs-btn-active-bg: #0d4374;
    --bs-btn-active-border-color: #0d4374;
    --bs-btn-disabled-color: #0d4374;
    --bs-btn-disabled-border-color: #0d4374;
    --bs-btn-focus-shadow-rgb: 13, 67, 116;
}

/* Badge */
.badge.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* Pagination */
.page-link {
    --bs-pagination-active-bg: #0d4374;
    --bs-pagination-active-border-color: #0d4374;
    --bs-pagination-color: #0d4374;
    --bs-pagination-hover-color: #0a355d;
}

/* Nav tabs / pills */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--bs-primary);
}

.nav-link {
    --bs-nav-link-color: #0d4374;
    --bs-nav-link-hover-color: #0a355d;
}

/* Progress bar */
.progress-bar {
    --bs-progress-bar-bg: #0d4374;
}

/* List group */
.list-group-item.active {
    --bs-list-group-active-bg: #0d4374;
    --bs-list-group-active-border-color: #0d4374;
}

/* Dropdown */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--bs-primary);
}

/* Accordion */
.accordion-button:not(.collapsed) {
    color: #0d4374;
    background-color: #cfd9e3;
}
.accordion-button:focus {
    border-color: #9fb3c8;
    box-shadow: 0 0 0 0.25rem rgba(13, 67, 116, 0.25);
}

/* Focus ring */
:root {
    --bs-focus-ring-color: rgba(13, 67, 116, 0.25);
}
.form-control:focus,
.form-select:focus {
    border-color: #9fb3c8;
    box-shadow: 0 0 0 0.25rem rgba(13, 67, 116, 0.25);
}
.form-check-input:checked {
    background-color: #0d4374;
    border-color: #0d4374;
}
.form-check-input:focus {
    border-color: #9fb3c8;
    box-shadow: 0 0 0 0.25rem rgba(13, 67, 116, 0.25);
}
.form-switch .form-check-input:checked {
    background-color: #0d4374;
    border-color: #0d4374;
}

/* Text utilities */
.text-primary {
    color: var(--bs-primary) !important;
}
.border-primary {
    border-color: var(--bs-primary) !important;
}

/* Alert primary */
.alert-primary {
    --bs-alert-color: #051b2e;
    --bs-alert-bg: #cfd9e3;
    --bs-alert-border-color: #9fb3c8;
    --bs-alert-link-color: #051b2e;
}

/* Table primary */
.table-primary {
    --bs-table-bg: #cfd9e3;
    --bs-table-border-color: #b9c3cd;
}
