:root {
  --primary-color: #0A192F;
  --secondary-color: #FFD700;
  --text-color-light: #f0f0f0;
  --text-color-dark: #333;
  --padding-base: 1rem;
  --max-width: 1200px;
}

/* 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);
  background-color: #f8f8f8;
  padding-top: 70px; /* Space for fixed header on desktop */
}

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

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

/* Header styles */
.site-header {
  background-color: var(--primary-color);
  padding: var(--padding-base) 0;
  color: var(--text-color-light);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  position: fixed; /* Make header sticky */
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-base);
}

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

.logo:hover {
  color: #fff; /* Lighter accent on hover */
  text-decoration: none;
}

.main-nav ul {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-color-light);
  font-weight: bold;
  padding: 0.5rem 0;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  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%;
}

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

/* Auth Buttons styles */
.auth-buttons {
  display: flex;
  gap: 1rem;
  margin-left: 1.5rem; /* Space from navigation */
}

.auth-buttons .btn {
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none; /* Remove underline for buttons */
}

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

.btn-register:hover {
  background-color: #fff;
}

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

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

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001; /* Above nav */
}

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

/* Footer styles */
.site-footer {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  padding: 2rem 0;
  margin-top: 3rem; /* Space from content */
  font-size: 0.9rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-base);
}

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

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

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

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

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

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  position: relative;
}

.copyright {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.7);
}

.scroll-to-top {
  position: fixed; /* Fixed position */
  bottom: 20px;
  right: 20px;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, opacity 0.3s ease;
  opacity: 0; /* Hidden by default */
  visibility: hidden;
  z-index: 999;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background-color: #fff; /* Lighter on hover */
}

.scroll-to-top svg {
  fill: var(--primary-color);
}

/* Responsive styles */
@media (max-width: 768px) {
  body {
    padding-top: 120px; /* Adjust for taller mobile header with buttons */
  }

  .site-header {
    padding: 0.5rem 0; /* Adjust overall header padding on mobile */
  }

  .header-container {
    display: grid; /* Use grid for complex mobile layout */
    grid-template-columns: auto 1fr auto; /* Hamburger | Logo (centered) | Empty space */
    grid-template-rows: auto auto; /* Row 1: Hamburger/Logo, Row 2: Auth Buttons */
    gap: 0.5rem 0; /* Vertical gap between rows */
    align-items: center;
    padding: 0 var(--padding-base);
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    grid-column: 1;
    grid-row: 1;
    justify-self: start; /* Align to the start of the grid cell */
  }

  .logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center; /* Center the logo within its grid cell */
    text-align: center; /* Ensure text is centered within the logo's own box */
  }

  .auth-buttons {
    grid-column: 1 / -1; /* Span all columns */
    grid-row: 2; /* Place on the second row */
    display: flex;
    justify-content: center; /* Center buttons horizontally */
    gap: 1rem;
    margin-left: 0; /* Override desktop margin */
    padding-top: 0.5rem; /* Add some padding above buttons */
  }

  .main-nav {
    position: absolute;
    top: 100%; /* Position below the entire header (including buttons) */
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default */
    flex-direction: column;
    text-align: center;
    padding: 1rem 0;
    z-index: 999; /* Below hamburger menu */
  }

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

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

  .main-nav li {
    width: 100%;
  }

  .main-nav a {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

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

  /* Hamburger menu animation */
  .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-grid {
    grid-template-columns: 1fr; /* Stack columns on mobile */
    text-align: center;
  }

  .footer-column h3 {
    margin-top: 1.5rem;
  }

  .footer-nav ul {
    align-items: center; /* Center footer links */
  }

  .scroll-to-top {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}