/* Accessibility Improvements */

/* Skip to main content */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
}

/* Focus Visible Styles */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default focus for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .arv-service {
        border: 2px solid var(--text-primary);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@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 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

/* ARIA Live Regions */
[aria-live] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Keyboard Navigation */
.navbar-nav .nav-link:focus,
.arv-service .arv-s-btn a:focus,
.btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* Color Contrast Improvements */
.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Link Underlines for Better Visibility */
a:not(.btn):not(.nav-link) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:not(.btn):not(.nav-link):hover {
    text-decoration-thickness: 2px;
}

/* Form Labels */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Error States */
.error,
[aria-invalid="true"] {
    border-color: #ff3333 !important;
    box-shadow: 0 0 0 3px rgba(255, 51, 51, 0.1) !important;
}

/* Success States */
.success,
[aria-invalid="false"] {
    border-color: #4caf50 !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1) !important;
}

/* Loading States for Screen Readers */
[aria-busy="true"]::after {
    content: "Loading...";
    position: absolute;
    left: -10000px;
}
