/* ============================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZED
   Versione 3.0 - Pulita
   ============================================ */

:root {
  --mobile-nav-height: 64px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   BOTTOM NAVIGATION BAR - MOBILE
   ============================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding-bottom: var(--safe-area-bottom);
}

.mobile-bottom-nav .nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

.mobile-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #6b7280;
  font-size: 10px;
  font-weight: 500;
}

.mobile-bottom-nav .nav-item .nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item.active {
  color: #48d597;
  background: rgba(72, 213, 151, 0.1);
}

/* ============================================
   DESKTOP NAV
   ============================================ */
.desktop-nav {
  display: flex;
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  /* Mostra bottom nav, nascondi desktop nav */
  .mobile-bottom-nav {
    display: block;
  }

  .desktop-nav {
    display: none !important;
  }

  /* Spazio per bottom nav */
  body {
    padding-bottom: calc(var(--mobile-nav-height) + 16px) !important;
  }

  /* Container */
  .container, .max-w-7xl, .max-w-6xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Grid in colonna */
  .grid {
    grid-template-columns: 1fr !important;
  }

  /* Titoli */
  .text-3xl { font-size: 1.5rem !important; }
  .text-2xl { font-size: 1.25rem !important; }

  /* Card */
  .bg-white.rounded-lg {
    padding: 1rem !important;
  }

  /* Tabelle scrollabili */
  .overflow-x-auto {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  table {
    min-width: 600px !important;
  }

  /* Tab navigation scrollabile */
  nav.flex.-mb-px {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  nav.flex.-mb-px button {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
}

/* ============================================
   iOS FIX
   ============================================ */
@supports (-webkit-touch-callout: none) {
  .mobile-bottom-nav {
    padding-bottom: max(var(--safe-area-bottom), 8px);
  }
}
