/* =========================================================
   MOBILE.CSS – FINAL STABLE VERSION
   Purpose:
   ✔ Fix blank page on mobile
   ✔ Override layout.css safely
   ✔ Keep desktop UI untouched
   ✔ Work for reminders, services, all pages
========================================================= */

@media (max-width: 768px) {

  /* -----------------------------------------------------
     GLOBAL RESET – STOP HEIGHT COLLAPSE
  ----------------------------------------------------- */

  html, body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  * {
    box-sizing: border-box;
    max-height: none !important;
  }

  /* -----------------------------------------------------
     APP LAYOUT – KILL FLEX + 100VH BUG
  ----------------------------------------------------- */

  .app-container {
    display: block !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  .main-content {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    position: relative !important;
  }

  /* -----------------------------------------------------
     🚨 CORE FIX – THIS WAS BREAKING MOBILE
  ----------------------------------------------------- */

  .content-area,
  .content-area.page-transition {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;

    overflow: visible !important;
    position: relative !important;

    /* Disable SPA animation effects */
    transform: none !important;
    opacity: 1 !important;
  }

  /* Disable transition wrapper fully */
  .page-transition {
    animation: none !important;
    transition: none !important;
  }

  /* -----------------------------------------------------
     HEADER – KEEP VISIBLE
  ----------------------------------------------------- */

  .header {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: #ffffff;
    padding: 8px 16px;
  }

  /* -----------------------------------------------------
     SIDEBAR – MOBILE DRAWER
  ----------------------------------------------------- */

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    background: #6d28d9;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
  }

  .sidebar-overlay.open {
    display: block;
  }

  /* -----------------------------------------------------
     TABLE / CARD CONTAINERS – NO CLIPPING
  ----------------------------------------------------- */

  .glass-card,
  .table-wrapper {
    height: auto !important;
    overflow: visible !important;
  }

  /* -----------------------------------------------------
     REMINDER TABLE → MOBILE CARD VIEW
  ----------------------------------------------------- */

  .reminder-table {
    display: block !important;
    width: 100% !important;
    border: none;
  }

  .reminder-table thead {
    display: none !important;
  }

  .reminder-table tbody,
  .reminder-table tr {
    display: block !important;
    width: 100%;
  }

  .reminder-table tr {
    background: #ffffff;
    margin-bottom: 16px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    overflow: hidden;
  }

  .reminder-table td {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    text-align: right;
    white-space: normal !important;
  }

  .reminder-table td:last-child {
    border-bottom: none;
  }

  .reminder-table td::before {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    text-align: left;
    flex: 1;
  }

  .reminder-table td:nth-child(1)::before { content: "Vehicle"; }
  .reminder-table td:nth-child(2)::before { content: "Customer"; }
  .reminder-table td:nth-child(3)::before { content: "Phone"; }
  .reminder-table td:nth-child(4)::before { content: "Service"; }
  .reminder-table td:nth-child(5)::before { content: "Due Date"; }
  .reminder-table td:nth-child(6)::before { content: "Status"; }
  .reminder-table td:nth-child(7)::before { content: "Actions"; }

  /* -----------------------------------------------------
     BUTTONS – MOBILE FRIENDLY
  ----------------------------------------------------- */

  .action-btn {
    padding: 6px 10px;
    font-size: 12px;
    margin-left: 6px;
    margin-top: 4px;
  }

  /* -----------------------------------------------------
     SAFETY – PREVENT HORIZONTAL SCROLL
  ----------------------------------------------------- */

  body {
    overflow-x: hidden;
  }
}
