/* Maintenance-specific styles */

/* Prevent horizontal scrolling globally */

main {
  overflow-x: hidden;
  max-width: 100%;
}


@media (max-width: 767px) {
 
  main > div {
    padding: 1rem !important;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* Fix tabs navigation on mobile */
  .tabs-nav-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  .tabs-nav-mobile::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
  
  .card nav.flex {
    flex-wrap: nowrap;
    min-width: 0;
  }
  
  .card nav a {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Fix tabs container padding on mobile */
  .card > div.border-b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Ensure cards don't overflow */
  .card {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Fix Quick Actions cards on mobile */
  .grid.grid-cols-1 {
    max-width: 100%;
  }
  
  /* Ensure flex items don't overflow */
  .flex.items-center {
    min-width: 0;
  }
  
  /* Fix text overflow in stats cards */
  .card .flex.items-center.justify-between {
    min-width: 0;
  }
  
  .card .flex.items-center.justify-between > div:first-child {
    min-width: 0;
    flex: 1;
  }
  
  /* Page header */
  main > div > div:first-child {
    margin-bottom: 1rem !important;
  }
  
  main > div > div:first-child h1 {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }
  
  main > div > div:first-child p {
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
  }
  
  /* Card padding */
  .card {
    padding: 1rem !important;
    overflow: visible;
  }
  
  /* Header section - stack vertically */
  .maintenance-header-section {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  .maintenance-header-section h2 {
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
  }
  
  .maintenance-actions-section {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }
  
  .maintenance-search {
    width: 100% !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
  
  /* Filter section - stack vertically */
  .maintenance-filter-section {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }
  
  .maintenance-filter-controls {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  .maintenance-filter-controls select {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Table container with proper scrolling */
  .maintenance-table-container {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Table styling for mobile */
  .table-cell {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
    min-width: 80px !important;
  }
  
  .table-header {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
    min-width: 80px !important;
  }
  
  /* Action buttons in table - make them more compact */
  .table-cell .flex {
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }
  
  .table-cell button {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
  }
  
  /* Better touch targets for buttons */
  button, a.btn-primary, a.btn-secondary {
    min-height: 44px !important;
    font-size: 0.875rem !important;
  }
  
  /* Pagination - stack vertically */
  .maintenance-pagination {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
  }
  
  .maintenance-pagination-info {
    font-size: 0.75rem !important;
    text-align: center !important;
  }
  
  .maintenance-pagination-controls {
    gap: 0.5rem !important;
  }
  
  .maintenance-pagination-controls button {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
  
  #paginationNumbers {
    gap: 0.25rem !important;
  }
  
  #paginationNumbers button {
    min-width: 36px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
  
  /* Service History page - fix header and dropdown on mobile */
  main > div > div:first-child > div.flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  
  main > div > div:first-child > div.flex.items-center.justify-between > div.flex.space-x-2 {
    width: 100% !important;
  }
  
  main > div > div:first-child #vehicleSelect {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
}

