/* ── Sidebar wrapper ── */
#sidebar-wrapper {
  width: 250px !important;
  min-height: 100vh;
  background: #1e1e1e !important;
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  font-family: "Barlow", "DM Sans", "Segoe UI", sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Layout: push content wrapper to the right of sidebar ── */
#wrapper {
  display: flex !important;
  min-height: 100vh;
}
#page-content-wrapper {
  margin-left: 250px !important;
  flex: 1 !important;
  min-width: 0;
  background: #f5f5f5 !important;
}

/* ── Logo ── */
.wh-sb-logo {
  padding: 50px 20px 10px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.wh-sb-logo-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1;
}
.wh-sb-logo-wealth {
  color: #ffffff;
}
.wh-sb-logo-houze {
  color: #ff8b00;
}

/* ── Nav list ── */
#sidebar-wrapper .sidebar-nav {
  list-style: none !important;
  margin: 6px 0 0 !important;
  padding: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#sidebar-wrapper .sidebar-nav li {
  margin: 0;
  padding: 0;
}

/* ── Base link ── */
#sidebar-wrapper .sidebar-nav .menu {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 25px 16px 25px 40px !important;
  text-decoration: none !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: #b0b0b0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  transition: color 0.18s !important;
  white-space: nowrap;
  position: relative;
}
#sidebar-wrapper .sidebar-nav .menu:hover {
  color: #ffffff !important;
  background: transparent !important;
  text-decoration: none !important;
}

/* ── Active state: white pill right-flush + orange text ── */
#sidebar-wrapper .sidebar-nav .menu.wh-sb-active {
  color: #ff8b00 !important;
  font-weight: 700 !important;
}
#sidebar-wrapper .sidebar-nav .menu.wh-sb-active::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 10px;
  right: 0;
  bottom: 4px;
  background: #f5f5f5;
  border-radius: 50px 0 0 50px;
  /* background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 315 165'><path d='M0 79.8691C0 58.0864 17.6165 40.4428 39.3992 40.4625C113.98 40.5297 269.443 40.3136 281.45 37.3828C297.293 33.5156 315 0 315 0V165C315 165 305.68 137.93 281.45 126.758C263.228 118.357 113.255 118.703 39.9862 119.391C17.9972 119.598 0 101.859 0 79.8691Z' fill='%23F5F5F5'/></svg>");
  background-size: cover;
  background-repeat: no-repeat; */
  z-index: 0;
}
#sidebar-wrapper .sidebar-nav .menu.wh-sb-active svg,
#sidebar-wrapper .sidebar-nav .menu.wh-sb-active span {
  position: relative;
  z-index: 1;
}

/* ── Divider ── */
.wh-sb-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 8px 16px;
}

/* ── Bottom section (Support + Logout) ── */
.wh-sb-bottom {
  padding: 0 0 20px;
  margin-top: auto;
}

/* ── Dropdown ── */
#sidebar-wrapper .dropdown-container {
  padding: 2px 0 6px 52px;
}
#sidebar-wrapper .dropdown-container a {
  display: block;
  padding: 5px 10px;
  font-size: 0.75rem;
  color: #555 !important;
  text-decoration: none !important;
  border-radius: 6px;
  transition: color 0.2s;
}
#sidebar-wrapper .dropdown-container a:hover {
  color: #ff8b00 !important;
}

