
/* ========== CONFIGURATION ========== */
/* Change this to 'static' for non-fixed navbar */
:root {
  --navbar-mode: fixed; /* 'fixed' or 'static' */
  --primary-h: 222;
  --primary-s: 47%;
  --primary-l: 11%;
  --gradient-primary: linear-gradient(135deg, hsl(222,60%,45%), hsl(260,60%,55%));
  --bg: #ffffff;
  --fg: #0f172a;
  --card: #ffffff;
  --muted: #f1f5f9;
  --muted-fg: #64748b;
  --border-color: #e2e8f0;
  --accent: #f1f5f9;
  --destructive: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --radius: 0.75rem;
}


/* ========== NAVBAR ========== */
.navbar {
  top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/* FIXED MODE */
.navbar.mode-fixed { position: fixed; }
.navbar.mode-fixed.scrolled { box-shadow: var(--shadow); }
/* .navbar.mode-fixed.hidden { transform: translateY(-100%); } */
.navbar-spacer-fixed { height: 64px; }

/* STATIC MODE */
.navbar.mode-static { position: relative; }
.navbar-spacer-static { display: none; }

.navbar-inner { max-width: 1280px; width: 100%; margin: 0 auto; padding: 0 1rem; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }

/* Logo */
.logo { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; flex-shrink: 0; }
.logo:hover { opacity: 0.9; }
.nav-logo-img { object-fit: contain; }
.logo-icon { height: 40px; width: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 12px; background: var(--gradient-primary); transition: border-radius 0.4s; }
.logo:hover .logo-icon { border-radius: 50%; }
/* Nav links */
.nav-links { display: none; align-items: center; gap: 2px; }
@media(min-width:1024px) { .nav-links { display: flex; } }

.navbar .nav-link { position: relative; padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.875rem; font-weight: 500; color: var(--muted-fg); background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: color 0.2s, background 0.2s; }
.navbar .nav-link:hover { color: var(--fg); }
.navbar .nav-link.active { color: #6055CD; }
.navbar .nav-link.active::after { content:''; position: absolute; bottom: 0; left: 8px; right: 8px; height: 2px; border-radius: 1px; background: #6055CD; }
.navbar .nav-link .chevron { width: 14px; height: 14px; transition: transform 0.2s; }
.navbar .nav-link.open .chevron { transform: rotate(180deg); }

/* Dropdown */
.navbar .dropdown-wrap { position: relative; }
.navbar .dropdown { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px); min-width: 260px; background: var(--card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 9999; padding: 0.5rem; }
.navbar .dropdown.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }

/* 2 items per row dropdown layout */
.navbar .dropdown.dropdown-grid-2 {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  left:400px !important;
  gap: 8px;
  padding: 10px;
}
.navbar .dropdown.dropdown-grid-2 .dropdown-item {
  width: auto;
}
.navbar .dropdown.dropdown-grid-2 .dropdown-item.dropdown-spacer {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}
.navbar .dropdown.dropdown-grid-2 .quicklink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  background: rgba(96,85,205,0.10);
  border: 1px solid rgba(96,85,205,0.20);
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
.navbar .dropdown.dropdown-grid-2 .quicklink svg {
  width: 16px;
  height: 16px;
  color: #6055CD;
}
.navbar .dropdown.dropdown-grid-2 .quicklink:hover {
  background: rgba(96,85,205,0.14);
  border-color: rgba(96,85,205,0.28);
  transform: translateY(-1px);
}
.navbar .dropdown.dropdown-grid-2 .quicklink:active {
  transform: translateY(0);
}

.navbar  .dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 8px; text-decoration: none; color: var(--fg); transition: background 0.15s; }
.navbar  .dropdown-item:hover { background: var(--accent); }
.navbar  .dropdown-item .di-icon { height: 36px; width: 36px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; }
.navbar  .dropdown-item:hover .di-icon { background: #6055CD; color: #fff; }
.navbar  .dropdown-item .di-icon svg { width: 16px; height: 16px; }
.navbar  .di-label { font-size: 0.875rem; font-weight: 500; }
.navbar  .di-desc { font-size: 0.75rem; color: var(--muted-fg); }
.navbar  .di-badge { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: #6155cd27; color: #6055CD; font-weight: 600; }

/* Right actions */
.nav-actions { display: flex; align-items: center; gap: 4px; }
/* Search */
.searchWrap {
  position: relative;
  width: 180px;
}
@media (min-width: 768px) {
  .searchWrap { width: 180px; }
}

.search-box {
  display: flex;
  align-items: center;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--muted);
  transition: all 0.2s;
  width: 100%;
}
.search-box:focus-within { background: var(--card); border-color: hsla(var(--primary-h),var(--primary-s),var(--primary-l),0.5); box-shadow: 0 0 0 3px hsla(var(--primary-h),var(--primary-s),var(--primary-l),0.1); width: 180px; }
.search-box svg { margin-left: 12px; width: 16px; height: 16px; color: var(--muted-fg); flex-shrink: 0; }
.search-box input { background: transparent; border: none; outline: none; font-size: 0.875rem; color: var(--fg); padding: 0.5rem; padding-right: 34px; width: 100%; }
.search-box input::placeholder { color: var(--muted-fg); }

.searchSpinner {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  pointer-events: none;
}

.navbar-inner .ipo_list {
  position: absolute;
  top: calc(100% + 10px);
  left: -10vw;
  right: 0;
  z-index: 60;
  width: calc(100% + 20vw);
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
  padding: 8px 0;
}

.navbar-inner .ipo_list [role="listitem"] {
  padding: 10px 12px;
  margin: 0 !important;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.navbar-inner .ipo_list [role="listitem"]:hover {
  background: var(--accent);
}

.navbar-inner .ipo_list p {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted-fg);
  font-size: 13px;
}

/* Icon button */
.icon-btn { padding: 10px; border-radius: 8px; background: none; border: none; cursor: pointer; color: var(--muted-fg); transition: background 0.2s, transform 0.15s; display: none; }
@media(min-width:640px) { .icon-btn { display: flex; } }
.icon-btn:hover { background: var(--muted); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.always-show { display: flex; }

/* Notification badge */
.notif-wrap { position: relative; }
.notif-badge { position: absolute; top: 4px; right: 4px; height: 16px; width: 16px; border-radius: 50%; background: var(--destructive); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.notif-ping { position: absolute; top: 4px; right: 4px; height: 16px; width: 16px; border-radius: 50%; background: rgba(239,68,68,0.4); animation: ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
@keyframes ping { 75%,100% { transform: scale(2); opacity: 0; } }

/* User avatar */
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; background: none; border: none; cursor: pointer; transition: background 0.2s; }
.user-btn:hover { background: var(--muted); }
.nav-user-wrap { position: relative; margin-left: 4px; }
.no-text-decoration { text-decoration: none; }
.user-menu-left { left: 0; }
.user-avatar { height: 32px; width: 32px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.user-btn .chevron { width: 14px; height: 14px; color: var(--muted-fg); transition: transform 0.2s; display: none; }
@media(min-width:640px) { .user-btn .chevron { display: block; } }
.user-btn.open .chevron { transform: rotate(180deg); }

/* User menu */
.user-menu { position: absolute; right: 0; top: 100%; margin-top: 8px; width: 224px; background: var(--card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; transform: translateY(8px); z-index: 50; }
.user-menu.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.user-menu-header { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; }
.user-menu-avatar { height: 40px; width: 40px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; }
.user-menu-name { font-size: 14px; font-weight: 600; }
.user-menu-email { font-size: 12px; color: var(--muted-fg); }
.user-menu-items { padding: 6px; }
.user-menu-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: none; border: none; cursor: pointer; width: 100%; font-size: 14px; color: var(--fg); transition: background 0.15s; }
.user-menu-item:hover { background: var(--accent); }
.user-menu-item svg { width: 16px; height: 16px; color: var(--muted-fg); }
.user-menu-footer { border-top: 1px solid var(--border-color); padding: 6px; }
.user-menu-logout { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: none; border: none; cursor: pointer; width: 100%; font-size: 14px; color: var(--destructive); transition: background 0.15s; }
.user-menu-logout:hover { background: rgba(239,68,68,0.08); }
.user-menu-logout svg { width: 16px; height: 16px; }
   .user-menu-signup { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: none; border: none; cursor: pointer; width: 100%; font-size: 14px;color:#ffffff; background: var(--gradient-primary);  }
.user-menu-signup svg { width: 16px; height: 16px; }

/* Mobile hamburger */
.hamburger { display: flex; padding: 10px; border-radius: 8px; background: none; border: none; cursor: pointer; color: var(--fg); margin-left: 4px; }
@media(min-width:1024px) { .hamburger { display: none; } }
.hamburger svg { width: 20px; height: 20px; }
.hamburger:hover { background: var(--muted); }

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mobile-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.mobile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mobile-overlay.show .mobile-backdrop {
  opacity: 1;
}
.mobile-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 85%;
  max-width: 384px;
  background: var(--card);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.mobile-overlay.show .mobile-panel {
  transform: translate3d(0, 0, 0);
}

.mobile-header { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border-color); }
.mobile-header .logo-text { font-size: 1.125rem; font-weight: 700; }
.mobile-close { padding: 8px; border-radius: 8px; background: none; border: none; cursor: pointer; color: var(--fg); }
.mobile-close:hover { background: var(--muted); }
.mobile-close svg { width: 20px; height: 20px; }

.mobile-search { padding: 12px 16px; }
.mobile-search .search-box { display: flex; width: 100%; }

.mobile-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.mobile-nav-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--fg); background: none; border: none; cursor: pointer; width: 100%; transition: background 0.15s ease, transform 0.12s ease; }
.mobile-nav-item:hover { background: var(--muted); transform: translateY(-1px); }
.mobile-nav-item:active { transform: translateY(0); }
.mobile-nav-item.active { background: var(--accent); color: hsl(var(--primary-h),var(--primary-s),var(--primary-l)); }
.mobile-nav-item .item-left { display: flex; align-items: center; gap: 12px; }
.mobile-nav-item svg { width: 18px; height: 18px; }

.mobile-children { margin-left: 16px; padding-left: 16px; border-left: 2px solid var(--border-color); overflow: hidden; max-height: 0; transition: max-height 0.3s; }
.mobile-children.open { max-height: 500px; }
.mobile-child { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--fg); font-size: 14px; font-weight: 500; transition: background 0.15s ease, transform 0.12s ease; }
.mobile-child:hover { background: var(--accent); transform: translateX(2px); }
.mobile-child:active { transform: translateX(0); }
.mobile-child svg { width: 16px; height: 16px; color: var(--muted-fg); }
.mobile-child-desc { font-size: 12px; color: var(--muted-fg); }

.mobile-footer { border-top: 1px solid var(--border-color); padding: 12px 16px; display: flex; gap: 8px; }
.mobile-footer button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 8px; background: var(--muted); border: none; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--fg); }
