/* Critical Accessibility Fixes for LineDiet Website */
/* Following WCAG 2.1 AA standards for color contrast */

/* Text Color Fixes - Ensuring minimum 4.5:1 contrast ratio */
.text-primary, .hero-title, .section-title, h1, h2, h3, h4, h5, h6 {
  color: #212529 !important; /* Dark gray/black for maximum contrast */
}

.text-secondary, .hero-subtitle, .section-subtitle, p, .description {
  color: #2E7D32 !important; /* Primary green with sufficient contrast */
}

/* Light text on dark backgrounds */
.btn-primary, .cta-button, .whatsapp-button {
  background-color: #2E7D32 !important;
  color: #FFFFFF !important;
  border: 2px solid #2E7D32 !important;
}

.btn-secondary {
  background-color: #FF8F00 !important;
  color: #FFFFFF !important;
  border: 2px solid #FF8F00 !important;
}

/* Card and content area fixes */
.card-title, .package-title, .testimonial-name {
  color: #212529 !important;
}

.card-text, .package-description, .testimonial-text {
  color: #2E7D32 !important;
}

/* Navigation fixes */
.navbar-brand, .nav-link {
  color: #212529 !important;
}

.nav-link:hover, .nav-link:focus {
  color: #2E7D32 !important;
}

/* Footer fixes */
.footer-text, .footer-link {
  color: #212529 !important;
}

.footer-link:hover {
  color: #2E7D32 !important;
}

/* Form elements */
.form-label, .form-text {
  color: #212529 !important;
}

.form-control {
  color: #212529 !important;
  border: 2px solid #2E7D32 !important;
}

/* Focus indicators for keyboard navigation */
*:focus {
  outline: 3px solid #2E7D32 !important;
  outline-offset: 2px !important;
}

.btn:focus, .form-control:focus, .nav-link:focus {
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.25) !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  * {
    color: #000000 !important;
    background-color: #FFFFFF !important;
  }
  
  .btn-primary {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border: 3px solid #000000 !important;
  }
  
  .btn-secondary {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    border: 3px solid #000000 !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;
  }
}

/* Touch target improvements */
.btn, .nav-link, .form-control, .clickable {
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 12px 16px !important;
}

/* Screen reader improvements */
.sr-only {
  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 for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #2E7D32;
  color: #FFFFFF;
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 6px;
}

/* Error and success message accessibility */
.alert-success {
  background-color: #d4edda !important;
  color: #155724 !important;
  border: 2px solid #155724 !important;
}

.alert-error, .alert-danger {
  background-color: #f8d7da !important;
  color: #721c24 !important;
  border: 2px solid #721c24 !important;
}

/* Ensure all interactive elements are accessible */
button, a, input, select, textarea {
  font-size: 16px !important; /* Prevent zoom on mobile */
}

/* Image alt text styling */
img[alt] {
  font-style: italic;
  color: #2E7D32;
}

/* Table accessibility */
table {
  border-collapse: collapse;
}

th, td {
  border: 1px solid #2E7D32;
  padding: 8px;
  text-align: right; /* RTL support */
}

th {
  background-color: #E8F5E8;
  color: #212529;
  font-weight: bold;
}

/* Language direction support */
[dir="rtl"] {
  text-align: right;
}

[dir="ltr"] {
  text-align: left;
}