/* ===== RESPONSIVE DESIGN ===== */

/* Mobile First Approach */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  /* Typography */
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
  h3 { font-size: var(--font-size-xl); }
  
  /* Navigation */
  .nav-container {
    padding: var(--space-sm) var(--space-md);
  }
  
  .nav-menu {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-xl);
    transform: translateY(-100%);
    transition: transform var(--transition-normal);
    z-index: var(--z-dropdown);
  }
  
  .nav-menu.active {
    transform: translateY(0);
  }
  
  .nav-list {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  /* Hero Section */
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    text-align: center;
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .hero-stats {
    justify-content: center;
    gap: var(--space-lg);
  }
  
  .hero-actions {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }
  
  .btn-large {
    width: 100%;
    justify-content: center;
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .service-card {
    padding: var(--space-lg);
  }
  
  /* About */
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  
  /* Contact */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  
  .contact-info {
    order: 2;
  }
  
  .contact-form {
    order: 1;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .container {
    padding: 0 var(--space-lg);
  }
  
  /* Hero */
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  /* About */
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
  }
  
  /* Contact */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
  }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container {
    padding: 0 var(--space-lg);
  }
  
  /* Navigation */
  .nav-menu {
    display: flex;
  }
  
  .nav-toggle {
    display: none;
  }
  
  /* Hero */
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-4xl);
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
  
  /* About */
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-4xl);
  }
  
  /* Contact */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-4xl);
  }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .container {
    padding: 0 var(--space-xl);
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
  
  /* About */
  .about-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
  }
  
  /* Contact */
  .contact-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
  }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    padding: 0 var(--space-2xl);
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

/* Ultra Wide Screens (1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
  }
}

/* ===== LANDSCAPE ORIENTATION ===== */

@media (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: auto;
    padding: var(--space-2xl) 0;
  }
  
  .hero-container {
    gap: var(--space-xl);
  }
  
  .hero-title {
    font-size: var(--font-size-2xl);
  }
  
  .hero-stats {
    gap: var(--space-lg);
  }
  
  .stat-number {
    font-size: var(--font-size-xl);
  }
}

/* ===== HIGH DPI DISPLAYS ===== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-particles {
    background-size: 100px 100px;
  }
}

/* ===== DARK MODE PREFERENCES ===== */

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
  }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-particles {
    animation: none;
  }
  
  .title-line.highlight {
    animation: none;
  }
  
  .badge-glow {
    animation: none;
  }
}

/* ===== PRINT STYLES ===== */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .navbar,
  .nav-toggle,
  .hero-actions,
  .contact-form,
  .footer {
    display: none !important;
  }
  
  .hero {
    min-height: auto;
    padding: var(--space-xl) 0;
  }
  
  .hero-container {
    grid-template-columns: 1fr;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .contact-content {
    grid-template-columns: 1fr;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
  
  .page-break {
    page-break-before: always;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Focus indicators for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  *:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
  
  .btn:focus,
  .nav-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --primary: #00ffff;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --bg-primary: #000000;
    --bg-secondary: #111111;
  }
  
  .service-card,
  .contact-card,
  .about-card,
  .hero-card {
    border: 2px solid var(--primary);
  }
}

/* ===== CONTAINER QUERIES (Future-proofing) ===== */

@supports (container-type: inline-size) {
  .services-grid {
    container-type: inline-size;
  }
  
  @container (max-width: 400px) {
    .service-card {
      padding: var(--space-md);
    }
    
    .service-icon {
      width: 60px;
      height: 60px;
    }
  }
}

/* ===== FLEXIBLE GRID SYSTEM ===== */

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 767.98px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .grid-cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== ADDITIONAL SECTIONS RESPONSIVE ===== */

/* Contact form responsive */
@media (max-width: 1024px) {
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  
  .info-side {
    order: -1;
  }
}

/* Configurateur responsive */
@media (max-width: 1024px) {
  .configurateur-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  
  .summary-side {
    position: static;
  }
}

/* Legal content responsive */
@media (max-width: 1024px) {
  .legal-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  
  .legal-sidebar {
    position: static;
  }
  
  .legal-nav {
    position: sticky;
    top: 80px;
  }
}

/* Agent section responsive */
@media (max-width: 768px) {
  .agent-header {
    flex-direction: column;
    text-align: center;
  }
  
  .agent-price {
    text-align: center;
  }
  
  .agent-actions {
    flex-direction: column;
  }
}

/* Demo section responsive */
@media (max-width: 768px) {
  .demo-features {
    grid-template-columns: 1fr;
  }
}

/* Packs section responsive */
@media (max-width: 768px) {
  .packs-grid {
    grid-template-columns: 1fr;
  }
}

/* Presets section responsive */
@media (max-width: 768px) {
  .presets-grid {
    grid-template-columns: 1fr;
  }
}

/* Process steps responsive */
@media (max-width: 768px) {
  .process-steps {
    grid-template-columns: 1fr;
  }
}

/* Additional services responsive */
@media (max-width: 768px) {
  .additional-grid {
    grid-template-columns: 1fr;
  }
}

/* FAQ responsive */
@media (max-width: 768px) {
  .faq-question {
    font-size: var(--font-size-base);
    padding: var(--space-md);
  }
}

/* Contact cards responsive */
@media (max-width: 768px) {
  .contact-cards {
    grid-template-columns: 1fr;
  }
}

/* Feature grid responsive */
@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .feature-item {
    flex-direction: column;
    text-align: center;
  }
  
  .feature-icon {
    margin: 0 auto var(--space-md);
  }
}

/* Info features responsive */
@media (max-width: 768px) {
  .info-features {
    gap: var(--space-md);
  }
  
  .info-feature {
    flex-direction: column;
    text-align: center;
  }
  
  .info-icon {
    margin: 0 auto var(--space-md);
  }
}

/* ===== UTILITY CLASSES ===== */

.hidden-mobile {
  display: block;
}

.visible-mobile {
  display: none;
}

@media (max-width: 767.98px) {
  .hidden-mobile {
    display: none;
  }
  
  .visible-mobile {
    display: block;
  }
}

.text-center-mobile {
  text-align: left;
}

@media (max-width: 767.98px) {
  .text-center-mobile {
    text-align: center;
  }
}

.full-width-mobile {
  width: auto;
}

@media (max-width: 767.98px) {
  .full-width-mobile {
    width: 100%;
  }
}
