/*
 * MUBS Brand Theme Override
 * Remaps Veltrix/Bootstrap primary colors to official MUBS brand colors:
 *   Navy  #0a1628  — dark backgrounds, sidebar
 *   Red   #d42b3a  — primary actions, highlights
 *   Blue  #2e7bb5  — secondary, links, info
 *   Yellow #f5c518 — accents, badges, active states
 */

/* ── Bootstrap CSS variable overrides ── */
:root {
    --bs-primary: #d42b3a;
    --bs-primary-rgb: 212, 43, 58;
    --bs-primary-text-emphasis: #8a1b24;
    --bs-primary-bg-subtle: #fae8ea;
    --bs-primary-border-subtle: #f0b0b5;

    --bs-secondary: #2e7bb5;
    --bs-secondary-rgb: 46, 123, 181;

    --bs-info: #2e7bb5;
    --bs-info-rgb: 46, 123, 181;
    --bs-info-text-emphasis: #1a4a6e;
    --bs-info-bg-subtle: #e0eef8;
    --bs-info-border-subtle: #a8d0ee;

    --bs-warning: #f5c518;
    --bs-warning-rgb: 245, 197, 24;
    --bs-warning-text-emphasis: #7a6209;
    --bs-warning-bg-subtle: #fef9e0;
    --bs-warning-border-subtle: #fbe99a;

    --bs-link-color: #2e7bb5;
    --bs-link-hover-color: #1a5a8a;
    --bs-link-color-rgb: 46, 123, 181;
}

/* ── Sidebar dark (data-sidebar=dark) ── */
[data-sidebar="dark"] {
    --bs-sidebar-dark-bg: #0a1628 !important;
    --bs-sidebar-dark-menu-item-color: #8fa8c8 !important;
    --bs-sidebar-dark-menu-sub-item-color: #8fa8c8 !important;
    --bs-sidebar-dark-menu-item-icon-color: #8fa8c8 !important;
    --bs-sidebar-dark-menu-item-hover-color: #ffffff !important;
    --bs-sidebar-dark-menu-item-active-color: #f5c518 !important;
    --bs-sidebar-dark-menu-item-active-bg: rgba(245, 197, 24, 0.1) !important;
}

/* ── Sidebar background & logo area ── */
.vertical-menu,
#sidebar-menu,
.navbar-brand-box {
    background-color: #0a1628 !important;
}

/* ── Sidebar active menu item ── */
#sidebar-menu ul li a.active,
#sidebar-menu ul li a:hover,
.mm-active > a {
    color: #f5c518 !important;
}

#sidebar-menu ul li a.active i,
#sidebar-menu ul li a:hover i,
.mm-active > a i {
    color: #f5c518 !important;
}

/* Active item background */
#sidebar-menu ul li a.active {
    background-color: rgba(245, 197, 24, 0.1) !important;
}

/* ── Topbar ── */
#page-topbar {
    background-color: #0a1628 !important;
}
#page-topbar .navbar-header,
#page-topbar .header-item,
#page-topbar .header-item span,
#page-topbar .nav-link,
#page-topbar a,
#page-topbar button.header-item {
    color: #c8d8e8 !important;
}
#page-topbar .header-item:hover,
#page-topbar a:hover {
    color: #ffffff !important;
}
/* Hamburger menu icon */
#page-topbar #vertical-menu-btn i {
    color: #c8d8e8 !important;
}
/* User name in topbar */
#page-topbar .d-none.d-sm-inline-block {
    color: #c8d8e8 !important;
}

[data-topbar="dark"] {
    --bs-header-bg: #0a1628 !important;
    --bs-header-item-color: #c8d8e8 !important;
}

/* ── Bootstrap primary button ── */
.btn-primary {
    background-color: #d42b3a !important;
    border-color: #d42b3a !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #b82230 !important;
    border-color: #b82230 !important;
}

