:root {
  --primary-color: #FFD700;
  --secondary-color: #8B0000;
  --text-color-light: #fff;
  --text-color-dark: #333;

  --header-top-height-desktop: 60px;
  --main-nav-height-desktop: 45px;
  --header-height-desktop: calc(var(--header-top-height-desktop) + var(--main-nav-height-desktop));

  --header-top-height-mobile: 60px;
  --mobile-buttons-area-height-mobile: 55px;
  --header-height-mobile: calc(var(--header-top-height-mobile) + var(--mobile-buttons-area-height-mobile));
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark);
  padding-top: var(--header-height-desktop); /* Desktop content protection */
}

/* No Scroll for Mobile Menu */
body.no-scroll {
  overflow: hidden;
}

/* Site Header - Fixed & Floating (Desktop First) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  background-color: transparent; /* Base for containing children */
}

.header-top {
  background-color: var(--secondary-color); /* Dark red for top area */
  min-height: var(--header-top-height-desktop);
  display: flex;
  align-items: center;
  padding: 10px 0; /* Vertical padding, horizontal handled by container */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px; /* Horizontal padding for logo/buttons */
}

.logo {
  color: var(--primary-color);
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure logo is always visible */
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
}

.mobile-buttons-area,
.hamburger-menu,
.mobile-spacer {
  display: none; /* Hidden on desktop */
}

.main-nav {
  background-color: var(--primary-color); /* Gold for main navigation */
  min-height: var(--main-nav-height-desktop);
  display: flex; /* Desktop default: visible */
  align-items: center;
  padding: 5px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.nav-link {
  color: var(--text-color-dark);
  text-decoration: none;
  padding: 8px 15px;
  font-weight: bold;
  font-size: 16px;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping for double-word phrases */
}

.nav-link:hover,
.nav-link.active {
  color: var(--secondary-color);
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.btn-register {
  background-image: linear-gradient(to right, #FFD700, #FFA500);
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
}

.btn-register:hover {
  background-image: linear-gradient(to right, #FFA500, #FFD700);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

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

.btn-login:hover {
  background-color: #a00000;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.btn-download {
  background-color: #008000; /* Green for download */
  color: var(--text-color-light);
  border: 1px solid #006400;
}

.btn-download:hover {
  background-color: #006400;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* Footer Styles */
.site-footer {
  background-color: var(--text-color-dark);
  color: var(--text-color-light);
  padding: 40px 20px 20px;
  font-size: 14px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

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

.footer-logo {
  color: var(--primary-color);
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  display: inline-block;
}

.site-footer h3 {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 15px;
}

.site-footer p,
.site-footer ul {
  margin-bottom: 10px;
}

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

.site-footer a {
  color: var(--text-color-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

/* Mobile Styles */
@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile); /* Mobile content protection */
  }

  .header-container {
    padding: 0 15px;
    max-width: none;
    width: 100%;
  }

  .nav-container {
    padding: 0 15px;
    max-width: none;
    width: 100%;
  }

  .header-top {
    min-height: var(--header-top-height-mobile);
    padding: 10px 0;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002; /* Above logo and buttons */
  }

  .hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: var(--primary-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);
  }

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

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

  .mobile-spacer {
    display: block; /* Spacer to push logo to center */
    width: 30px; /* Same width as hamburger to balance */
    order: 3;
  }

  .mobile-buttons-area {
    display: flex; /* Show mobile buttons area */
    background-color: var(--secondary-color);
    min-height: var(--mobile-buttons-area-height-mobile);
    padding: 10px 0;
  }

  .mobile-buttons-area .header-container {
    justify-content: center;
    gap: 8px;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-height-mobile); /* Will be dynamically updated by JS */
    left: 0;
    width: 80%;
    height: calc(100% - var(--header-height-mobile)); /* Will be dynamically updated by JS */
    background-color: var(--primary-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 999; /* Below hamburger, above overlay */
    padding-top: 20px; /* Internal padding for menu items */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
  }

  .main-nav .nav-link {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

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

  .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);
    z-index: 998; /* Below menu, above content */
    transition: opacity 0.3s ease;
    opacity: 0;
  }

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

  .footer-container {
    flex-direction: column;
    gap: 20px;
  }

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

  .footer-col:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
  }
}