/* Responsive Design für Thermal Grid System */

/* Large Desktop (>1400px) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  .hero-title {
    font-size: 3.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop (1200px - 1399px) */
@media (max-width: 1200px) {
  .hero-content .container {
    gap: var(--space-8);
  }
  
  .newsletter-content {
    gap: var(--space-8);
  }
}

/* Large Tablet (992px - 1199px) */
@media (max-width: 992px) {
  /* Navigation */
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--creme);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: var(--space-12);
    gap: var(--space-4);
    transition: left var(--transition-normal);
    box-shadow: var(--card-shadow);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-item.dropdown .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(201, 123, 99, 0.05);
    margin-top: var(--space-2);
    border-radius: 8px;
  }
  
  .hamburger {
    display: flex;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  /* Hero */
  .hero-content .container {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }
  
  .hero-title {
    font-size: var(--text-3xl);
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  /* Grids */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Newsletter */
  .newsletter-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }
  
  .form-group {
    flex-direction: column;
  }
}

/* Tablet (768px - 991px) */
@media (max-width: 768px) {
  :root {
    --space-16: 3rem;
    --space-20: 4rem;
  }
  
  /* Typography */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  
  .hero-title {
    font-size: var(--text-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-base);
  }
  
  /* Sections */
  section {
    padding: var(--space-12) 0;
  }
  
  .section-header {
    margin-bottom: var(--space-12);
  }
  
  .section-header p {
    font-size: var(--text-base);
  }
  
  /* Grids */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .reviews-grid {
    gap: var(--space-6);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  /* Cards */
  .stat-card,
  .benefit-card,
  .article-card {
    padding: var(--space-6);
  }
  
  .stat-icon svg {
    width: 32px;
    height: 32px;
  }
  
  .benefit-icon svg {
    width: 40px;
    height: 40px;
  }
  
  /* Filter Chips */
  .filter-chips {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: var(--space-2);
  }
  
  .filter-chips::-webkit-scrollbar {
    height: 4px;
  }
  
  .filter-chips::-webkit-scrollbar-thumb {
    background: var(--hellgrau);
    border-radius: 2px;
  }
  
  .chip {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Forms */
  .newsletter-form {
    max-width: 400px;
    margin: 0 auto;
  }
  
  .cost-calculator {
    padding: var(--space-6);
  }
}

/* Mobile Large (576px - 767px) */
@media (max-width: 576px) {
  .container {
    padding: 0 var(--space-3);
  }
  
  /* Header */
  .nav-container {
    padding: 0 var(--space-3);
    height: 60px;
  }
  
  .nav-menu {
    top: 60px;
    height: calc(100vh - 60px);
  }
  
  /* Hero */
  .hero {
    min-height: 80vh;
  }
  
  .hero-title {
    font-size: var(--text-2xl);
  }
  
  .hero-cta {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
  
  /* Content */
  .stat-number {
    font-size: var(--text-3xl);
  }
  
  .stat-card {
    padding: var(--space-4);
  }
  
  .benefit-card,
  .article-card,
  .review-card {
    padding: var(--space-4);
  }
  
  /* Forms */
  .form-group input {
    font-size: var(--text-base);
  }
  
  /* Footer */
  .footer {
    padding: var(--space-12) 0 var(--space-6);
  }
  
  .footer-section {
    text-align: center;
  }
  
  /* Back to top */
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: var(--space-4);
    right: var(--space-4);
  }
}

/* Mobile Small (up to 575px) */
@media (max-width: 420px) {
  :root {
    --space-12: 2rem;
    --space-16: 2.5rem;
    --space-20: 3rem;
  }
  
  /* Typography */
  .hero-title {
    font-size: 1.75rem;
  }
  
  .section-header h2 {
    font-size: var(--text-xl);
  }
  
  /* Hero thermal grid */
  .thermal-grid-overlay {
    opacity: 0.05;
  }
  
  /* Content spacing */
  .article-content,
  .benefit-card {
    padding: var(--space-3);
  }
  
  .stat-card {
    padding: var(--space-3);
  }
  
  /* Performance improvements */
  .thermal-grid-overlay .grid-cell {
    animation-duration: 8s;
  }
  
  /* Reduce motion for better performance */
  .article-card:hover img {
    transform: none;
  }
  
  .benefit-card:hover {
    transform: none;
  }
}

/* Landscape Mobile Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
  }
  
  .hero-content {
    padding: var(--space-4) 0;
  }
  
  .nav-container {
    height: 50px;
  }
  
  .nav-menu {
    top: 50px;
    height: calc(100vh - 50px);
    padding-top: var(--space-6);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hamburger {
    width: 30px;
    height: 30px;
  }
}

/* Print Styles */
@media print {
  .header,
  .back-to-top,
  .preloader,
  .thermal-grid-overlay,
  .newsletter-section {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .hero {
    min-height: auto;
    padding: var(--space-8) 0;
  }
  
  .btn {
    border: 1px solid black;
    background: white !important;
    color: black !important;
  }
  
  section {
    page-break-inside: avoid;
    padding: var(--space-6) 0;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .thermal-grid-overlay .grid-cell {
    border-radius: 1px;
  }
}

/* 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;
  }
  
  .thermal-grid-overlay .grid-cell {
    animation: none;
  }
  
  .preloader .grid-cell {
    animation: none;
    opacity: 1;
  }
}

/* Dark Mode Support (für zukünftige Implementierung) */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles would go here */
  /* Currently not implemented but ready for future use */
}

/* Container Queries Support (for future browsers) */
@container (max-width: 600px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

/* Focus Management for Mobile */
@media (max-width: 768px) {
  button:focus-visible,
  a:focus-visible,
  input:focus-visible {
    outline: 3px solid var(--terracotta);
    outline-offset: 2px;
  }
}

/* Gesture Support */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }
  
  .chip {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Network Performance Optimization */
@media (max-width: 768px) {
  /* Reduce image quality on slower connections */
  .hero-image img,
  .article-card img {
    image-rendering: optimizeSpeed;
  }
  
  /* Disable complex animations */
  .thermal-grid-overlay {
    display: none;
  }
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid var(--graphit);
  }
  
  .btn-secondary {
    border-width: 2px;
  }
  
  .article-card,
  .benefit-card,
  .stat-card {
    border: 2px solid var(--graphit);
  }
}

/* JavaScript-disabled fallback */
.no-js .preloader {
  display: none;
}

.no-js .nav-menu {
  position: static;
  display: flex;
  background: transparent;
  box-shadow: none;
}

.no-js .hamburger {
  display: none;
}

/* Performance monitoring */
.performance-monitor {
  position: fixed;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
  z-index: 9999;
  opacity: 0.1;
  transition: opacity 0.3s;
}

.performance-monitor:hover {
  opacity: 1;
}