/* Header Container */
.ptrb-header-container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 6 var(--spacing-md);
}

/* Header Base */
header {
  background-color: #275a89;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
}

/* Navigation Bar */
.ptrb-header-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  position: relative;
}

/* Logo Container */
.ptrb-logo {
  display: flex;
  align-items: center;
}

.ptrb-logo img {
  height: 80px;
  width: auto;
  /* Changed from glow to shadow effect */
  opacity: 0.85;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
}

/* Optional: Add hover effect to make logo more visible on hover */
.ptrb-logo img:hover {
  opacity: 1;
  filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.4));
}

/* Navigation Menu */
.ptrb-header-navbar-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.ptrb-header-nav-item {
  position: relative;
  margin-left: var(--spacing-sm);
}

.ptrb-header-nav-link {
  color: white;
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  display: block;
  font-weight: 500;
  transition: var(--transition-normal);
  font-size: 20px;
  position: relative;
}

.ptrb-header-nav-link:hover,
.ptrb-header-nav-link:focus {
  color: white;
}

/* Underline effect on hover */
.ptrb-header-nav-link:after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: white;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.ptrb-header-nav-link:hover:after,
.ptrb-header-nav-link:focus:after {
  width: 70%;
}

/* User Dropdown Menu */
.ptrb-user-menu {
  position: relative !important;
  z-index: 9999 !important;
}

/* Ensure the dropdown menu displays properly */
.ptrb-header-dropdown-menu {
  display: none;
  position: absolute !important;
  background-color: #fff !important;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 99999 !important;
  border-radius: 4px;
  padding: 8px 0;
  top: 100%;
  right: 0;
  list-style: none;
}

/* Fix hover behavior */
.ptrb-user-menu:hover .ptrb-header-dropdown-menu {
  display: block;
}

/* Fix the dropdown item styling */
.ptrb-header-dropdown-item {
  color: var(--text-dark, #333);
  text-decoration: none;
  padding: 8px 16px;
  display: block;
  font-size: 14px;
  transition: all 0.2s ease;
}

.ptrb-header-dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color, #275a89);
}

/* Mobile Menu Toggle */
.ptrb-header-navbar-toggler {
  display: none;
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: white;
  padding: var(--spacing-xs);
}

/* Active State for Navigation */
.ptrb-header-nav-item.active .ptrb-header-nav-link {
  color: white;
}

.ptrb-header-nav-item.active .ptrb-header-nav-link:after {
  width: 70%;
}

/* Main Content Container (to maintain consistent spacing) */
main.ptrb-header-container {
  min-height: calc(100vh - 80px); /* Adjust based on your header height */
}

/* Fix for body to prevent horizontal scrolling */
body {
  overflow-x: hidden;
  width: 100%;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .ptrb-header-navbar {
    flex-wrap: wrap;
  }

  .ptrb-header-navbar-toggler {
    display: block;
    order: 2;
  }

  .ptrb-logo {
    order: 1;
  }

  /* Modified mobile menu to overlay content instead of pushing it down */
  .ptrb-header-navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    width: 100%;
    order: 3;
    display: none;
    background-color: white;
    padding: var(--spacing-xs) 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    border-top: 1px solid var(--border-light);
  }

  .ptrb-header-navbar-menu.active {
    display: flex;
  }

  .ptrb-header-nav-item {
    width: 100%;
    margin-left: 0;
  }

  .ptrb-header-nav-link {
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-dark, #333);
  }

  .ptrb-header-nav-link:after {
    background-color: var(--primary-color, #275a89);
  }

  .ptrb-header-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: var(--bg-gray, #f5f5f5);
    display: none;
    padding-left: var(--spacing-sm);
    width: 100%;
    overflow: visible;
  }

  .ptrb-user-menu:hover .ptrb-header-dropdown-menu {
    display: none; /* Override desktop hover behavior */
  }

  .ptrb-user-menu.active .ptrb-header-dropdown-menu {
    display: block;
  }

  /* Add a tap/click behavior for mobile */
  .ptrb-user-menu > .ptrb-header-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .ptrb-user-menu > .ptrb-header-nav-link::after {
    content: "▼";
    font-size: var(--font-size-xs);
    margin-left: var(--spacing-xs);
    position: static;
    width: auto;
    height: auto;
    background-color: transparent;
  }

  /* Adjust logo effects for mobile if needed */
  .ptrb-logo img {
    opacity: 0.9; /* Slightly higher opacity on mobile for better visibility */
  }
}

/* Additional JavaScript for Mobile Dropdown */
@media (max-width: 768px) {
  /* This will be handled by the JavaScript you provided */
}