/* General Navbar Styling */
.navbar {
  /* UPDATED: Make the navbar sticky */
  position: sticky;
  top: 0;
  z-index: 1000; /* A high number to keep it on top */
  background-color: #333;
  padding: 1rem;
  font-family: sans-serif;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75em; /* Space between portrait and icon */
  transition: transform 0.2s ease-in-out;
}

/* ADD THIS RULE for the hover effect */
.nav-logo:hover {
  transform: scale(1.1); /* Makes the logo slightly larger on hover */
}

/* ADD THIS RULE to increase the icon size */
.nav-logo .material-icons {
  font-size: 1.8rem; /* Increased from the default size */
}

.nav-portrait {
  width: 32px;
  height: 32px;
  border-radius: 50%; /* Makes the image circular */
  object-fit: cover; /* Ensures the image fills the circle */
}

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

.nav-item {
  margin-left: 2rem;
}

.nav-links {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: block;
}

.nav-links:hover {
  background-color: #555;
  border-radius: 5px;
}

/* Dropdown Menu Styling */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #333;
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: 5px;
  min-width: 200px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: block;
  text-decoration: none;
}

.dropdown-menu li a:hover {
  background-color: #555;
}

/* Light Theme */
.navbar.navbar-light {
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.navbar.navbar-light .nav-logo,
.navbar.navbar-light .nav-links {
  color: #333;
}

.navbar.navbar-light .nav-links:hover {
  background-color: #f2f2f2;
}

.navbar.navbar-light .dropdown-menu {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
}

.navbar.navbar-light .dropdown-menu li a {
  color: #333;
}

.navbar.navbar-light .dropdown-menu li a:hover {
  background-color: #f2f2f2;
}

.navbar.navbar-light .menu-icon {
  color: #333; /* Sets the icon to a dark color */
}

/* --- Hamburger Menu Styles --- */
.menu-icon {
  display: none; /* Hidden by default on desktop */
  cursor: pointer;
  color: #fff; /* Or var(--text-color) if you want it to change with theme */
}

/* --- Responsive Styles for Mobile --- */
@media screen and (max-width: 768px) {
  .nav-container {
    /* Allow items to wrap and position the icon */
    flex-wrap: wrap;
  }

  .menu-icon {
    display: block; /* Show the icon on mobile */
  }

  .nav-menu {
    /* Instead of display: none */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;

    width: 100%;
    flex-direction: column;
    text-align: center;
  }

  .nav-menu.active {
    /* Instead of display: flex */
    max-height: 500px; /* A height larger than the menu will ever be */
  }

  .nav-item {
    margin: 1rem 0;
    width: 100%;
  }

  .nav-item.dropdown.active .dropdown-menu {
    display: block; /* Shows the dropdown when its parent has the 'active' class */
  }

  .dropdown-menu {
    position: static; /* Make dropdowns appear inline */
    display: none; /* Keep them hidden until clicked */
    background-color: #444; /* Slightly different color for sub-menu */
    box-shadow: none;
    width: 100%;
  }
}
