/* AdminLTE Red Cross Theme Override
 * This file contains specific overrides for AdminLTE components
 * to match the Uganda Red Cross Society branding
 */

/* ===== SIDEBAR OVERRIDES ===== */
/* Keep sidebar with AdminLTE dark theme - white text on dark background */
.main-sidebar {
    background-color: #343a40 !important; /* AdminLTE dark sidebar background */
}

/* Ensure all sidebar text is white */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background-color: #E30613 !important; /* Red accent only for active items */
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

/* Sidebar submenu styling - ensure white text */
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding-left: 2.25rem;
}

.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(227, 6, 19, 0.8) !important; /* Slightly transparent red for submenu active */
    color: #fff !important;
}

/* Force white text for all sidebar navigation elements */
.main-sidebar .nav-link,
.main-sidebar .nav-link i,
.main-sidebar .nav-link p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* User panel text should be white */
.main-sidebar .user-panel .info a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.main-sidebar .user-panel .info a:hover {
    color: #fff !important;
}

/* ===== BRAND LINK ===== */
.brand-link {
    background-color: #2c3136 !important; /* Darker than sidebar for contrast */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.brand-link:hover {
    background-color: #1f2126 !important;
    color: #fff !important;
}

/* ===== CONTENT HEADER ===== */
.content-header {
    background-color: transparent;
}

.content-header h1 {
    color: #E30613;
}

.breadcrumb-item.active {
    color: #E30613;
}

.breadcrumb-item a {
    color: #6c757d;
}

.breadcrumb-item a:hover {
    color: #E30613;
}

/* ===== CARDS ===== */
.card.card-primary {
    border-top: 3px solid #E30613 !important;
}

.card.card-primary .card-header {
    background-color: #E30613 !important;
    border-color: #E30613 !important;
    color: white;
}

.card.card-outline.card-primary {
    border-top: 3px solid #E30613 !important;
    border-left: 1px solid #E30613 !important;
    border-right: 1px solid #E30613 !important;
    border-bottom: 1px solid #E30613 !important;
}

.card.card-outline.card-primary .card-header {
    background-color: transparent !important;
    color: #E30613 !important;
    border-bottom: 1px solid #E30613 !important;
}

/* ===== BUTTONS ===== */
.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: #E30613 !important;
    border-color: #E30613 !important;
    color: white !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary.focus {
    background-color: #c00511 !important;
    border-color: #c00511 !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(227, 6, 19, 0.25) !important;
}

.btn-outline-primary {
    color: #E30613 !important;
    border-color: #E30613 !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
    background-color: #E30613 !important;
    border-color: #E30613 !important;
    color: white !important;
}

/* ===== FORM CONTROLS ===== */
.form-control:focus {
    border-color: #E30613 !important;
    box-shadow: 0 0 0 0.2rem rgba(227, 6, 19, 0.25) !important;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #E30613 !important;
    border-color: #E30613 !important;
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(227, 6, 19, 0.25) !important;
}

/* ===== INFO BOXES ===== */
.info-box-icon.bg-primary {
    background-color: #E30613 !important;
}

.small-box.bg-primary {
    background-color: #E30613 !important;
}

.small-box.bg-primary .small-box-footer {
    background-color: rgba(0, 0, 0, 0.1);
}

/* ===== TABLES ===== */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(227, 6, 19, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(227, 6, 19, 0.05);
}

/* ===== PAGINATION ===== */
.page-item.active .page-link {
    background-color: #E30613 !important;
    border-color: #E30613 !important;
}

.page-link {
    color: #E30613 !important;
}

.page-link:hover {
    color: #c00511 !important;
    background-color: rgba(227, 6, 19, 0.1);
}

/* ===== ALERTS ===== */
.alert-primary {
    background-color: #f8d7da !important;
    border-color: #E30613 !important;
    color: #a0040d !important;
}

/* ===== BADGES ===== */
.badge-primary {
    background-color: #E30613 !important;
}

/* ===== PROGRESS BARS ===== */
.progress-bar {
    background-color: #E30613 !important;
}

/* ===== DROPDOWNS ===== */
.dropdown-item.active,
.dropdown-item:active {
    background-color: #E30613 !important;
}

/* ===== TABS AND PILLS ===== */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: #E30613 !important;
}

.nav-tabs .nav-link.active {
    border-bottom-color: #E30613 !important;
    color: #E30613 !important;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: #E30613;
}

/* ===== MODAL HEADERS ===== */
.modal-header.bg-primary {
    background-color: #E30613 !important;
}

/* ===== FOOTER ===== */
.main-footer a {
    color: #E30613 !important;
}

.main-footer a:hover {
    color: #c00511 !important;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .main-sidebar {
        background-color: #343a40 !important; /* Keep dark sidebar in dark mode */
    }
    
    .brand-link {
        background-color: #2c3136 !important;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 767.98px) {
    .main-sidebar {
        background-color: #343a40 !important; /* Keep dark sidebar on mobile */
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.btn-primary:focus,
.btn-outline-primary:focus {
    outline: 2px solid #E30613;
    outline-offset: 2px;
}

/* Ensure sufficient contrast for accessibility */
.text-primary {
    color: #a0040d !important; /* Darker shade for better contrast */
}

/* ===== LOADING STATES ===== */
.btn-primary:disabled,
.btn-primary.disabled {
    background-color: rgba(227, 6, 19, 0.6) !important;
    border-color: rgba(227, 6, 19, 0.6) !important;
}

/* ===== SUCCESS AND ERROR STATES ===== */
.is-valid .form-control:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.is-invalid .form-control:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}