﻿/* === CUSTOM BASE STYLES === */
@layer base {
  * {
    @apply border-gray-200;
  }
  
  body {
    @apply bg-white text-gray-900 antialiased;
  }
}

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

/* === CUSTOM ANIMATIONS === */
@layer utilities {
  .animate-fade-in {
    animation: fadeIn 0.5s ease-in;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* === ACCESSIBILITY ENHANCEMENTS === */

/* High Contrast Mode */
.high-contrast {
  --color-bg: #000000;
  --color-text: #ffffff;
  --color-primary: #00ff00;
  --color-secondary: #ffff00;
}

.high-contrast {
  background-color: var(--color-bg) !important;
  color: var(--color-text) !important;
}

.high-contrast body {
  background-color: var(--color-bg) !important;
  color: var(--color-text) !important;
}

.high-contrast a {
  color: var(--color-primary) !important;
  text-decoration: underline !important;
}

.high-contrast button {
  border: 2px solid var(--color-text) !important;
}

.high-contrast .bg-white {
  background-color: #000000 !important;
  color: #ffffff !important;
}

.high-contrast .text-gray-900,
.high-contrast .text-gray-800,
.high-contrast .text-gray-700,
.high-contrast .text-gray-600 {
  color: #ffffff !important;
}

.high-contrast .bg-gray-50,
.high-contrast .bg-gray-100 {
  background-color: #1a1a1a !important;
}

/* Increased Line Spacing */
.increased-line-spacing {
  line-height: 1.8 !important;
}

.increased-line-spacing p,
.increased-line-spacing li,
.increased-line-spacing div {
  line-height: 1.8 !important;
}

/* Increased Letter Spacing */
.increased-letter-spacing {
  letter-spacing: 0.05em !important;
}

.increased-letter-spacing p,
.increased-letter-spacing span,
.increased-letter-spacing a,
.increased-letter-spacing button {
  letter-spacing: 0.05em !important;
}

/* Reduce Motion */
.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* Focus Visible Styles - WCAG Compliant */
*:focus-visible {
  outline: 3px solid #0d9488 !important;
  outline-offset: 2px !important;
}

/* Skip to Main Content Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #0d9488;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
  font-weight: 600;
}

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

/* Screen Reader Only Content */
.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;
}

/* Keyboard Navigation Indicators */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #0d9488 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2) !important;
}

/* Ensure sufficient color contrast */
.text-gray-500 {
  color: #6b7280 !important;
}

.text-gray-600 {
  color: #4b5563 !important;
}

/* Image Alt Text Fallback */
img:not([alt]) {
  border: 3px solid red !important;
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* Touch Target Size - Minimum 44x44px for mobile */
@media (max-width: 768px) {
  button,
  a,
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Prefers 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;
  }
}

/* Prefers Color Scheme */
@media (prefers-color-scheme: dark) {
  /* Optional: Add dark mode support */
}

/* High Contrast Mode Detection */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor !important;
  }
}
