/* ==============================================================
   Artist Directory — Custom Nav & Header
   Scoped to #ad-scope + .ad-bottom-bar (fixed overlay)
   ============================================================== */

/* --- Scope isolation ------------------------------------------ */
#ad-scope {
  font-family: system-ui, -apple-system, sans-serif;
  width: 100%;
  display: block;
  position: relative;
  z-index: 999;
}

#ad-scope,
#ad-scope *,
#ad-scope *::before,
#ad-scope *::after {
  box-sizing: border-box;
}

#ad-scope a {
  text-decoration: none;
}

#ad-scope button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

#ad-scope .hidden {
  display: none !important;
}

/* --- Icon wrapper --------------------------------------------- */
#ad-scope .ad-icon,
.ad-bottom-item .ad-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

#ad-scope .ad-icon svg,
.ad-bottom-item .ad-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Header ---------------------------------------------------- */
#ad-scope .ad-header {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#ad-scope .ad-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

#ad-scope .ad-header-tools {
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.88);
}

#ad-scope .ad-header-tools__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

#ad-scope .ad-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#ad-scope .ad-quick-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.05);
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  transition: background-color .18s ease, color .18s ease;
}

#ad-scope .ad-quick-link:hover,
#ad-scope .ad-quick-link:focus-visible {
  background: rgba(17, 24, 39, 0.1);
  color: #111827;
  outline: none;
}

#ad-scope .ad-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 420px);
}

#ad-scope .ad-header-search input {
  flex: 1 1 auto;
  min-width: 180px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #111827;
  font-size: 14px;
}

#ad-scope .ad-header-search button {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* --- Logo ----------------------------------------------------- */
#ad-scope .ad-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#ad-scope .ad-logo {
  height: 38px;
  width: auto;
  display: block;
}

#ad-scope .ad-logo-code {
  display: inline-flex;
  align-items: center;
}

#ad-scope .ad-logo-code svg,
#ad-scope .ad-logo-code img {
  height: 38px;
  width: auto;
  display: block;
}

#ad-scope .ad-logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  white-space: nowrap;
  line-height: 1;
}

/* --- Desktop nav ---------------------------------------------- */
#ad-scope .ad-nav-desktop {
  display: none;
}

#ad-scope .ad-nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#ad-scope .ad-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
  position: relative;
}

#ad-scope .ad-nav-link:hover,
#ad-scope .ad-nav-link:focus-visible {
  background: rgba(17, 24, 39, 0.07);
  color: #111827;
  outline: none;
}

/* --- Tooltip (desktop only, added via @media below) ----------- */
#ad-scope .ad-item::after {
  content: attr(data-label);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 4px 9px;
  font-size: 12px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .18s ease;
  z-index: 9999;
}

#ad-scope .ad-item:hover::after {
  opacity: 1;
}

/* --- User dropdown -------------------------------------------- */
#ad-scope .ad-user-wrap {
  position: relative;
}

#ad-scope .ad-user-btn {
  display: inline-flex;
  align-items: center;
}

#ad-scope .ad-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  padding: 10px;
  min-width: 220px;
  z-index: 1000;
  animation: adDropIn .15s ease;
}

@keyframes adDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

#ad-scope .ad-user-dropdown ul,
#ad-scope .ad-user-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

#ad-scope .ad-user-dropdown li {
  padding: 0;
}

#ad-scope .ad-user-dropdown a {
  color: #1f2937;
  font-size: 14px;
  font-weight: 500;
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background-color .15s ease, color .15s ease;
}

#ad-scope .ad-user-dropdown a:hover {
  color: #111827;
  background: rgba(17, 24, 39, 0.07);
}

/* --- Avatar --------------------------------------------------- */
#ad-scope .ad-avatar,
.ad-bottom-item .ad-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* --- Bottom bar (mobile) -------------------------------------- */
.ad-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 998;
}

.ad-bottom-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #374151;
  background: none;
  border: 0;
  padding: 6px 14px;
  border-radius: 10px;
  gap: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
  min-width: 48px;
}

.ad-bottom-item:hover,
.ad-bottom-item:focus-visible {
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
  outline: none;
}

/* Extra space so content isn't hidden behind bottom bar on mobile */
body.ad-nav-active {
  padding-bottom: 68px;
}

/* --- Responsive ----------------------------------------------- */
@media (min-width: 768px) {
  .ad-bottom-bar {
    display: none;
  }

  #ad-scope .ad-nav-desktop {
    display: block;
  }

  body.ad-nav-active {
    padding-bottom: 0;
  }
}

@media (max-width: 767px) {
  .ad-bottom-bar {
    display: flex;
  }

  #ad-scope .ad-nav-desktop {
    display: none;
  }

  /* Dropdown sits above the bottom bar on mobile */
  #ad-scope .ad-user-dropdown {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 72px;
    top: auto;
  }

  /* No tooltip on mobile */
  #ad-scope .ad-item::after {
    display: none;
  }

  #ad-scope .ad-header-tools__inner {
    padding: 10px 14px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  #ad-scope .ad-quick-links {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #ad-scope .ad-quick-links::-webkit-scrollbar {
    display: none;
  }

  #ad-scope .ad-quick-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #ad-scope .ad-header-search {
    display: none;
  }
}

/* --- Hide theme header when active (JS also handles this) ----- */
body.ad-hide-theme-header #masthead,
body.ad-hide-theme-header .site-header,
body.ad-hide-theme-header .main-header,
body.ad-hide-theme-header .ast-header-wrap,
body.ad-hide-theme-header .elementor-location-header,
body.ad-hide-theme-header #uncode-header,
body.ad-hide-theme-header .uncode-header-wrapper,
body.ad-hide-theme-header .menu-wrapper,
body.ad-hide-theme-header .navbar-main {
  display: none !important;
}
