/* Desktop hover refinements */
@media (hover: hover) and (pointer: fine) {
  .bottom-nav__item:hover { 
    background: var(--bn-hover-bg);
  }
  .bottom-nav__item:hover .bottom-nav__icon { 
    fill: var(--bn-active);
  }
}
/* Bottom Navigation Bar - Reusable, mobile-first, RTL-ready
   No external dependencies. Uses CSS variables for theme customization. */

:root {
  --bn-height: 45px; /* mobile default */

  /* Modern Golden/Green Palette */
  /* Flat GLASS background (no elevation) - transparent, not creamy */
  --bn-bg: rgba(255, 255, 255, 0.14); /* milky white glass */
  --bn-border: rgba(255, 255, 255, 0.35); /* subtle light border */
  --bn-shadow: none; /* No embossing/shadows */
  
  --bn-icon: #205f44; /* A softer, more muted green */
  --bn-text: #134835; /* Darker, for contrast */
  
  --bn-active-icon: #1A4D38;
  --bn-active-text: #000;
  --bn-active-indicator: #1A4D38;
  
  --bn-badge-bg: #c0392b;
  --bn-badge-color: #fff;
  
  --bn-hover-bg: rgba(255, 255, 255, 0.16);
  --bn-press-bg: rgba(255, 255, 255, 0.22);
}

/* Desktop/Windows (fine pointer + hover) */
@media (hover: hover) and (pointer: fine) {
  :root { --bn-height: 55px; }
}

/* Safe-area support for iOS notch */
.bn-safe-area {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav {
  position: fixed;
  z-index: 99999;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bn-height);
  /* Force golden background, guard against overrides */
  background: var(--bn-bg) !important; /* translucent glass */
  box-shadow: var(--bn-shadow);
  border-top: 1px solid var(--bn-border) !important; /* thin, flat border */
  display: flex;
  align-items: stretch; /* Stretch items to full height */
  justify-content: space-around;
  direction: rtl;
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  backdrop-filter: saturate(120%) blur(14px);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  overflow: hidden; /* smooth clipping for hover/press bg */
}

.bottom-nav__item {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 100%;
  color: var(--bn-text);
  background: transparent; /* prevent default white button background */
  border: 0; /* remove default border */
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Vazir', Tahoma, Arial, sans-serif;
  font-size: 12px; /* mobile */
  font-weight: 700; /* bold on all devices */
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  transition: background 200ms ease;
  will-change: transform, background;
  touch-action: manipulation;
}

/* Desktop font size */
@media (hover: hover) and (pointer: fine) {
  .bottom-nav__item { font-size: 14.4px; }
}

.bottom-nav__item:active { background: var(--bn-press-bg); }

.bottom-nav__item--active .bottom-nav__icon {
  fill: var(--bn-active-icon);
  transform: translateY(-2px) scale(1.1);
}

.bottom-nav__item--active .bottom-nav__label {
  color: var(--bn-active-text);
  font-weight: 900;
  opacity: 1;
  transform: translateY(-1px);
}

.bottom-nav__item--active::before {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background: var(--bn-active-indicator);
  border-radius: 50%;
  transform: scale(1);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav__item:not(.bottom-nav__item--active)::before {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: var(--bn-active-indicator);
    border-radius: 50%;
    transform: scale(0);
}

/* Remove focus outline and handle focus/blur properly */
.bottom-nav__item:focus {
  outline: none;
  background: var(--bn-hover-bg);
}

.bottom-nav__item:focus:not(:focus-visible) {
  background: transparent;
}

/* Touch device specific - remove focus after tap */
@media (hover: none) and (pointer: coarse) {
  .bottom-nav__item:focus {
    background: transparent;
  }
}

.bottom-nav__icon {
  width: 18px; /* mobile */
  height: 18px;
  fill: var(--bn-icon);
  flex: 0 0 auto;
  transition: fill 200ms ease;
}

/* Desktop icon size */
@media (hover: hover) and (pointer: fine) {
  .bottom-nav__icon { width: 20px; height: 20px; }
}

.bottom-nav__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 200ms ease, opacity 200ms ease;
}

.bottom-nav__badge {
  position: absolute;
  top: 6px;
  inset-inline-start: 18px; /* RTL-aware */
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--bn-badge-bg);
  color: var(--bn-badge-color);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

/* Labels always visible - removed hiding rule for small screens */

/* Modern bubble hover/active for inner wrap */
.bottom-nav__wrap { padding: 8px 12px; border-radius: 12px; transition: background 200ms ease; }

@media (hover: hover) and (pointer: fine) {
  .bottom-nav__item:hover .bottom-nav__wrap { background: rgba(255,255,255,0.20); }
}

.bottom-nav__item--active .bottom-nav__wrap { background: rgba(255,255,255,0.24); }

/* Slightly larger touch target on small phones */
@media (max-width: 380px) {
  :root { --bn-height: 48px; }
  .bottom-nav__icon { width: 18px; height: 18px; }
  .bottom-nav__wrap { padding: 8px 10px; }
}
