/*
 * Mobile CSS for Shiny Apps
 * Optimized for touch devices and responsive design
 * To be used with statlabfun package
 */

/* MOBILE NAVIGATION IMPROVEMENTS */
@media (max-width: 768px) {

  /* Navigation bar */
  .navbar {
    padding: 8px 10px !important;
    min-height: 60px !important;
  }

  /* Logo on mobile */
  .navbar-brand img {
    max-height: 32px !important;
    width: auto !important;
  }

  /* Navigation menu */
  .navbar-nav {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 100% !important;
    margin-top: 8px !important;
  }

  /* Nav items */
  .navbar-nav .nav-item {
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  /* Nav links - touch friendly */
  .nav-link {
    min-height: 44px !important;
    min-width: 60px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    text-align: center !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
  }

  /* Active tab */
  .nav-link.active {
    background-color: rgba(45, 140, 155, 0.15) !important;
    color: #2D8C9B !important;
    font-weight: 600 !important;
    transform: scale(1.05) !important;
    border-bottom: 1px solid #2D8C9B !important;
    border-radius: 8px 8px 0 0 !important;
  }

  /* Touch-friendly buttons */
  .btn {
    min-height: 44px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
  }

  /* Better spacing */
  .container-fluid {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* Responsive tables */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Mobile modals */
  .modal-dialog {
    margin: 10px !important;
    max-width: calc(100% - 20px) !important;
  }

  /* Form elements */
  .form-group {
    margin-bottom: 15px !important;
  }

  /* Prevent iOS zoom */
  input[type='text'],
  input[type='email'],
  input[type='password'],
  input[type='number'],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Very small devices */
@media (max-width: 576px) {
  .container-fluid {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  .card {
    margin-bottom: 15px !important;
  }

  /* Smaller nav items */
  .nav-link {
    min-width: 50px !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
  }
}
