/* Accessibility Improvements */

/* Focus states for better keyboard navigation */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #666666;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Screen reader only text */
.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;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    button,
    a,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Improved color contrast for links */
a {
    color: var(--primary-color);
    text-decoration: underline;
}

a:hover,
a:focus {
    color: var(--primary-light);
    text-decoration: none;
}

/* Form labels should be visible */
label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* Error messages should be clearly visible */
.error-message,
.error-state {
    color: var(--error-color);
    font-weight: 500;
}

/* Success messages */
.success-message {
    color: var(--success-color);
    font-weight: 500;
}

/* Loading states should be accessible */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ARIA live regions */
[role="alert"],
[role="status"] {
    position: relative;
}

/* Better button contrast */
.btn {
    font-weight: 500;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Improved modal accessibility */
.modal {
    position: fixed;
    z-index: 10000;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Better table accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Image alt text support */
img {
    max-width: 100%;
    height: auto;
}

img[alt=""] {
    border: 2px dashed var(--border-color);
}

