/* Accessibility Enhancements */

/* Focus Styles - Ensure all interactive elements have visible focus indicators */
*:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Skip Link - Already in base.css but ensuring visibility */
.skip-link:focus {
  position: absolute;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  padding: 8px 16px;
  background: #000;
  color: #fff;
  z-index: 10000;
  text-decoration: none;
}

/* Ensure sufficient color contrast for text */
.text-light,
.text-white {
  color: #ffffff !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid #000;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* 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;
  }
  
  .card:hover {
    transform: none;
  }
  
  .profile-card:hover {
    transform: none;
  }
}

/* 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-width: 0;
}

/* Ensure buttons and links have minimum touch target size (44x44px) */
.btn,
.nav-link,
.dropdown-item {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Improve form label association */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Error states for forms */
.form-control:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #dc3545;
}

.form-control:invalid:not(:focus):not(:placeholder-shown) + .invalid-feedback {
  display: block;
}

/* Ensure images have alt text (visual indicator for missing alt) */
img:not([alt]) {
  border: 2px dashed #ffc107;
}

/* Improve link contrast */
a:not(.btn):not(.nav-link) {
  color: #007bff;
  text-decoration: underline;
}

a:not(.btn):not(.nav-link):hover,
a:not(.btn):not(.nav-link):focus {
  color: #0056b3;
  text-decoration: underline;
}

/* Ensure sufficient spacing for touch targets */
.nav-item + .nav-item {
  margin-left: 0.5rem;
}

/* Improve table accessibility */
table {
  border-collapse: collapse;
}

th {
  text-align: left;
  font-weight: 600;
}

/* Improve modal accessibility */
.modal {
  color-scheme: light;
}

.modal-header {
  border-bottom: 1px solid #dee2e6;
}

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

/* Improve alert accessibility */
.alert {
  border-left: 4px solid;
}

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

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

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

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

