
/* Tablet Styles (768px - 991px) */
@media (max-width: 991px) {
  /* Adjust service cards for better tablet layout */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Adjust footer layout */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Adjust hero section padding */
  .hero {
    padding: 140px 0 80px;
  }
  
  /* Adjust font sizes for better readability on tablets */
  .hero-title {
    font-size: 2.8rem;
  }
  
  .section-title {
    font-size: 2.2rem;
  }
}

/* Mobile Landscape Styles (576px - 767px) */
@media (max-width: 767px) {
  /* Stack service cards for mobile */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  /* Adjust hero section for mobile */
  .hero {
    padding: 120px 0 60px;
    text-align: center;
  }
  
  .hero-content {
    max-width: 100%;
  }
  
  .hero-title {
    font-size: 2.4rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  /* Adjust section padding */
  .services, .features {
    padding: 60px 0;
  }
  
  /* Improve mobile navigation */
  .nav-menu {
    width: 100%;
    background: var(--dark-blue);
    position: absolute;
    top: 100%;
    left: 0;
    padding: 1rem 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
  }
  
  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .nav-item {
    display: block;
    margin: 1rem 0;
    text-align: center;
  }
  
  .mobile-toggle {
    display: block;
    font-size: 1.5rem;
    color: white;
  }
}

/* Mobile Portrait Styles (up to 575px) */
@media (max-width: 575px) {
  /* Further reduce font sizes */
  .hero-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  /* Adjust container padding */
  .container {
    padding: 0 1.25rem;
  }
  
  /* Stack footer columns */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  /* Adjust logo size */
  .logo img {
    height: 35px;
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
  
  /* Adjust button layout in hero section */
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 250px;
  }
  
  /* Improve service card spacing */
  .service-card {
    margin-bottom: 1.5rem;
  }
  
  /* Adjust padding in service content */
  .service-content {
    padding: 1.5rem;
  }
}

/* Extra Small Devices (up to 375px) */
@media (max-width: 375px) {
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .btn {
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
  }
  
  .service-title {
    font-size: 1.3rem;
  }
}

/* Print Styles */
@media print {
  .header, .footer, .hero-buttons, .mobile-toggle {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  .container {
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
  }
  
  .hero, .services, .features {
    padding: 1cm 0;
    background: none;
    color: #000;
  }
  
  .hero-title, .section-title, .service-title {
    color: #000;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  .service-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary: #0047AB;
    --primary-light: #0056d6;
    --primary-dark: #003380;
    --secondary: #008080;
    --accent: #FF0000;
    --dark: #000000;
    --dark-blue: #000033;
    --light: #FFFFFF;
    --gray: #444444;
    --gray-light: #CCCCCC;
  }
  
  .hero, .footer {
    background: var(--dark);
  }
  
  a, .btn, .nav-link {
    text-decoration: underline;
  }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .slide-up, .slide-right, .fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 767px) {
  /* Improve mobile navigation */
  .nav-menu {
    width: 100%;
    background: var(--dark-blue);
    position: fixed; /* Changed from absolute to fixed */
    top: 70px; /* Adjust based on your header height */
    left: 0;
    padding: 1rem 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999; /* Ensure it's above everything else */
    height: calc(100vh - 70px); /* Full height minus header */
    overflow-y: auto; /* Allow scrolling if needed */
  }
  
  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto; /* Ensure it's clickable */
  }
  
  .nav-item {
    display: block;
    margin: 1rem 0;
    text-align: center;
    pointer-events: auto; /* Ensure nav items are clickable */
  }
  
  .nav-link {
    display: block;
    padding: 1rem 2rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
    pointer-events: auto; /* Ensure links are clickable */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1); /* iOS tap highlight */
  }
  
  .nav-link:hover,
  .nav-link:active {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .mobile-toggle {
    display: block;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1); /* iOS tap highlight */
    user-select: none; /* Prevent text selection */
    pointer-events: auto; /* Ensure it's clickable */
  }
  
  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }
  
  /* Add overlay to prevent clicking behind menu */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}