/* ================== */
/* Header Styles      */
/* ================== */

header {
  position: relative; /* Context for absolute elements if any */
  color: white; /* Default text color for header children */
}

.animated-gradient { /* Applied to the main header section */
  /* margin-bottom: 0; /* Removed, nav might not be directly below or sticky */
  background: linear-gradient(
    45deg,
    var(--gradient-start),
    var(--gradient-middle),
    var(--gradient-end)
  );
  background-size: 200% 200%;
  animation: gradientAnimation 10s ease infinite; /* Keyframes in animations.css */
  padding: 4rem 2rem 5rem; /* Increased padding for more impact */
  text-align: center;
}

.header-content {
  max-width: 900px; /* Slightly increased max-width */
  margin: 0 auto;
  padding: 1rem 15px; /* Adjusted padding, top/bottom handled by .animated-gradient */
  position: relative; /* For potential z-indexing if needed */
  z-index: 1;
}

/* Using Inter font styles defined in base.css */
.header-content h1 {
  font-size: 3.5rem; /* Adjusted for impact, consider h1 style from base.css */
  margin: 0.5rem 0 1.5rem; /* Adjusted margins */
  font-weight: 700;
  line-height: 1.2;
  color: white; /* Ensure color */
  text-shadow: 0 3px 6px rgba(0,0,0,0.35); /* Enhanced text shadow */
  text-rendering: optimizeLegibility;
}

.header-content p {
  font-size: 1.3rem; /* Adjusted for readability, consider bodyLarge from base.css */
  margin: 0 auto 2.5rem; /* Adjusted margins */
  opacity: 0.95; /* Slightly more opaque */
  max-width: 650px;
  color: white; /* Ensure color */
  text-shadow: 0 2px 4px rgba(0,0,0,0.25); /* Enhanced text shadow */
}

/* Hero Rive Animation Container (moved from components.css) */
.hero-animation {
  margin: 0 auto 2.5rem; /* Increased bottom margin */
  max-width: 350px; /* Matches iframe width */
  height: 350px;    /* Matches iframe height */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* If Rive animation has parts that might go out of bounds */
}

.rive-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Start hidden, JS adds .rive-loaded */
    transition: opacity 0.5s ease-in-out;
}

.rive-loaded {
    opacity: 1;
}

.rive-iframe {
    /* Styles are mostly inline in HTML, but defaults can be here */
    max-width: 100%;
    max-height: 100%;
}


/* ===================== */
/* Navigation Styles     */
/* ===================== */

nav {
  background-color: var(--card-background);
  padding: 0.75rem 1rem; /* Adjusted padding */
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Slightly softer shadow */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px; /* Standard horizontal padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 65px; /* Base height */
}

/* Navigation Logo */
.nav-logo-link {
  display: flex; /* For alignment if there was text next to logo */
  align-items: center;
  flex-shrink: 0; /* Prevent logo from shrinking */
}
.nav-logo-img {
  height: 40px; /* Adjust as needed */
  width: auto;
  transition: transform 0.3s ease;
}
.nav-logo-img:hover {
  transform: scale(1.08);
}


/* Navigation Menu List (ul) */
.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Reduced gap for tighter main links */
  margin: 0; /* Reset margin */
  padding: 0; /* Reset padding */
  margin-left: auto; /* This pushes the entire menu to the right */
}

.nav-menu li {
  display: flex; /* Align icon and text nicely */
  align-items: center;
}

/* Navigation Links (a) */
.nav-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.6rem 1.2rem; /* Slightly more padding */
  border-radius: 6px; /* Softer radius */
  position: relative;
  transition: all 0.25s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem; /* Increased gap for icon and text */
  font-weight: 500; /* Medium weight for nav links */
  font-size: 0.95rem; /* Slightly smaller for a cleaner look */
}

.nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.08); /* Subtle themed background */
}
.nav-link.active {
  color: var(--primary-color);
  font-weight: 600; /* Bolder active link */
}
.nav-link.active::after { /* Underline for active link */
  content: '';
  position: absolute;
  bottom: -2px; /* Position below the padding */
  left: 50%;
  transform: translateX(-50%);
  width: 60%; /* Adjust width of underline */
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 1px;
}


/* Icons within nav menu links */
.nav-menu .nav-link i {
  font-size: 1.1rem; /* Slightly smaller icons */
  line-height: 1; /* Ensure icon doesn't affect line height */
}

/* Specific style for Login/Sign up button in Nav */
.nav-link-cta {
  /* margin-left: auto; /* REMOVED: This was pushing only this button to the far right */
  padding: 0.6rem 1.5rem !important; /* Override .nav-link padding if needed */
  font-size: 0.9rem !important; /* Consistent font size with other buttons */
  /* Inherits .login-signup-button styles for main appearance */
}
.nav-link-cta:hover {
    /* login-signup-button hover styles will apply */
    background-color: var(--secondary-color) !important; /* Example override */
    color: white !important;
}


