/* Accessibility Improvements for Baton Engineering */

/* Focus indicators */
*:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background: #fff;
        color: #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
    
    a {
        color: #0000ff;
        text-decoration: underline;
    }
    
    a:visited {
        color: #800080;
    }
}

/* Reduced motion support */
@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 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;
}

/* Keyboard navigation improvements */
.nav-link:focus,
.btn:focus,
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Form accessibility */
.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
}

.form-control:invalid {
    border-color: #dc3545;
}

.form-control:valid {
    border-color: #28a745;
}

/* Error messages */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

.success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 5px;
}

/* Button accessibility */
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Table accessibility */
.table th {
    font-weight: 600;
}

.table caption {
    caption-side: top;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Modal accessibility */
.modal[aria-hidden="true"] {
    display: none;
}

.modal[aria-hidden="false"] {
    display: block;
}

/* Loading states */
.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Color contrast improvements */
.text-muted {
    color: #6c757d !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.bg-dark {
    background-color: #343a40 !important;
    color: #fff;
}

/* Link improvements */
a:not(.btn) {
    text-decoration: underline;
}

a:not(.btn):hover {
    text-decoration: none;
}

/* Image accessibility */
img:not([alt]) {
    border: 2px solid #dc3545;
}

/* Print accessibility */
@media print {
    .skip-link,
    .btn,
    .form-control,
    .modal {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
}