/* GlobalMobileStyles.css */
/* Global styling for mobile devices across the application */

/* Default mobile font sizing */
html {
  font-size: 16px;
}

@media (max-width: 768px) {
  /* Base styling for mobile devices */
  body {
    font-size: 15px;
    overflow-x: hidden;
  }

  /* Touch targets: scope to real controls, not all links */
  button,
  input[type="button"],
  input[type="submit"],
  .btn,
  .mobile-toggle,
  .close-menu-btn,
  .mobile-dropdown-trigger,
  .mobile-logout-btn,
  .bp_fn_button.only_text,
  .auth-button {
    min-height: 44px;
    min-width: 44px;
  }

  /* Fix iOS tap highlight */
  a,
  button,
  input,
  select,
  textarea {
    -webkit-tap-highlight-color: transparent;
  }

  /* Add safe area insets for notched phones */
  .app-container,
  .fixed-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  /* Hide scrollbars but keep functionality */
  ::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
  }

  .scrollable-container {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  /* Improved form elements for touch */
  input,
  select,
  textarea {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 0.75rem;
    border-radius: 8px;
  }

  /* Mobile headings */
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Mobile table improvements */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  /* Convert tables to cards on smallest screens */
  @media (max-width: 480px) {
    table thead {
      display: none;
    }

    table tbody tr {
      display: block;
      margin-bottom: 1rem;
      border: 1px solid var(--border-color, #eaeaea);
      border-radius: 8px;
      padding: 1rem;
    }

    table tbody td {
      display: flex;
      justify-content: space-between;
      padding: 0.5rem 0;
      border-bottom: 1px solid var(--border-color, #eaeaea);
    }

    table tbody td:last-child {
      border-bottom: none;
    }

    table tbody td:before {
      content: attr(data-label);
      font-weight: 600;
    }
  }

  /* Mobile spacing */
  .container,
  .content-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Floating action button */
  .floating-action-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
  }

  /* Mobile cards */
  .mobile-card {
    background-color: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #eaeaea);
    transition: all 0.2s ease;
  }

  /* Mobile badges */
  .mobile-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
  }

  /* Mobile action buttons */
  .mobile-action-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #eaeaea);
    color: var(--text-secondary, #4b5563);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  /* Mobile grid overrides */
  .grid-container {
    grid-template-columns: 1fr !important;
  }
}