/* --- Mobile Navigation Toggle (Hamburger) --- */
.nav-toggle {
    display: none;
    opacity: 0; /* Keep it functional but invisible */
    width: 0;
    height: 0;
    position: absolute; /* Allows label to be positioned over it */
}

.nav-toggle-label {
    display: none; /* Hidden by default, shown on mobile */
    /* Position will be set in media query */
    cursor: pointer;
    width: 28px; /* Slightly smaller hamburger */
    height: 22px;
    z-index: 1002; /* Above menu, below potential modals */
    position: relative; /* For pseudo elements */
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background: var(--text-color);
    height: 3px;
    width: 100%;
    position: absolute;
    left: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bouncy transition */
    border-radius: 2px;
}

.nav-toggle-label span {
    top: 50%;
    transform: translateY(-50%);
}
.nav-toggle-label span::before {
    content: '';
    top: -8px;
}
.nav-toggle-label span::after {
    content: '';
    top: 8px;
}


/* ============================ */
/* Responsive Header/Nav Styles */
/* ============================ */

@media (max-width: 768px) {
  /* --- Header Adjustments --- */
  .animated-gradient {
    padding: 2rem 1rem 3rem;
  }
  .header-content {
    padding: 1rem 10px;
  }
  .header-content h1 {
    font-size: 2.6rem; /* Smaller heading on mobile */
  }
  .header-content p {
    font-size: 1.1rem; /* Smaller paragraph on mobile */
    margin-bottom: 2rem;
  }
  .hero-animation {
    max-width: 280px; /* Adjust Rive animation size for mobile */
    height: 280px;
    margin-bottom: 1.5rem;
  }


  /* --- Main Navigation Adjustments (Mobile Menu) --- */
  .nav-container {
    /* justify-content: space-between; Logo left, hamburger right is default */
  }

  /* Show hamburger menu trigger and position it */
  .nav-toggle-label {
      display: block;
      /* If logo is present, hamburger is usually pushed by nav-menu becoming block */
      /* If nav-menu is empty on desktop, you might need to position it manually */
      /* For now, assuming the flex layout will position it correctly */
  }

  .nav-menu {
    position: fixed;
    top: 0; /* Align with top of viewport */
    left: 0;
    width: 280px; /* Width of the slide-out menu */
    height: 100vh; /* Full viewport height */
    background: var(--card-background);
    flex-direction: column;
    align-items: stretch; /* Stretch items to full width */
    padding: 60px 0 20px; /* Top padding for spacing, bottom padding */
    transform: translateX(-100%);
    transition: transform 0.35s ease-in-out;
    z-index: 1001; /* Below label/checkbox overlay */
    overflow-y: auto; /* Scroll if content exceeds height */
    gap: 0; /* Reset gap for vertical items */
    box-shadow: 5px 0 15px rgba(0,0,0,0.15); /* Shadow for the menu */
    margin-left: 0; /* Reset desktop margin */
  }

  .nav-menu li {
    width: 100%;
  }
  .nav-menu .nav-link {
    width: 100%;
    padding: 1rem 1.5rem; /* Generous padding for touch targets */
    border-radius: 0;
    justify-content: flex-start; /* Align text/icon left */
    border-bottom: 1px solid var(--border-color); /* Separator */
    font-size: 1rem; /* Increase font size slightly for mobile menu */
  }
   .nav-menu li:last-child .nav-link {
       border-bottom: none; /* Remove border on last item */
   }
   .nav-menu .nav-link.active::after {
       display: none; /* Hide underline for active link in mobile menu, active state is enough */
   }
   .nav-link-cta { /* Reset specific CTA styles for mobile menu */
       margin-left: 0;
       background-color: transparent !important; /* Make it look like a regular link */
       color: var(--text-color) !important;
       border: none !important;
       box-shadow: none !important;
       font-weight: 500 !important; /* Match other nav links */
   }
    .nav-link-cta:hover {
        background-color: rgba(var(--primary-color-rgb), 0.08) !important;
        color: var(--primary-color) !important;
    }


  /* Hamburger icon animation (X shape) when nav-toggle is checked */
  .nav-toggle:checked + .nav-toggle-label span {
    background: transparent; /* Middle bar fades out */
  }
  .nav-toggle:checked + .nav-toggle-label span::before {
    transform: rotate(45deg);
    top: 0;
  }
  .nav-toggle:checked + .nav-toggle-label span::after {
    transform: rotate(-45deg);
    top: 0;
  }

  /* Show menu when checkbox is checked */
  .nav-toggle:checked ~ .nav-menu { /* Target the menu relative to the checkbox */
      transform: translateX(0); /* Slide menu in */
  }

  /* Overlay for when mobile menu is open */
  /* Consider adding an overlay to dim the page content */
  /*
  .nav-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.5);
      z-index: 1000;
  }
  .nav-toggle:checked ~ .nav-overlay {
      display: block;
  }
  */

} /* End of @media (max-width: 768px) */