/* General Styling */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #333333; /* Default text color */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Header Offset */
:root {
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: transparent; /* Allows internal sections to define their own backgrounds */
  box-sizing: border-box;
  overflow-x: hidden; /* Prevents horizontal scroll from header elements */
}

/* Header Top Section */
.header-top {
  background-color: #002B4A; /* Dark blue */
  min-height: 60px;
  display: flex;
  align-items: center;
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%; /* Ensure container fills parent */
  min-height: 60px;
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF; /* White text for logo */
  text-decoration: none;
  display: block; /* Ensures it takes up space */
  padding: 10px 0; /* Add some padding for click area */
  white-space: nowrap; /* Prevent logo text from wrapping */
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  margin-left: auto; /* Push buttons to the right */
}

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

/* Main Navigation Section */
.main-nav {
  background-color: #26A9E0; /* Primary light blue */
  min-height: 50px;
  display: flex; /* Desktop default: visible, horizontal */
  align-items: center;
}

.main-nav .nav-container {
  display: flex;
  justify-content: center; /* Center nav links */
  align-items: center;
  width: 100%; /* Ensure container fills parent */
  min-height: 50px;
}

.nav-link {
  color: #000000; /* Black text for contrast on light blue */
  padding: 15px 20px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap; /* Prevent nav links from wrapping */
}

.nav-link:hover {
  background-color: rgba(0, 0, 0, 0.1); /* Subtle hover effect */
  color: #FFFFFF; /* White text on hover */
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline */
  display: inline-block; /* Ensure padding and width work */
  box-sizing: border-box;
}

.btn-login {
  background-color: #EA7C07; /* Orange */
  color: #000000; /* Black text */
}

.btn-register {
  background-color: #FFD700; /* Gold */
  color: #000000; /* Black text */
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001; /* Above other header elements */
  margin-right: 15px; /* Spacing from logo */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #FFFFFF; /* White lines */
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 9px; }
.hamburger-menu span:nth-child(3) { top: 18px; }

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Menu Overlay (hidden by default) */
.mobile-menu-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  z-index: 999; /* Below menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styling */
.site-footer {
  background-color: #002B4A; /* Dark blue, consistent with header top */
  color: #FFFFFF; /* White text */
  padding: 40px 0 20px;
  font-size: 14px;
}

.site-footer h3 {
  color: #FFFFFF;
  font-size: 18px;
  margin-bottom: 20px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-column {
  flex: 1;
  min-width: 250px; /* Ensure columns don't get too small */
  max-width: 30%;
}

.footer-column p {
  line-height: 1.6;
  margin-bottom: 10px;
}

.footer-nav a {
  display: block;
  color: #CCCCCC; /* Lighter white for links */
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Header Offset for Mobile */
  :root {
    --header-offset: 110px; /* Mobile: header-top (60px) + mobile-nav-buttons (50px) */
  }

  /* Prevent content overflow */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  /* Header adjustments */
  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  }

  .header-top .header-container {
    padding-left: 15px;
    padding-right: 15px;
    justify-content: space-between; /* Space between hamburger and logo */
  }

  /* Mobile Logo Centering (Method 1: Flexbox for text logo) */
  .logo {
    flex: 1; /* Allow logo to take remaining space */
    text-align: center; /* Center text within its flex item */
    font-size: 20px;
    padding: 10px 0;
    max-width: calc(100% - 60px); /* To prevent overlap with hamburger */
    color: #FFFFFF; /* Ensure white color on dark background */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: -1; /* Place it first */
    margin-right: 15px; /* Spacing from logo */
  }

  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding around buttons */
    background-color: #002B4A; /* Same as header-top for continuity */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Keep buttons in a single line */
    justify-content: center; /* Center buttons if less than 2 */
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    overflow-wrap: break-word; /* Allow text wrapping */
  }

  /* Main Navigation (Mobile Menu) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header + buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset));
    overflow-y: auto;
    background-color: #26A9E0; /* Primary light blue */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Above overlay, below hamburger */
  }

  .main-nav.active {
    display: flex; /* Show the menu when active */
    transform: translateX(0); /* Slide in */
  }

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align links to the left */
    padding: 20px 0;
    width: 100%;
    max-width: none; /* No max-width on mobile */
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: normal; /* Allow text wrapping for longer links */
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer adjustments */
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }

  .footer-column {
    max-width: 100%;
    min-width: unset;
  }

  .footer-bottom {
    margin-top: 20px;
  }
}

/* Accessibility: Ensure body scroll is prevented when mobile menu is open */
body.no-scroll {
  overflow: hidden;
}

/* Payment Methods 图标容器样式 */
.payment-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
}

.payment-icons img,
.payment-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Game Providers 图标容器样式 */
.game-providers-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.game-providers-icons img,
.game-provider-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Social Media 图标容器样式 */
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.social-media-icons img,
.social-media-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
