.navbar {
  align-items: center;
  background: color-mix(in srgb, var(--bg-primary) 86%, transparent);
  backdrop-filter: blur(20px);
  border-bottom: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: var(--navbar-height);
  left: 0;
  padding: 0 clamp(14px, 3vw, 32px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 80;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.4vw, 1.12rem);
  font-weight: 600;
  gap: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  width: fit-content;
}

.brand img {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.brand-logo {
  height: 52px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  /* Dark theme: black bg disappears, white text shows */
  mix-blend-mode: lighten;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.12));
  transition: filter 0.3s;
}

/* Light theme: invert so it becomes black text on white bg,
   then multiply makes the white bg transparent */
.theme-light .brand-logo {
  mix-blend-mode: multiply;
  filter: invert(1) drop-shadow(0 0 4px rgba(0,0,0,0.08));
}

.gender-toggle {
  background: var(--bg-secondary);
  border-radius: var(--radius-pill);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  position: relative;
  width: auto;
}

.gender-toggle button {
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  min-height: 30px;
  padding: 0 14px;
  position: relative;
  transition:
    background 180ms var(--transition-smooth),
    color 180ms var(--transition-smooth);
  z-index: 2;
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

.gender-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.12));
  border-radius: var(--radius-pill);
  box-shadow:
    0 0 0 1.5px rgba(var(--accent-rgb), 0.55),
    0 4px 18px rgba(var(--accent-rgb), 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.18);
  transform: scale(1.12);
  transition: transform 0.2s;
}

.gender-indicator {
  display: none;
}

.navbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: end;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-primary);
  display: inline-flex;
  height: 44px;
  justify-content: center;
  position: relative;
  transition:
    background 180ms var(--transition-smooth),
    color 180ms var(--transition-smooth);
  width: 44px;
}

.icon-button svg {
  fill: currentColor;
  height: 22px;
  width: 22px;
}

.icon-button:hover {
  background: var(--accent-muted);
  color: var(--accent-dark);
}

.icon-button.has-alert {
  animation: shake 1.3s ease-in-out 2;
}

.alert-dot {
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  height: 9px;
  position: absolute;
  right: 6px;
  top: 6px;
  width: 9px;
}

.alert-dot.hidden {
  display: none;
}

.notification-shell,
.profile-shell {
  position: relative;
}

.notification-dropdown,
.profile-dropdown {
  background: color-mix(in srgb, var(--bg-primary) 96%, white 4%);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hover);
  min-width: 290px;
  opacity: 0;
  padding: 12px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 54px;
  transform: translateY(10px);
  transition:
    opacity 180ms var(--transition-smooth),
    transform 180ms var(--transition-smooth);
  z-index: 100;
}

.notification-dropdown.open,
.profile-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dropdown-header button,
.profile-dropdown button {
  background: transparent;
  border: 0;
  color: var(--accent-dark);
  font-size: 0.9rem;
}

.notification-item {
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  padding: 10px 12px;
}

.notification-item.unread {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--text-primary);
  font-weight: 500;
}

.profile-dropdown {
  display: grid;
  gap: 12px;
  min-width: 230px;
}

.profile-dropdown a {
  font-weight: 500;
}

.profile-dropdown legend {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.profile-dropdown label {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

@media (max-width: 768px) {
  .navbar {
    align-items: start;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    height: auto;
    justify-items: start;
    min-height: 76px;
    padding: 4px 8px 6px;
    row-gap: 3px;
  }

  .brand {
    grid-column: 1;
    justify-self: start;
  }

  .navbar-actions {
    height: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
  }

  .navbar-actions > .icon-button,
  .notification-shell > .icon-button,
  .profile-shell > .icon-button {
    display: none;
  }

  .brand span {
    display: none;
  }

  .brand img {
    height: 28px;
    width: 28px;
  }

  .gender-toggle {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    position: static;
    width: fit-content;
    z-index: 90;
  }

  .gender-toggle button {
    font-size: 0.66rem;
    min-height: 25px;
    padding: 0 8px;
  }

  .gender-toggle {
    padding: 3px;
  }

  .profile-dropdown {
    left: 12px;
    min-width: 0;
    position: fixed;
    right: 12px;
    top: 78px;
  }

  .notification-dropdown {
    left: 12px;
    min-width: 0;
    position: fixed;
    right: 12px;
    top: 78px;
  }
}

.floating-action-pill {
  display: none;
  background: color-mix(in srgb, var(--bg-primary) 94%, white 6%);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 100px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  flex-direction: column;
  gap: 3px;
}

@media (max-width: 768px) {
  .floating-action-pill {
    align-items: center;
    display: flex;
    flex-direction: row;
    grid-column: 2;
    grid-row: 2;
    justify-content: center;
    gap: 4px;
    padding: 3px 4px;
    place-self: center end;
  }
}

.floating-action-pill .icon-button {
  height: 38px;
  width: 38px;
}

.floating-action-pill .icon-button svg {
  height: 18px;
  width: 18px;
}

@media (max-width: 768px) {
  .floating-action-pill .icon-button {
    height: 26px;
    width: 26px;
  }

  .floating-action-pill .icon-button svg {
    height: 14px;
    width: 14px;
  }

  .floating-action-pill .alert-dot {
    border-width: 1px;
    height: 7px;
    right: 4px;
    top: 4px;
    width: 7px;
  }
}

/* Premium Liquid Droplet Bubble Styling for Emojis & Icons */
.emoji-icon,
.custom-svg-icon,
.lucide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.08));
  border: 1.5px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
  box-shadow: 
    0 4px 10px rgba(var(--accent-rgb), 0.12),
    inset -2.5px -2.5px 6px rgba(var(--accent-rgb), 0.3),
    inset 2.5px 2.5px 6px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: liquidBubble 6s ease-in-out infinite alternate;
  flex-shrink: 0;
  line-height: 1;
  position: relative;
  overflow: visible;
}

