/* Mobile First Responsive Design */

/* Consistent Breakpoint System */
/* Mobile: 320px - 767px */
/* Tablet: 768px - 1023px */
/* Desktop: 1024px - 1439px */
/* Large Desktop: 1440px+ */

/* Mobile menu styling - clean and professional */

/* Base mobile styles (up to 767px) */
@media (max-width: 767px) {
  /* Header mobile styles */
  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
  }
  
  .nav {
    order: 3;
    width: 100%;
    display: none !important;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-top: 3px solid var(--primary-800);
    margin-top: 0;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    box-shadow: var(--shadow-heavy);
    animation: slideDown 0.3s ease-out;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .nav.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Backdrop overlay when mobile menu is open */
  .nav.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease-out;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex !important;
  }
  
  .nav-list li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-list li:last-child {
    border-bottom: none;
  }
  
  .nav-list .nav-link {
    display: block !important;
    padding: 1.25rem 2rem;
    width: 100%;
    text-align: left;
    color: var(--bg-primary) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
  }
  
  .nav-list .nav-link:hover,
  .nav-list .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bg-primary) !important;
    transform: translateX(5px);
  }
  
  .nav-list .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: var(--primary-800);
    transition: width 0.3s ease;
  }
  
  .nav-list .nav-link:hover::before {
    width: 4px;
  }
  
  .mobile-menu-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: transparent;
    border: 2px solid var(--primary-500);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    transition: all 0.3s ease;
  }
  
  .mobile-menu-toggle:hover {
    background-color: var(--primary-500);
    border-color: var(--primary-600);
  }
  
  .mobile-menu-toggle.active {
    background-color: var(--primary-600);
    border-color: var(--primary-700);
  }
  
  .mobile-menu-toggle:hover span {
    background-color: var(--bg-primary);
  }
  
  .mobile-menu-toggle.active span {
    background-color: var(--bg-primary);
  }
  
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  .header-contact {
    order: 2;
  }
  
  /* Hero section mobile */
  .hero {
    min-height: 80vh;
    padding: 2rem 0;
    padding-top: 140px; /* Extra padding for mobile to account for expanded nav */
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
  
  /* Services grid mobile */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  /* Contact section mobile */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
  
  /* Footer mobile */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Testimonials mobile */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* General mobile adjustments */
  .container {
    padding: 0 1rem;
  }
  
  .section-header {
    margin-bottom: 2rem;
  }
  
  .about, .services, .how-we-work, .testimonials, .contact, .featured-snippet {
    padding: 3rem 0;
  }
  
  /* Featured snippet mobile adjustments */
  .featured-snippet-content h2 {
    font-size: 1.5rem;
  }
  
  .featured-snippet-content h2:first-child {
    font-size: 1.75rem;
  }
  
  .featured-snippet-content p {
    font-size: 1rem;
  }
  
  .featured-snippet-content ol li {
    font-size: 1rem;
  }
  
  /* Button adjustments */
  .btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  /* Form adjustments */
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.875rem;
  }
  
  /* Map adjustments */
  .map-container iframe {
    height: 300px;
  }
}

/* Tablet styles (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Header tablet */
  .header-content {
    padding: 1rem 0;
  }
  
  .nav-list {
    gap: 1.5rem;
  }
  
  /* Hero tablet */
  .hero {
    min-height: 90vh;
  }
  
  .hero-buttons {
    gap: 1.5rem;
  }
  
  /* Services grid tablet */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  /* Contact section tablet */
  .contact-content {
    gap: 2.5rem;
  }
  
  /* Footer tablet */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  /* Testimonials tablet */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  /* General tablet adjustments */
  .container {
    padding: 0 2rem;
  }
  
  .about, .services, .how-we-work, .testimonials, .contact, .featured-snippet {
    padding: 4rem 0;
  }
  
  /* Map adjustments */
  .map-container iframe {
    height: 400px;
  }
}

/* Desktop styles (1024px and above) */
@media (min-width: 1024px) {
  /* Header desktop */
  .header-content {
    padding: 1.5rem 0;
  }
  
  .nav-list {
    gap: 2.5rem;
  }
  
  /* Hero desktop */
  .hero {
    min-height: 100vh;
  }
  
  .hero-content {
    max-width: 900px;
  }
  
  /* Services grid desktop */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
  
  /* Contact section desktop */
  .contact-content {
    gap: 4rem;
  }
  
  /* Footer desktop */
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
  }
  
  /* Testimonials desktop */
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
  
  /* General desktop adjustments */
  .container {
    padding: 0 2rem;
  }
  
  .about, .services, .how-we-work, .testimonials, .contact, .featured-snippet {
    padding: 5rem 0;
  }
  
  /* Hover effects for desktop */
  .service-card:hover {
    transform: translateY(-8px);
  }
  
  .btn:hover {
    transform: translateY(-3px);
  }
}

/* Large desktop styles (1200px and above) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
    padding: 0;
  }
  
  .hero-content {
    max-width: 1000px;
  }
  
  .about-content,
  .work-content,
  .featured-snippet-content {
    max-width: 900px;
  }
  
  /* Enhanced grid layouts for larger screens */
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
  }
  
  .testimonials-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
  }
}

/* Large desktop styles (1200px and above) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
    padding: 0;
  }
  
  .hero-content {
    max-width: 1000px;
  }
  
  .about-content,
  .work-content {
    max-width: 900px;
  }
}

/* Extra large screens (1400px and above) */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
  
  .hero-content {
    max-width: 1100px;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  .hero {
    min-height: 100vh;
    padding: 1rem 0;
  }
  
  .hero-content {
    padding: 2rem 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-background {
    background-image: url('../images/hero-bg@2x.jpg');
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .service-card:hover,
  .btn:hover {
    transform: none;
  }
  
  /* Increase touch targets */
  .nav-link {
    padding: 0.75rem;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .btn {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
  }
  
  .mobile-menu-toggle {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem;
  }
  
  /* Improve form touch targets */
  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 44px;
    padding: 0.875rem;
  }
  
  /* Improve phone link touch targets */
  .phone-link {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hero-background {
    animation: none;
  }
}

/* Dark mode support (if user prefers) */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #1f2937;
    --light-gray: #374151;
    --text-dark: #f9fafb;
    --text-light: #d1d5db;
    --border-color: #4b5563;
  }
  
  body {
    background-color: var(--white);
    color: var(--text-dark);
  }
  
  .header {
    background-color: var(--dark-gray);
  }
  
  .service-card,
  .testimonial-card,
  .contact-form,
  .work-process {
    background-color: var(--light-gray);
    color: var(--text-dark);
  }
}

/* Print styles */
@media print {
  .header,
  .mobile-menu-toggle,
  .hero-buttons,
  .contact-form,
  .map-container,
  .footer {
    display: none !important;
  }
  
  .hero {
    background: none !important;
    color: var(--black) !important;
    min-height: auto !important;
    padding: 1rem 0 !important;
  }
  
  .hero-title,
  .hero-subtitle {
    color: var(--black) !important;
    text-shadow: none !important;
  }
  
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
  
  .about, .services, .how-we-work, .testimonials, .contact {
    padding: 1rem 0 !important;
    background: none !important;
  }
  
  .service-card,
  .testimonial-card {
    box-shadow: none !important;
    border: 1px solid var(--border-color) !important;
    break-inside: avoid;
  }
  
  a {
    color: var(--black) !important;
    text-decoration: underline !important;
  }
  
  .btn {
    display: none !important;
  }
} 