/* ==========================================================================
   AFibWatch - Responsive & Mobile Android App Experience
   Breakpoints: Desktop (>768px), Tablet (768px), Smartphone (<768px)
   CodeIgniter 3 Migration Ready: assets/css/responsive.css
   ========================================================================== */

/* Mobile Breakpoint (<768px) */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  /* Hide Desktop Sidebar on Mobile */
  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
  }

  .sidebar.mobile-open {
    display: flex;
    left: 0;
  }

  /* Show Mobile App Top Bar & Bottom Navigation */
  .mobile-app-bar {
    display: flex;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-content {
    padding: 16px;
    padding-bottom: 84px; /* Ensure bottom nav doesn't overlap content */
  }

  .page-header {
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .card {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  /* Stack Tables & Custom Touch View */
  .responsive-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
  }

  table.data-table th, table.data-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  /* Bottom Sheet Modal Style on Smartphone */
  .modal-backdrop.show .modal-card {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 100%;
    margin-top: auto;
    transform: translateY(0);
    animation: bottom-sheet-slide 0.3s ease-out;
  }

  .modal-backdrop {
    align-items: flex-end;
  }

  @keyframes bottom-sheet-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Large Touch Targets for Finger Friendly UX */
  .btn {
    width: 100%;
    margin-bottom: 8px;
  }

  .btn-inline-mobile {
    width: auto;
    margin-bottom: 0;
  }

  /* Landing Page (index.html) Specific Android Mobile Overrides */
  .desktop-nav, .desktop-only-header {
    display: none !important;
  }

  .landing-header-container {
    padding: 12px 16px !important;
  }

  .hero-section {
    padding: 28px 16px !important;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    text-align: center;
  }

  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
    margin: 0 auto 24px auto !important;
  }

  .hero-actions {
    justify-content: center;
    flex-direction: column;
    gap: 10px !important;
  }

  .hero-illustration-card {
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 auto;
    height: auto !important;
    min-height: 280px;
    padding: 20px !important;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .security-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .landing-footer {
    padding: 32px 16px 90px 16px !important; /* Bottom nav offset */
    text-align: center;
  }

  .landing-footer-content {
    flex-direction: column;
    gap: 16px !important;
    text-align: center;
  }
}

/* Tablet Breakpoint (768px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 80px;
  }

  .sidebar .brand-title,
  .sidebar .user-info-text,
  .sidebar .sidebar-link span {
    display: none;
  }

  .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
  }

  .sidebar-link {
    justify-content: center;
    padding: 14px 0;
  }

  .main-content {
    padding: 20px;
  }
}

/* Desktop Large Breakpoints */
@media (min-width: 1025px) {
  .mobile-bottom-nav,
  .mobile-app-bar {
    display: none !important;
  }
}