/* ── Outline primary button ── */
.btn-outline-primary {
    color: #d42b3a !important;
    border-color: #d42b3a !important;
}
.btn-outline-primary:hover {
    background-color: #d42b3a !important;
    color: #fff !important;
}

/* ── Secondary / info buttons ── */
.btn-info {
    background-color: #2e7bb5 !important;
    border-color: #2e7bb5 !important;
    color: #fff !important;
}
.btn-info:hover {
    background-color: #246090 !important;
    border-color: #246090 !important;
}

/* ── Warning button ── */
.btn-warning {
    background-color: #f5c518 !important;
    border-color: #f5c518 !important;
    color: #0a1628 !important;
    font-weight: 600;
}
.btn-warning:hover {
    background-color: #d4a914 !important;
    border-color: #d4a914 !important;
    color: #0a1628 !important;
}

/* ── Badges — only target explicit bg-* badge classes, not soft variants ── */
.badge.bg-primary {
    background-color: #d42b3a !important;
}
.badge.bg-info {
    background-color: #2e7bb5 !important;
}
.badge.bg-warning {
    background-color: #f5c518 !important;
    color: #0a1628 !important;
}

/* Preserve soft background utility classes used in dashboard activity icons */
.bg-soft-primary {
    background-color: rgba(212, 43, 58, 0.1) !important;
    color: #d42b3a !important;
}
.bg-soft-success {
    background-color: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
}
.bg-soft-warning {
    background-color: rgba(245, 197, 24, 0.1) !important;
    color: #c9a000 !important;
}
.bg-soft-info {
    background-color: rgba(46, 123, 181, 0.1) !important;
    color: #2e7bb5 !important;
}
.bg-soft-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

/* ── Text colors ── */
.text-primary {
    color: #d42b3a !important;
}
.text-info {
    color: #2e7bb5 !important;
}
.text-warning {
    color: #f5c518 !important;
}

/* ── Links ── */
a {
    color: #2e7bb5;
}
a:hover {
    color: #1a5a8a;
}

/* ── Form focus rings ── */
.form-control:focus,
.form-select:focus {
    border-color: #2e7bb5 !important;
    box-shadow: 0 0 0 0.2rem rgba(46, 123, 181, 0.25) !important;
}

/* ── Pagination ── */
.page-item.active .page-link {
    background-color: #d42b3a !important;
    border-color: #d42b3a !important;
}
.page-link {
    color: #2e7bb5 !important;
}
.page-link:hover {
    color: #1a5a8a !important;
}

/* ── Nav tabs active ── */
.nav-tabs .nav-link.active {
    color: #d42b3a !important;
    border-bottom-color: #d42b3a !important;
}
.nav-pills .nav-link.active {
    background-color: #d42b3a !important;
}

/* ── Progress bars ── */
.progress-bar {
    background-color: #d42b3a !important;
}
.progress-bar.bg-info {
    background-color: #2e7bb5 !important;
}
.progress-bar.bg-warning {
    background-color: #f5c518 !important;
}

/* ── Alerts ── */
.alert-primary {
    background-color: #fae8ea;
    border-color: #f0b0b5;
    color: #8a1b24;
}
.alert-info {
    background-color: #e0eef8;
    border-color: #a8d0ee;
    color: #1a4a6e;
}

/* ── Card header accent — only on content area cards, not mini-stat or nav elements ── */
.main-content .card:not(.mini-stat) .card-header {
    border-top: 3px solid #d42b3a;
}

/* ── Card headers with explicit colored backgrounds (e.g. create/edit forms) ── */
.main-content .card-header[style*="background"],
.main-content .card-header[class*="bg-"] {
    background: #0a1628 !important;
    color: #ffffff !important;
    border-bottom: 3px solid #d42b3a !important;
    border-top: none !important;
}

/* ── Breadcrumb active ── */
.breadcrumb-item.active {
    color: #d42b3a;
}
.breadcrumb-item a {
    color: #2e7bb5;
}

