/* Accessibility CSS Enhancements */

/* Focus styles for all interactive elements */
:focus {
  outline: 2px solid #2563eb; /* Blue-700 */
  outline-offset: 2px;
}

/* For elements where the default outline isn't desired, ensure alternative visual focus */
.custom-focus:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5);
  outline: none;
}

/* Skip link styling */
.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;
}

.sr-only:focus {
  position: absolute;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 1rem;
  background-color: #1e40af;
  color: white;
  text-decoration: none;
}

/* Responsive accessibility enhancements */
@media (max-width: 640px) {
  /* Increase touch target size on mobile */
  button, 
  [role="button"],
  a {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Ensure text is readable at smaller screen sizes */
  body {
    font-size: 16px;
    line-height: 1.5;
  }
  
  /* Improve focus visibility on mobile */
  :focus {
    outline: 3px solid #2563eb; /* Blue-700 */
    outline-offset: 3px;
  }
  
  /* Adjust skip link position on mobile */
  .sr-only:focus {
    width: 100%;
    text-align: center;
  }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-bounce, 
  .animate-fade-in, 
  .transition, 
  .transition-transform,
  .transition-all,
  .transition-colors,
  .transition-opacity,
  .transition-shadow {
    animation: none !important;
    transition: none !important;
  }
}

  /* FAQ Button Styles */
    #faq-list button {
      font-size: 1.125rem; /* text-lg */
    }
    @media (min-width: 640px) {
      #faq-list button {
        font-size: 1.5rem; /* text-2xl */
      }
    }
    #faq-list button:focus-visible {
      outline: 2px solid #3b82f6;
      border-radius: 0.25rem;
    }
    #faq-list button span {
      font-size: 1.25rem;
    }
    #faq-list .answer {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease-out;
    }
    #faq-list .answer.visible {
      max-height: 2000px;
    }
    
    /* Mobile Menu Improvements */
    body.menu-open {
      overflow: hidden;
    }
    #mobile-menu.visible {
      display: flex !important;
    }
    #mobile-menu a:active,
    #mobile-menu a:focus {
      text-decoration: underline;
    }


     @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(20px); }
      to { opacity: 1; transform: translateY(0); }
    }
    
    @keyframes pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.05); }
    }
    
    .fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
    .card-hover { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
    .card-hover:hover { transform: translateY(-8px); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
    .icon-pulse:hover { animation: pulse 2s infinite; }
    .success-indicator { 
      opacity: 0; 
      transform: translateY(10px); 
      transition: all 0.3s ease; 
    }
    .card-hover:hover .success-indicator { 
      opacity: 1; 
      transform: translateY(0); 
    }
    
    .challenge-card { 
      animation-delay: var(--animation-delay, 0s);
    }
    
    .bg-gradient-subtle {
      background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }
    
    /* Sticky navigation styles */
    .sticky-nav {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      z-index: 50;
      transform: translateY(-100%);
      transition: transform 0.3s ease-in-out;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .sticky-nav.show {
      transform: translateY(0);
    }
    
    /* Back to top button */
    .back-to-top {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 50px;
      height: 50px;
      background: #1e40af;
      color: white;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
      z-index: 40;
      box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    }
    
    .back-to-top.show {
      opacity: 1;
      visibility: visible;
    }
    
    .back-to-top:hover {
      background: #1d4ed8;
      transform: translateY(-2px);
    }
    
    /* Floating CTA for mobile */
    .floating-cta {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      background: #1e40af;
      color: white;
      padding: 12px 24px;
      border-radius: 50px;
      font-weight: 600;
      text-decoration: none;
      box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
      z-index: 35;
      display: none;
      animation: pulse 2s infinite;
    }
    
    .floating-cta.show {
      display: block;
    }
    
    @media (max-width: 768px) {
      .floating-cta.show {
        display: block;
      }
    }
    
    @keyframes pulse {
      0%, 100% { 
        transform: translateX(-50%) scale(1); 
      }
      50% { 
        transform: translateX(-50%) scale(1.05); 
      }
    }

     /* Mobile viewport height fix for iPhone */
    :root {
      --vh: 1vh;
    }
    
    /* Dynamic viewport height support */
    .min-h-screen-safe {
      min-height: 100vh;
      min-height: calc(var(--vh, 1vh) * 100);
      min-height: 100dvh; /* Dynamic viewport height for modern browsers */
    }
    
    /* Ensure hero section always fills screen on mobile */
    @media (max-width: 768px) {
      .hero-section {
        min-height: -webkit-fill-available;
        min-height: 100vh;
        min-height: 100dvh;
      }
    }
    
    /* iOS Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
      .hero-section {
        min-height: -webkit-fill-available;
      }
    }
    
    /* Additional iPhone viewport fixes */
    html {
      scroll-behavior: smooth;
    }
    
    body {
      /* Prevent iOS bounce effect from showing white background */
      overscroll-behavior-y: none;
    }

     /* Scroll-based fade-in animation */
    .scroll-fade-in {
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }
    
    .scroll-fade-in.visible {
      opacity: 1;
      transform: translateY(0);
    }
    
    /* Icon pulse animation */
    .icon-pulse {
      animation: pulse 2s infinite;
    }
    
    @keyframes pulse {
      0%, 100% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.1);
      }
    }