/* -------------------------------------------------------------
   MILITANT Mobile Responsive Stylesheet
   Global responsive enhancements across all pages
   ------------------------------------------------------------- */

/* Prevent any accidental horizontal scrolling */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Image Crispness & High Resolution Optimization */
img {
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

.feature-showcase-image img,
.screenshot-card img,
.phone-frame img,
.hero-mockup img {
  image-rendering: -webkit-optimize-contrast;
  border-radius: 20px;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border-radius: 12px;
}

.table-responsive table {
  width: 100%;
  min-width: 500px;
}

/* Responsive Code Blocks */
pre {
  max-width: 100%;
  overflow-x: auto !important;
  white-space: pre !important;
  word-break: normal !important;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px !important;
  border-radius: 12px;
}

pre code {
  white-space: pre !important;
  word-break: normal !important;
}

/* Mobile Nav Overlay Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Navigation Container Global Fix */
nav .container, header .container {
  max-width: 1400px !important;
  width: 100% !important;
}

@media (max-width: 1250px) {
  .nav-links {
    display: none !important;
  }
  .mobile-menu-btn {
    display: block !important;
  }
}

/* Breakpoints */

/* --- Tablet / Large Mobile (<= 1024px) --- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 40px !important;
  }

  .hero-grid .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-grid p {
    margin-left: auto;
    margin-right: auto;
  }

  .download-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  }

  .feature-showcase {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
}

/* --- Mobile Standard (<= 768px) --- */
@media (max-width: 768px) {
  /* Container padding */
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Section Paddings & Margins */
  .hero {
    padding: 120px 0 40px !important;
    margin-bottom: 40px !important;
  }

  .features, 
  .comparison, 
  .apps, 
  .testimonials, 
  .faq, 
  .cta,
  .values,
  .content,
  .screenshots {
    padding: 50px 0 !important;
  }

  /* Typography */
  h1, .hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.5rem) !important;
    letter-spacing: -0.5px !important;
    line-height: 1.2 !important;
  }

  h2, .section-header h2 {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
    letter-spacing: -0.5px !important;
  }

  .section-header {
    margin-bottom: 40px !important;
  }

  /* Hero buttons */
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    gap: 12px !important;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  /* Hero Mockup in Index */
  .hero-mockup {
    margin-top: 40px !important;
  }

  /* Stacked Showcase Images Fix */
  .feature-showcase-image.stacked {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .feature-showcase-image.stacked img {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 320px !important;
    transform: none !important;
  }

  /* Phone Mockups in Download Pages (Android, Linux, Windows, MacOS) */
  .hero-mockup {
    height: auto !important;
    min-height: 360px;
  }

  .phone-container {
    position: relative !important;
    width: 100% !important;
    max-width: 260px !important;
    margin: 0 auto !important;
    transform: none !important;
  }

  .phone-container.phone-1 {
    display: none;
  }

  .phone-container.phone-2 {
    transform: none !important;
  }

  .mockup-bg {
    width: 280px !important;
    height: 280px !important;
  }

  /* Navigation Bar Adjustments */
  nav .container, header .container {
    height: 70px !important;
  }

  .logo span, .logo {
    font-size: 1.1rem !important;
  }

  .logo img {
    width: 32px !important;
    height: 32px !important;
  }

  .back-btn, .back-link {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }

  /* Mobile Nav Drawer */
  .mobile-nav {
    position: fixed !important;
    top: 70px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: calc(100vh - 70px) !important;
    background: #ffffff !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    z-index: 99 !important;
    padding: 24px !important;
    overflow-y: auto !important;
    border-bottom: 1px solid var(--gray-200);
  }

  /* Grids */
  .comparison-grid,
  .testimonials-grid,
  .faq-grid,
  .footer-grid,
  .values-grid,
  .screenshots-grid,
  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .apps-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 12px !important;
  }

  .app-card {
    padding: 24px 14px !important;
  }

  .app-icon {
    font-size: 2.5rem !important;
    width: 60px !important;
    height: 60px !important;
  }

  /* Footer */
  footer {
    padding: 40px 0 24px !important;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* --- Compact Mobile (<= 480px) --- */
@media (max-width: 480px) {
  .btn, .download-btn {
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
    white-space: normal !important;
    text-align: center;
  }

  .status-banner {
    padding: 14px 20px !important;
    font-size: 0.95rem !important;
    width: 100%;
    justify-content: center;
  }

  .command-box {
    font-size: 0.75rem !important;
    padding: 10px !important;
  }

  .command-box code {
    white-space: pre-wrap !important;
    word-break: break-all !important;
  }
}
