/* ═══════════════════════════════════════════════════════════════
   AI-evident — Shared Mobile CSS
   Injected into all pages via <link rel="stylesheet" href="mobile.css">
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. DISABLE HEAVY ANIMATIONS ON MOBILE ─────────────────────── */
@media (max-width: 768px) {
  /* Kill canvas particles & grid bg — handled by JS too */
  #hero-canvas, #particle-canvas, #cta-canvas, #left-canvas,
  .grid-bg { display: none !important; }

  /* Disable ALL CSS animations except essential ones */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }

  /* Keep blinking dots (live indicators) */
  .live-dot, .spm-dot, .scan-dot, .badge-dot, .ready-dot {
    animation-duration: 1s !important;
    animation-iteration-count: infinite !important;
  }

  /* Keep scan progress pulse */
  .spm-fill, .progress-fill, .ss-fill {
    animation: none !important;
  }

  /* Disable glitch title animation */
  .glitch-title { animation: none !important; }

  /* Disable ticker — too wide for mobile */
  .ticker-wrap { display: none !important; }

  /* Disable backdrop-filter (expensive on mobile) */
  nav, .topbar, .notif-panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(11,18,32,.98) !important;
  }
}

/* ── 2. BURGER NAV ─────────────────────────────────────────────── */
.burger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  cursor: pointer;
  color: var(--text);
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.burger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.25s;
}

/* Mobile drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
}
.mobile-drawer.open { display: flex; }
.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--panel, #151E2E);
  border-left: 1px solid var(--border, #253244);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.mobile-drawer.open .drawer-panel { transform: translateX(0); }
.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted, #8A97AB);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.drawer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border, #253244);
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--text, #F4F6F8);
}
.drawer-logo img { height: 28px; width: auto; }
.drawer-logo span { font-weight: 800; font-size: 15px; }
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  color: var(--muted, #8A97AB);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}
.drawer-link:hover, .drawer-link.active {
  color: var(--text, #F4F6F8);
  background: rgba(255,255,255,.04);
  border-left-color: var(--red, #C00000);
}
.drawer-divider {
  height: 1px;
  background: var(--border, #253244);
  margin: 12px 0;
}
.drawer-btns {
  padding: 16px 20px;
  margin-top: auto;
  border-top: 1px solid var(--border, #253244);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-btn {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font, system-ui);
  text-align: center;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  transition: all .2s;
}
.drawer-btn.primary {
  background: var(--red, #C00000);
  border-color: var(--red, #C00000);
  color: #fff;
}
.drawer-lang {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
}
.drawer-lang button {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font, system-ui);
  font-size: 13px;
  transition: all .2s;
}
.drawer-lang button.active { background: var(--red); border-color: var(--red); color: #fff; }

@media (max-width: 768px) {
  .burger-btn { display: flex; }
  nav .nav-links,
  nav .nav-right .lang-toggle,
  nav .nav-right .btn-login { display: none !important; }
}

/* ── 3. NAV ON MOBILE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 16px !important; }
  .nav-logo-img { height: 28px !important; }
  .logo-text { font-size: 14px !important; }
}

/* ── 4. HERO SECTION ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #hero { padding: 90px 20px 48px !important; min-height: auto !important; }
  .hero-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .hero-right { display: none; } /* Hide terminal on mobile — too heavy */
  .glitch-title .line { font-size: clamp(28px, 8vw, 44px) !important; }
  .hero-sub { font-size: 15px !important; }
  .hero-btns { flex-direction: column !important; }
  .btn-primary, .btn-secondary { width: 100% !important; padding: 16px !important; font-size: 15px !important; }
}

/* ── 5. SECTIONS ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  section, .deep-section, .registry-section,
  .heatmap-section, .industry-section, .top-section,
  .cta-section, .faq-section, .pricing-section,
  .calc-section, .pipeline-section { padding: 48px 20px !important; }

  .section-title { font-size: clamp(24px, 6vw, 36px) !important; }
  .section-sub { font-size: 15px !important; }
}

/* ── 6. MODULE CARDS (How it works pipeline) ───────────────────── */
@media (max-width: 768px) {
  .flow-stages { grid-template-columns: 1fr !important; }
  .modules-grid { grid-template-columns: 1fr !important; }
  .connector-line { display: none; }
}

