/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   WCAG 2.1 AA Compliant Styles
   ============================================ */

/* HIGH CONTRAST MODE */
body.high-contrast {
    background: #000 !important;
    color: #ffff00 !important;
}

body.high-contrast .card,
body.high-contrast .bg-white,
body.high-contrast .banner {
    background: #000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

body.high-contrast .banner::before {
    background: #000 !important;
}

body.high-contrast .navbar,
body.high-contrast .footer {
    background: #000 !important;
    border: 2px solid #ffff00 !important;
}

body.high-contrast .btn {
    background: #000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

body.high-contrast a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

body.high-contrast .text-muted,
body.high-contrast .text-secondary {
    color: #ffff00 !important;
}

body.high-contrast img {
    border: 2px solid #ffff00;
    filter: grayscale(100%) contrast(150%);
}

/* SCREEN READER ONLY CONTENT */
.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: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* FOCUS INDICATORS */
*:focus-visible {
    outline: 3px solid #ff9933;
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid #ff9933;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 153, 51, 0.2);
}

.btn:focus-visible {
    outline: 3px solid #ff9933;
    outline-offset: 2px;
}

/* SKIP NAVIGATION IMPROVEMENTS */
.skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    padding: 1rem 2rem;
    background: #ff9933;
    color: white;
    font-weight: bold;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* LIVE REGION FOR SCREEN READERS */
[aria-live="polite"],
[aria-live="assertive"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* KEYBOARD NAVIGATION ENHANCEMENTS */
.nav-link:focus,
.dropdown-item:focus,
.list-group-item:focus {
    position: relative;
    z-index: 1;
}

/* TOUCH TARGET SIZES (minimum 44x44px) */
@media (pointer: coarse) {
    .btn,
    .nav-link,
    .list-group-item,
    a {
        /* min-height: 44px;
        min-width: 44px; */
        display: inline-flex;
        align-items: center;
        /* justify-content: center; */
    }
    
    .accessibility-controls .btn {
        /* min-height: 44px;
        min-width: 44px; */
    }
}

/* IMPROVE TEXT READABILITY */
body.large-text {
    font-size: 20px !important;
}

body.large-text h1 {
    font-size: 2.5rem !important;
}

body.large-text h2 {
    font-size: 2rem !important;
}

body.large-text h3 {
    font-size: 1.75rem !important;
}

body.large-text .btn,
body.large-text .nav-link {
    font-size: 1.1rem !important;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .carousel {
        transition: none !important;
    }
    
    .ticker-text {
        animation: none !important;
    }
    
    .service-card:hover {
        transform: none !important;
    }
}

/* ERROR AND SUCCESS MESSAGES */
.alert {
    border-left-width: 5px;
}

.alert::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* FORM ACCESSIBILITY */
input:invalid,
textarea:invalid,
select:invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23dc3545' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zM7 4h2v5H7V4zm0 6h2v2H7v-2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* LINK UNDERLINES FOR CLARITY */
.footer a,
.card-body a {
    text-decoration: none;
    /* text-decoration-color: rgba(255, 153, 51, 0.4); */
    text-underline-offset: 2px;
}

.footer a:hover,
.card-body a:hover {
    text-decoration-color: #1a3a6b;
}

/* TABLE ACCESSIBILITY */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

tr:nth-child(even) {
    background: #f8f9fa;
}

/* IMPROVED CONTRAST FOR DISABLED ELEMENTS */
:disabled,
[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* LANGUAGE DIRECTION SUPPORT */
[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
}

/* PRINT ACCESSIBILITY */
@media print {
    * {
        color: #000 !important;
        background: #fff !important;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]::after {
        content: " (" attr(title) ")";
    }
}