/* ════════════════════════════════════════════════════════════
   mobile.css — Global Mobile / Responsive Enhancements
   Works alongside style.css / index.css / about.css / contact.css
   Load this LAST so its rules win at mobile breakpoints.
   ════════════════════════════════════════════════════════════ */

/* ── Universal overflow guards ───────────────────────────── */
img, svg, canvas, iframe, video,
audio, embed, object {
  max-width: 100%;
  height: auto;
}

html { -webkit-text-size-adjust: 100%; }

body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Hide the desktop custom cursor on touch / small screens */
@media (pointer: coarse) {
  .custom-cursor { display: none !important; }
}
@media (max-width: 640px) {
  .custom-cursor { display: none !important; }
}

/* Make form fields and buttons easier to tap on touch */
input, select, textarea, button { max-width: 100%; }

/* ═══════════════ MOBILE NAV (hamburger + drawer) ═══════════
   The toggle button and drawer are injected by js/mobile-nav.js.
   Only active on pages that contain .navbar > .nav-links.      */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  flex-shrink: 0;
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--text-main, #f3f4f6);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.mobile-nav-toggle:hover,
.mobile-nav-toggle[aria-expanded="true"] {
  background: var(--accent-glow, rgba(99,102,241,0.2));
  border-color: var(--border-hover, rgba(99,102,241,0.4));
}

.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  z-index: 3000;
}
.mobile-backdrop.open { display: block; }

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 85vw);
  z-index: 3001;
  background: #0b1120;
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: calc(var(--nav-height, 72px) + 1rem) 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer .mobile-drawer-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mobile-drawer a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.mobile-drawer a i { width: 1.2rem; text-align: center; color: #818cf8; }
.mobile-drawer a:hover,
.mobile-drawer a.active {
  background: rgba(99,102,241,0.12);
  color: #fff;
}

body.nav-open { overflow: hidden; }

/* ── Tablet: collapse the top navbar into hamburger ─────── */
@media (max-width: 1024px) {
  .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .nav-links { display: none !important; }
  .mobile-nav-toggle { display: inline-flex; }
}

/* ═══════════════ GENERIC RESPONSIVE LAYOUT ════════════════ */

/* Tablet / small laptop */
@media (max-width: 1024px) {
  .app-container { padding: 1rem; }
}

/* Mobile */
@media (max-width: 768px) {
  .app-container { padding: 0.75rem; }

  /* Stack all common card grids to a single column */
  .stats-dashboard,
  .categories-grid,
  .tools-grid,
  .mission-grid,
  .timeline-grid,
  .benefits-grid,
  .pricing-grid,
  .faq-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hero */
  .hero-section { padding: 2.75rem 1rem; }
  .hero-section h1 { font-size: 2rem !important; }
  .hero-section p { font-size: 0.95rem !important; }

  /* Search */
  .search-input-wrapper { border-radius: 14px; }

  /* Section titles */
  .section-title { font-size: 1.35rem !important; }

  /* About / Contact sections */
  .mission-card, .timeline-item { padding: 1.5rem; }
  .team-grid { gap: 1.5rem; }
  .team-card { width: 100%; max-width: 340px; }
  .contact-info-panel, .contact-form-panel { padding: 1.75rem; }
  .contact-info-panel h2,
  .contact-info-panel h1 { font-size: 1.8rem !important; }

  /* Pricing */
  .pricing-card { padding: 2rem 1.5rem; }

  /* Policy / text pages */
  .policy-content { padding: 0 1rem; }

  /* Generic wide content in a scroll wrapper */
  .table-wrap,
  [class*="table-container"],
  [class*="table-wrap"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Footer */
  .app-footer { padding: 2.5rem 1.25rem 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 0.5rem; }

  /* Buttons: comfortable tap targets */
  .btn, .btn-primary, .btn-search, .btn-submit,
  [class*="btn-"] {
    min-height: 44px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .navbar { padding: 0.6rem 0.9rem !important; border-radius: 14px; }
  .logo { font-size: 1.25rem; }
  .logo img { height: 26px !important; }

  .hero-section h1 { font-size: 1.7rem !important; }
  .hero-tagline { font-size: 0.68rem !important; padding: 0.3rem 0.7rem !important; }

  .stats-dashboard { gap: 0.65rem; }
  .stat-card { padding: 0.9rem; flex-direction: column; text-align: center; }
  .stat-icon { width: 38px; height: 38px; font-size: 0.95rem; }

  .tools-grid { gap: 0.85rem; }
  .tool-card { padding: 1.1rem; }
  .tool-card-footer { flex-wrap: wrap; gap: 0.5rem; }

  .seo-category-links { gap: 0.5rem; }
  .seo-cat-link { padding: 0.6rem 0.8rem; font-size: 0.8rem; }

  .faq-item { padding: 1rem 1.1rem; }

  .contact-info-panel, .contact-form-panel { padding: 1.25rem; }
  .info-item-card { padding: 0.9rem; }

  .pricing-hero h1 { font-size: 1.9rem !important; }
  .plan-price { font-size: 2.2rem !important; }

  .app-container { padding: 0.5rem; }
}

/* ═══════════════ TABLES (small screens) ═══════════════════ */
@media (max-width: 600px) {
  table { max-width: 100%; }
  thead th { font-size: 0.8rem; }
  th, td { padding: 0.5rem 0.4rem; }
}
