/* Base Styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 60px 0 0; /* Default padding for fixed header on desktop */
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
}

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

/* Header Styles */
.site-header {
  background-color: #2c3e50; /* Dark blue-grey for professionalism */
  color: #fff;
  padding: 15px 0; /* Original padding */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: fixed; /* Make header sticky */
  top: 0;
  width: 100%;
  z-index: 1000; /* Ensure it stays on top of other content */
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header .logo {
  font-size: 28px;
  font-weight: bold;
  color: #007bff; /* Primary color for logo */
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.site-header .logo:hover {
  color: #ffc107; /* Secondary color on hover */
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.main-nav li {
  margin-left: 25px;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: #ffc107; /* Secondary color for hover/active */
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: #ffc107; /* Secondary color for underline */
  transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.header-actions {
  display: flex; /* Show buttons on desktop */
  align-items: center;
  gap: 10px; /* Space between buttons */
}

.header-actions .btn {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap; /* Prevent buttons from wrapping */
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.header-actions .btn-register {
  background-color: #007bff; /* Primary color */
  color: #fff;
  border: 1px solid #007bff;
}

.header-actions .btn-register:hover {
  background-color: #0056b3; /* Darker primary */
  border-color: #0056b3;
}

.header-actions .btn-login {
  background-color: transparent;
  color: #007bff; /* Primary color */
  border: 1px solid #007bff;
}

.header-actions .btn-login:hover {
  background-color: #007bff;
  color: #fff;
}

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

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Footer Styles */
.site-footer {
  background-color: #34495e; /* Slightly darker blue-grey for footer */
  color: #ecf0f1;
  padding: 40px 0 20px;
  font-size: 14px;
}

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

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

.footer-col h3 {
  color: #007bff; /* Primary color for footer headings */
  font-size: 18px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

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

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

.footer-col a:hover {
  color: #ffc107; /* Secondary color on hover */
}

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

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-bottom p {
  margin: 0;
}

.back-to-top {
  background-color: #007bff; /* Primary color */
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  visibility: hidden;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}

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

.back-to-top:hover {
  background-color: #ffc107; /* Secondary color */
}

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

  .site-header .container {
    flex-direction: row; /* Keep as row for top line */
    flex-wrap: wrap; /* Allow items to wrap to next line */
    justify-content: flex-start; /* Hamburger on the far left */
    align-items: center;
    padding-top: 10px; /* Add some vertical padding for mobile */
    padding-bottom: 10px;
    gap: 0; /* Reset gap */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: 1; /* Place hamburger first */
    margin-right: 0; /* Reset any auto margins */
  }

  .site-header .logo {
    font-size: 24px;
    order: 2; /* Place logo second */
    flex-grow: 1; /* Allow logo to take remaining space in the row */
    text-align: center; /* Center the logo text */
    margin: 0; /* Reset margins */
  }

  .main-nav {
    /* display: none; Remove this as it prevents transform from working */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.95); /* Semi-transparent dark blue-grey */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999; /* Below sticky header but above content */
    transform: translateX(100%); /* Initially off-screen */
    transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out; /* Add visibility to transition */
    visibility: hidden; /* Hide initially, prevent interaction */
    order: 4; /* Assign order, though it's fixed */
  }

  body.nav-open .main-nav {
    transform: translateX(0%); /* Slide in */
    visibility: visible; /* Make visible */
  }

  .main-nav ul {
    flex-direction: column;
    text-align: center;
  }

  .main-nav li {
    margin: 15px 0;
  }

  .main-nav a {
    font-size: 20px;
    padding: 10px 0;
  }

  .header-actions {
    display: flex; /* Show buttons on mobile */
    order: 3; /* Place buttons after logo */
    flex-basis: 100%; /* Force buttons to wrap to a new line */
    justify-content: center; /* Center buttons horizontally */
    margin-top: 15px; /* Add space between top row and buttons */
    width: 100%; /* Ensure full width for centering */
  }

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

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

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

  .footer-columns {
    flex-direction: column;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
  }

  .back-to-top {
    bottom: 15px;
    right: 15px;
  }
}