/* ============================================================
   Navbar search dropdown
   Markup: base/templates/base/partials/_search_dropdown.html
   ============================================================ */

.nav-search-wrapper {
  position: relative;
  width: 260px;
}

/* Panel (sits just under the input) */
.nav-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: min(520px, 72vh);
  overflow: hidden;
  background: #171718;
  border: 1px solid rgba(255, 223, 0, 0.16);
  border-radius: 14px;
  box-shadow: 0 22px 44px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.35);
  z-index: 1080;
  font-family: "Outfit", sans-serif;
}

.nav-search-dropdown.d-none {
  display: none !important;
}

/* Scrollable result list */
.nav-search-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 6px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.nav-search-results::-webkit-scrollbar {
  width: 6px;
}

.nav-search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}

/* Section (Groups / Teams / Posts / Users) */
.nav-search-group {
  padding: 6px 0 4px;
}

.nav-search-group + .nav-search-group {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.nav-search-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #FFDF00;
}

.nav-search-group-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  margin-right: -6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #9a9aa0;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-search-group-more i {
  font-size: 0.65rem;
}

.nav-search-group-more:hover,
.nav-search-group-more:focus-visible {
  color: #FFDF00;
  background: rgba(255, 223, 0, 0.08);
  outline: none;
}

/* Result row */
.nav-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav-search-item:hover,
.nav-search-item:focus-visible {
  background: rgba(255, 223, 0, 0.06);
  outline: none;
}

.nav-search-item:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(255, 223, 0, 0.35);
}

/* Thumbnails: users/posts round, groups/teams square */
.nav-search-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #111112;
}

.nav-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-search-thumb--square {
  border-radius: 9px;
}

/* Uploaded team logos: image only, no background */
.nav-search-thumb--logo {
  background: transparent;
}

.nav-search-thumb--logo img {
  object-fit: contain;
}

/* Team without a logo: tag initials (same look as team list fallback) */
.nav-search-thumb--initials {
  background: linear-gradient(135deg, #26261a, #111112);
  color: #FFDF00;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* Text */
.nav-search-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.nav-search-item-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  color: #f3f3f3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-search-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-search-item-title i {
  flex: none;
  font-size: 0.8rem;
}

.nav-search-sub {
  overflow: hidden;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #8a8a90;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Chevron shown on hover */
.nav-search-go {
  flex: none;
  font-size: 0.75rem;
  color: #FFDF00;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-search-item:hover .nav-search-go,
.nav-search-item:focus-visible .nav-search-go {
  opacity: 1;
  transform: none;
}

/* Footer: see all results */
.nav-search-all {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #111112;
  font-size: 0.82rem;
  color: #c9c9ce;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-search-all > i {
  color: #FFDF00;
  font-size: 0.85rem;
}

.nav-search-all-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-search-all strong {
  font-weight: 600;
  color: #fff;
}

.nav-search-all kbd {
  flex: none;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #171718;
  box-shadow: none;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: #9a9aa0;
}

.nav-search-all:hover,
.nav-search-all:focus-visible {
  background: rgba(255, 223, 0, 0.06);
  color: #fff;
  outline: none;
}

/* Empty state */
.nav-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 20px 24px;
  text-align: center;
}

.nav-search-empty-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(255, 223, 0, 0.08);
  color: #FFDF00;
  font-size: 1rem;
}

.nav-search-empty-title {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f3f3f3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-search-empty-sub {
  font-size: 0.78rem;
  color: #8a8a90;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-search-wrapper {
    width: 100%;
  }

  .nav-search-dropdown {
    max-height: min(480px, 70vh);
  }
}
