:root {
  --primary-color: #007bff;
  --secondary-color: #ffc107;
  --dark-blue: #0056b3;
  --light-gray: #f8f9fa;
  --text-color: #333;
  --white-color: #fff;
  --header-top-height: 60px; /* Approximate height, will be adjusted by JS */
  --main-nav-height: 50px; /* Approximate height, will be adjusted by JS */
  --mobile-button-area-height: 50px; /* Approximate height, will be adjusted by JS */
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  padding-top: calc(var(--header-top-height) + var(--main-nav-height)); /* Default padding for desktop, adjusted by JS */
  transition: padding-top 0.3s ease; /* Smooth transition for padding-top */
}

/* Site Header - Fixed on top */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--white-color); /* Fallback, specific areas will override */
}

/* Header Top Area */
.header-top {
  background-color: var(--dark-blue); /* Distinct background for top area */
  color: var(--white-color);
  padding: 10px 0;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color); /* Bright color for logo */
  text-decoration: none;
  padding: 5px 0;
  white-space: nowrap;
}

.desktop-nav-buttons {
  display: flex; /* Show on desktop */
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  font-size: 15px;
}

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

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--dark-blue);
  border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #e0a800;
  border-color: #e0a800;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--white-color);
  border: 2px solid var(--white-color);
}

.btn-outline:hover {
  background-color: var(--white-color);
  color: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.3);
}

/* Main Navigation - Below header-top */
.main-nav {
  background-color: var(--light-gray); /* Distinct background for nav area */
  width: 100%;
  display: flex; /* Show on desktop */
  padding: 10px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Horizontal for desktop */
  justify-content: center; /* Center menu items */
  align-items: center;
  padding: 0 20px;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 8px 15px;
  font-weight: 600;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background-color: rgba(0, 123, 255, 0.1);
  border-radius: 5px;
}

/* Hamburger menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
}

/* Mobile button area (hidden on desktop) */
.mobile-button-area {
  display: none; /* Hidden on desktop */
}

/* Mobile menu overlay (hidden on desktop) */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
}

/* Site Footer */
.site-footer {
  background-color: #212529;
  color: #f8f9fa;
  padding: 40px 0 20px;
  font-size: 14px;
}

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

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

.footer-col {
  flex: 1;
  min-width: 200px;
}

.footer-col h3 {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: bold;
}

.footer-col p {
  margin-bottom: 10px;
  color: #adb5bd;
}

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

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

.footer-nav a {
  color: #adb5bd;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #495057;
}

.footer-bottom p {
  margin: 0;
  color: #adb5bd;
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* Body padding adjustment for mobile fixed header + button area */
  body {
    padding-top: calc(var(--header-top-height) + var(--mobile-button-area-height));
  }

  /* Containers fill full width */
  .header-container,
  .nav-container,
  .footer-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-top {
    padding: 10px 0;
  }

  .logo {
    flex-grow: 1; /* Allow logo to take available space */
    text-align: center; /* Center the logo */
    font-size: 24px;
    padding: 0;
  }

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

  /* Hamburger Menu */
  .hamburger-menu {
    display: flex; /* Show on mobile */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002; /* Higher than mobile menu */
    position: relative; /* For z-index to work */
    order: -1; /* Place to the left */
    margin-right: 15px; /* Spacing from logo */
  }

  .hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
  }

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

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

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

  /* Mobile Button Area */
  .mobile-button-area {
    display: block; /* Show on mobile */
    background-color: var(--dark-blue); /* Same as header-top for consistency */
    padding: 10px 0;
    position: fixed;
    top: var(--header-top-height); /* Position below header-top */
    width: 100%;
    z-index: 990; /* Lower than mobile menu, higher than content */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .mobile-button-area .header-container {
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  /* Main Navigation (Mobile) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical for mobile */
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px; /* Width of the mobile menu */
    background-color: var(--white-color);
    transform: translateX(-100%); /* Initially off-screen */
    transition: transform 0.3s ease;
    z-index: 1001; /* Higher than overlay */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    padding-top: calc(var(--header-top-height) + var(--mobile-button-area-height) + 20px); /* Push menu content down */
    overflow-y: auto; /* Allow scrolling if menu is long */
  }

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

  .nav-container {
    flex-direction: column; /* Vertical menu items */
    align-items: flex-start; /* Align menu items to the left */
    padding: 0 15px;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-color);
  }

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

  .nav-link:hover,
  .nav-link.active {
    background-color: var(--light-gray);
    color: var(--primary-color);
    border-radius: 0;
  }

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

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

  /* Footer adjustments */
  .footer-grid {
    flex-direction: column;
  }

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

  .footer-col h3 {
    text-align: center;
  }

  .footer-col p,
  .footer-col ul {
    text-align: center;
  }
  .footer-nav li {
    display: inline-block; /* Allow footer links to be horizontal on mobile */
    margin: 0 8px 8px;
  }
}
