/**
 * WCAG 2.2 Level AA Accessibility Fixes
 * This file contains CSS overrides to improve color contrast and accessibility
 * without modifying the core visual design.
 */

/* ============================================
   Color Contrast Fixes (WCAG SC 1.4.3)
   Minimum contrast ratio: 4.5:1 for normal text
   ============================================ */

/* Fix disabled pagination contrast - was #ecf0f1 on #3be6c4 */
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
    color: #155724; /* Dark green for better contrast on light cyan */
    background-color: #b8e0d8; /* Slightly darker background */
}

/* Fix pager disabled states */
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
    color: #155724;
    background-color: #b8e0d8;
}

/* ============================================
   Focus Visibility Improvements (WCAG SC 2.4.7)
   ============================================ */

/* Enhanced focus indicator for all focusable elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25);
}

/* Enhanced focus for dropdown toggles */
.bootstrap-select > .dropdown-toggle:focus {
    outline: 2px solid #005fcc !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25) !important;
}

/* Focus indicators for close buttons in modals */
.modal .close:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* ============================================
   Placeholder Text Contrast (WCAG SC 1.4.3)
   ============================================ */

::placeholder {
    color: #5a6268; /* Darker gray for better contrast */
    opacity: 1;
}

/* Webkit browsers */
::-webkit-input-placeholder {
    color: #5a6268;
    opacity: 1;
}

/* Firefox */
::-moz-placeholder {
    color: #5a6268;
    opacity: 1;
}

/* IE/Edge */
:-ms-input-placeholder {
    color: #5a6268;
}

/* ============================================
   Link Underlines (WCAG SC 1.4.1)
   Links must be distinguishable by more than color
   ============================================ */

/* Ensure links in content areas are underlined */
.card-body a:not(.btn),
.modal-body a:not(.btn),
.alert a:not(.btn) {
    text-decoration: underline;
}

.card-body a:not(.btn):hover,
.modal-body a:not(.btn):hover,
.alert a:not(.btn):hover {
    text-decoration: none;
}

/* ============================================
   Error State Indicators (WCAG SC 1.4.1, 3.3.1)
   ============================================ */

/* Ensure error states are visible beyond just color */
/*.field-validation-error,
.validation-summary-errors {
    border-left: 4px solid #ff0000;
    padding-left: 8px;
}*/

.input-validation-error {
    border-width: 2px !important;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

/* ============================================
   Skip Link (WCAG SC 2.4.1)
   ============================================ */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #005fcc;
    color: #ffffff;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   High Contrast Mode Support
   ============================================ */

@media (prefers-contrast: high) {
    a {
        text-decoration: underline;
    }
    
    .btn {
        border-width: 2px;
    }
    
    input, select, textarea {
        border-width: 2px;
    }
}

/* ============================================
   Screen Reader Only Utility (WCAG SC 4.1.3)
   ============================================ */

.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   DataTable Accessibility Improvements
   ============================================ */

/* Fix pagination button focus visibility */
.dataTables_wrapper .dataTables_paginate .paginate_button:focus {
    outline: 2px solid #005fcc !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25) !important;
}

/* Fix search input focus */
.dataTables_wrapper .dataTables_filter input:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25);
}

/* Fix length select focus */
.dataTables_wrapper .dataTables_length select:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25);
}

/* Fix table header sort links focus */
table.dataTable thead th.sorting:focus,
table.dataTable thead th.sorting_asc:focus,
table.dataTable thead th.sorting_desc:focus {
    outline: 2px solid #005fcc;
    outline-offset: -2px;
}

/* Improve button group spacing for touch targets (WCAG 2.5.8) */
/*.btn-group .btn {
    min-width: 44px;
    min-height: 44px;
}*/

.btn-group .btn + .btn {
    margin-left: 4px;
}
