/* Bottom Navigation Bar Styles */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--controls-bg, rgba(255, 255, 255, 0.95));
  box-shadow: var(--controls-shadow, 0 -2px 10px rgba(0, 0, 0, 0.1));
  padding: 8px 0;
  /* Add padding for mobile safe area at the bottom */
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto; /* Change from fixed height to auto */
  min-height: 60px; /* Keep minimum height */
  overflow: hidden;
}

/* Media query for standalone mode (installed PWA) */
@media all and (display-mode: standalone) {
  .bottom-nav {
    /* Extra padding in standalone mode */
    padding-bottom: calc(5px + env(safe-area-inset-bottom, 8px));
  }
  
  /* Adjust content padding to prevent overlap with nav bar */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 8px));
  }
}

.bottom-nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  max-width: 600px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  flex: 1;
  text-decoration: none;
  color: var(--text-light, #757575);
  transition: color 0.2s ease;
}

.nav-item:hover, .nav-item:focus {
  color: var(--primary-color, #1e88e5);
}

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

.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  fill: currentColor;
}

.nav-label {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* Dark mode adjustments */
.dark-theme .bottom-nav {
  background-color: var(--controls-bg, rgba(30, 30, 30, 0.95));
}

/* RTL support - always keep the navigation LTR for consistent ordering */
.bottom-nav-wrapper {
  /* Force left-to-right direction regardless of page direction */
  direction: ltr !important;
  flex-direction: row;
}

.nav-item {
  flex-direction: column;
}

/* Animation for active state */
.nav-item.active .nav-icon {
  transform: scale(1.1);
}

/* Responsive styles */
@media (max-width: 360px) {
  .nav-label {
    font-size: 10px;
  }
  
  .nav-icon {
    width: 20px;
    height: 20px;
  }
}

/* Accessibility focus styles */
.nav-item:focus {
  outline: none;
}

.nav-item:focus-visible {
  outline: 2px solid var(--primary-color, #1e88e5);
  outline-offset: 2px;
  border-radius: 4px;
}