/* Basic Reset & Body Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Arial', sans-serif; /* Fallback to Arial, sans-serif */
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
  direction: ltr; /* Explicitly set text direction */
  padding-top: var(--header-height, 70px); /* Dynamic padding for fixed header */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

ul {
  list-style: none;
}

/* Header Styles */
.site-header {
  background-color: #003366; /* Primary color */
  color: #fff;
  padding: 0; /* Padding moved to .header-primary-row */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  position: fixed; /* Make header sticky */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000; /* Ensure it's above other content */
}

.site-header .header-primary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.site-header .logo {
  font-size: 2.2em; /* Larger for brand presence */
  font-weight: bold;
  color: #FFD700; /* Accent color for logo */
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.site-header .logo:hover {
  color: #fff;
}

.main-nav .nav-list {
  display: flex;
  gap: 25px; /* Spacing between nav items */
}

.main-nav .nav-link {
  color: #fff;
  font-size: 1.1em;
  padding: 10px 0;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  color: #FFD700; /* Accent color on hover/active */
}

/* Underline effect for nav links */
.main-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: #FFD700;
  transition: width 0.3s ease;
}

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

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-buttons .btn {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  text-decoration: none; /* Ensure no underline */
}

.auth-buttons .register-btn {
  background-color: #FFD700;
  color: #003366;
  border: 1px solid #FFD700;
}

.auth-buttons .register-btn:hover {
  background-color: #e6c200;
  color: #001a33;
}

.auth-buttons .login-btn {
  background-color: transparent;
  color: #FFD700;
  border: 1px solid #FFD700;
}

.auth-buttons .login-btn:hover {
  background-color: #FFD700;
  color: #003366;
}

/* Mobile Auth Buttons (hidden by default) */
.mobile-auth-buttons-wrapper {
  display: none; /* Hidden on desktop */
  background-color: #003366;
  padding: 10px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-auth-buttons {
  justify-content: center;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001; /* Ensure it's above other elements */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #FFD700; /* Accent color for hamburger 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 State */
.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 9px;
}

/* Footer Styles */
.site-footer {
  background-color: #003366; /* Primary color */
  color: #fff;
  padding: 40px 0 20px;
  font-size: 0.95em;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}

.site-footer .footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Three columns on desktop */
  gap: 30px;
  margin-bottom: 30px;
}

.site-footer .footer-col h3 {
  color: #FFD700; /* Accent color for headings */
  font-size: 1.3em;
  margin-bottom: 15px;
  position: relative;
  padding-bottom: 5px;
}

.site-footer .footer-col h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: #FFD700;
}

.site-footer .footer-col p,
.site-footer .footer-col ul li {
  margin-bottom: 10px;
  line-height: 1.8;
}

.site-footer .footer-col a {
  color: #fff;
  transition: color 0.3s ease;
}

.site-footer .footer-col a:hover {
  color: #FFD700; /* Accent color on hover */
}

.site-footer .footer-nav li {
  margin-bottom: 8px;
}

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

.site-footer .copyright {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .site-header .header-primary-row .container { /* Adjust padding for inner container */
    padding: 0 15px;
  }
  .main-nav .nav-list {
    gap: 15px;
  }
  .main-nav .nav-link {
    font-size: 1em;
  }
}

@media (max-width: 768px) {
  /* Header Primary Row Layout (Hamburger Left, Logo Center) */
  .site-header .header-primary-row {
    flex-wrap: nowrap; /* Keep items on one line */
    justify-content: space-between;
    padding-bottom: 0; /* Remove bottom padding if mobile buttons are in new row */
  }

  .site-header .logo {
    font-size: 1.8em;
    margin: 0 auto; /* Center the logo */
    flex-grow: 1; /* Allow logo to take available space for centering */
    text-align: center;
    order: 2; /* Position logo in the middle */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    order: 1; /* Position hamburger on the left */
    margin-right: auto; /* Push logo to center */
  }

  /* Hide desktop auth buttons */
  .desktop-auth-buttons {
    display: none;
    order: 3; /* Keep order for consistency, but it's hidden */
  }

  /* Show mobile auth buttons */
  .mobile-auth-buttons-wrapper {
    display: block; /* Show mobile-only buttons wrapper */
  }

  /* Main Navigation (Mobile Overlay) */
  .main-nav {
    position: absolute; /* Make main-nav itself absolute */
    top: var(--header-height); /* Position below the header, dynamic height */
    left: 0;
    width: 100%;
    z-index: 999; /* Below hamburger menu */
    background-color: #003366; /* Match header background */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none; /* Hidden by default */
    padding: 0; /* Remove padding from main-nav container */
  }

  .main-nav.active {
    display: block; /* Show main-nav when active */
  }

  .main-nav .nav-list {
    flex-direction: column;
    padding: 20px 0; /* Apply padding to the list */
    display: flex; /* Always flex column when main-nav is active */
    width: 100%; /* Ensure list takes full width */
  }

  .main-nav .nav-link {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }
  .main-nav .nav-link::after {
    left: 20px; /* Adjust underline position for mobile */
  }

  .site-footer .footer-columns {
    grid-template-columns: 1fr; /* Stack columns vertically */
    text-align: center;
  }

  .site-footer .footer-col h3::after {
    left: 50%;
    transform: translateX(-50%); /* Center underline */
  }
}

@media (min-width: 769px) {
  /* Reset mobile specific styles for desktop */
  .hamburger-menu {
    display: none; /* Hide hamburger on desktop */
  }

  .main-nav {
    position: static; /* Reset position for desktop */
    display: block; /* Ensure it's visible */
    background-color: transparent; /* Reset background */
    box-shadow: none; /* Remove shadow */
    border-top: none; /* Remove border */
    padding: 0; /* Remove padding */
    width: auto; /* Reset width */
  }

  .main-nav .nav-list {
    display: flex !important; /* Ensure nav-list is always visible on desktop */
    flex-direction: row; /* Reset to row */
    padding: 0; /* Reset padding */
  }

  .main-nav .nav-link {
    padding: 10px 0; /* Reset padding */
    border-bottom: none; /* Remove border */
  }
  .main-nav .nav-link::after {
    left: 0; /* Reset underline position */
  }

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