/* Custom Primary Color Override for MLM System */
/* Primary Color: #498fc0 */

:root {
    /* Override Bootstrap primary color variables */
    --bs-primary: #498fc0;
    --bs-primary-rgb: 73, 143, 192;
    
    /* Override link colors */
    --bs-link-color: #498fc0;
    --bs-link-hover-color: #3a7ca6;
    
    /* Button primary colors */
    --bs-btn-primary-bg: #498fc0;
    --bs-btn-primary-border: #498fc0;
    --bs-btn-primary-hover-bg: #3a7ca6;
    --bs-btn-primary-hover-border: #326b8f;
    --bs-btn-primary-active-bg: #326b8f;
    --bs-btn-primary-active-border: #2a5a7a;
    
    /* Form controls */
    --bs-form-valid-border-color: #498fc0;
    --bs-form-focus-border-color: #498fc0;
}

/* Bootstrap Component Overrides */

/* Primary Button */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #498fc0;
    --bs-btn-border-color: #498fc0;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #3a7ca6;
    --bs-btn-hover-border-color: #326b8f;
    --bs-btn-focus-shadow-rgb: 73, 143, 192;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #326b8f;
    --bs-btn-active-border-color: #2a5a7a;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #498fc0;
    --bs-btn-disabled-border-color: #498fc0;
}

/* Outline Primary Button */
.btn-outline-primary {
    --bs-btn-color: #498fc0;
    --bs-btn-border-color: #498fc0;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #498fc0;
    --bs-btn-hover-border-color: #498fc0;
    --bs-btn-focus-shadow-rgb: 73, 143, 192;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #498fc0;
    --bs-btn-active-border-color: #498fc0;
    --bs-btn-disabled-color: #498fc0;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #498fc0;
}

/* Border Primary */
.border-primary {
    border-color: #498fc0 !important;
}

/* Background Primary */
.bg-primary {
    background-color: #498fc0 !important;
}

.bg-primary.bg-opacity-10 {
    background-color: rgba(73, 143, 192, 0.1) !important;
}

.bg-primary.bg-opacity-15 {
    background-color: rgba(73, 143, 192, 0.15) !important;
}

.bg-primary.bg-opacity-20 {
    background-color: rgba(73, 143, 192, 0.2) !important;
}

.bg-primary.bg-opacity-25 {
    background-color: rgba(73, 143, 192, 0.25) !important;
}

.bg-primary.bg-opacity-50 {
    background-color: rgba(73, 143, 192, 0.5) !important;
}

.bg-primary.bg-opacity-75 {
    background-color: rgba(73, 143, 192, 0.75) !important;
}

/* Text Primary */
.text-primary {
    color: #498fc0 !important;
}

/* Badge Primary */
.badge.bg-primary {
    background-color: #498fc0 !important;
}

/* Progress Bar Primary */
.progress-bar.bg-primary,
.progress-bar:not([class*="bg-"]) {
    background-color: #498fc0 !important;
}

/* Form Controls */
.form-control:focus {
    border-color: #498fc0;
    box-shadow: 0 0 0 0.25rem rgba(73, 143, 192, 0.25);
}

.form-check-input:checked {
    background-color: #498fc0;
    border-color: #498fc0;
}

.form-check-input:focus {
    border-color: #7ab0d6;
    box-shadow: 0 0 0 0.25rem rgba(73, 143, 192, 0.25);
}

/* Form Range */
.form-range::-webkit-slider-thumb {
    background-color: #498fc0;
}

.form-range::-webkit-slider-thumb:active {
    background-color: #a7c7e8;
}

.form-range::-moz-range-thumb {
    background-color: #498fc0;
}

.form-range::-moz-range-thumb:active {
    background-color: #a7c7e8;
}

/* Links */
a {
    color: #498fc0;
}

a:hover {
    color: #3a7ca6;
}

/* List Group */
.list-group-item-primary {
    color: #1c3745;
    background-color: #d1e7f3;
}

.list-group-item-primary.list-group-item-action:hover,
.list-group-item-primary.list-group-item-action:focus {
    color: #1c3745;
    background-color: #bcdcec;
}

