/* =========================================
   GLOBAL & RESET
   ========================================= */
html {
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #0f172a; /* Match your card bg if whole site is dark */
  color: #ffffff;
}

/* =========================================
   LAYOUT UTILITIES
   ========================================= */
.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
  width: 100%;
  box-sizing: border-box;
}

/* Container to center content globally (Optional but recommended) */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.card {
  background: #1e293b; /* Slightly lighter than body for contrast */
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: #4f46e5;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s ease, transform 0.1s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

/* =========================================
   NAVBAR FIXES (CRITICAL)
   ========================================= */

/* 1. The Nav Background Bar (Full Width) */
nav {
  position: relative; /* Change to 'fixed' if you want it sticky */
  top: 0;
  width: 100%;
  background-color: #0f172a;
  border-bottom: 1px solid #1e293b;
  z-index: 1000;
  /* Do NOT set max-width here, let the background stretch */
}

/* 2. The Inner Container (Constrained Width) */
/* This forces links to stay within 1200px even if screen is huge */
.nav-content {
  max-width: 1200px;
  margin: 0 auto; /* Centers the content */
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 3. Navigation Links List */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem; /* Space between links */
  align-items: center;
}

nav ul li {
  position: relative; /* Essential for dropdown positioning */
  flex-shrink: 0; /* Prevents links from squishing */
}

nav ul li a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  display: block;
  padding: 1rem 0; /* Hit area */
}

nav ul li a:hover {
  color: #4f46e5;
}

/* =========================================
   DROPDOWN FIXES
   ========================================= */

/* Desktop Dropdown */
nav ul li ul.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  
  /* FIX: Explicit width prevents stretching */
  width: 220px; 
  min-width: 200px;
  
  /* FIX: Ensure it doesn't stretch right */
  right: auto; 
  
  background-color: #1e293b;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  border: 1px solid #334155;
  padding: 0.5rem 0;
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 0;
  z-index: 1001;
}

/* Show dropdown on hover */
nav ul li:hover ul.dropdown {
  display: flex;
}

nav ul li ul.dropdown li {
  width: 100%;
}

nav ul li ul.dropdown li a {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

nav ul li ul.dropdown li a:hover {
  background-color: #334155;
  color: #fff;
}

/* =========================================
   MOBILE MENU FIXES
   ========================================= */

/* Mobile Menu Toggle Button (Hamburger) - Example Styling */
.mobile-menu-btn {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* The Mobile Dropdown Container */
#mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  
  /* FIX: Constrain width to parent container, not viewport */
  width: 100%; 
  max-width: 1200px; /* Match nav content max-width */
  
  right: auto; /* CRITICAL: Do not set right: 0 */
  
  background-color: #1e293b;
  border-top: 1px solid #334155;
  z-index: 999;
  display: none; /* Hidden by default, toggle via JS */
  flex-direction: column;
  padding: 1rem 0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* When mobile menu is active (via JS class) */
#mobile-menu.active {
  display: flex;
}

#mobile-menu a {
  padding: 1rem 1.5rem;
  color: white;
  text-decoration: none;
  border-bottom: 1px solid #334155;
}

#mobile-menu a:hover {
  background-color: #334155;
}

/* =========================================
   RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 768px) {
  /* Hide desktop links on mobile */
  nav ul.desktop-links {
    display: none;
  }

  /* Show hamburger button */
  .mobile-menu-btn {
    display: block;
  }

  /* Ensure mobile menu takes full width of screen on small devices */
  #mobile-menu {
    position: absolute;
    left: 0;
    width: 100%; /* Full screen width on mobile is okay */
    max-width: 100%;
  }
  
  .nav-content {
    padding: 0 1rem;
  }
}   
