/* =========================================
   HARD RESET & MODERN HEADER LAYOUT
   ========================================= */

/* 1. Main Header Container - The Canvas */
#header {
  height: 70px !important;
  /* line-height: 70px !important; */
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  position: relative;
  z-index: 999;
}

/* 2. The Grid - Enforcing straight lines */
#header .container {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  height: 100% !important;
  padding: 0 20px !important;
  max-width: 100% !important; /* Use full width for modern feel */
}

/* 3. Left Section (Logo + Mobile Menu) */
#header .float-start,
#header .left-side {
  display: flex !important;
  align-items: center !important;
  height: 60% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
}

#logo {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  margin-right: 32px !important;
  border: none !important;
  padding: 0 !important;
}

#logo a { 
  display: flex !important; 
  align-items: center !important; 
  height: 100%;
}

#logo img {
  max-height: 38px !important;
  height: auto !important;
  width: auto !important;
  object-fit: contain;
  margin-top: -4px !important; /* Force pull up */
  padding: 0 !important;
}

/* 4. Center/Right Section (Navigation) */
.nav-wrapper {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  flex: 1; /* Take up remaining space */
  justify-content: center; /* Center the menu visually */
}

#navigation {
  margin: 0 !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
}

#navigation > ul {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  margin: 0 !important;
}

#navigation > ul > li {
  height: 100% !important;
  /* display: flex !important; */
  align-items: center !important;
}

#navigation > ul > li > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 42px !important; /* Pill height matches widgets */
  line-height: 1 !important;
  padding: 0 16px !important;
  border-radius: 99px !important;
  font-weight: 500 !important;
}

/* 5. Right Section (User & Icons) */
#header .float-end,
#header .right-side {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  float: none !important;
  flex-shrink: 0;
  gap: 8px; /* Space between icons */
}

/* Force icons to align */
.header-widget {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.header-notifications {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
}

.header-notifications-trigger,
.header-notifications-trigger a {
  height: 40px !important;
  width: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  top: auto !important;
  transform: none !important;
  line-height: normal !important;
}

.user-menu {
  display: flex !important;
  align-items: center !important;
}

.user-avatar {
  float: none !important;
  display: block !important;
  position: relative !important;
  top: auto !important;
  margin: 0 !important;
}

/* Start clean styling below */

/* Modernize Navigation Links */
#navigation > ul > li > a {
  display: inline-flex;
  align-items: center;
  height: 36px; /* Pill height */
  padding: 0 16px;
  font-weight: 600;
  font-size: 14px;
  color: #555;
  border-radius: 20px;
  transition: all 0.2s ease;
  margin: 0 2px;
}

#navigation > ul > li:hover > a,
#navigation > ul > li.current > a,
#navigation > ul > li.active > a {
  color: var(--theme-color-1);
  background-color: rgba(55, 179, 74, 0.06);
}

/* Adjust dropdown position for new height */
#navigation ul ul {
  top: calc(100% + 10px);
  border-radius: 8px;
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.04);
  padding: 8px;
}

/* Removed duplicate logo rules */

/* Remove conflicting legacy rule below if any */

/* Top-level navigation spacing & hover accent */
#header .container {
  display: flex;               /* Ensure flex on all breakpoints */
  align-items: center;         /* Center items vertically */
  justify-content: space-between;
  height: 100%;                /* Full height of header */
  padding: 0;                  /* Outer spacing handled by #header padding */
}

/* Reset legacy navigation positioning */
#navigation {
  margin-top: 0 !important;
  display: flex !important;
  align-items: center !important;
  height: 100%;
}

#navigation>ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  height: 100%;
}

#navigation>ul>li {
  margin: 0 6px;
  display: flex;
  align-items: center;
  position: relative;
}

#navigation>ul>li>a {
  display: inline-flex;
  align-items: center;
  height: auto;
  padding: 10px 18px;
  font-weight: 500;
  font-size: 15px;
  color: #475569;
  border-radius: 50px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  background-color: transparent;
}

#navigation>ul>li:hover>a,
#navigation>ul>li.active>a,
#navigation>ul>li:focus-within>a,
#navigation>ul>li>a.current {
  color: #fff;
  background-color: var(--theme-color-1);
  box-shadow: 0 4px 12px rgba(55, 179, 74, 0.25);
  transform: translateY(-1px);
}

#navigation>ul>li>a:after {
  content: none !important;
  display: none !important;
}

/* Modern Dropdown Menu Styling */
#navigation ul ul {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.15);
  padding: 10px 0;
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-top: 15px;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(15px);
  opacity: 0;
  visibility: hidden;
  display: block;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  z-index: 100;
}

#navigation ul li:hover>ul {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#navigation ul ul li {
  margin: 0;
  padding: 0 10px;
}

#navigation ul ul li a {
  font-weight: 500;
  font-size: 14px;
  color: #334155;
  padding: 12px 18px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

#navigation ul ul li a i {
  color: #94a3b8;
  transition: color 0.2s;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

