/* Accessibility improvements for RGAA 4.1 compliance */

/* Skip links - hidden by default, visible on focus */
.skip-links {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: 1000;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: top 0.3s;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skip-link:focus {
  top: 6px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Focus indicators */
*:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

/* High contrast color improvements */
.btn-primary {
  background-color: #0056b3;
  border-color: #0056b3;
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #004085;
  border-color: #004085;
  color: #ffffff;
}

/* Text contrast improvements */
.text-muted {
  color: #495057 !important;
}

/* Link contrast improvements */
a {
  color: #0056b3;
}

a:hover,
a:focus {
  color: #004085;
}

/* Form improvements */
.form-control:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

/* Select improvements */
.form-control-select:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

/* Error states */
.has-error .form-control {
  border-color: #dc3545;
}

.has-error .form-control:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Alert improvements */
.alert[role="alert"] {
  border-left: 4px solid;
}

.alert-danger[role="alert"] {
  border-left-color: #dc3545;
}

.alert-success[role="alert"] {
  border-left-color: #28a745;
}

.alert-warning[role="alert"] {
  border-left-color: #ffc107;
}

.alert-info[role="alert"] {
  border-left-color: #17a2b8;
}

/* Navigation improvements */
nav[role="navigation"] ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav[role="navigation"] li {
  display: inline-block;
  margin-right: 1rem;
}

/* Button improvements */
.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
}

.btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 124, 186, 0.25);
}

/* Touch target improvements */
a, button, input[type="button"], input[type="submit"], input[type="reset"] {
  min-height: 44px;
  min-width: 44px;
}

/* Form controls touch targets */
.form-control {
  min-height: 44px;
  padding: 8px 12px;
}

/* Pagination improvements */
.pagination .page-list li {
  display: inline-block;
  margin: 0 2px;
}

.pagination .page-list a {
  padding: 8px 12px;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.pagination .page-list a:hover,
.pagination .page-list a:focus {
  background-color: #f8f9fa;
  border-color: #007cba;
}

.pagination .page-list .current a {
  background-color: #007cba;
  color: white;
  border-color: #007cba;
}

/* Breadcrumb improvements */
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin: 0 8px;
  color: #6c757d;
}

/* Logo improvements */
.header_logo a:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* Product improvements */
.product-flag {
  display: inline-block;
  padding: 4px 8px;
  margin: 2px;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: bold;
}

/* Screen reader only text */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Alternative for older browsers */
.sr-only-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  *:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
  }
  
  .btn:focus {
    outline: 3px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .skip-link {
    transition: none;
  }
}
