/* mobile.css - Specific adjustments for Mobile responsiveness (< 768px) */

@media (max-width: 768px) {
  /* 1. Prevent Horizontal Scroll */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 2. Main Layout adjustment */
  .app-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  /* 3. Bottom Nav Bar (Sidebar conversion) */
  .app-sidebar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 75px !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 5px 10px !important;
    background: rgba(13, 22, 48, 0.95) !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    border-right: none !important;
    z-index: 1000 !important;
    backdrop-filter: blur(12px) !important;
    box-sizing: border-box !important;
  }

  /* Hide sidebar elements that don't fit in bottom nav */
  .sidebar-logo, .sidebar-profile-btn, .sidebar-footer {
    display: none !important;
  }

  .nav-item {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 6px !important;
    font-size: 0.65rem !important;
    width: auto !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  /* 4. Main Content Area */
  .main-content {
    padding: 15px 15px 95px 15px !important; /* Bottom padding to prevent bottom nav from hiding content */
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 5. Week/Day Selector Scroll */
  .days-nav {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding-bottom: 5px !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch !important; /* smooth scroll iOS */
  }
  .day-btn {
    flex-shrink: 0 !important;
  }

  /* 6. Meal Cards Vertical Stack */
  .meals-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .meal-card {
    flex-direction: column !important;
    height: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .meal-image-container {
    width: 100% !important;
    height: 180px !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .meal-info-container {
    width: 100% !important;
    padding: 15px !important;
    box-sizing: border-box !important;
  }

  /* 7. Macros grid wrapping */
  .macros-summary {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* 2x2 grid */
    gap: 10px !important;
    width: 100% !important;
  }

  /* 8. Fix Chat for Mobile */
  .ryan-chat-float {
    bottom: 90px !important; /* Move above bottom nav */
    right: 15px !important;
  }

  #ryan-chat-window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    z-index: 99999 !important;
    margin: 0 !important;
  }

  /* 9. Fix Modals */
  .modal-card {
    width: 95vw !important;
    max-height: 90vh !important;
    margin: auto !important;
    border-radius: 16px !important;
  }

  /* 10. Login & Forms */
  .login-card {
    width: 90vw !important;
    padding: 24px !important;
  }
  .input-field {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}
