/* Custom Header Layout Styles - Based on Tailwind Design */

/* Reset main content area */
.site-main {
  margin: 0 !important;
  padding: 0 !important;
}

.site-header {
  display: block !important;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(34, 139, 178, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0;
  max-width: 100% !important;
}

.header-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-left .site-branding {
  margin-right: 0;
  text-align: left;
  display: flex;
  align-items: center;
}

.header-left .site-logo {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
  text-align: left;
  width: auto;
  display: flex;
  align-items: center;
}

.header-left .site-logo .custom-logo {
  height: 4rem; /* 64px equivalent to h-16 */
  width: auto;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.header-left .site-logo .custom-logo:hover {
  opacity: 0.9;
}

.header-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-center .primary-navigation {
  position: static;
  margin-left: 0;
  top: auto;
  right: auto;
  display: none; /* Hidden on mobile, shown on lg+ */
}

.header-center .primary-navigation > .primary-menu-container {
  position: static;
  padding: 0;
  background-color: transparent;
  transform: none;
  visibility: visible;
  opacity: 1;
}

/* Show navigation on large screens */
@media (min-width: 1024px) {
  .header-center .primary-navigation {
    display: flex;
    align-items: center;
  }
}

.header-right {
  flex: 0 0 auto;
  display: none; /* Hidden on mobile, shown on lg+ */
  align-items: center;
  gap: 0.75rem;
}

/* Show header-right on large screens */
@media (min-width: 1024px) {
  .header-right {
    display: flex;
  }
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  color: #374151;
  height: 2.25rem; /* 36px */
  border-radius: 0.375rem;
  padding: 0 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.login-button:hover,
.login-button:focus {
  background-color: #f9fafb;
  color: #111827;
  text-decoration: none;
  outline: none;
}

.login-button:focus {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.logout-button {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.logout-button:hover,
.logout-button:focus {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

/* Mobile hamburger button */
.mobile-menu-button {
  display: block;
  padding: 0.5rem;
  color: #228bb2;
  background: none;
  border: none;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.mobile-menu-button:hover {
  background-color: rgba(34, 139, 178, 0.1);
}

.mobile-menu-button svg {
  width: 24px;
  height: 24px;
}

/* Hide mobile button on large screens */
@media (min-width: 1024px) {
  .mobile-menu-button {
    display: none;
  }
}

/* Mobile menu container */
.mobile-menu {
  display: none;
  margin-top: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  max-height: 0;
  opacity: 0;
}

.mobile-menu.open {
  display: block;
  max-height: 500px;
  opacity: 1;
}

.mobile-menu nav {
  padding-bottom: 1rem;
}

.mobile-menu nav > * + * {
  margin-top: 1rem;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #374151;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
}

.mobile-menu a:hover {
  color: #228bb2;
}

.mobile-menu .mobile-login-section {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.mobile-menu .login-button {
  display: inline-flex;
  width: 100%;
  justify-content: center;
}

/* Mobile menu list styles */
.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-list li {
  margin: 0;
  padding: 0;
}

.mobile-nav-list li a {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  color: #374151;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
  border-bottom: 1px solid #f3f4f6;
}

.mobile-nav-list li a:hover {
  color: #228bb2;
}

.mobile-nav-list li:last-child a {
  border-bottom: none;
}

/* Mobile responsiveness */
@media (max-width: 1023px) {
  .site-header {
    padding: 1rem 0;
  }

  .header-left {
    flex: 1;
  }

  .header-center .primary-navigation {
    display: none;
  }
}

/* Desktop navigation styles */
@media (min-width: 1024px) {
  .menu-button-container {
    display: none !important;
  }

  .primary-menu-container {
    display: block !important;
  }

  #primary-menu-list {
    display: flex !important;
    flex-direction: row;
    gap: 2rem;
    justify-content: center;
    margin: 0;
    padding: 0;
    align-items: center;
  }

  #primary-menu-list li {
    margin: 0;
    list-style: none;
    position: relative;
  }

  #primary-menu-list li a {
    color: #0a0a0a; /* text-foreground equivalent */
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    display: block;
    font-size: 16px;
    line-height: 1.5rem;
  }

  #primary-menu-list li a:hover,
  #primary-menu-list li a:focus {
    color: #072b55; /* primary color - adjust to match your theme */
    text-decoration: none;
  }

  /* Current page indicator */
  #primary-menu-list li.current-menu-item a,
  #primary-menu-list li.current_page_item a {
    color: #072b55;
  }
}

/* Additional styling to match the design */
.header-main {
  min-height: 4rem; /* 64px equivalent */
}

/* Remove default WordPress navigation styling conflicts */
.primary-navigation .primary-menu-container {
  max-width: none;
}

/* Typography improvements */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Focus states for accessibility */
.login-button:focus,
#primary-menu-list li a:focus,
.mobile-menu-button:focus {
  outline: 2px solid #228bb2;
  outline-offset: 2px;
}

/* Hide WordPress default menu button */
.menu-button-container {
  display: none !important;
}

/* Smooth animations */
* {
  box-sizing: border-box;
}

.mobile-menu,
.login-button,
#primary-menu-list li a,
.mobile-menu-button {
  transition: all 0.2s ease;
}

.seperate-logout {
  display: none;
}

/* ============================================
   USER PROFILE DROPDOWN
   ============================================ */
.user-profile-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.user-profile-trigger:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.user-profile-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  color: #6b7280;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0a0a;
  line-height: 1.25rem;
  margin: 0;
}

.user-role {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1rem;
  margin: 0;
}

.dropdown-arrow {
  color: #6b7280;
  transition: transform 0.2s ease;
}

/* Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
  min-width: 12rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: all 0.2s ease;
}

.user-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0a0a;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 0.25rem;
}

.dropdown-separator {
  height: 1px;
  background-color: #e5e7eb;
  margin: 0.25rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f9fafb;
  color: #0a0a0a;
  text-decoration: none;
}

.dropdown-item-signout {
  color: #dc2626;
}

.dropdown-item-signout:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.dropdown-icon {
  flex-shrink: 0;
  color: inherit;
}

/* Mobile Responsiveness */
@media (max-width: 1023px) {
  .user-profile-dropdown {
    display: none;
  }

  /* Show user profile in mobile menu */
  .mobile-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
  }

  .mobile-user-profile .user-avatar {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
  }

  .mobile-user-profile .user-details {
    flex: 1;
  }

  .mobile-user-profile .user-name {
    font-size: 1rem;
    font-weight: 600;
  }

  .mobile-user-profile .user-role {
    font-size: 0.875rem;
  }
}

/* Show mobile user profile when logged in */
@media (max-width: 1023px) {
  .mobile-menu .mobile-user-profile {
    display: flex;
  }
}

header button:not(:hover):not(:active):not(.has-background) {
  background-color: transparent !important;
}

/* Dropdown arrow styling */
.primary-navigation .sub-menu-toggle {
  background: transparent;
  border: 0;
  padding: 0.25rem;
  border-radius: 0.375rem;
  margin-left: 0.25rem;
  color: #6b7280;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.primary-navigation .sub-menu-toggle .dropdown-arrow {
  transition: transform 0.2s ease;
}

.primary-navigation .sub-menu-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* Hide toggle button on desktop, show on mobile */
@media (min-width: 1024px) {
  .primary-navigation .sub-menu-toggle {
    display: none;
  }
}
.primary-navigation > div > .menu-wrapper > li > .sub-menu {
  width: 200px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
}
.primary-navigation > div > .menu-wrapper > li > .sub-menu li {
  background: #fff !important;
  border-radius: 12px !important;
  padding: 0 15px !important;
}
.primary-navigation > div > .menu-wrapper > li > .sub-menu li a:hover {
  background: hsl(357 71% 52%) !important;
  border-radius: 12px !important;
  padding-left: 15px !important;
}
.primary-navigation > div > .menu-wrapper > li > .sub-menu li a:hover {
  color: #fff !important;
}
