/* ADA Compliance CSS - WCAG 2.1 Level AA */

/* Skip Navigation Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #C8A96A;
    color: #000;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Enhanced Focus Indicators - WCAG 2.4.7 */
:focus {
    outline: 3px solid #C8A96A !important;
    outline-offset: 2px !important;
}

:focus-visible {
    outline: 3px solid #C8A96A !important;
    outline-offset: 2px !important;
}

/* Form Controls Focus */
.form-control:focus,
.form-select:focus {
    border-color: #C8A96A !important;
    box-shadow: 0 0 0 0.25rem rgba(200, 169, 106, 0.35) !important;
    outline: none !important;
}

/* Button Focus */
.btn:focus,
.btn:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 0.25rem rgba(200, 169, 106, 0.35) !important;
}

/* Link Focus */
a:focus,
a:focus-visible {
    outline: 3px solid #C8A96A !important;
    outline-offset: 2px !important;
}

/* Dropdown Focus */
.dropdown-item:focus,
.dropdown-item:focus-visible {
    outline: 2px solid #C8A96A !important;
    outline-offset: -2px !important;
    background-color: rgba(200, 169, 106, 0.2) !important;
}

/* Card Focus */
.card:focus-within {
    box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.5);
}

/* Enhanced Color Contrast - WCAG 1.4.3 (4.5:1 minimum) */
/* Text colors with proper contrast ratios */
.text-muted {
    color: #a0a0a0 !important;
}

/* Link colors with proper contrast */
a {
    color: #C8A96A;
}

a:hover {
    color: #e0c78a;
}

/* Form Labels - Ensure visibility */
label,
.form-label {
    color: #e0e0e0;
    font-weight: 500;
}

/* Required Field Indicator */
.required-field::after,
.form-label.required::after {
    content: " *";
    color: #ff6b6b;
    font-weight: bold;
}

/* Error Messages - High Contrast */
.invalid-feedback,
.error-message,
.text-danger {
    color: #ff6b6b !important;
    font-weight: 500;
}

/* Success Messages - High Contrast */
.valid-feedback,
.success-message,
.text-success {
    color: #69db7c !important;
}

/* Warning Messages - High Contrast */
.text-warning {
    color: #fcc419 !important;
}

/* Table Accessibility */
table {
    border-collapse: collapse;
}

th {
    background-color: rgba(200, 169, 106, 0.1);
    font-weight: 600;
}

/* Improve table row focus */
tr:focus-within {
    outline: 2px solid #C8A96A;
    outline-offset: -2px;
}

/* Screen Reader Only Content */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Show on focus for skip links */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Icon Accessibility - Hide decorative icons from screen readers */
.fa,
.fas,
.far,
.fab,
.fal,
.fad {
    speak: none;
}

[aria-hidden="true"] {
    speak: none;
}

/* Interactive Elements Min Size - WCAG 2.5.5 (44x44px touch targets) */
.btn,
.nav-link,
.dropdown-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Form Inputs Minimum Height */
.form-control,
.form-select {
    min-height: 44px;
}

/* Checkbox and Radio Accessibility */
.form-check-input {
    width: 20px;
    height: 20px;
    min-width: 20px;
}

.form-check-input:focus {
    border-color: #C8A96A;
    box-shadow: 0 0 0 0.25rem rgba(200, 169, 106, 0.35);
}

/* Animation Reduction for Motion Sensitivity - WCAG 2.3.3 */
@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;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --bs-body-bg: #000;
        --bs-body-color: #fff;
    }
    
    .btn-primary,
    .btn-gold {
        background-color: #C8A96A !important;
        color: #000 !important;
        border: 2px solid #fff !important;
    }
    
    .card {
        border: 2px solid #fff !important;
    }
    
    a {
        text-decoration: underline !important;
    }
}

/* Ensure links are distinguishable */
main a:not(.btn):not(.nav-link):not(.dropdown-item) {
    text-decoration: underline;
}

main a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    text-decoration: none;
}

/* Loading States Accessibility */
[aria-busy="true"] {
    cursor: wait;
}

/* Disabled States - Clear Visual Distinction */
[disabled],
.disabled,
:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal Accessibility */
.modal:focus {
    outline: none;
}

.modal-dialog:focus {
    outline: none;
}

/* Ensure modal is keyboard navigable */
.modal-content {
    outline: 2px solid transparent;
}

.modal-content:focus-within {
    outline: 2px solid #C8A96A;
}

/* Print Accessibility */
@media print {
    .skip-link,
    .sr-only {
        display: none !important;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* Toast/Notification Accessibility */
.toast {
    role: alert;
}

/* Progress Bars */
.progress {
    background-color: #333;
}

.progress-bar {
    background-color: #C8A96A;
}

/* Badge Contrast */
.badge {
    font-weight: 600;
}

/* Ensure sufficient line height for readability */
body {
    line-height: 1.6;
}

p, li {
    line-height: 1.6;
}

/* Maximum line width for readability - WCAG 1.4.8 */
.content-readable {
    max-width: 80ch;
}

/* Text Spacing Support - WCAG 1.4.12 */
/* Users can override with user stylesheets */

/* Ensure no content is lost with 200% text zoom */
@media screen and (min-width: 320px) {
    html {
        font-size: 100%;
    }
}