/* Glassy liquid droplet highlight reflection */
.emoji-icon::before,
.custom-svg-icon::before,
.lucide-icon::before {
  content: "";
  position: absolute;
  top: 3.5px;
  left: 6.5px;
  width: 32%;
  height: 18%;
  background: rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  transform: rotate(-15deg);
  pointer-events: none;
  z-index: 1; /* Low z-index highlight reflection */
}

.emoji-icon {
  font-size: 1.15rem;
  color: initial !important;
}

.custom-svg-icon svg,
.lucide-icon i {
  width: 14px;
  height: 14px;
  stroke: currentColor; /* Inherit colorful parent styles dynamically! */
  fill: none;
  stroke-width: 2.2px;
  position: relative;
  z-index: 2; /* Sits above highlight layer */
}

.gender-toggle button.active .emoji-icon,
.gender-toggle button.active .custom-svg-icon,
.gender-toggle button.active .lucide-icon,
.category-button.active .emoji-icon,
.category-button.active .custom-svg-icon,
.category-button.active .lucide-icon {
  /* Keep full 3D liquid bubble — just make it glow more brightly */
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.55),
    rgba(var(--accent-rgb), 0.28)
  ) !important;
  border-color: rgba(var(--accent-rgb), 0.85) !important;
  box-shadow:
    0 6px 18px rgba(var(--accent-rgb), 0.45),
    inset -2.5px -2.5px 6px rgba(var(--accent-rgb), 0.5),
    inset 2.5px 2.5px 6px rgba(255, 255, 255, 0.7) !important;
  animation: liquidBubble 6s ease-in-out infinite alternate !important;
}

.gender-toggle button.active .emoji-icon::before,
.gender-toggle button.active .custom-svg-icon::before,
.gender-toggle button.active .lucide-icon::before,
.category-button.active .emoji-icon::before,
.category-button.active .custom-svg-icon::before,
.category-button.active .lucide-icon::before {
  background: rgba(255, 255, 255, 0.7);
}

.gender-toggle button.active .custom-svg-icon svg,
.gender-toggle button.active .custom-svg-icon svg path,
.gender-toggle button.active .custom-svg-icon svg circle,
.gender-toggle button.active .custom-svg-icon svg line,
.gender-toggle button.active .custom-svg-icon svg polyline,
.gender-toggle button.active .lucide-icon i,
.category-button.active .custom-svg-icon svg,
.category-button.active .custom-svg-icon svg path,
.category-button.active .custom-svg-icon svg circle,
.category-button.active .custom-svg-icon svg line,
.category-button.active .custom-svg-icon svg polyline,
.category-button.active .lucide-icon i {
  stroke: #fff !important;
  fill: none !important;
}

.gender-toggle button:hover .emoji-icon,
.gender-toggle button:hover .custom-svg-icon,
.gender-toggle button:hover .lucide-icon,
.category-button:hover .emoji-icon,
.category-button:hover .custom-svg-icon,
.category-button:hover .lucide-icon {
  transform: scale(1.18) rotate(5deg);
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.34), rgba(var(--accent-rgb), 0.16));
  box-shadow: 
    0 6px 14px rgba(var(--accent-rgb), 0.18),
    inset -3px -3px 8px rgba(var(--accent-rgb), 0.35),
    inset 3px 3px 8px rgba(255, 255, 255, 0.7);
}

@keyframes liquidBubble {
  0% { border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; }
  50% { border-radius: 50% 50% 30% 70% / 50% 60% 40% 50%; }
  100% { border-radius: 62% 38% 37% 63% / 44% 41% 59% 56%; }
}