.list-group-item-primary.list-group-item-action.active {
    color: #fff;
    background-color: #1c3745;
    border-color: #1c3745;
}

/* Alert Primary */
.alert-primary {
    color: #2c578f;
    background-color: rgba(73, 143, 192, 0.1);
    border-color: rgba(73, 143, 192, 0.2);
}

.alert-primary .alert-link {
    color: #1c3745;
}

/* Pagination */
.page-link {
    color: #498fc0;
}

.page-link:hover {
    color: #3a7ca6;
    background-color: rgba(73, 143, 192, 0.1);
    border-color: #498fc0;
}

.page-item.active .page-link {
    background-color: #498fc0;
    border-color: #498fc0;
}

/* Dropdown */
.dropdown-item.active,
.dropdown-item:active {
    color: #fff;
    background-color: #498fc0;
}

/* Nav Pills */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: #498fc0;
}

/* Custom MLM Classes */
.stat-icon.bg-primary {
    background-color: #498fc0 !important;
}

.badge.bg-primary {
    background-color: #498fc0 !important;
}

.modal-actions .btn-primary {
    background-color: #498fc0 !important;
    border-color: #498fc0 !important;
}

.modal-actions .btn-primary:hover {
    background-color: #3d7aa8 !important;
    border-color: #367091 !important;
}

/* Gradient Override for Primary */
.bg-gradient.bg-primary {
    background-image: linear-gradient(180deg, #498fc0 0%, rgba(73, 143, 192, 0.85) 100%) !important;
}

/* Additional specific overrides for better consistency */
.text-primary-emphasis {
    color: #1e3951 !important;
}

.border-primary-subtle {
    border-color: #c1ddee !important;
}

.bg-primary-subtle {
    background-color: #d6e8f5 !important;
}

/* Focus ring */
.btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(73, 143, 192, 0.5);
}

/* Loading spinners and other animations */
.spinner-border.text-primary {
    color: #498fc0 !important;
}

.spinner-grow.text-primary {
    color: #498fc0 !important;
}

/* Accordion */
.accordion-button:not(.collapsed) {
    color: #1e3951;
    background-color: #d6e8f5;
}

.accordion-button:focus {
    border-color: #8bb8d9;
    box-shadow: 0 0 0 0.25rem rgba(73, 143, 192, 0.25);
}

/* Toast */
.toast-header .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(73, 143, 192, 0.25);
}

/* Offcanvas */
.offcanvas-header .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(73, 143, 192, 0.25);
}

/* Additional comprehensive overrides for complete brand consistency */

/* Link colors */
.link-primary,
a.text-primary:hover,
a.text-primary:focus {
    color: #498fc0 !important;
}

/* Active states */
.active .text-primary,
.show .text-primary,
.nav-link.active {
    color: #498fc0 !important;
}

/* Table and list styling */
.table-primary,
.table-primary > th,
.table-primary > td {
    background-color: rgba(73, 143, 192, 0.1) !important;
    border-color: rgba(73, 143, 192, 0.2) !important;
}

/* Alert primary */
.alert-primary {
    color: #2c5aa0;
    background-color: rgba(73, 143, 192, 0.1);
    border-color: rgba(73, 143, 192, 0.2);
}

/* Dropdown and select styling */
.dropdown-item.active,
.dropdown-item:active,
.form-select:focus,
.form-control:focus {
    border-color: #498fc0 !important;
    box-shadow: 0 0 0 0.2rem rgba(73, 143, 192, 0.25) !important;
}

/* Pagination */
.page-link {
    color: #498fc0;
}

.page-item.active .page-link {
    background-color: #498fc0;
    border-color: #498fc0;
}

.page-link:hover {
    color: #3d7aa8;
    background-color: rgba(73, 143, 192, 0.1);
    border-color: #498fc0;
}

/* Modal headers */
.modal-header {
    border-bottom-color: rgba(73, 143, 192, 0.1);
}

/* Card headers with primary theme */
.card-header.bg-primary,
.card-header.text-primary {
    background-color: rgba(73, 143, 192, 0.1) !important;
    color: #498fc0 !important;
    border-bottom-color: rgba(73, 143, 192, 0.2) !important;
}

