/* Accessibility Fixes - High Contrast Typography and UI Elements */

/* Global dropdown and select fixes for high contrast */
select, .form-select, option {
    color: #2C2C2E !important;
    background-color: white !important;
    border: 2px solid #4A6FA5 !important;
}

select:focus, .form-select:focus {
    outline: 3px solid #B47857 !important;
    outline-offset: 2px !important;
}

/* Dropdown option styling */
option, .dropdown-item {
    color: #2C2C2E !important;
    background-color: white !important;
}

option:hover, .dropdown-item:hover {
    color: white !important;
    background-color: #4A6FA5 !important;
}

/* Button contrast improvements */
.btn {
    border: 2px solid transparent;
    font-weight: 600;
}

.btn-primary {
    background-color: #4A6FA5 !important;
    border-color: #4A6FA5 !important;
    color: white !important;
}

.btn-outline-primary {
    color: #4A6FA5 !important;
    border-color: #4A6FA5 !important;
    background-color: white !important;
}

.btn-outline-primary:hover {
    color: white !important;
    background-color: #4A6FA5 !important;
}

/* Navbar and navigation fixes */
.navbar {
    border-bottom: 3px solid #4A6FA5;
}

.nav-link {
    color: #2C2C2E !important;
    font-weight: 500;
}

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

/* Form label improvements */
.form-label, label {
    color: #2C2C2E !important;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Input field contrast */
.form-control, .form-select {
    border: 2px solid #A6A9B6;
    color: #2C2C2E !important;
    background-color: white !important;
}

/* ADMIN PANEL - CRITICAL CONTRAST FIXES */
.admin-panel h1,
.admin-panel h2,
.admin-panel h3,
.admin-panel h4,
.admin-panel h5,
.admin-panel h6 {
    color: #2C2C2E !important;
}

.admin-panel p,
.admin-panel span,
.admin-panel div:not(.btn):not(.badge) {
    color: #2C2C2E !important;
}

.admin-panel .text-muted {
    color: #A6A9B6 !important;
}

.admin-panel .badge {
    color: white !important;
}

/* TABLE FIXES - CRITICAL */
.table {
    --bs-table-color: #2C2C2E !important;
    --bs-table-bg: white !important;
}

.table th {
    color: #2C2C2E !important;
    font-weight: 600 !important;
    background-color: #D9DDE6 !important;
}

.table td {
    color: #2C2C2E !important;
    background-color: white !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: #f8f9fa !important;
    color: #2C2C2E !important;
}

/* CARD FIXES - CRITICAL */
.card {
    background-color: white !important;
    border: 1px solid #D9DDE6 !important;
}

.card-header {
    background-color: #D9DDE6 !important;
    color: #2C2C2E !important;
    border-bottom: 1px solid #A6A9B6 !important;
}

.card-body {
    color: #2C2C2E !important;
    background-color: white !important;
}

.card-title {
    color: #2C2C2E !important;
}

.card-text {
    color: #A6A9B6 !important;
}

/* FORCE DARK TEXT EVERYWHERE */
body,
.container,
.container-fluid,
.row,
.col-12,
main,
* {
    color: #2C2C2E !important;
}

/* FIX BOOTSTRAP OVERRIDES */
.dropdown-menu {
    background-color: #D9DDE6 !important;
    border: 1px solid #A6A9B6 !important;
}

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

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #4A6FA5 !important;
    color: white !important;
}

/* NAVIGATION ESCAPE ROUTES */
.escape-navigation {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.form-control:focus, .form-select:focus {
    border-color: #4A6FA5 !important;
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25) !important;
}

/* Card and content area improvements */
.card {
    border: 2px solid #D9DDE6;
    
}

.card-header, .card-title {
    color: #2C2C2E !important;
    font-weight: 600;
}

.card-body {
    color: #2C2C2E !important;
}

/* Text content contrast */
p, .text-muted {
    color: #2C2C2E !important;
}

/* Hero section text improvements */
.lead {
    color: #4A6FA5 !important;
    font-weight: 600 !important;
}

.text-secondary {
    color: #A6A9B6 !important;
}

/* Link improvements */
a {
    color: #4A6FA5;
    text-decoration: underline;
}

a:hover {
    color: #B47857;
    text-decoration-thickness: 2px;
}

/* Alert and notification styling */
.alert {
    border-width: 2px;
    border-style: solid;
    font-weight: 500;
}

.alert-success {
    color: #155724 !important;
    background-color: #d4edda !important;
    border-color: #155724 !important;
}

.alert-danger {
    color: #721c24 !important;
    background-color: #f8d7da !important;
    border-color: #721c24 !important;
}

.alert-warning {
    color: #856404 !important;
    background-color: #fff3cd !important;
    border-color: #856404 !important;
}

/* Loading and spinner improvements */
.spinner-border {
    border-width: 3px;
}

/* Table improvements */
.table {
    color: #2C2C2E;
}

.table th {
    background-color: #4A6FA5;
    color: white;
    border-bottom: 3px solid #2C2C2E;
}

.table td {
    border-bottom: 1px solid #A6A9B6;
}

/* Modal improvements */
.modal-header, .modal-body, .modal-footer {
    color: #2C2C2E !important;
}

.modal-title {
    color: #2C2C2E !important;
    font-weight: 600;
}

/* Badge improvements */
.badge {
    font-weight: 600;
    border: 1px solid;
}

/* Progress bar improvements */
.progress-bar {
    background-color: #4A6FA5;
    color: white;
    font-weight: 600;
}

/* List group improvements */
.list-group-item {
    color: #2C2C2E !important;
    border: 2px solid #D9DDE6;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    border-color: #4A6FA5;
}

/* Sidebar text fix for authenticated users */
.sidebar-heading, .list-group-item {
    color: white !important;
}

/* Icon improvements */
i[data-feather] {
    stroke-width: 2.5px;
}

/* Focus indicators for accessibility */
*:focus {
    outline: 3px solid #B47857 !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-width: 3px !important;
        font-weight: 600 !important;
    }
    
    .btn {
        border-width: 3px !important;
    }
    
    select, .form-select, .form-control {
        border-width: 3px !important;
    }
}

/* Skip to content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #4A6FA5;
    color: white;
    padding: 8px;
    text-decoration: none;
    
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* Ensure minimum touch target sizes */
.btn, .nav-link, .dropdown-item, select, .form-control {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* High contrast loading states */
.loading-overlay {
    background-color: rgba(44, 44, 46, 0.9) !important;
    color: white !important;
}

/* Improved interactive elements */
.interactive-btn, .hover-card {
    transition: all 0.2s ease-in-out;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 111, 165, 0.3);
    border-color: #4A6FA5 !important;
}

/* Status indicators with high contrast */
.status-indicator {
    border: 2px solid;
    
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 8px;
}

.status-active {
    background-color: #28a745;
    border-color: #1e7e34;
}

.status-inactive {
    background-color: #dc3545;
    border-color: #c82333;
}

.status-pending {
    background-color: #ffc107;
    border-color: #e0a800;
}