/* Responsive Design Styles */
/* Mobile First Approach */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    transition: left 0.3s ease;
    z-index: 1000;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-menu ul {
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
  }
  
  .hamburger {
    display: block;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service-builder-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .customizer-options {
    grid-template-columns: 1fr;
  }
  
  .modal-container {
    margin: 1rem;
    padding: 1.5rem;
    max-width: calc(100vw - 2rem);
  }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .service-builder-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container {
    padding: 0 2rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .service-builder-grid { grid-template-columns: 1fr; gap: 2rem; }
  
  .customizer-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .container {
    padding: 0 2.5rem;
  }
  
  .hero-title {
    font-size: 3.5rem;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
  
  .service-builder-grid { grid-template-columns: minmax(540px, 640px) minmax(380px, 460px); gap: 2rem; justify-content: center; }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    padding: 0 3rem;
  }
  
  .hero-title {
    font-size: 4rem;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }
  
  .service-builder-grid { grid-template-columns: minmax(540px, 680px) minmax(380px, 520px); gap: 2.5rem; justify-content: center; }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-section {
    min-height: 100vh;
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
}

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

/* Print Styles */
@media print {
  .nav-menu,
  .hero-section,
  .footer,
  .modal-overlay {
    display: none !important;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .portfolio-item,
  .service-package {
    break-inside: avoid;
    margin-bottom: 2rem;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .portfolio-item,
  .service-package {
    border: 2px solid #ffffff;
  }
  
  .modal-container {
    border: 3px solid #ffffff;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #ffffff;
    --accent-color: #007bff;
  }
}

/* Light Mode Support */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #ffffff;
    --accent-color: #007bff;
  }
}

/* Focus Management */
@media (any-hover: none) {
  .portfolio-item:hover,
  .service-package:hover {
    transform: none;
    box-shadow: none;
  }
  
  .nav-menu a:hover {
    background: none;
  }
}

/* Container Queries (Future-proofing) */
@container (min-width: 400px) {
  .portfolio-item {
    grid-template-columns: 1fr 2fr;
  }
  
  .portfolio-image {
    height: 100%;
  }
}

/* Grid Fallbacks */
@supports not (display: grid) {
  .portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
  }
  
  .portfolio-item {
    flex: 1 1 300px;
    margin-bottom: 2rem;
  }
  
  .service-builder-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
  }
  
  .service-package {
    flex: 1 1 300px;
    margin-bottom: 2rem;
  }
}

/* CSS Custom Properties Fallback */
@supports not (--custom: property) {
  .portfolio-item {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .service-package {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .modal-container {
    background: #1a1a1a;
  }
}
