/* Accessibility Styles */

/* High Contrast Mode */
html.high-contrast {
  filter: contrast(1.5);
}

html.high-contrast * {
  text-shadow: none !important;
  box-shadow: none !important;
}

/* Invert Colors Mode */
html.invert-colors {
  filter: invert(100%) !important;
}

html.invert-colors img,
html.invert-colors video,
html.invert-colors [style*="background-image"] {
  filter: invert(100%);
}

/* Highlight Links */
html.highlight-links a {
  background-color: #ffff00 !important;
  color: #000000 !important;
  text-decoration: underline !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
  font-weight: 600 !important;
}

html.highlight-links button {
  outline: 3px solid #0066cc !important;
  outline-offset: 3px !important;
}

/* Readable Font */
html.readable-font,
html.readable-font * {
  font-family: 'Arial', 'Helvetica', sans-serif !important;
  letter-spacing: 0.05em !important;
  line-height: 1.8 !important;
}

/* Emphasize Headers */
html.emphasize-headers h1,
html.emphasize-headers h2,
html.emphasize-headers h3,
html.emphasize-headers h4,
html.emphasize-headers h5,
html.emphasize-headers h6 {
  background-color: #f0f0f0 !important;
  padding: 0.5em !important;
  border-left: 5px solid #0066cc !important;
  margin-bottom: 1em !important;
  font-weight: 900 !important;
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
  outline: 3px solid #0066cc !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(0, 102, 204, 0.2) !important;
}

/* Skip to Content Link */
.skip-to-content {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1em;
  background-color: #000;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

.skip-to-content:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* 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-width: 0;
}

/* Improved Focus for Buttons and Interactive Elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #0066cc !important;
  outline-offset: 2px !important;
}

/* High Contrast Mode for Form Elements */
html.high-contrast input,
html.high-contrast textarea,
html.high-contrast select,
html.high-contrast button {
  border: 2px solid #000 !important;
}

/* Cursor Enhancement */
html.highlight-links a:hover,
html.highlight-links button:hover {
  cursor: pointer;
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

/* Print Styles for Accessibility */
@media print {
  .accessibility-toolbar,
  .whatsapp-button,
  nav,
  footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
    color: #000;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* Dark Mode Support (for inverted colors) */
html.invert-colors {
  color-scheme: dark;
}

/* Ensure Images Don't Break Layout */
img {
  max-width: 100%;
  height: auto;
}

/* ARIA Live Regions */
[aria-live="polite"],
[aria-live="assertive"] {
  position: relative;
}

/* Custom Scrollbar for Better Visibility */
html.high-contrast ::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

html.high-contrast ::-webkit-scrollbar-track {
  background: #f1f1f1;
  border: 1px solid #000;
}

html.high-contrast ::-webkit-scrollbar-thumb {
  background: #000;
  border: 2px solid #f1f1f1;
}

html.high-contrast ::-webkit-scrollbar-thumb:hover {
  background: #333;
}

