/* Base styles */
:root {
  --primary-color: #0A244A;
  --secondary-color: #FFD700;
  --text-color-light: #ffffff;
  --text-color-dark: #333333;
  --bg-dark: #1a1a1a;
  --bg-light: #f4f4f4;
  --border-color: #333333;
}

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

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-color-light);
  background-color: var(--bg-dark);
  padding-top: 5rem; /* Added to account for the fixed header height */
}

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

a:hover {
  color: #fff;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Header styles */
.site-header {
  background-color: var(--primary-color);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: fixed; /* Changed to fixed position */
  top: 0;
  width: 100%;
  z-index: 1000; /* Ensure header stays on top */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  position: relative; /* Added for logo absolute positioning on mobile */
}

.site-header .logo {
  font-family: 'Georgia', serif;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  transition: color 0.3s ease;
}

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

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

.main-nav .nav-list a {
  color: var(--text-color-light);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav .nav-list 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 .nav-list a:hover::after,
.main-nav .nav-list a.active::after {
  width: 100%;
}

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

.auth-buttons {
  display: flex;
  gap: 1rem;
}

.auth-buttons .btn {
  padding: 0.7rem 1.2rem;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: inline-block; /* Added for <a> tags to apply padding/height correctly */
  text-align: center; /* Added for <a> tags to center text */
  line-height: normal; /* Ensure text baseline is normal for <a> */
}

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

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

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

.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-color-light);
  transition: all 0.3s ease-in-out;
}

.hamburger-menu.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Footer styles */
.site-footer {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 0 1.5rem;
}

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

.footer-column p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #ccc;
}

.footer-column ul {
  padding-left: 0;
}

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

.footer-column ul li a {
  color: #ccc;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-column ul li a:hover {
  color: var(--secondary-color);
}

.newsletter-form {
  display: flex;
  margin-top: 1rem;
}

.newsletter-form input[type="email"] {
  flex-grow: 1;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 5px 0 0 5px;
  background-color: #2a2a2a;
  color: var(--text-color-light);
  font-size: 0.9rem;
}

.newsletter-form input[type="email"]::placeholder {
  color: #888;
}

.newsletter-form button {
  padding: 0.8rem 1.2rem;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: none;
  border-radius: 0 5px 5px 0;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
  background-color: #fff;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: #aaa;
  position: relative;
}

.footer-bottom .back-to-top {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.footer-bottom .back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Responsive styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 3.25rem; /* Ensure header has enough base height for hamburger */
  }

  .site-header .logo {
    font-size: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    white-space: nowrap;
    width: auto;
    text-align: center;
  }

  /* Auth buttons - always visible on mobile, centered below logo in a separate area */
  .auth-buttons {
    display: flex; /* Make them visible, overriding desktop display */
    flex-direction: row; /* Keep buttons side-by-side */
    justify-content: center; /* Center the buttons within their container */
    gap: 1rem;
    position: absolute;
    top: 3.75rem; /* Position below the header's top row (3.25rem height + 0.5rem buffer) */
    left: 0;
    width: 100%;
    padding: 0.7rem 0;
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 7rem; /* Adjusted to be below the new auth-buttons position (3.75rem top + ~2.5rem height + 0.75rem buffer) */
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
    z-index: 999;
  }

  .main-nav.open {
    display: flex;
    z-index: 1001;
  }

  /* NEW: Styles for vertical menu on mobile */
  .main-nav .nav-list {
    flex-direction: column; /* Stack items vertically */
    gap: 0; /* Remove horizontal gap */
    padding: 0; /* Ensure no padding on the ul itself */
  }

  .main-nav .nav-list li {
    width: 100%; /* Ensure each list item takes full width */
  }

  .main-nav .nav-list a {
    display: block; /* Make the anchor tag fill its parent li */
    padding: 0.8rem 1.5rem; /* Add vertical padding for better spacing */
    text-align: center; /* Center the text */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Add a separator */
    color: var(--text-color-light); /* Ensure color is correct */
  }

  .main-nav .nav-list li:last-child a {
    border-bottom: none; /* No border for the last item */
  }

  /* Adjust the ::after pseudo-element for the underline */
  .main-nav .nav-list a::after {
    left: 50%; /* Center the underline */
    transform: translateX(-50%);
    bottom: 0.25rem; /* Adjust vertical position */
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
  }

  .main-nav .nav-list a:hover::after,
  .main-nav .nav-list a.active::after {
    width: 60%; /* Make the underline appear centered and shorter */
  }

  .hamburger-menu {
    display: flex;
    order: -1; /* Pushed to the far left */
  }

  /* Adjust body padding-top for the taller header on mobile */
  body {
    padding-top: 7rem; /* Calculated: Header base height (~3.25rem) + auth buttons height (~2.5rem) + buffer */
  }

  /* Remove .auth-buttons.open styles as they are no longer toggled */
  /* The original .auth-buttons.open block is removed/merged */

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-column h3 {
      margin-top: 1.5rem;
  }

  .newsletter-form {
    justify-content: center;
  }
  
  .newsletter-form input[type="email"] {
      max-width: 250px;
  }

  .footer-bottom .back-to-top {
    right: 1rem;
    bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
    .site-header .logo {
        font-size: 1.8rem;
    }
    .auth-buttons .btn {
        width: auto;
        padding: 0.7rem 1rem;
    }
    .auth-buttons {
        gap: 0.5rem;
    }
}