/* Responsive CSS - A&L Home Solutions */
/* Enhanced Responsive Design with Modern Breakpoints */

 *,
 *::before,
 *::after {
   box-sizing: border-box;
   min-width: 0;
 }

 html {
   overflow-x: hidden;
 }

 body {
   overflow-x: hidden;
 }

 img,
 video,
 iframe,
 canvas,
 svg {
   max-width: 100%;
   height: auto;
 }

 .content {
   width: 100%;
   max-width: 100%;
   overflow-x: clip;
 }

/* Enhanced Breakpoint System */
@media (max-width: 320px) {
  /* Extra Small Devices */
  .container {
    padding: 0 0.5rem;
  }
  
  .section {
    padding: 1.5rem 0;
  }
  
  .splash-title {
    font-size: 1.5rem;
    min-height: 2rem;
  }
  
  .splash-subtitle {
    font-size: 0.9rem;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .cta-button {
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
  }
  
  .glass-card {
    padding: 1rem;
  }
  
  .nav-mobile {
    max-width: 100%;
  }
}

 @media (max-width: 480px) {
   .px-6 {
     padding-left: 1rem !important;
     padding-right: 1rem !important;
   }

   .max-w-7xl,
   .max-w-6xl,
   .max-w-5xl,
   .max-w-4xl,
   .max-w-3xl,
   .max-w-2xl {
     max-width: 100% !important;
   }

   .text-5xl {
     font-size: clamp(2rem, 9vw, 3rem) !important;
     line-height: 1.1 !important;
   }

   .text-4xl {
     font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
     line-height: 1.15 !important;
   }

   .text-xl {
     font-size: 1rem !important;
     line-height: 1.6 !important;
   }

   .text-2xl {
     font-size: 1.125rem !important;
     line-height: 1.6 !important;
   }

   .leading-tight {
     line-height: 1.1 !important;
   }

   .leading-relaxed {
     line-height: 1.6 !important;
   }

   .break-words {
     overflow-wrap: anywhere;
     word-break: break-word;
   }

   h1,
   h2,
   h3,
   p,
   a,
   span {
     overflow-wrap: break-word;
   }

   .inline-flex {
     flex-wrap: wrap;
   }
 }

@media (min-width: 321px) and (max-width: 480px) {
  /* Small Devices */
  .splash-logo {
    width: 180px;
    height: 180px;
  }
  
  .splash-title {
    font-size: 1.8rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .grid-modern {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (min-width: 481px) and (max-width: 640px) {
  /* Medium Small Devices */
  .splash-logo {
    width: 200px;
    height: 200px;
  }
  
  .splash-title {
    font-size: 2rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  /* Medium Devices (Tablets) */
  .splash-logo {
    width: 220px;
    height: 220px;
  }
  
  .splash-title {
    font-size: 2.2rem;
  }
  
  .hero-title {
    font-size: 3.5rem;
  }
  
  .grid-features {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .split-layout {
    grid-template-columns: 1fr 1fr;
  }
  
  .nav-mobile {
    max-width: 350px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Large Devices (Small Laptops) */
  .splash-logo {
    width: 240px;
    height: 240px;
  }
  
  .splash-title {
    font-size: 2.5rem;
  }
  
  .hero-title {
    font-size: 4rem;
  }
  
  .grid-testimonials {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .masonry {
    columns: 2;
  }
}

@media (min-width: 1025px) and (max-width: 1280px) {
  /* Extra Large Devices (Laptops) */
  .splash-logo {
    width: 260px;
    height: 260px;
  }
  
  .splash-title {
    font-size: 2.8rem;
  }
  
  .hero-title {
    font-size: 4.5rem;
  }
  
  .grid-hero {
    grid-template-columns: 1fr 1fr;
  }
  
  .sidebar-layout {
    grid-template-columns: 280px 1fr;
  }
  
  .masonry {
    columns: 3;
  }
}

@media (min-width: 1281px) and (max-width: 1440px) {
  /* 2X Large Devices (Large Laptops) */
  .splash-logo {
    width: 280px;
    height: 280px;
  }
  
  .splash-title {
    font-size: 3rem;
  }
  
  .hero-title {
    font-size: 5rem;
  }
  
  .container {
    max-width: 1300px;
  }
}

@media (min-width: 1441px) and (max-width: 1920px) {
  /* 3X Large Devices (Desktops) */
  .splash-logo {
    width: 300px;
    height: 300px;
  }
  
  .splash-title {
    font-size: 3.2rem;
  }
  
  .hero-title {
    font-size: 5.5rem;
  }
  
  .container {
    max-width: 1400px;
  }
  
  .grid-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1921px) {
  /* 4X Large Devices (Ultra Wide) */
  .splash-logo {
    width: 350px;
    height: 350px;
  }
  
  .splash-title {
    font-size: 3.5rem;
  }
  
  .hero-title {
    font-size: 6rem;
  }
  
  .container {
    max-width: 1600px;
  }
  
  .grid-modern {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
  
  .masonry {
    columns: 4;
  }
}

/* Orientation-Based Responsive Design */
@media (orientation: landscape) and (max-height: 600px) {
  .splash-screen {
    padding: 1rem 0;
  }
  
  .splash-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 1rem;
  }
  
  .splash-title {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
  }
  
  .splash-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .loading-container {
    width: 200px;
    margin-bottom: 0.75rem;
  }
  
  .section-hero {
    min-height: 90vh;
    padding-top: 60px;
  }
}

@media (orientation: portrait) and (max-width: 480px) {
  .hero-section {
    padding: 2rem 1rem;
  }
  
  .hero-content {
    padding: 1rem;
  }
  
  .cta-button {
    width: 100%;
    margin-bottom: 1rem;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .splash-logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .gradient-text {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .glass-card {
    transition: none;
  }
  
  .glass-card:hover {
    transform: none;
  }
  
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .cta-button {
    min-height: 44px;
    min-width: 44px;
  }
  
  .nav-mobile {
    padding-top: env(safe-area-inset-top);
  }
  
  .fab {
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
  }
}

/* Mouse Input Optimizations */
@media (hover: hover) and (pointer: fine) {
  .glass-card:hover {
    transform: translateY(-5px) scale(1.02);
  }
  
  .cta-button:hover {
    transform: translateY(-4px) scale(1.02);
  }
  
  .fab:hover {
    transform: scale(1.1) translateY(-2px);
  }
}

/* Device-Specific Optimizations */
/* iPad */
@media only screen 
  and (min-device-width: 768px) 
  and (max-device-width: 1024px) 
  and (-webkit-min-device-pixel-ratio: 2) {
  
  .splash-logo {
    width: 250px;
    height: 250px;
  }
  
  .grid-hero {
    gap: 3rem;
  }
  
  .section {
    padding: 3rem 0;
  }
}

/* iPhone */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 812px) 
  and (-webkit-min-device-pixel-ratio: 3) {
  
  .header {
    height: 88px;
    padding-top: env(safe-area-inset-top);
  }
  
  .section-hero {
    padding-top: 88px;
  }
  
  .fab {
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* Small Phones */
@media only screen 
  and (max-device-width: 375px) 
  and (-webkit-min-device-pixel-ratio: 2) {
  
  .hero-title {
    font-size: 2rem;
  }
  
  .cta-button {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
  }
}

/* Print Responsive */
@media print {
  .splash-screen,
  .nav-mobile,
  .fab,
  .loading-container {
    display: none;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  .glass-card {
    border: 1px solid #ccc;
    background: white;
    color: black;
  }
}

/* Reduced Motion Responsive */
@media (prefers-reduced-motion: reduce) {
  .splash-screen {
    transition: opacity 0.3s ease;
  }
  
  .floating-element,
  .pulse-glow,
  .shimmer-effect {
    animation: none;
  }
  
  .glass-card:hover,
  .cta-button:hover,
  .fab:hover {
    transform: none;
  }
}

/* Dark Mode Responsive */
@media (prefers-color-scheme: dark) {
  .glass-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
  }
  
  .modern-input {
    background: rgba(255, 255, 255, 0.03);
  }
}

/* Light Mode Responsive */
@media (prefers-color-scheme: light) {
  .glass-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
  }
  
  .modern-input {
    background: rgba(0, 0, 0, 0.03);
  }
}

/* Network-Aware Responsive */
@media (prefers-reduced-data: reduce) {
  .splash-logo img {
    background-image: url('Assets/allhomesolutionslogo.jpg');
  }
  
  .particle {
    display: none;
  }
  
  .shimmer-effect {
    animation: none;
  }
}

/* Battery-Aware Responsive */
@media (prefers-reduced-battery: low) {
  .floating-element,
  .pulse-glow,
  .shimmer-effect {
    animation: none;
  }
  
  .splash-logo img {
    animation: none;
  }
  
  .particle {
    animation-duration: 30s;
  }
}
