/* ====== SCS Navbar (scoped) ====== */

/* 只影响 #NavBarMenu 内部，避免污染全站 ul */
#NavBarMenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#NavBarMenu {
  background-color: #fff;
}

/* 让顶层菜单横向排列 */
#NavBarMenu #topNav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* 每个顶级菜单项 */
#NavBarMenu .topParent {
  flex: 1;
  text-align: center;
  position: relative; /* 给 submenu 定位用 */
  padding: 14px 0;
}

/* 顶级链接：横向对齐文字+箭头 */
#NavBarMenu .dropdown-items > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: #0E0E0E;
  font-weight: 600;
}

/* hover 色 */
#NavBarMenu .dropdown-items > a:hover {
  color: #f27d04;
}

/* 箭头旋转 */
#NavBarMenu .dropdown-items svg {
  transition: transform 0.3s ease;
}
#NavBarMenu .dropdown-items:hover svg {
  transform: rotate(180deg);
}

/* ===== submenu（你以后加 ul.submenu 才生效，现在不会影响） ===== */
#NavBarMenu ul.submenu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  list-style: none;
  padding-left: 0;
  margin-top: 0;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  position: absolute;
  z-index: 1000;
  left: 0;
  top: 100%;
  min-width: 240px;
}

#NavBarMenu li.topParent:hover .submenu {
  max-height: 800px;
  opacity: 1;
}

#NavBarMenu ul.submenu li {
  padding: 10px 16px 10px 30px;
  position: relative;
  white-space: nowrap;
}

#NavBarMenu ul.submenu li a {
  color: #333;
  text-decoration: none;
}

#NavBarMenu ul.submenu li:hover {
  background-color: #fffbcc;
  font-weight: bold;
}

#NavBarMenu ul.submenu li:hover a {
  text-decoration: underline;
}

#NavBarMenu ul.submenu li:hover::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid green;
}

/* 移动端：改成竖排 */
@media (max-width: 768px) {
  #NavBarMenu #topNav {
    flex-direction: column;
    align-items: stretch;
  }
  #NavBarMenu .topParent {
    flex: none;
    padding: 10px 0;
  }
  #NavBarMenu .dropdown-items > a {
    width: 100%;
  }
}

/* SCS header/nav bottom accent line */
#NavBarMenu.bottomline,
.bottomline {
  border-bottom: 4px solid #05c6fd;
}

/* User avatar circle (shown when logged in) */
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background-color: #4caf50; color: #fff; display: flex;
  justify-content: center; align-items: center; font-weight: 700;
}
.nav-item.dropdown .dropdown-toggle::after { display: none; }
.nav-link { display: flex; align-items: center; }

/* Ensure site header (with user avatar dropdown) stacks above sticky navbar */
#siteHeader {
  position: relative;
  z-index: 1025;
}
