/* a11y.css - Accessibility Styles
 * 
 * Focus indicators, screen reader utilities, and accessibility enhancements.
 * Created: 2025-01-28
 */

/* =============================================
   Focus Indicators
   ============================================= */

/* Remove default outline for mouse users */
*:focus {
  outline: none;
}

/* Show focus ring for keyboard users */
*:focus-visible {
  outline: 3px solid var(--theme-color, #667eea);
  outline-offset: 2px;
}

/* Fallback for browsers that don't support :focus-visible */
@supports not selector(:focus-visible) {
  *:focus {
    outline: 3px solid var(--theme-color, #667eea);
    outline-offset: 2px;
  }
}

/* Enhanced focus for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--theme-color, #667eea);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.15);
}

/* Tool cards - enhanced focus */
.tool-card:focus-visible {
  outline: 3px solid var(--theme-color, #667eea);
  outline-offset: 4px;
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Options/Radio-like buttons */
.option:focus-visible {
  outline: 3px solid var(--theme-color, #667eea);
  outline-offset: 2px;
}

/* Upload zones */
.upload-zone:focus-visible {
  outline: 3px solid var(--theme-color, #667eea);
  outline-offset: 4px;
}

/* =============================================
   Screen Reader Only
   ============================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Allow sr-only content to be focusable */
.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: inherit;
}

/* =============================================
   Skip Links
   ============================================= */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--theme-color, #667eea);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* =============================================
   Reduced Motion
   ============================================= */

@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;
  }
}

/* =============================================
   High Contrast Mode Enhancements
   ============================================= */

@media (prefers-contrast: high) {
  .tool-card {
    border: 2px solid currentColor;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  .progress-bar {
    border: 1px solid currentColor;
  }
}

/* =============================================
   Touch Target Sizes
   ============================================= */

/* Ensure minimum touch target size of 44x44px */
@media (pointer: coarse) {
  button,
  .btn,
  .tool-card,
  .option,
  select,
  input[type="file"],
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  a {
    padding: 4px;
  }
}

/* =============================================
   Progress Bar ARIA Styles
   ============================================= */

.progress-bar[role="progressbar"] {
  position: relative;
}

/* Optional: Show progress percentage for screen readers */
.progress-bar[role="progressbar"]::after {
  content: attr(aria-valuenow) '%';
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
