/* =====================================================
   ACCESSIBILITY FIXES - App (app.barrierefreies-pdf-erstellen.de)
   WCAG 2.1 AA Compliance
   ===================================================== */

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: #7c3aed;
  color: white !important;
  padding: 12px 24px;
  border-radius: 0 0 12px 12px;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.3s ease;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid white;
  outline-offset: -3px;
}

/* ===== Focus States (WCAG 2.4.7) ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #7c3aed !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* Primary Buttons - Higher Contrast Focus */
.btn-shine:focus-visible,
[class*="bg-gradient"]:focus-visible {
  outline: 3px solid white !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.5) !important;
}

/* Glass Cards Focus */
.glass:focus-visible,
.border-gradient:focus-visible {
  outline: 2px solid #7c3aed !important;
  outline-offset: 4px !important;
}

/* Remove default outline but ensure focus-visible works */
:focus:not(:focus-visible) {
  outline: none;
}

/* ===== Reduced Motion (WCAG 2.3.3) ===== */
@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;
  }

  /* Stop floating animations */
  .float-1,
  .float-2,
  .float-3,
  .animate-float {
    animation: none !important;
    transform: none !important;
  }

  /* Stop pulse animations */
  .animate-pulse-slow,
  .animate-bounce-slow,
  .animate-urgency-pulse {
    animation: none !important;
  }

  /* Stop gradient animations */
  .hero-animation,
  .urgency-banner,
  .border-gradient::before {
    animation: none !important;
    background-size: 100% 100% !important;
  }

  /* Stop slide/fade animations */
  .animate-slide-up,
  .animate-fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Hero step animation - show all steps or first only */
  [x-data] [x-show] {
    transition: none !important;
  }
}

/* ===== Touch Targets (WCAG 2.5.5) ===== */
@media (pointer: coarse) {
  /* Navigation Links */
  nav a,
  .site-navigation a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
  }

  /* Buttons */
  button,
  [role="button"],
  .btn-shine {
    min-height: 44px;
    min-width: 44px;
  }

  /* Mobile Menu Button */
  .site-navigation-toggle,
  [class*="mobile"] button {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  /* Trust Badges */
  .trust-badge {
    min-height: 44px;
  }
}

/* ===== Contrast Fixes ===== */
/* Ensure gray-400 text meets contrast requirements */
.text-gray-400 {
  color: #6b7280 !important; /* Upgraded from #9CA3AF */
}

/* Placeholder text contrast */
::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
}

/* ===== SVG Accessibility ===== */
/* Decorative SVGs should be hidden from screen readers */
svg[aria-hidden="true"],
.decorative-icon {
  pointer-events: none;
}

/* ===== Screen Reader Only (Utility) ===== */
.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,
.sr-only:active {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
  .glass,
  .border-gradient,
  .trust-badge {
    border: 2px solid currentColor !important;
  }

  .btn-shine,
  [class*="bg-gradient"] {
    border: 2px solid white !important;
  }

  .text-gradient {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: #7c3aed !important;
  }
}
