/* General body styles for sticky footer and reset default margins */
html {
  scroll-behavior: smooth; /* Enable smooth scrolling for anchor links */
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif; /* Ensure font is consistent */
}

main {
  flex-grow: 1; /* Allows main content to fill available space */
}

/* Top Navigation Bar */
.topnav {
  display: flex;
  justify-content: space-around;
  background-color: #d1882f;
  overflow: hidden;
  padding-left: 240px;
  padding-right: 240px;
  box-sizing: border-box; /* Ensure padding is included in width */
  z-index: 10;
}

/* Style the links inside the navigation bar */
.topnav a {
  /* margin-bottom: -5px; - Removed to fix gap */
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 28px 32px;
  text-decoration: none;
  font-size: 17px;
}

/* Add an active class to highlight the current page */
.active {
  background-color: #333;
  color: white;
}

/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
  display: none;
}

/* Dropdown container - needed to position the dropdown content */
.dropdown {
  float: left;
  overflow: hidden;
}

/* Style the dropdown button to fit inside the topnav */
.dropdown .dropbtn {
  font-size: 17px;
  border: none;
  outline: none;
  color: white;
  padding: 28px 32px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

/* Style the dropdown content (hidden by default) */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  padding-top: 5px; /* Added to bridge the gap */
  z-index: 100; /* Increased z-index to appear above hero section */
}

/* Style the links inside the dropdown */
.dropdown-content a {
  float: none;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

/* Add a dark background on topnav links and the dropdown button on hover */
.topnav a:hover, .dropdown:hover .dropbtn {
  background-color: #555;
  color: white;
}

/* Add a grey background to dropdown links on hover */
.dropdown-content a:hover {
  background-color: #ddd;
  color: black;
}

/* Show the dropdown menu when the user moves the mouse over the dropdown button */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Language container - needed to position the language-group content */
.language-group {
  float: left;
  overflow: hidden;
}

/* Style the language-group button to fit inside the topnav */
.language-group .language-group-btn {
  font-size: 17px;
  border: none;
  outline: none;
  color: white;
  padding: 28px 32px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

/* Style the language-group content (hidden by default) */
.language-group-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  padding-top: 5px; /* Added to bridge the gap */
  z-index: 100; /* Increased z-index to appear above hero section */
}

/* Style the links inside the dropdown */
.language-group-content a {
  float: none;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

/* Add a dark background on topnav links and the language-group button on hover */
.topnav a:hover, .language-group:hover .language-group-btn {
  background-color: #555;
  color: white;
}

/* Add a grey background to language-group links on hover */
.language-group-content a:hover {
  background-color: #ddd;
  color: black;
}

/* Show the language-group menu when the user moves the mouse over the language-group button */
.language-group:hover .language-group-content {
  display: block;
}

/* Footer styles */
.footer {
  background-color: #333;
  color: #fff;
  display: flex;
  justify-content: space-around;
  padding: 20px;
  padding-left: 300px;
  padding-right: 300px;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto; /* Pushes footer to the bottom with flexbox */
  z-index: 10;
}

.footer-left {
  flex: 1;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin: 8px 0;
  position: relative; /* 为footer-submenu定位 */
}

.footer-nav li.footer-dropdown {
  position: relative; /* 父元素定位 */
  display: flex;
  align-items: center; /* 保证文字和箭头在一行 */
  gap: 5px; /* 文字和箭头间距 */
}

.footer-nav a {
  color: #d1882f;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-submenu {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: none; /* 默认隐藏 */
  position: absolute;
  left: 15%;   /* 菜单显示在右侧，也可以改为 bottom:0; */
  top: -150%;
  background-color: #444;
  min-width: 120px;
  z-index: 100;
  border-radius: 4px;
}

.footer-submenu li {
  margin: 0;
  padding: 5px 15px;
  white-space: nowrap; /* 防止换行 */
}

.footer-submenu a {
  color: #fff;
}

.footer-dropdown .footer-arrow {
  font-size: 0.8em;
  margin-left: 5px;
  cursor: pointer;
  transition: transform 0.2s ease;
  color: #d1882f;
  display: inline-block;
}

.footer-dropdown.open .footer-arrow {
  transform: rotate(90deg); /* 展开时箭头转向 */
}

.footer-right {
  flex: 1;
  text-align: right;
}

.footer-right p {
  margin: 6px 0;
  color: #fff;
}

.footer-right i {
  color: #d1882f;
  margin-right: 6px;
}

/* Responsive styles for Top Navigation and Footer */
@media screen and (max-width: 600px) {
  .topnav{
    display: block;
    padding-left: 0px;
    padding-right: 0px;
  }

  .topnav a:not(:first-child), .dropdown .dropbtn{
    display: none;
  }
  .topnav a:not(:first-child), .language-group .language-group-btn{
    display: none;
  }
  .topnav a.icon {
    float: right;
    display: block;
  }

  .topnav.responsive {position: relative;}
  .topnav.responsive a.icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }
  .topnav.responsive .dropdown {float: none;}
  .topnav.responsive .dropdown-content {position: relative;}
  .topnav.responsive .dropdown .dropbtn {
    display: block;
    width: 100%;
    text-align: left;
  }
  .topnav.responsive .language-group {float: none;}
  .topnav.responsive .language-group-content {position: relative;}
  .topnav.responsive .language-group .language-group-btn {
    display: block;
    width: 100%;
    text-align: left;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding-left: 20px;
    padding-right: 20px;
  }

  .footer-right {
    text-align: left;
    margin-top: 15px;
  }

  .footer-submenu {
    left: 0; /* 手机版时下拉在下方 */
    top: 100%;
  }
}