/* Global Mobile Optimization Styles */

/* Mobile-first responsive utilities */
@media (max-width: 640px) {
  /* Force mobile-friendly table behavior */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive table {
    min-width: 600px; /* Ensure table doesn't get too cramped */
  }
  
  /* Mobile-friendly modals */
  .modal-mobile {
    margin: 0.5rem;
    max-height: 95vh;
    width: calc(100vw - 1rem);
  }
  
  /* Mobile-friendly buttons */
  .btn-mobile {
    min-height: 44px; /* iOS touch target minimum */
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  /* Mobile-friendly form inputs */
  .input-mobile {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
  
  /* Mobile-friendly navigation */
  .nav-mobile {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .nav-mobile li {
    flex-shrink: 0;
  }
  
  /* Mobile-friendly cards */
  .card-mobile {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  /* Mobile-friendly text */
  .text-mobile {
    font-size: 0.875rem;
    line-height: 1.5;
  }
  
  /* Mobile-friendly spacing */
  .spacing-mobile {
    padding: 0.75rem;
    margin: 0.5rem;
  }
  
  /* Hide non-essential elements on mobile */
  .hide-mobile {
    display: none !important;
  }
  
  /* Show mobile-specific elements */
  .show-mobile {
    display: block !important;
  }
  
  /* Mobile-friendly dropdowns */
  .dropdown-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
  }
  
  .dropdown-mobile-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
  .tablet-optimize {
    padding: 1rem;
  }
  
  .tablet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
  .desktop-optimize {
    padding: 1.5rem;
  }
  
  .desktop-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* Global mobile-friendly classes */
.mobile-container {
  @apply px-4 sm:px-6 lg:px-8;
}

.mobile-text {
  @apply text-sm sm:text-base;
}

.mobile-button {
  @apply px-3 py-2 text-sm sm:px-4 sm:py-2 sm:text-base;
}

.mobile-input {
  @apply px-3 py-2 text-base sm:px-4 sm:py-2;
}

.mobile-card {
  @apply p-4 sm:p-6;
}

.mobile-grid {
  @apply grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4;
}

.mobile-flex {
  @apply flex flex-col sm:flex-row gap-2 sm:gap-4;
}

.mobile-spacing {
  @apply space-y-2 sm:space-y-4;
}

.mobile-hidden {
  @apply hidden sm:block;
}

  .mobile-visible {
    @apply block sm:hidden;
  }
  
  /* Image and media optimizations */
  img {
    max-width: 100%;
    height: auto;
  }
  
  video {
    max-width: 100%;
    height: auto;
  }
  
  /* Prevent horizontal scroll from any element */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Ensure containers don't overflow */
  .container, [class*="container"] {
    max-width: 100vw;
    overflow-x: hidden;
  }
