/* Top Bar Styles */
.top-bar,
.mobile-top-bar {
  background-color: #4169e1;
  padding: 7%;
}

.top-bar a {
  font-size: 14px;
  text-decoration: none;
  transition: opacity 0.3s;
}

.top-bar a:hover {
  opacity: 0.8;
}

.top-logo {
  height: 30px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* Menu Toggle Button */
.menu-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  padding: 0;
}

.menu-toggle:focus {
  outline: none;
}

/* Navbar Styles */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 7px 6%;
}

.logo {
  height: 50px;
  width: auto;
}

.navbar-nav {
  gap: 1rem;
}

.navbar-nav .nav-link {
  color: #333;
  font-weight: 500;
  padding: 8px 20px;
  transition: color 0.3s;
  text-decoration: none;
}

.navbar-nav .nav-link:hover {
  color: #2574df;
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #2574df;
  transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
  width: 100%;
}

.dropdown {
  position: relative; /* Reference point for dropdown menu positioning */
}

/* Link inside the dropdown (hover effect applied) */
.dropdown > a {
  display: block;
  padding: 0.5rem 1rem;
  background-color: transparent; /* Default background */
  color: #fff; /* Default text color */
  transition: all 0.3s ease;
  border-radius: 0.5rem; /* Rounded corners for hover effect */
}

/* Apply hover effect to both the parent link and dropdown */
.dropdown:hover > a {
  background-color: #fff; /* Green background (like in the image) */
  color: #000;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  left: 0;
  z-index: 1050;
  min-width: 12rem; /* Ensure enough space for dropdown items */
  background-color: #bdd5ff; /* Match parent hover background */
  border-radius: 0.5rem; /* Rounded corners */
  padding: 0.5rem 0; /* Inner padding for dropdown items */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow */
  display: none; /* Hide by default */
}

/* Show dropdown menu on hover */
.dropdown:hover .dropdown-menu {
  display: block; /* Display dropdown when parent is hovered */
}

/* Dropdown Items */
.dropdown-item {
  padding: 0.5rem 1rem;
  background-color: transparent; /* Default background */
  color: #000; /* Default text color */
  text-decoration: none; /* Remove underline */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hover effect for dropdown items */
.dropdown-item:hover {
  background-color: #ffffff; /* Highlight background */
  color: #000; /* Match the dropdown hover color */
}

/* Sidebar Styles */
.offcanvas {
  width: 300px;
}

.sidebar-logo {
  padding: 1rem 0;
}

.sidebar-menu {
  padding: 1rem 0;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-heading {
  color: #4169e1;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
}

.sidebar-item {
  margin-bottom: 1rem;
}

.sidebar-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  display: block;
  padding: 0.5rem 0;
  transition: color 0.3s;
}

.sidebar-link:hover {
  color: #4169e1;
}

.submenu {
  padding-left: 1rem;
  margin-top: 0.5rem;
}

.submenu a {
  color: #666;
  text-decoration: none;
  display: block;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.submenu a:hover {
  color: #4169e1;
}

.sidebar-menu ul li a {
  color: #666;
  text-decoration: none;
  display: block;
  padding: 0.4rem 0;
  transition: color 0.3s;
}

.sidebar-menu ul li a:hover {
  color: #4169e1;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .navbar-nav {
    padding-top: 1rem;
    text-align: center;
  }

  .nav-link {
    padding: 0.5rem 0;
  }

  .dropdown-menu {
    text-align: center;
  }

  /* Center logo in responsive view */
  .navbar-brand {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
  }

  .logo {
    height: 65px;
    margin: 0 auto;
  }
}

@media (max-width: 575.98px) {
  .mobile-top-bar {
    text-align: center;
  }

  .logo {
    height: 50px;
    display: block;
    margin: 0 auto;
  }

  .mobile-top-bar .d-flex {
    gap: 0.5rem;
  }

  .top-logo {
    height: 25px;
  }

  /* Additional centering for smaller screens */
  .navbar-brand {
    padding: 10px 0;
  }
}
/* Active state styles */
.nav-link.active {
  color: #4169e1 !important;
  position: relative;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background-color: #4169e1;
}

.dropdown-item.active {
  background-color: #4169e1 !important;
  color: white !important;
}

.sidebar-link.active {
  color: #4169e1 !important;
  font-weight: 600;
}

.submenu a.active {
  color: #4169e1 !important;
  font-weight: 600;
}

.dropdown-toggle.active {
  opacity: 0.8 !important;
}

/* Ensure active states are visible in mobile */
@media (max-width: 991.98px) {
  .nav-link.active::after {
    width: 30px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media screen and (min-width: 1680px) {
  .top-bar,
  .mobile-top-bar {
    padding: 6%;
  }

  .navbar {
    padding: 0 6%;
  }
}
