/**
 * High Contrast Fix for ezeTree
 * Ensures proper text readability on all devices
 */

/* Force proper contrast - override any dark backgrounds */
body {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Main content area */
.container,
.container-fluid {
    background-color: transparent;
    color: #212529 !important;
}

/* Cards - Always light background with dark text */
.card {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.card-body {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.card-header {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom: 1px solid #dee2e6 !important;
}

/* Typography - High contrast */
h1, h2, h3, h4, h5, h6 {
    color: #212529 !important;
}

p {
    color: #212529 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Ensure all text elements are readable */
span:not(.badge):not(.btn) {
    color: inherit !important;
}

div {
    color: inherit;
}

/* Links - Ensure they're visible */
a {
    color: #0d6efd !important;
}

a:hover {
    color: #0a58ca !important;
}

/* Badges - High contrast */
.badge-living {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.badge-deceased {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.badge {
    font-weight: 600 !important;
}

/* Navbar - Good contrast */
.navbar {
    background-color: #343a40 !important;
}

.navbar-brand,
.nav-link {
    color: #ffffff !important;
}

.nav-link:hover {
    color: #f8f9fa !important;
}

/* Forms - Readable inputs */
.form-control,
.form-select,
input,
select,
textarea {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #86b7fe !important;
}

/* Labels */
label,
.form-label {
    color: #212529 !important;
    font-weight: 500;
}

/* Tables */
.table {
    color: #212529 !important;
    background-color: #ffffff !important;
}

.table thead th {
    color: #212529 !important;
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
}

.table td {
    color: #212529 !important;
}

/* Buttons - High contrast */
.btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}

.btn-info {
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: #ffffff !important;
}

/* List groups */
.list-group-item {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

/* Alerts */
.alert {
    color: #212529 !important;
}

.alert-success {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
    color: #0f5132 !important;
}

.alert-danger {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
    color: #842029 !important;
}

.alert-warning {
    background-color: #fff3cd !important;
    border-color: #ffecb5 !important;
    color: #664d03 !important;
}

.alert-info {
    background-color: #cfe2ff !important;
    border-color: #b6d4fe !important;
    color: #084298 !important;
}

/* Modals */
.modal-content {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.modal-header {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.modal-body {
    color: #212529 !important;
}

/* Footer */
.footer {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-top: 1px solid #dee2e6 !important;
}

/* Biography section - High readability */
.biography-section {
    background-color: #ffffff !important;
    color: #212529 !important;
    line-height: 1.8;
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid #dee2e6 !important;
}

.nav-tabs .nav-link {
    color: #495057 !important;
}

.nav-tabs .nav-link.active {
    background-color: #ffffff !important;
    color: #0d6efd !important;
    border-color: #dee2e6 #dee2e6 #fff !important;
}

/* Dropdowns */
.dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
}

.dropdown-item {
    color: #212529 !important;
}

.dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Person name specifically */
.person-name h2,
h2.mb-1 {
    color: #212529 !important;
    font-weight: 600;
}

/* Birth/Death dates */
.person-dates,
.text-muted {
    color: #6c757d !important;
    font-size: 15px;
}

/* Profile photo container */
.profile-photo-container {
    background-color: transparent;
}

/* Quick actions sidebar */
.quick-actions {
    background-color: #ffffff !important;
}

.quick-actions .btn {
    margin-bottom: 8px;
}

/* Ensure tab content is readable */
.tab-content {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.tab-pane {
    padding: 20px;
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* DataTables */
.dataTables_wrapper {
    color: #212529 !important;
}

.dataTables_filter input {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

/* Mobile specific high contrast */
@media (max-width: 768px) {
    body {
        background-color: #f8f9fa !important;
    }
    
    .card {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Ensure all mobile text is readable */
    * {
        color: inherit;
    }
}

/* Override any dark mode preferences */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    .card,
    .card-body {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
}

/* Print styles - high contrast */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    
    .card {
        border: 1px solid #000000 !important;
    }
}

