/* LOCATION: public/css/mobile-nav.css */
/* ============================================================
   MOBILE BOTTOM NAV — APPLE LIQUID GLASS (Bulletproof Fix)
   ============================================================ */

:root {
  --nav-bg: var(--glass-strong, rgba(30, 30, 35, 0.85));
  --nav-border: var(--glass-border, rgba(255, 255, 255, 0.12));
  --nav-accent: var(--accent, #007aff);
  --nav-height: 72px;
}

[data-theme="dark"] {
  --nav-bg: var(--glass-strong, rgba(20, 20, 25, 0.92));
  --nav-border: rgba(255, 255, 255, 0.08);
}

/* 1. CONTAINER (Ascuns pe desktop) */
.nav-bottom {
  display: none;
}

@media (max-width: 900px) {
  /* 🔥 FIX: Folosim left/right în loc de transform pentru a nu ieși din ecran */
  .nav-bottom {
    display: block;
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    left: 12px;
    right: 12px;
    width: auto; /* Se întinde perfect între left și right */
    z-index: 9999;
    pointer-events: none;
  }

  body {
    padding-bottom: calc(var(--nav-height) + 32px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* 2. STICLA (Fundalul barei) */
.nav-bottom-items {
  pointer-events: auto;
  display: flex; /* Folosim flex în loc de grid pentru a evita overflow-ul */
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  box-sizing: border-box;
  
  background: var(--nav-bg);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--nav-border);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  
  animation: navSlideUp 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes navSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 3. BUTOANELE */
.nav-bottom-item {
  flex: 1 1 0%; /* Forțează toate butoanele să fie egale */
  min-width: 0; /* Previne ca textul să împingă butonul în afară */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
  color: var(--text-muted, #86868b);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.nav-bottom-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-bottom-item span {
  white-space: nowrap;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-bottom-item:active {
  transform: scale(0.92);
}

/* 4. STARE ACTIVĂ */
.nav-bottom-item-active {
  color: var(--nav-accent) !important;
}

.nav-bottom-item-active svg {
  transform: scale(1.1);
}

.nav-bottom-item-active span {
  font-weight: 700;
}

.nav-bottom-item-active::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.1);
  z-index: -1;
}

[data-theme="dark"] .nav-bottom-item-active::before {
  background: rgba(90, 200, 250, 0.15);
}

[data-theme="dark"] .nav-bottom-item-active {
  color: #5ac8fa !important;
}

/* 5. BUTONUL PRIMARY ("Nou") */
.nav-bottom-item-primary {
  background: linear-gradient(135deg, #007aff, #0a84ff) !important;
  color: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 
    0 4px 12px rgba(0, 122, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-2px); 
}

.nav-bottom-item-primary span,
.nav-bottom-item-primary svg {
  color: #ffffff !important;
}

.nav-bottom-item-primary:active {
  transform: translateY(0) scale(0.95);
}

/* 6. BADGE (Notificări) - FIXAT SĂ NU MAI LĂRGEASCĂ BUTONUL */
.nav-bottom-item .badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 16px); /* Poziționare fixă, nu influențează lățimea */
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--nav-bg);
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
  z-index: 10;
  box-sizing: content-box; /* Previne umflarea badge-ului */
}

/* 7. AJUSTĂRI PENTRU ECRANE MICI */
@media (max-width: 360px) {
  .nav-bottom-items { padding: 4px; }
  .nav-bottom-item { font-size: 9px; }
  .nav-bottom-item svg { width: 20px; height: 20px; }
}

/* 8. ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
  .nav-bottom-items { animation: none; }
  .nav-bottom-item, .nav-bottom-item svg { transition: none; }
}

/* Logo theme switching */
.logo-icon-light { display: inline-block !important; }
.logo-icon-dark  { display: none !important; }
[data-theme="dark"] .logo-icon-light { display: none !important; }
[data-theme="dark"] .logo-icon-dark  { display: inline-block !important; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .logo-icon-light { display: none !important; }
  html:not([data-theme="light"]) .logo-icon-dark  { display: inline-block !important; }
}

/* ============================================================
   FIX URGENT: BADGE NOTIFICARE (Să fie CERC, nu elastic)
   ============================================================ */

.nav-bottom-item .badge {
  position: absolute !important;
  top: 4px !important;
  right: calc(50% - 18px) !important; /* Îl centrează perfect deasupra iconiței */
  
  /* FORȚĂM DIMENSIUNI FIXE DE CERC */
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  padding: 0 !important;
  border-radius: 50% !important; /* Cerc perfect */
  box-sizing: border-box !important;
  
  /* Culori și text */
  background: #ff3b30 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  
  /* Efect de sticlă */
  border: 2px solid var(--nav-bg, rgba(30, 30, 35, 0.85)) !important;
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4) !important;
  z-index: 10 !important;
  text-align: center !important;
  transform: none !important;
}

/* Ne asigurăm că textul butonului (Mesaje, Oferte) NU este afectat de badge */
.nav-bottom-item > span:not(.badge) {
  position: relative !important;
  z-index: 1 !important;
}

/* ============================================================
   PATCH: FORȚARE FORMĂ DE PASTILĂ PENTRU TAB-UL ACTIV
   ============================================================ */

.nav-bottom-item-active::before {
  /* Schimbăm din 14px în 999px ca să devină perfect oval */
  border-radius: 999px !important; 
  
  /* Păstrăm spațiul de 4px ca să pară scufundat în bară */
  inset: 4px !important; 
}