#navigation ul ul li:hover>a {
  background-color: var(--theme-color-1);
  color: #fff;
  transform: translateX(4px);
  padding-left: 18px; /* Compensate for transform if needed, or just visual polish */
  box-shadow: 0 4px 10px rgba(55, 179, 74, 0.2);
}

#navigation ul ul li:hover>a i {
  color: #fff;
}

/* Notification triggers / buttons */
.header-notifications-trigger a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #475569 !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  text-decoration: none;
  top: auto !important; /* Override legacy positioning */
  transform: none !important; /* Override legacy positioning */
}

.header-notifications-trigger a:hover {
  background: #f1f5f9 !important;
  color: var(--theme-color-1) !important;
}

.header-notifications-trigger a span {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
  line-height: 1;
}

.user-avatar {
  width: 44px;
  height: 44px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  object-fit: cover;
}

.user-avatar:hover img {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Sign In Button for Guest */
.guest-sign-in {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  background: var(--theme-color-1, #37b34a) !important;
  color: #fff !important;
  font-weight: 600;
  padding: 0 20px !important;
  height: 44px !important;
  width: auto !important;
  border-radius: 50px !important;
  box-shadow: 0 4px 14px rgba(55, 179, 74, 0.25) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.guest-sign-in:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(55, 179, 74, 0.4) !important;
  opacity: 0.95;
}

.guest-sign-in i {
  font-size: 18px;
}

.guest-sign-in img {
  background: #fff;
  padding: 2px;
}

/* Dropdown refinements for User Menu and Notifications */
.header-notifications-dropdown {
  border-radius: 16px;
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 15px;
  padding: 10px 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.user-menu-small-nav li {
  margin: 0;
}

.user-menu-small-nav li a {
  padding: 10px 20px;
  font-weight: 500;
  color: #475569;
  transition: all 0.2s;
  border-radius: 8px;
  margin: 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu-small-nav li a i {
  color: #94a3b8;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.user-menu-small-nav li a:hover {
  background-color: var(--theme-color-0_1);
  color: var(--theme-color-1);
  transform: translateX(4px);
}

.user-menu-small-nav li a:hover i {
  color: var(--theme-color-1);
}

.user-menu-small-nav hr {
  margin: 8px 10px;
  border-color: rgba(0, 0, 0, 0.05);
}

/* User status header inside dropdown */
.user-status {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.user-name span {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* Mobile menu (mmenu) visual tune */
.mm-menu {
  background: #fff;
  z-index: 3000;
}

.mm-wrapper__blocker {
  z-index: 2990;
}

.mm-menu .mm-listview>li>a {
  padding: 14px 18px;
  font-size: 16px;
  color: #334155;
  font-weight: 500;
}

.mm-menu .mm-listview>li.mm-selected>a,
.mm-menu .mm-listview>li>a:focus {
  color: var(--theme-color-1);
  background: var(--theme-color-0_1);
}

/* Mobile menu custom head */
.mm-head-block {
  padding: 20px 20px 15px;
  background: linear-gradient(135deg, var(--theme-color-1), #2ca03a);
  color: #fff;
}

.mm-head-block+li>a {
  border-top: 0;
}

.mm-head-block .mm-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mm-head-block .mm-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.mm-head-block .mm-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mm-head-block .mm-user-avatar.mm-guest {
  color: #fff;
  font-size: 26px;
}

.mm-head-block .mm-user-meta {
  line-height: 1.3;
}

.mm-head-block .mm-user-name {
  font-weight: 700;
  font-size: 18px;
}

.mm-head-block .mm-user-role {
  font-size: 13px;
  opacity: .9;
}

.mm-head-block .mm-user-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.mm-head-block .mm-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s;
}

.mm-head-block .mm-link:hover {
  background: rgba(255, 255, 255, .3);
}

.mm-head-block .mm-link.text-danger {
  background: rgba(255, 0, 0, .2);
}

/* Better item separation and arrows in mmenu */
.mm-menu .mm-listview > li { border-bottom: 1px solid #f1f5f9; }
.mm-menu .mm-listview > li:last-child { border-bottom: 0; }
.mm-menu .mm-listview > li > a:hover { background: #f8fafc; }
.mm-menu .mm-listview .mm-next:after,
.mm-menu .mm-btn.mm-btn_next:after {
  /* caret color for submenu arrow */
  border-color: #94a3b8;
}
.mm-menu .mm-listview .mm-next:hover:after,
.mm-menu .mm-btn.mm-btn_next:hover:after { border-color: var(--theme-color-1); }

/* Safe-area for devices with a notch */
@supports (padding-top: env(safe-area-inset-top)) {
  .mm-menu { padding-top: env(safe-area-inset-top); }
}

/* Hamburger hit area & active color */
.mmenu-trigger .hamburger {
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  transition: background 0.2s;
}

/* Ensure hamburger block aligns with other controls */
.mmenu-trigger {
  display: none; /* Hidden by default on desktop */
  align-items: center;
  height: 44px;
  margin: 0;
}

.mmenu-trigger .hamburger:hover {
  background: #f1f5f9;
}

.hamburger--collapse.is-active .hamburger-inner,
.hamburger--collapse.is-active .hamburger-inner::before,
.hamburger--collapse.is-active .hamburger-inner::after {
  background-color: var(--theme-color-1);
}

/* ===== MOBILE HEADER: fully rebuilt ===== */
@media (max-width: 1099px) {

  /* Fixed header height */
  #header {
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 !important;
  }

  /* 3-zone flex row: [left] [spacer] [right] */
  #header .container,
  #header > .container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 60px !important;
    padding: 0 14px !important;
    margin: 0 auto !important;
    max-width: 100% !important;
  }

  /* Hide desktop nav wrapper entirely — prevents ghost spacer */
  .nav-wrapper {
    display: none !important;
  }

  /* Left zone: hamburger + logo */
  #header .float-start {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    flex: 0 0 auto;
    float: none !important;
    height: 60px;
    margin: 0;
  }

  /* Right zone: bell + avatar / sign-in */
  #header .float-end {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px;
    flex: 0 0 auto;
    float: none !important;
    position: static !important;
    background: transparent !important;
    height: 60px;
    margin: 0;
  }

  /* Logo */
  #logo {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
  }
  #logo a { display: flex; align-items: center; }
  #logo img { height: 28px !important; width: auto !important; }

  /* Hamburger button - ABSOLUTE CENTER BY FLEX */
  .mmenu-trigger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    margin-right: 16px;
    flex-shrink: 0;
    padding: 0 !important;
    background: transparent !important; /* KILL THE GREY BOX FROM STYLE.CSS */
    border: none !important; /* Remove any border from style.css */
    border-radius: 0 !important; /* Remove border radius from style.css */
    top: auto !important; /* Kill legacy top position */
    transform: none !important; /* Kill legacy transforms */
  }

  .mmenu-trigger .hamburger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 12px;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    position: relative;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer;
    overflow: hidden; /* Ensure nothing spills out */
    top: auto !important; /* Reset style.css top: 16px */
    left: auto !important; /* Reset style.css left: 12px */
    right: auto !important;
    transform: none !important; /* Reset style.css transform scale */
  }

  /* Reset box to be absolute center reference */
  .hamburger-box {
    width: 20px !important;
    height: 14px !important;
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important; /* Stop flex stretching */
  }

  /* The actual lines - Reset ALL previous transforms/positions */
  .hamburger-inner, 
  .hamburger-inner::before, 
  .hamburger-inner::after {
    width: 20px !important;
    height: 2px !important;
    background-color: #334155 !important;
    border-radius: 4px;
    position: absolute !important;
    left: 0 !important;
    content: '' !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.2s ease, top 0.2s ease, bottom 0.2s ease !important;
  }

  /* Center line - Absolute Grid Center */
  .hamburger-inner {
    top: 50% !important;
    margin-top: -1px !important; /* Half height offset */
    transform: none !important;
  }
  
  /* Top line - Relative to Center line location in code, but absolute visually */
  .hamburger-inner::before {
    top: -6px !important;
  }
  
  /* Bottom line */
  .hamburger-inner::after {
    top: 6px !important;
    bottom: auto !important;
  }

  /* Active state overrides */
  .hamburger--collapse.is-active .hamburger-inner {
    transform: translate3d(0, -10px, 0);
    opacity: 0;
  }
  
  .hamburger--collapse.is-active .hamburger-inner::before {
    top: 0 !important;
    transform: rotate(45deg);
    transition-delay: 0.1s;
  }
  
  .hamburger--collapse.is-active .hamburger-inner::after {
    top: 0 !important;
    transform: rotate(-45deg);
    transition-delay: 0.1s;
  }

  /* Icon buttons: notification bell */
  .header-widget {
    padding: 0 !important;
    border: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
  }
  .header-notifications {
    position: static !important;
    display: flex !important;
    align-items: center;
  }
  .header-notifications-trigger a {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #475569 !important;
    font-size: 18px;
  }
  .header-notifications-trigger a:hover { background: #e2e8f0 !important; }

  /* Avatar */
  .user-avatar {
    width: 36px !important;
    height: 36px !important;
  }
  .user-avatar img {
    width: 36px !important;
    height: 36px !important;
  }

  /* Guest sign-in button — icon only on mobile */
  .guest-sign-in span { display: none !important; }
  .guest-sign-in {
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    justify-content: center !important;
  }
  .guest-sign-in img { width: 26px !important; height: 26px !important; border-radius: 50%; }

  /* Wrapper padding for body */
  #wrapper { padding-top: 60px !important; }
}

/* Transparent header → force white bg on mobile so text is readable */
@media (max-width: 1099px) {
  .transparent-header #header {
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(10px);
  }
  body .transparent-header #navigation > ul li a,
  .transparent-header .header-notifications-trigger a { color: #334155 !important; }
}