/* ADA Compliance CSS - Banyan Tree Village */

/* Skip Links for Screen Readers */
.skip-links {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: 9999;
}

.skip-link,
.visually-hidden-focusable {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link:focus,
.visually-hidden-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: 8px 16px !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  background-color: #000 !important;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 4px !important;
  font-weight: bold !important;
  z-index: 10000 !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn-primary {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
  }
  
  .btn-outline-primary {
    color: #000 !important;
    border-color: #000 !important;
  }
  
  .btn-outline-primary:hover {
    background-color: #000 !important;
    color: #fff !important;
  }
}

/* Reduced Motion Support */
@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;
  }
  
  .carousel {
    animation: none !important;
  }
  
  .fade {
    transition: none !important;
  }
}

/* Enhanced Focus Indicators */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
.btn:focus,
.nav-link:focus,
.dropdown-toggle:focus {
  outline: 3px solid #005fcc !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.3) !important;
}

/* Navigation accessibility improvements */
.nav-item.active,
.nav-link[aria-current="page"] {
  font-weight: bold;
  position: relative;
}

.nav-item.active::after,
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: currentColor;
}

/* Form accessibility improvements */
.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control:invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control:invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Error states */
.is-invalid {
  border-color: #dc3545 !important;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

/* Button accessibility improvements */
.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.15s ease-in-out;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Color contrast improvements */
.text-muted {
  color: #3d3333 !important;
}

.bg-light {
  background-color: #f8f9fa !important;
  color: #3d3333 !important;
}

.bg-dark {
  background-color: #212529 !important;
  color: #fff !important;
}

/* Override Bootstrap's light text colors for better readability */
body {
  color: #3d3333 !important;
}

.card-text {
  color: #3d3333 !important;
}

.text-light {
  color: #3d3333 !important;
}

p, .form-text {
  color: #3d3333 !important;
}

/* Table accessibility */
.table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Alert accessibility */
.alert {
  border-left: 4px solid;
  border-radius: 4px;
}

.alert-success {
  border-left-color: #198754;
}

.alert-danger {
  border-left-color: #dc3545;
}

.alert-warning {
  border-left-color: #ffc107;
}

.alert-info {
  border-left-color: #0dcaf0;
}

/* Link accessibility */
a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Image accessibility */
img {
  max-width: 100%;
  height: auto;
}

/* Screen reader only content */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Large text mode support */
@media (min-resolution: 120dpi) {
  body {
    font-size: 18px;
    line-height: 1.6;
  }
  
  .btn {
    min-height: 48px;
    min-width: 48px;
    font-size: 18px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e9ecef;
    --bs-primary: #6ea8dc;
  }
  
  .hero-section {
    background-color: #2d3748;
    color: #e9ecef;
  }
  
  .card {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e9ecef;
  }
}

/* Keyboard navigation improvements */
.dropdown-menu {
  border: 2px solid #dee2e6;
}

.dropdown-item:focus,
.dropdown-item:hover {
  background-color: #e9ecef;
  color: #3d3333 !important;
  outline: 2px solid #005fcc;
  outline-offset: -2px;
}

/* Mobile accessibility improvements */
@media (max-width: 768px) {
  .btn {
    min-height: 48px;
    min-width: 48px;
    font-size: 16px;
  }
  
  .nav-link {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  .form-control {
    min-height: 48px;
    font-size: 16px;
  }
}

/* Print accessibility */
@media print {
  .skip-links,
  .navbar,
  .btn,
  .social-icons {
    display: none !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  .visually-hidden {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
  }
}