/* Mobile Optimized Styles - iPhone UX Enhancement */
/* Safe-area aware, thumb-friendly navigation */

:root {
  --mobile-tab-height: 4.5rem;
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 768px) {
  /* Ensure main content clears the fixed bottom nav */
  .main-with-bottom-nav {
    padding-bottom: calc(var(--mobile-tab-height) + var(--mobile-safe-bottom) + 1rem) !important;
  }

  /* Fixed Bottom Tab Navigation */
  .mobile-tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--color-bg-primary, #ffffff);
    border-top: 1px solid var(--color-border, #e8ecf4);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    height: calc(var(--mobile-tab-height) + var(--mobile-safe-bottom));
    padding: 0;
    padding-bottom: var(--mobile-safe-bottom);
    margin: 0;
    list-style: none;
    z-index: 1030; /* Aligned with zIndex.fixed in tailwind.config.js */
    -webkit-overflow-scrolling: touch;
  }

  .tab-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    text-decoration: none;
    color: var(--color-text-secondary, #a0aec0);
    font-size: 0.75rem;
    font-weight: 600;
    min-height: 44px; /* HIG/WCAG minimum */
    transition: all var(--transition-duration-fast, 150ms) ease;
    -webkit-tap-highlight-color: transparent;
  }

  .tab-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 1.5rem;
    width: 1.5rem;
  }

  .tab-label {
    display: block;
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .tab-nav-item.active {
    color: var(--color-primary, #c41e3a);
  }

  .tab-nav-item:active {
    transform: scale(0.95);
    background-color: rgba(0, 0, 0, 0.02);
  }

  /* Prevent iOS zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Adjust Footer for Mobile Tab Nav */
  .site-footer {
    padding-bottom: calc(var(--spacing-lg, 2rem) + var(--mobile-tab-height) + var(--mobile-safe-bottom)) !important;
  }
}