/* ── Logout form ── */
.wh-sb-logout-form {
  margin: 0;
  padding: 0;
}
.wh-sb-logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 25px 16px 25px 40px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: #b0b0b0;
  font-family: inherit;
  text-align: left;
  transition: color 0.18s;
}
.wh-sb-logout-btn:hover {
  color: #ffffff;
}
/* ── Learning Hub sub-menu ── */
.wh-lh-submenu {
  padding: 0 0 8px 0;
  display: none; /* hidden by default, shown when LH is active */
}
.wh-lh-submenu.open {
  display: block;
}
.wh-lh-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 50px;
  text-decoration: none !important;
  font-size: 0.78rem;
  font-weight: 500;
  color: #707070 !important;
  transition: color 0.18s;
  white-space: normal;
  line-height: 1.4;
}
.wh-lh-sub-item:hover {
  color: #ffffff !important;
  text-decoration: none !important;
}
.wh-lh-sub-item.active {
  color: #ff8b00 !important;
  font-weight: 600;
}
.wh-lh-sub-item svg {
  flex-shrink: 0;
  opacity: 0.5;
}
.wh-lh-sub-item.active svg {
  opacity: 1;
}
/* ── Mobile Menu Toggle Button ── */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: 15px;
  right: 15px;
  z-index: 10000;
  background: #ff8b00;
  border: none;
  border-radius: 30px;
  padding: 10px 18px;
  cursor: pointer;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 22px;
}

.hamburger-icon span {
  display: block;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Animated hamburger to X */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.toggle-text {
  color: white;
  font-size: 14px;
  font-weight: 500;
  font-family: "Barlow", "DM Sans", sans-serif;
}

/* ── Mobile Overlay ── */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  backdrop-filter: blur(2px);
}

.mobile-overlay.active {
  display: block;
}

/* ── Responsive Sidebar ── */
@media (max-width: 768px) {
  .wh-lh-sub-item {
    padding: 9px 16px 9px 40px;
  }

  /* Show mobile toggle button */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Sidebar styles for mobile */
  #sidebar-wrapper {
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    position: fixed;
    z-index: 9999;
    box-shadow: none;
  }

  /* When sidebar is open */
  #sidebar-wrapper.mobile-sidebar-open {
    transform: translateX(0);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  }

  /* When sidebar is closed (default) */
  #sidebar-wrapper.mobile-sidebar-closed {
    transform: translateX(-100%);
  }

  /* Adjust page content wrapper for mobile */
  #page-content-wrapper {
    margin-left: 0 !important;
    width: 100%;
  }

  /* Make navigation items more touch-friendly */
  #sidebar-wrapper .sidebar-nav .menu {
    padding: 18px 16px 18px 30px !important;
    font-size: 1rem !important;
  }

  .wh-sb-logout-btn {
    padding: 18px 16px 18px 30px !important;
    font-size: 1rem !important;
  }

  /* Adjust logo spacing for mobile */
  .wh-sb-logo {
    padding: 30px 20px 15px;
  }

  /* Smaller dropdown indentation */
  #sidebar-wrapper .dropdown-container {
    padding-left: 45px;
  }

  /* Close sidebar when clicking outside */
  body.sidebar-open {
    overflow: hidden;
  }
}

/* Tablet styles (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .wh-lh-sub-item {
    padding: 9px 12px 9px 38px;
  }

  #sidebar-wrapper {
    width: 240px !important;
  }

  #page-content-wrapper {
    margin-left: 240px !important;
  }

  #sidebar-wrapper .sidebar-nav .menu {
    padding: 22px 16px 22px 35px !important;
    font-size: 0.85rem !important;
  }

  .wh-sb-logout-btn {
    padding: 22px 16px 22px 35px !important;
  }
}

/* Desktop styles (1025px and above) */
@media (min-width: 1025px) {
  #sidebar-wrapper {
    transform: translateX(0) !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }

  .mobile-overlay {
    display: none !important;
  }
}

/* Small mobile devices (max-width: 480px) */
@media (max-width: 480px) {
  #sidebar-wrapper {
    width: 260px !important;
  }

  .wh-sb-logo img {
    width: 80% !important;
  }

  #sidebar-wrapper .sidebar-nav .menu {
    padding: 15px 12px 15px 25px !important;
    gap: 12px !important;
  }

  .wh-sb-logout-btn {
    padding: 15px 12px 15px 25px !important;
    gap: 12px !important;
  }

  .mobile-menu-toggle {
    padding: 8px 14px;
    bottom: 100px;
    right: 12px;
  }
}