/* ── Dropdown active ── */
.dropdown-item.active,
.dropdown-item:active {
    background-color: #d42b3a !important;
}

/* ── Dropdown items always dark text — fixes mobile rendering ── */
.dropdown-item,
.dropdown-item span {
    color: #333 !important;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f0f4f8;
    color: #0a1628 !important;
}
.dropdown-item.active span,
.dropdown-item:active span {
    color: #fff !important;
}

/* ── Checkbox / radio checked ── */
.form-check-input:checked {
    background-color: #d42b3a !important;
    border-color: #d42b3a !important;
}

/* ── Switch checked ── */
.form-check-input:checked[type="checkbox"] {
    background-color: #2e7bb5 !important;
    border-color: #2e7bb5 !important;
}

/* ── DataTables ── */
table.dataTable thead th,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #d42b3a !important;
    color: #fff !important;
    border-color: #d42b3a !important;
}

/* ── SweetAlert2 confirm button ── */
.swal2-confirm {
    background-color: #d42b3a !important;
    border-color: #d42b3a !important;
}

/* ── Select2 ── */
.select2-container--default .select2-results__option--highlighted {
    background-color: #2e7bb5 !important;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus
    .select2-selection--multiple {
    border-color: #2e7bb5 !important;
    box-shadow: 0 0 0 0.2rem rgba(46, 123, 181, 0.25) !important;
}

/* ── Mini-stat label pills inside dashboard cards — keep compact, don't override bg ── */
.mini-stat-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fff;
}
.mini-stat-label.bg-success {
    background-color: #28a745 !important;
}
.mini-stat-label.bg-warning {
    background-color: #f5c518 !important;
    color: #0a1628 !important;
}
.mini-stat-label.bg-info {
    background-color: #2e7bb5 !important;
}
.mini-stat-label.bg-primary {
    background-color: #d42b3a !important;
}

/* ── MUBS three-color accent bar — absolutely positioned, zero layout impact ── */
#page-topbar {
    overflow: visible !important;
}
#page-topbar::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        #d42b3a 33.3%,
        #2e7bb5 33.3% 66.6%,
        #f5c518 66.6%
    );
    z-index: 1003;
}

/* Remove the sidebar ::after that was breaking layout */
.vertical-menu {
    overflow: visible;
}

/* ── Logo area brand text ── */
.logo-txt,
.logo span {
    color: #f5c518 !important;
}

/* ── Page title ── */
.page-title-box h4 {
    color: #0a1628;
}

/* ── Coming soon menu items — not clickable ── */
#sidebar-menu a.coming-soon {
    cursor: not-allowed !important;
    opacity: 0.6;
    pointer-events: none;
}

/* ── Modal headers — MUBS navy with red accent ── */
.modal-header {
    background-color: #0a1628 !important;
    color: #ffffff !important;
    border-bottom: 3px solid #d42b3a !important;
}
.modal-header .modal-title,
.modal-header h5,
.modal-header h4 {
    color: #ffffff !important;
}
.modal-header .btn-close {
    filter: invert(1) !important;
}

/* ── Modal footer ── */
.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* ── Section titles inside modals / cards ── */
.section-title {
    color: #0a1628 !important;
    border-bottom-color: #d42b3a !important;
}

/* ── Left-border accent items (qualifications, employment, dtr-details) ── */
.qualification-item,
.employment-item,
.dtr-details {
    border-left-color: #d42b3a !important;
}

/* ── Membership tier badge colors ── */
.badge-tier-free {
    background-color: #6c757d !important;
    color: #fff !important;
}
.badge-tier-paid {
    background-color: #d42b3a !important;
    color: #fff !important;
}
.badge-tier-full {
    background-color: #2e7bb5 !important;
    color: #fff !important;
}
.badge-tier-honorary {
    background-color: #f5c518 !important;
    color: #0a1628 !important;
}
.badge-tier-life {
    background-color: #0a1628 !important;
    color: #fff !important;
}

/* Vote Now pulse animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}
