body {
  overflow-x: hidden;
}

/*
  Base Styles
  -----------------------------------------------------------------------------
*/
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --text-dark: #212529;
  --text-light: #f8f9fa;
  --bg-light: #f8f9fa;
  --bg-dark: #343a40;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
}

a {
  text-decoration: none;
  color: inherit;
}

/*
  Header and Navigation (Updated for centering)
  -----------------------------------------------------------------------------
*/
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background-color: #fff;
  width: 100%;
  box-shadow: 0 2px 4px var(--shadow-color);
  z-index: 1000;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-links {
  list-style: none;
  margin: 0 auto; /* The key to centering on desktop */
  padding: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.nav-links > li > a:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

.hamburger {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
}

/*
  Dropdown Menu
  -----------------------------------------------------------------------------
*/
.tools-dropdown {
  position: relative;
}

.tools-dropdown > a {
  cursor: pointer;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; /* No gap between the trigger and the menu */
  left: 50%;
  transform: translateX(-70%);
  background-color: #fff;
  box-shadow: 0 4px 8px var(--shadow-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  min-width: 600px;
  max-width: 1200px;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
  transition: all 0.3s ease;
  visibility: hidden;
  z-index: 1000;
  opacity: 0;
}

.tools-dropdown:hover .dropdown-menu {
  display: grid;
  visibility: visible;
  opacity: 1;
}

.dropdown-section {
  display: flex;
  flex-direction: column;
}

.dropdown-section h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.dropdown-section a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.dropdown-section a:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

.dropdown-section a i {
  color: var(--secondary-color);
  font-size: 1.1rem;
}

.dropdown-section a:hover i {
  color: var(--primary-color);
}


/*
  Mobile Menu and Media Queries
  -----------------------------------------------------------------------------
*/

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%; /* Position off-screen to the right */
  width: 100%;
  max-width: 300px;
  height: 100vh;
  background-color: #f8f9fa;
  color: #333;
  padding: 2rem 1rem;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-in-out;
  z-index: 1001;
  overflow-y: auto;
}

.mobile-menu.active {
  right: 0; /* Slide in from the right */
}

.mobile-menu .close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem; /* Adjust close button position */
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
}

.mobile-menu .mobile-nav-links {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.mobile-menu .mobile-nav-links li {
  border-bottom: 1px solid #eee;
}

.mobile-menu .mobile-nav-links li:last-child {
  border-bottom: none;
}

.mobile-menu .mobile-nav-links a {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: color 0.2s;
}

.mobile-menu .mobile-nav-links a:hover {
  color: #007bff;
}

.mobile-dropdown-toggle a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-dropdown-content {
  display: none;
  padding-left: 1rem;
}

.mobile-dropdown-content.active {
  display: block;
}

.mobile-dropdown-content .dropdown-section {
  margin-bottom: 1rem;
}

.mobile-dropdown-content .dropdown-section h4 {
  font-size: 0.9rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.mobile-dropdown-content .dropdown-section a {
  padding: 0.5rem 0;
  font-weight: 400;
}

/* Hide desktop nav on small screens, show hamburger */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: block;
  }
}

/* Hide hamburger and mobile menu on large screens */
@media (min-width: 769px) {
  .hamburger,
  .mobile-menu {
    display: none;
  }
}

/*
  Footer
  -----------------------------------------------------------------------------
*/
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--secondary-color);
  font-size: 0.9rem;
  background-color: #fff;
}

footer a {
  color: var(--primary-color);
  font-weight: 600;
}
