/* Enhanced keyboard navigation and accessibility styles */

/* Skip link visible on focus */
.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: fixed;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Enhanced focus indicators for keyboard navigation */
body.keyboard-nav *:focus {
  outline: 2px solid theme('colors.emerald.500');
  outline-offset: 2px;
}

/* Touch-friendly interactive elements */
.touch-manipulation {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(16, 185, 129, 0.1);
}

/* Smooth transitions */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Loading spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* Improved focus visible for dark mode */
.dark *:focus-visible {
  outline-color: theme('colors.emerald.400');
}

/* Better disabled state */
button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Line clamp utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
  /* Increase tap targets */
  button, a, input, select, textarea {
    min-height: 44px;
  }

  /* Better spacing for mobile */
  .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

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