:root {
  --primary-color: #0A1931;
  --secondary-color: #FFD700;
  --text-color: #f0f0f0;
  --accent-color: #e0e0e0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #1a2a44; /* Slightly lighter than primary for contrast */
  padding-top: 70px; /* Offset for fixed header, adjust as needed based on header height */
}

a {
  text-decoration: none;
  color: var(--text-color);
}

ul {
  list-style: none;
}

/* New rule for placeholder */
.header-right-placeholder {
  display: none; /* Hidden by default on desktop */
}

/* Header Styles */
.site-header {
  background-color: var(--primary-color);
  padding: 1rem 0;
  border-bottom: 2px solid var(--secondary-color);
  position: fixed; /* Make header sticky */
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  /* Removed desktop specific flex properties here, moved to .header-main-desktop-and-mobile-top */
  padding: 0 1.5rem;
  display: flex; /* Default to flex column for mobile, overridden for desktop */
  flex-direction: column;
  gap: 1rem; /* Gap between mobile top row and mobile buttons */
}

.header-main-desktop-and-mobile-top { /* This div controls desktop layout and mobile top row */
  display: flex; /* Default for desktop: logo left, nav+buttons right */
  justify-content: space-between;
  align-items: center;
  width: 100%; /* Ensure it spans full width */
}

.desktop-nav-and-buttons { /* Groups desktop auth buttons */
  display: flex;
  align-items: center;
  /* gap: 1.5rem;  Gap between nav and auth buttons - now only contains auth buttons, so gap is less relevant but harmless */
}

.logo {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  transition: color 0.3s ease;
}

.logo:hover {
  color: #fff;
}

.main-nav ul {
  display: flex; /* Default for desktop */
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--secondary-color);
}

/* Main Nav Z-index fix */
.main-nav {
  z-index: 1001; /* Must be higher than site-header's z-index */
}

/* Auth Buttons Styles */
.auth-buttons {
  display: flex; /* Default for desktop buttons */
  gap: 1rem;
  align-items: center;
}

.auth-buttons .button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  font-weight: bold;
  text-transform: uppercase;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap; /* Prevent buttons from wrapping */
}

.auth-buttons .register {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: 2px solid var(--secondary-color);
}

.auth-buttons .register:hover {
  background-color: #fff;
  color: var(--primary-color);
}

.auth-buttons .login {
  background-color: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.auth-buttons .login:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

/* Hide mobile-only elements by default on desktop */
.auth-buttons.mobile-only {
  display: none;
}

.hamburger-menu {
  display: none; /* Hide on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Footer Styles (unchanged) */
.site-footer {
  background-color: var(--primary-color);
  padding: 3rem 0;
  color: var(--accent-color);
  font-size: 0.9rem;
  border-top: 2px solid var(--secondary-color);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 0 1.5rem;
}

.footer-column h3 {
  color: var(--secondary-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.footer-column p {
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: var(--accent-color);
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: var(--secondary-color);
}

.footer-nav li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright {
  font-size: 0.85rem;
  color: var(--accent-color);
}

.back-to-top {
  color: var(--secondary-color);
  font-weight: bold;
  transition: color 0.3s ease;
}

.back-to-top:hover {
  color: #fff;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
    flex-direction: column; /* Stack top row and mobile buttons */
    gap: 1rem; /* Gap between mobile top row and mobile buttons */
  }

  /* Mobile Top Row: Hamburger left, Logo center */
  .header-main-desktop-and-mobile-top {
    display: grid; /* Use grid for precise positioning */
    /* Columns: 1. Hamburger (auto width), 2. Logo (centered, takes up space), 3. Placeholder (auto width, same as hamburger) */
    grid-template-columns: auto 1fr auto; 
    align-items: center;
  }

  .logo {
    grid-column: 2 / 3; /* Place logo in the middle column */
    justify-self: center; /* Center logo horizontally within its grid cell */
    text-align: center; /* Ensure text inside logo is centered */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    grid-column: 1 / 2; /* Place hamburger in the first column (left) */
    justify-self: start; /* Align to start of its grid cell */
  }

  .header-right-placeholder {
    display: block; /* Show placeholder on mobile to balance the logo centering */
    grid-column: 3 / 4; /* Place in the third column */
    width: 41px; /* Match hamburger's effective width (25px span + 0.5rem*2 padding) */
  }

  /* Hide desktop navigation and desktop auth buttons on mobile */
  .main-nav { /* This will be the dropdown menu */
    display: none; /* Hidden by default, shown with .active */
    flex-direction: column;
    position: absolute;
    /* Adjusted top to account for total header height (fixed position relative to viewport) */
    top: 158px; /* Estimate: site-header padding (32px) + header-main-desktop-and-mobile-top height (~60px) + header-container gap (16px) + mobile auth buttons row (~50px) = 158px */
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    border-top: 1px solid var(--secondary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001; /* Ensure it's above the fixed header */
    padding-bottom: 1rem;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
  }

  .main-nav li {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
  }

  .main-nav a {
    display: block;
    padding: 0.8rem 0;
    font-size: 1.1rem;
  }

  .main-nav a::after {
    left: 50%;
    transform: translateX(-50%);
    width: 0;
  }

  .main-nav a:hover::after,
  .main-nav a.active::after {
    width: 50%; /* Smaller underline for mobile */
  }

  /* Hide the container for desktop nav and buttons */
  .desktop-nav-and-buttons {
    display: none;
  }

  /* Mobile-only Auth Buttons below logo, centered */
  .auth-buttons.mobile-only {
    display: flex; /* Show mobile buttons */
    justify-content: center; /* Center the buttons */
    padding: 0.5rem 0; /* Add some padding */
    width: 100%;
  }
  .auth-buttons.mobile-only .button {
      flex: 1; /* Allow buttons to grow and fill space */
      max-width: 150px; /* Limit button width */
      text-align: center;
  }
  .auth-buttons.mobile-only .button:first-child {
      margin-right: 0.5rem; /* Gap between buttons */
  }
  .auth-buttons.mobile-only .button:last-child {
      margin-left: 0.5rem; /* Gap between buttons */
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }
}