/* Base Accessibility Styles */
:root {
  --color-primary: #3B82F6;
  --color-primary-dark: #2563EB;
  --color-primary-light: #DBEAFE;
  --color-text: #1F2937;
  --color-text-light: #4B5563;
  --color-background: #FFFFFF;
  --color-background-alt: #F9FAFB;
  --focus-ring-color: #3B82F6;
  --focus-ring-offset: 2px;
  --transition-speed: 0.3s;
  --font-size-base: 16px;
  --contrast-ratio: 1;
  --font-scale: 1;
}

/* High Contrast Mode */
.high-contrast {
  --color-primary: #0000FF;
  --color-primary-dark: #0000CC;
  --color-primary-light: #CCCCFF;
  --color-text: #000000;
  --color-text-light: #333333;
  --color-background: #FFFFFF;
  --color-background-alt: #F0F0F0;
  --contrast-ratio: 1.5;
}

body {
  font-size: calc(var(--font-size-base) * var(--font-scale));
  line-height: 1.5;
  transition: font-size var(--transition-speed) ease;
}

/* Focus States */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring-offset) var(--color-background), 0 0 0 calc(var(--focus-ring-offset) + 2px) var(--focus-ring-color);
  border-radius: 0.25rem;
  transition: box-shadow var(--transition-speed) ease;
}

/* Skip to content link */
.sr-only.focus:not-sr-only {
  display: inline-block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  padding: 1rem;
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  text-decoration: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Animations applied to elements */
.fade-in {
  animation: fadeIn 0.8s ease-in-out;
}

.slide-in-up {
  animation: slideInUp 0.6s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #3B82F6;
    --color-primary-dark: #2563EB;
    --color-primary-light: #1E40AF;
    --color-text: #F9FAFB;
    --color-text-light: #D1D5DB;
    --color-background: #111827;
    --color-background-alt: #1F2937;
  }
}

/* Responsive text sizes */
@media (max-width: 640px) {
  :root {
    --font-size-base: 14px;
  }
}

/* Print styles for accessibility */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  a, a:visited {
    text-decoration: underline;
    color: #000;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  .no-print, nav, button {
    display: none !important;
  }
  
  .container {
    width: 100%;
    max-width: 100%;
  }
}

/* WCAG 2.1 AA Compliance Helpers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Custom Scrollbar for better visibility */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-background-alt);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-primary);
  border-radius: 6px;
  border: 3px solid var(--color-background-alt);
}

/* Form elements enhancements for accessibility */
input::placeholder,
textarea::placeholder {
  opacity: 0.7;
  color: var(--color-text-light);
}

/* Error states for form validation */
.input-error {
  border-color: #EF4444 !important;
}

.error-message {
  color: #EF4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Active navigation indicators */
.nav-active {
  color: var(--color-primary) !important;
  font-weight: 600;
}

