/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #007bff;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus Indicators */
:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

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

:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (forced-colors: active) {
    :focus {
        outline: 2px solid CanvasText;
        outline-offset: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        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: 0;
}

/* Improved Link Underlines */
a {
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* Better Form Labels */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Required Field Indicators */
.required::after {
    content: " *";
    color: #dc3545;
}

/* Error States */
.error {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success States */
.success {
    border-color: #28a745;
}

.success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Improved Button States */
.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
}

/* Better Table Accessibility */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}

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

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Improved Image Handling */
img {
    max-width: 100%;
    height: auto;
}

/* Better Color Contrast */
.text-muted {
    color: #6c757d !important;
}

/* Improved Navigation */
.nav-link:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Better Form Controls */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Improved Modal Accessibility */
.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Better Alert Accessibility */
.alert {
    border-left: 4px solid;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    border-left-color: #28a745;
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-info {
    border-left-color: #17a2b8;
} 