/* Global Styles */
:root {
  --primary-color: #003366;
  --secondary-color: #FFD700;
  --text-color: #ffffff;
  --dark-bg: #1a1a1a;
  --light-bg: #2a2a2a;
  --border-color: #004d99;
  --button-hover-primary: #004080;
  --button-hover-secondary: #e6c200;
}

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

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  background-color: var(--dark-bg);
  color: var(--text-color);
  padding-top: 80px; /* Desktop header height */
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--button-hover-secondary);
}

.btn-secondary {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
}

.btn-secondary:hover {
  background-color: var(--button-hover-primary);
}

.btn-tertiary {
  background-color: #4CAF50; /* A distinct green for download */
  color: var(--text-color);
}

.btn-tertiary:hover {
  background-color: #45a049;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--primary-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-height: 70px;
  display: flex;
  flex-direction: column; /* Allows top-wrapper and mobile-button-bar to stack */
}

.header-top-wrapper {
  width: 100%;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  order: 1; /* Desktop: logo first */
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  order: 2; /* Desktop: nav in middle */
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
}

.main-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
}

.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%;
}

.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  order: 3; /* Desktop: buttons last */
}

.hamburger-menu, .mobile-button-bar, .mobile-menu-overlay {
  display: none; /* Hidden on desktop */
}

/* Footer */
.site-footer {
  background-color: var(--light-bg);
  color: var(--text-color);
  padding: 40px 0 20px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-column .footer-heading {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-column p, .footer-column li {
  font-size: 14px;
  color: #ccc;
}

.footer-nav ul {
  list-style: none;
}

.footer-nav a {
  color: #ccc;
  text-decoration: none;
  display: block;
  padding: 5px 0;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: #aaa;
}

/* Mobile Styles */
@media (max-width: 768px) {
  body {
    padding-top: 130px; /* Mobile header + mobile button bar height */
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-content {
    padding: 10px 20px;
    justify-content: space-between;
    position: relative;
  }

  .logo {
    font-size: 24px;
    text-align: center;
    flex-grow: 1;
    order: 2; /* Mobile: logo centered */
  }

  .hamburger-menu {
    display: block;
    order: 1; /* Mobile: hamburger left */
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1001;
    padding: 0;
  }

  .hamburger-menu .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
  }

  .hamburger-menu .bar:last-child {
    margin-bottom: 0;
  }

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

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

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

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

  .mobile-button-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    border-top: 1px solid var(--border-color);
    width: 100%;
    z-index: 999; /* Below hamburger, above content */
  }

  .mobile-button-bar .btn {
    flex: 1;
    font-size: 14px;
    padding: 8px 10px;
  }

  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--primary-color);
    flex-direction: column;
    padding: 80px 20px 20px;
    transform: translateX(-100%); /* Slide out */
    transition: transform 0.3s ease-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: flex-start;
    align-items: flex-start;
  }

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

  .main-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .main-nav li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

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

  .main-nav a {
    padding: 15px 10px;
    display: block;
    width: 100%;
    font-size: 16px;
  }

  .main-nav a::after {
    display: none; /* Hide underline for mobile menu */
  }

  .mobile-menu-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 998; /* Below menu, above content */
    opacity: 0;
    transition: opacity 0.3s ease-out;
  }

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

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

  .footer-column {
    padding: 15px 0;
  }

  .footer-column .footer-heading {
    margin-bottom: 10px;
  }

  .footer-nav ul {
    padding: 0;
  }
  .footer-nav a {
    padding: 8px 0;
  }
}

body.no-scroll {
  overflow: hidden;
}