/**
 * Marktprognoze Responsive CSS
 * Mobile-First Responsive Design
 */

/* ============================================
   EXTRA SMALL (320px - 479px)
   ============================================ */
@media (max-width: 479px) {
  /* Typography */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .text-4xl { font-size: 1.75rem; }
  .text-3xl { font-size: 1.5rem; }
  .text-2xl { font-size: 1.25rem; }
  
  /* Spacing */
  .section { padding-top: var(--space-10); padding-bottom: var(--space-10); }
  .section-sm { padding-top: var(--space-6); padding-bottom: var(--space-6); }
  .section-md { padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .section-lg { padding-top: var(--space-12); padding-bottom: var(--space-12); }
  
  .p-6 { padding: var(--space-4); }
  .p-8 { padding: var(--space-4); }
  .px-6 { padding-left: var(--space-3); padding-right: var(--space-3); }
  .py-12 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .py-16 { padding-top: var(--space-10); padding-bottom: var(--space-10); }
  
  .gap-6 { gap: var(--space-4); }
  .gap-8 { gap: var(--space-4); }
  
  .mb-8 { margin-bottom: var(--space-6); }
  .mb-12 { margin-bottom: var(--space-8); }
  .mt-8 { margin-top: var(--space-6); }
  .mt-12 { margin-top: var(--space-8); }
  
  /* Hero */
  .hero { padding: var(--space-12) 0; }
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 0.9375rem; }
  
  /* Buttons */
  .btn { padding: var(--space-2) var(--space-4); }
  .btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
  .btn-xl { padding: var(--space-4) var(--space-6); font-size: var(--text-base); }
  
  /* Forms */
  .form-input, .form-select, .form-textarea { padding: var(--space-2) var(--space-3); }
  
  /* Grid */
  .grid-cols-1 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-cols-4 { grid-template-columns: 1fr; }
  
  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .stat-value { font-size: var(--text-2xl); }
  .stat-label { font-size: var(--text-xs); }
  
  /* Features */
  .features-grid { grid-template-columns: 1fr; }
  
  /* Blog */
  .blog-grid { grid-template-columns: 1fr; }
  
  /* Testimonials */
  .testimonials-grid { grid-template-columns: 1fr; }
  
  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-bottom-content { flex-direction: column; text-align: center; }
  .footer-legal { flex-wrap: wrap; justify-content: center; }
  
  /* Trust bar */
  .trust-items { gap: var(--space-4); }
  .trust-item { font-size: var(--text-xs); }
  
  /* Cards */
  .card-body { padding: var(--space-4); }
  
  /* CTA */
  .cta-section { padding: var(--space-12) 0; }
  
  /* Navbar */
  .navbar-container { height: 56px; }
  .navbar-menu {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background-color: var(--white);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-2);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .navbar-menu.active { display: flex; }
  .navbar-toggle { display: block; }
  
  /* Forms */
  .form-checkbox { flex-direction: column; align-items: flex-start; }
  
  /* Modal */
  .modal { margin: var(--space-4); }
  .cookie-content { flex-direction: column; text-align: center; }
  .cookie-buttons { width: 100%; justify-content: center; }
}

/* ============================================
   SMALL (480px - 639px)
   ============================================ */
@media (min-width: 480px) and (max-width: 639px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  
  .hero-title { font-size: 2rem; }
  
  .grid-cols-1 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  
  .blog-grid { grid-template-columns: 1fr; }
  
  .testimonials-grid { grid-template-columns: 1fr; }
  
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   MEDIUM - TABLET (640px - 1023px)
   ============================================ */
@media (min-width: 640px) and (max-width: 1023px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  
  .text-4xl { font-size: 2rem; }
  
  .section { padding-top: var(--space-12); padding-bottom: var(--space-12); }
  
  .hero { padding: var(--space-16) 0; }
  .hero-title { font-size: 2.5rem; }
  
  .grid-cols-1 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Navbar */
  .navbar-menu {
    display: flex;
    align-items: center;
  }
  .navbar-toggle { display: none; }
}

/* ============================================
   LARGE - DESKTOP (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  
  .text-4xl { font-size: var(--text-5xl); }
  
  .hero { padding: var(--space-20) 0; }
  .hero-title { font-size: clamp(2.5rem, 5vw, 3.5rem); }
  
  .grid-cols-1 { grid-template-columns: 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); }
  
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  
  .features-grid { grid-template-columns: repeat(3, 1fr); }
  
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
  
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
  
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  
  /* Navbar */
  .navbar-menu { display: flex !important; }
  .navbar-toggle { display: none; }
}

/* ============================================
   EXTRA LARGE (1280px+)
   ============================================ */
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
  
  .section { padding-top: var(--space-20); padding-bottom: var(--space-20); }
  
  .hero { padding: var(--space-24) 0; }
}

/* ============================================
   2XL - LARGE SCREENS (1536px+)
   ============================================ */
@media (min-width: 1536px) {
  .container {
    max-width: var(--container-2xl);
  }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { padding: var(--space-10) 0; }
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: var(--text-sm); margin-bottom: var(--space-4); }
}

/* ============================================
   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;
  }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --text-dark: #000000;
    --text: #000000;
  }
  
  .btn { border: 2px solid currentColor; }
  .card { border: 2px solid var(--border); }
  .feature-card { border: 2px solid var(--border); }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .no-print { display: none !important; }
  
  body { font-size: 12pt; }
  
  .container { max-width: 100%; padding: 0; }
  
  .hero { padding: 0; }
  
  a[href]::after { content: " (" attr(href) ")"; }
  
  .footer { padding-top: var(--space-4); }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn { min-height: 44px; }
  
  .form-input,
  .form-select,
  .form-textarea { min-height: 44px; }
  
  .navbar-item { padding: var(--space-2) var(--space-3); }
  
  /* Disable hover effects on touch */
  .card-hover:hover { transform: none; }
  .feature-card:hover { transform: none; }
  .blog-card:hover { transform: none; }
  
  /* Enable touch scrolling */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================
   MOBILE NAVIGATION FIXES
   ============================================ */
@media (max-width: 1023px) {
  /* Mobile menu overlay */
  .navbar-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: -1;
  }
  
  .navbar-menu.active::before {
    opacity: 1;
    visibility: visible;
  }
  
  /* Mobile language switcher */
  .lang-switcher {
    margin-top: var(--space-2);
  }
  
  .lang-switcher select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
  }
}

/* ============================================
   IE11 FALLBACKS
   ============================================ */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /* IE11 specific styles */
  .grid { display: -ms-grid; }
  
  .flex { display: -ms-flexbox; }
  
  .hidden { display: none; }
  
  .sticky { position: fixed; }
}
