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

.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Improved focus visibility for high contrast mode */
@media (prefers-contrast: high) {
  *:focus-visible {
    outline: 3px solid currentColor !important;
    outline-offset: 2px !important;
  }
}

/* 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;
    scroll-behavior: auto !important;
  }
}

/* Touch target improvement for mobile */
@media (hover: none) and (pointer: coarse) {
  button,
  a,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  button,
  input,
  select,
  textarea {
    border: 2px solid currentColor;
  }
}

/* Better text visibility in high contrast */
@media (prefers-contrast: high) {
  .text-white\/70,
  .text-gray-400,
  .text-gray-600 {
    opacity: 1 !important;
  }
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.5);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.7);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.5) transparent;
}

/* Ensure proper tap highlight on mobile */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent text overflow */
input,
textarea,
select {
  max-width: 100%;
}

/* Better contrast for placeholder text */
::placeholder {
  opacity: 0.6;
}

/* Focus visible improvements */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

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