/*
  weport-mobile.css
  Add this <link> to index.html, weport_demo.html, weport_live.html:
  <link rel="stylesheet" href="weport-mobile.css">

  Or paste this entire block into the <style> section of each file.
*/

/* ── MOBILE BASE ── */
@media (max-width: 768px) {

  /* Navigation */
  .topbar { padding: 8px 12px; gap: 8px; flex-wrap: nowrap; }
  .topbar-center { display: none; } /* Hide tabs on mobile — use hamburger */
  .nav-links { display: none; }
  .logo { font-size: 16px; }
  .btn-login, .btn-enter { padding: 5px 10px; font-size: 11px; }

  /* Landing page hero */
  h1 { font-size: clamp(2rem, 8vw, 3.5rem) !important; }
  .hero { padding: 6rem 1rem 3rem !important; }
  .hero-stats { gap: 1rem !important; flex-wrap: wrap; justify-content: center; }
  .stat-num { font-size: 1.5rem !important; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-primary-hero, .btn-ghost { width: 100%; max-width: 300px; text-align: center; }
  .roles-grid { grid-template-columns: 1fr !important; }
  .xrpl-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .problems-grid { grid-template-columns: 1fr 1fr !important; }
  .waitlist-form { flex-direction: column !important; }
  .quick-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .demo-accounts { grid-template-columns: repeat(3, 1fr) !important; }

  /* Demo app */
  .app { padding: 0.5rem !important; }
  .topbar-right { gap: 4px !important; }
  .user-name { display: none !important; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr !important; }
  .tabs { gap: 4px !important; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .tab { padding: 5px 10px !important; font-size: 11px !important; white-space: nowrap; flex-shrink: 0; }
  .card { padding: 1rem !important; }
  .metric .val { font-size: 18px !important; }
  h3 { font-size: 14px !important; }
  .row-title { font-size: 12px !important; }
  .row-sub { font-size: 11px !important; }

  /* Live operations */
  .split { grid-template-columns: 1fr !important; height: auto !important; }
  .map-container { height: 50vh; min-height: 280px; }
  .right-panel { height: 50vh; min-height: 300px; }
  .map-stats { display: none !important; }
  .map-legend { font-size: 10px !important; padding: 6px 8px !important; }
  .vessel-tooltip { font-size: 11px !important; min-width: 140px !important; }
  .xrpl-stats-row { grid-template-columns: repeat(3, 1fr) !important; }
  .panel-tab { font-size: 10px !important; padding: 8px 4px !important; }

  /* Login card */
  .login-wrap { margin: 0.5rem auto !important; }
  .quick-grid { grid-template-columns: repeat(4, 1fr) !important; }

  /* Modals */
  .modal { padding: 1.5rem !important; margin: 0.5rem !important; max-width: 100% !important; }
  .login-card { padding: 1.5rem !important; }

  /* Warehouse grid */
  .warehouse-grid { grid-template-columns: repeat(6, 1fr) !important; }

  /* Roster */
  .roster-grid { grid-template-columns: repeat(4, 1fr) !important; }

  /* XRPL escrow cards */
  .xec-header { flex-wrap: wrap; gap: 4px; }

  /* QR box */
  .qr-box { width: 90px !important; height: 90px !important; }
  .qr-icon { font-size: 28px !important; }

  /* Dashboard */
  .dash-grid2, .dash-grid3, .dash-grid4 { grid-template-columns: 1fr !important; }
  .dash-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .dash-tab { white-space: nowrap; flex-shrink: 0; }
  .kpi-bars { height: 50px !important; }

  /* Hide less important columns in tables on mobile */
  .hide-mobile { display: none !important; }

  /* Buttons */
  .btn-sm { padding: 4px 8px !important; font-size: 11px !important; }
  .topbar-right .btn-sm { padding: 4px 6px !important; }

  /* Scrollable tabs */
  .tabs::-webkit-scrollbar { height: 2px; }
  .tabs::-webkit-scrollbar-track { background: transparent; }
  .tabs::-webkit-scrollbar-thumb { background: rgba(29,158,117,0.3); border-radius: 1px; }
}

@media (max-width: 480px) {
  .problems-grid { grid-template-columns: 1fr !important; }
  .quick-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .xrpl-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .trade-stats { grid-template-columns: 1fr 1fr !important; }
  .map-container { height: 40vh; min-height: 220px; }
  .right-panel { height: 60vh; }
  .hero-stats .stat { min-width: 100px; }
  .nav-cta { display: none; } /* Hide nav CTA on very small screens */
}

/* ── TOUCH IMPROVEMENTS ── */
@media (hover: none) {
  .tab:hover, .btn:hover, .ql:hover, .vessel-list-item:hover {
    /* Remove hover states on touch devices to prevent sticky hover */
    background: inherit;
    color: inherit;
    border-color: inherit;
  }
  .tab.active { background: #1D9E75 !important; color: #fff !important; }

  /* Larger touch targets */
  .btn, .tab, .ql, button {
    min-height: 36px;
  }
}

/* ── PRINT STYLES ── */
@media print {
  .topbar, .tabs, .modal-overlay, .btn, button { display: none !important; }
  .card, .dash-card { box-shadow: none !important; border: 1px solid #ccc !important; }
  body { background: white !important; color: black !important; }
}