/* List group items */
.list-group-item.active {
    background-color: #498fc0;
    border-color: #498fc0;
}

/* Spinner and loading animations */
.spinner-border.text-primary {
    color: #498fc0 !important;
}

/* Form validation */
.is-valid {
    border-color: #28a745 !important;
}

.is-invalid {
    border-color: #dc3545 !important;
}

/* Custom checkbox and radio */
.form-check-input:checked {
    background-color: #498fc0;
    border-color: #498fc0;
}

.form-check-input:focus {
    border-color: #498fc0;
    box-shadow: 0 0 0 0.25rem rgba(73, 143, 192, 0.25);
}

/* Range slider */
.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem rgba(73, 143, 192, 0.25);
}

.form-range::-webkit-slider-thumb {
    background-color: #498fc0;
}

.form-range::-moz-range-thumb {
    background-color: #498fc0;
}

/* Switch/toggle styling */
.form-switch .form-check-input:checked {
    background-color: #498fc0;
    border-color: #498fc0;
}

/* Offcanvas headers */
.offcanvas-header {
    border-bottom-color: rgba(73, 143, 192, 0.1);
}

/* Toast styling */
.toast-header {
    border-bottom-color: rgba(73, 143, 192, 0.1);
}

/* Custom utility classes for the new primary color */
.text-custom-primary {
    color: #498fc0 !important;
}

.bg-custom-primary {
    background-color: #498fc0 !important;
}

.border-custom-primary {
    border-color: #498fc0 !important;
}

.btn-custom-primary {
    color: #fff;
    background-color: #498fc0;
    border-color: #498fc0;
}

.btn-custom-primary:hover {
    color: #fff;
    background-color: #3d7aa8;
    border-color: #367091;
}

.btn-custom-primary:focus,
.btn-custom-primary.focus {
    color: #fff;
    background-color: #3d7aa8;
    border-color: #367091;
    box-shadow: 0 0 0 0.2rem rgba(73, 143, 192, 0.5);
}

.btn-custom-primary.disabled,
.btn-custom-primary:disabled {
    color: #fff;
    background-color: #498fc0;
    border-color: #498fc0;
}

.btn-custom-primary:not(:disabled):not(.disabled):active,
.btn-custom-primary:not(:disabled):not(.disabled).active,
.show > .btn-custom-primary.dropdown-toggle {
    color: #fff;
    background-color: #367091;
    border-color: #2f657f;
}

.btn-custom-primary:not(:disabled):not(.disabled):active:focus,
.btn-custom-primary:not(:disabled):not(.disabled).active:focus,
.show > .btn-custom-primary.dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(73, 143, 192, 0.5);
}

/* Force override for any remaining inline Bootstrap primary colors */
* {
    --bs-primary: #498fc0 !important;
    --bs-primary-rgb: 73, 143, 192 !important;
}

/* Override any potential CSS custom properties */
html, body {
    --primary-color: #498fc0;
    --primary-hover: #3d7aa8;
    --primary-active: #367091;
}

/* Final catch-all for any missed elements */
.text-primary,
.btn-primary,
.bg-primary,
.border-primary,
.link-primary,
.alert-primary {
    /* color: #498fc0 !important; */
}

.btn-primary,
.bg-primary {
    background-color: #498fc0 !important;
    border-color: #498fc0 !important;
}

.border-primary {
    border-color: #498fc0 !important;
}

/* Make sure navbar and sidebar use the new color */
.navbar-brand,
.sidebar .nav-link.active,
.sidebar .nav-link:hover,
.sidebar .user-balance,
.sidebar .sidebar-menu li.active > a {
    color: #ffffff !important;
}

/* Progress bars and loading elements */
.progress-bar:not(.bg-success):not(.bg-warning):not(.bg-danger):not(.bg-info) {
    background-color: #498fc0 !important;
}

/* Final override for any missed primary elements */
[class*="primary"]:not([class*="text-primary"]):not([class*="bg-primary"]):not([class*="btn-primary"]):not([class*="border-primary"]) {
    color: #498fc0 !important;
}
