/* Hide nav-search by default to prevent flicker on page load */
.fb-nav .nav-search {
  display: none;
}

/* Desktop Navigation (Bottom) - Glossy Chrome Pill Bar */
@media (min-width: 768px) {
  .fb-nav {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0;
    /* Glossy silver/chrome gradient */
    background: linear-gradient(180deg, #b8b8b8 0%, #9a9a9a 40%, #888888 60%, #7a7a7a 100%);
    border-radius: 50px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2),
                0 8px 20px rgba(0, 0, 0, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.35);
    z-index: 1000;
    padding: 5px 5px;
  }

  /* Logo on left side */
  .fb-nav .nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    margin-right: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }

  .fb-nav .nav-logo:hover {
    opacity: 0.8;
  }

  .fb-nav .nav-logo-mark {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .fb-nav .nav-logo-text {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    letter-spacing: -0.02em;
  }

  /* Hide mobile nav on desktop */
  .fb-nav .mobile-nav {
    display: none;
  }

  /* Show desktop nav */
  .fb-nav .desktop-nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 2px;
  }

  .fb-nav .desktop-nav li {
    flex: 0 0 auto;
  }

  .fb-nav .desktop-nav a {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px 20px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 40px;
    white-space: nowrap;
  }

  .fb-nav .desktop-nav a:hover {
    color: #111;
    background: rgba(255, 255, 255, 0.2);
  }

  /* Active state — glossy dark pill */
  .fb-nav .desktop-nav a.active {
    color: #fff;
    background: linear-gradient(180deg, #555 0%, #333 40%, #222 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5),
                0 1px 0 rgba(255, 255, 255, 0.15);
  }

  /* Hide icons on desktop — text only */
  .fb-nav .desktop-nav i {
    display: none;
  }

  .fb-nav .desktop-nav span {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  /* Search box integrated in navbar */
  .fb-nav .nav-search {
    display: flex;
    align-items: center;
    /* darker, subtle glossy pill that fits the theme */
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.28));
    border-radius: 40px;
    padding: 5px 12px 5px 14px;
    margin-left: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 6px 18px rgba(0,0,0,0.45);
  }

  .fb-nav .nav-search input {
    border: none;
    background: transparent;
    outline: none;
    padding: 0 6px;
    font-size: 12px;
    color: #e8eef6; /* lighter text to contrast dark pill */
    width: 120px;
  }

  .fb-nav .nav-search input::placeholder {
    color: rgba(230,238,246,0.55);
  }

  .fb-nav .nav-search button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(230,238,246,0.85);
  }

  .fb-nav .nav-search button i {
    font-size: 13px;
  }

  /* Hide More menu modal on desktop */
  .more-menu-modal {
    display: none !important;
  }
}

/* Hide search box and logo on mobile */
@media (max-width: 767px) {
  .fb-nav .nav-search,
  .fb-nav .nav-logo {
    display: none;
  }
}

/* Mobile Navigation (Bottom) - With More button */
@media (max-width: 767px) {
  .fb-nav {
    position: fixed;
    bottom: 12px; /* float a bit above the edge */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    /* stronger, darker pill (no backdrop blur to avoid stacking glitches) */
    background: rgba(0, 0, 0, 0.986);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 40px; /* pill shape */
    border: 1px solid rgba(255,255,255,0.02);
    box-shadow: 0 20px 56px rgba(0,0,0,0.72), inset 0 1px 0 rgba(255,255,255,0.02);
    z-index: 1000;
    padding: 6px 6px;
    width: min(92%, 720px);
    max-width: 720px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }

  /* Hide desktop nav on mobile */
  .fb-nav .desktop-nav {
    display: none;
  }

  /* Show mobile nav */
  .fb-nav .mobile-nav {
    display: flex;
    flex-direction: row;
    margin: 0;
    padding: 0 4px;
    list-style: none;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    overflow-x: visible;
    gap: 8px;
  }

  .fb-nav .mobile-nav li {
    flex: 0 1 auto;
    text-align: center;
    max-width: 100px;
    padding: 0 4px;
  }

  .fb-nav .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px 4px 4px;
    color: #bdbdbd;
    text-decoration: none;
    font-size: 11px;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
    position: relative;
    border-radius: 10px;
  }

  .fb-nav .mobile-nav a:hover {
    background: rgba(255,255,255,0.02);
  }

  .fb-nav .mobile-nav a.active {
    /* Keep text color same as inactive */
    color: #bdbdbd;
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
  }

  /* Active state - only color the icon */
  .fb-nav .mobile-nav a.active i {
    color: #58a6ff;
  }

  .fb-nav .mobile-nav i {
    font-size: 22px;
    margin-bottom: 4px;
    transition: color 160ms ease;
  }

  .fb-nav .mobile-nav span {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: -0.2px;
  }
}

/* More Menu Modal */
.more-menu-modal {
  display: block;
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.more-menu-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.more-menu-modal.active {
  pointer-events: auto;
  opacity: 1;
}

.more-menu-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(88vw, 360px);
  background: rgba(14,16,20,0.96);
  color: #fff;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 32px 72px rgba(0,0,0,0.80), 0 0 0 1px rgba(255,255,255,0.03);
  padding: 14px 12px 20px;
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  transition:
    transform 0.36s cubic-bezier(0.34, 1.46, 0.64, 1),
    opacity 0.24s ease;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 10050;
  will-change: transform, opacity;
}

.more-menu-modal.active .more-menu-content {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}


.more-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 12px 12px;
  border-bottom: none; /* remove header separator */
}

.more-menu-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.close-more-menu {
  background: rgba(255,255,255,0.08);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.16s;
}

.close-more-menu:hover {
  background: rgba(255,255,255,0.12);
}

.more-menu-list {
  padding: 8px 6px;
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  color: #fff;
  text-decoration: none;
  transition: background 0.14s ease;
  border-bottom: none; /* remove item separators */
  border-radius: 10px;
}

.more-menu-item:hover {
  background: rgba(255,255,255,0.04);
}

.more-menu-item.active {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.more-menu-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.more-menu-item.active .more-menu-icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.more-menu-icon i {
  font-size: 18px;
}

.more-menu-item span {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
}

.more-menu-item .fa-chevron-right {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
}

.more-menu-item.active .fa-chevron-right {
  color: #fff;
}

/* Add padding to body to prevent content from being hidden behind bottom nav */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 768px) {
  /* Ensure page content (footer) is not hidden behind the fixed bottom nav on desktop */
  body {
    /* leave top padding unchanged, add bottom padding equal to nav height + gap */
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
    padding-top: 0;
  }
}

/* Additional mobile responsive adjustments */
@media (max-width: 600px) {
  .fb-nav .mobile-nav a {
    padding: 6px 2px 4px 2px;
  }

  .fb-nav .mobile-nav i {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .fb-nav .mobile-nav span {
    font-size: 9px;
  }
}

@media (max-width: 380px) {
  .fb-nav .mobile-nav a {
    padding: 5px 1px 3px 1px;
  }

  .fb-nav .mobile-nav i {
    font-size: 20px;
  }

  .fb-nav .mobile-nav span {
    font-size: 8px;
  }
}
