/* Accessibility improvements for WCAG 2.1 AA compliance */

/* Improve color contrast for better readability */

/* Error messages - ensure high contrast */
.text-danger {
    color: #dc3545 !important; /* Bootstrap default is ok, but ensure it's applied */
}

/* Improve link contrast */
a {
    color: #0056b3; /* Darker blue for better contrast */
}

a:hover,
a:focus {
    color: #004085;
    text-decoration: underline;
}

/* Improve placeholder text contrast */
::placeholder {
    color: #6c757d; /* Darker gray for better contrast */
    opacity: 1; /* Firefox */
}

/* Improve form validation messages */
.field-validation-error,
.validation-summary-errors {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

/* Ensure sufficient contrast for disabled elements */
.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Improve button contrast */
.btn-primary {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #004085;
    border-color: #002752;
}

/* Improve danger button contrast */
.btn-danger {
    background-color: #bd2130;
    border-color: #b21f2d;
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: #b21f2d;
    border-color: #a71d2a;
}

/* Improve warning button contrast */
.btn-warning {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #d39e00;
    border-color: #c69500;
    color: #212529;
}

/* Improve text on colored backgrounds */
.bg-danger {
    background-color: #dc3545 !important;
    color: #fff !important;
}

.bg-danger a {
    color: #fff !important;
    text-decoration: underline;
}

/* Ensure sufficient contrast for navigation */
.navbar-light .navbar-nav .nav-link {
    color: rgba(0, 0, 0, 0.7);
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: rgba(0, 0, 0, 0.9);
}

/* Improve table header contrast */
.table thead th {
    background-color: #343a40;
    color: #fff;
    border-color: #454d55;
}

/* Ensure focus is visible on all interactive elements */
*:focus {
    outline: 3px solid #005fcc !important;
    outline-offset: 2px !important;
}

/* Skip navigation link styling (already in site.css but ensure it's here) */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-to-main:focus {
    left: 0;
    top: 0;
}

/* Ensure sufficient size for touch targets */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"],
input[type="checkbox"],
input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
}

/* Improve contrast for required field indicators */
.starRed {
    color: #dc3545;
    font-weight: bold;
}

/* Ensure text is readable on colored backgrounds */
.colorRed {
    color: #dc3545;
}

.colorWhite {
    color: #fff;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }
    
    a {
        text-decoration: underline !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles for better readability */
@media print {
    .skip-to-main {
        display: none;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
}