/* ── 7. STATS GRIDS ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .pstats-grid { grid-template-columns: 1fr 1fr !important; }
  .stat-num { font-size: 36px !important; }
  .pstat-num { font-size: 28px !important; }
}

/* ── 8. TABLES → HORIZONTAL SCROLL ────────────────────────────── */
@media (max-width: 768px) {
  /* Wrap all tables */
  .reg-table-wrap,
  .cases-section,
  .section-card { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

  .compare-table,
  .cases-table,
  .reg-table { min-width: 560px; }

  /* Table scroll indicator */
  .table-scroll-hint {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    padding: 6px 16px;
    background: var(--panel2);
    border-bottom: 1px solid var(--border);
  }
}
.table-scroll-hint { display: none; }

/* ── 9. COMPARISON TABLE ───────────────────────────────────────── */
@media (max-width: 768px) {
  #comparison .section-inner { padding: 0 !important; }
  .compare-table { font-size: 12px; }
  .compare-table th, .compare-table td { padding: 10px 12px !important; }
}

/* ── 10. BENEFITS / TRIAD / TOP GRID ───────────────────────────── */
@media (max-width: 768px) {
  .benefits-grid { grid-template-columns: 1fr !important; }
  .triad-grid { grid-template-columns: 1fr !important; }
  .top-grid { grid-template-columns: 1fr !important; }
  .industry-grid { grid-template-columns: 1fr 1fr !important; }
  .testimonial-grid { grid-template-columns: 1fr !important; }
}

/* ── 11. DEEP SECTIONS (How it works) ──────────────────────────── */
@media (max-width: 768px) {
  .deep-inner,
  .deep-inner.reverse {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    direction: ltr !important;
  }
  .demo-box { font-size: 11px; }
  .osint-demo { grid-template-columns: 1fr 1fr !important; }
}

/* ── 12. PRICING ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr !important; }
  .calc-grid { grid-template-columns: 1fr !important; }
  .calc-inner { padding: 24px 20px !important; }
  .plan-commission { font-size: 32px !important; }
}

/* ── 13. PARTNERS FORM ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr !important; }
  .form-row-2 { grid-template-columns: 1fr !important; }
}

/* ── 14. REGISTRY HERO ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 90px 20px 40px !important; min-height: auto !important; }
  .hero-inner { grid-template-columns: 1fr !important; gap: 24px !important; }
  .counter-grid { grid-template-columns: 1fr 1fr !important; }
  .hero-title { font-size: clamp(32px, 9vw, 52px) !important; }
  .expand-content { grid-template-columns: 1fr !important; }
}

/* ── 15. FOOTER ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr !important; gap: 28px !important; }
  footer { padding: 32px 20px !important; text-align: center; }
  footer a { margin: 0 8px; }
}

/* ── 16. CABINET SIDEBAR → BOTTOM TAB BAR ─────────────────────── */
@media (max-width: 768px) {
  /* Hide sidebar */
  .sidebar { transform: translateX(-100%) !important; width: 100% !important; max-width: 280px; }
  .sidebar.mobile-open { transform: translateX(0) !important; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
  }
  .sidebar-overlay.open { display: block; }

  /* Main fills full width */
  .main { margin-left: 0 !important; padding: 20px 16px 90px !important; }

  /* Bottom tab bar */
  .mobile-tabbar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--panel, #151E2E);
    border-top: 1px solid var(--border, #253244);
    z-index: 500;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
  }
  .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s;
    flex: 1;
    color: var(--muted);
    font-size: 10px;
    font-family: var(--mono);
    text-align: center;
    background: none;
    border: none;
    font-family: var(--font, system-ui);
  }
  .tab-item.active { color: var(--red, #C00000); }
  .tab-item svg { flex-shrink: 0; }

  /* Cabinet metrics → 2 col on mobile */
  .metrics-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .metric-val { font-size: 24px !important; }
  .metric-spark { display: none; }

  /* Cases table card view on mobile */
  .cases-table thead { display: none; }
  .cases-table, .cases-table tbody,
  .cases-table tr, .cases-table td { display: block !important; width: 100% !important; }
  .cases-table tbody tr {
    background: var(--panel2, #1C2638);
    border: 1px solid var(--border, #253244);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 14px;
  }
  .cases-table td { padding: 4px 0 !important; border: none !important; }
  .cases-table td::before {
    content: attr(data-label);
    font-size: 10px;
    color: var(--muted, #8A97AB);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 2px;
    font-family: var(--mono, monospace);
  }
  .cases-table td:empty { display: none !important; }

  /* Finance grid */
  .finance-grid { grid-template-columns: 1fr !important; }
  .profile-grid { grid-template-columns: 1fr !important; }

  /* Evidence cards */
  .ec-items { grid-template-columns: 1fr 1fr !important; }
}
.mobile-tabbar { display: none; }

/* ── 17. LOGIN PAGE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .left-panel { display: none !important; }
  .right-panel { padding: 24px 20px !important; }
  body.login-page { overflow: auto !important; }
  .role-selector { grid-template-columns: 1fr 1fr !important; }
  .social-btns { grid-template-columns: 1fr 1fr !important; }
}

/* ── 18. MODALS ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #modal-photo, #modal-attorney, #modal-success {
    width: 95vw !important;
    padding: 24px 20px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    top: auto !important;
    bottom: 0 !important;
    transform: translateX(-50%) !important;
    border-radius: 16px 16px 0 0 !important;
  }
  #modal-photo > div[style*="grid-template-columns:1fr 1fr"],
  #modal-attorney > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 19. DASHBOARD (internal) ──────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 16px !important; }
  .topbar .user-name { display: none; }
  .scan-status { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  .scan-bar { flex-direction: column !important; gap: 12px !important; }
  .roi-grid { grid-template-columns: 1fr !important; }
}

/* ── 20. CTA BUTTONS ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .btn-big { padding: 16px 32px !important; font-size: 16px !important; width: 100% !important; }
  .btn-primary { width: 100% !important; }
  .submit-btn { font-size: 14px !important; }
}

/* ── 21. TOUCH TARGETS ─────────────────────────────────────────── */
@media (max-width: 768px) {
  button, a, .nav-item, .drawer-link, input, select {
    min-height: 44px;
  }
  .ftab, .filter-btn, .tweak-opt, .btn-sm { min-height: 36px !important; }
}

/* ── 22. TYPOGRAPHY ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-title { font-size: clamp(28px, 8vw, 48px) !important; }
  .cta-title { font-size: clamp(24px, 7vw, 40px) !important; }
  p, li { font-size: 14px !important; line-height: 1.65 !important; }
  .section-tag { font-size: 10px !important; }
}

/* ── 23. SCROLL BEHAVIOR ───────────────────────────────────────── */
@media (max-width: 768px) {
  html { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
