/* Enhanced accessibility fixes addressing DevTools warnings */

/* Better focus indication for interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[role="button"]:focus,
[tabindex]:focus {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

/* Skip unnecessary animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Ensure text is readable */
body {
  line-height: 1.5;
  color: #0f172a; /* Ensure sufficient contrast */
}

/* Improve button and link accessibility - minimum size targets */
@media (max-width: 767px) {
  button,
  [role="button"],
  a.btn,
  .btn,
  input[type="button"],
  input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  a {
    padding: 0.25rem;
    display: inline-block;
  }
}

/* Ensure color is not the only means of conveying information */
.required::after {
  content: "*";
  color: #ef4444;
  margin-left: 4px;
}

/* Fix for nesting interactive elements */
button button,
a a,
button a,
a button {
  all: unset;
  cursor: pointer;
}

/* Improve contrast for text */
.text-gray-400,
.text-gray-500 {
  color: #4b5563 !important; /* Darker gray for better contrast */
}

/* Ensure form labels are associated with inputs */
label {
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* Fix for ARIA attributes */
[aria-hidden="true"] {
  display: none !important;
}

/* Ensure proper role is assigned to elements */
nav ul {
  role: "list";
}

/* Ensure discernible text for buttons with only icons */
.icon-only-button {
  position: relative;
}

.icon-only-button::after {
  content: attr(aria-label);
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Fix color contrast issues */
.improved-contrast {
  color: #111827 !important;
  background-color: #f9fafb !important;
}
