/* ═══════════════════════════════════════════
   HEADER — Premium Knowledge Hub Design
   Glassmorphic Floating Nav
   ═══════════════════════════════════════════ */

body { margin: 0; padding: 0; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ═══ TOP BAR — Minimal accent line ═══ */
.top-bar {
  background: linear-gradient(90deg, #06d6a0, #a78bfa, #ffd166);
  height: 3px;
  padding: 0;
  overflow: hidden;
}
.top-bar-container, .top-bar-left, .top-bar-right, .top-bar-left .marquee { display: none; }

/* ═══ SITE HEADER — Glassmorphic ═══ */
.site-header {
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.site-header.scrolled {
  background: rgba(10, 14, 26, 0.92);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  border-bottom-color: rgba(255,255,255,0.08);
}

/* Light mode */
body:not(.dark-mode) .site-header {
  background: rgba(248, 249, 252, 0.8);
  border-bottom-color: rgba(0,0,0,0.06);
}
body:not(.dark-mode) .site-header.scrolled {
  background: rgba(248, 249, 252, 0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.header-main { padding: 10px 0; }

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ═══ LOGO ═══ */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  padding: 4px 0;
}
.header-logo img { height: 36px; width: auto; border-radius: 8px; }
.header-logo .logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #06d6a0, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* ═══ SEARCH BOX ═══ */
.search-box {
  flex: 1;
  max-width: 440px;
  display: flex;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 10px 44px 10px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: rgba(255,255,255,0.04);
  color: #f0f4f8;
  transition: all 0.25s;
  font-family: inherit;
}
.search-box input::placeholder { color: #5a6478; }
.search-box input:focus {
  border-color: rgba(6,214,160,0.4);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(6,214,160,0.1);
}

body:not(.dark-mode) .search-box input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: #1a1d26;
}
body:not(.dark-mode) .search-box input::placeholder { color: #8b92a8; }
body:not(.dark-mode) .search-box input:focus {
  border-color: rgba(5,155,120,0.4);
  box-shadow: 0 0 0 3px rgba(5,155,120,0.1);
}

.search-box button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #06d6a0, #04b686);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.search-box button:hover { transform: translateY(-50%) scale(1.05); box-shadow: 0 4px 12px rgba(6,214,160,0.3); }
.search-box button svg { width: 16px; height: 16px; color: #0a0e1a; }

/* ═══ SEARCH SUGGESTIONS ═══ */
.search-suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #1a2035;
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-top: none;
  max-height: 360px; overflow-y: auto;
  z-index: 1000; display: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.search-suggestions.active { display: block; }
body:not(.dark-mode) .search-suggestions { background: #fff; border-color: rgba(0,0,0,0.08); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }

.search-suggestion-item {
  padding: 10px 14px; cursor: pointer;
  display: flex; gap: 12px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.search-suggestion-item:hover { background: rgba(255,255,255,0.04); }
.search-suggestion-item:last-child { border-bottom: none; }
body:not(.dark-mode) .search-suggestion-item { border-bottom-color: #f0f2f7; }
body:not(.dark-mode) .search-suggestion-item:hover { background: #f8f9fc; }

.search-suggestion-image {
  width: 42px; height: 42px;
  background: rgba(6,214,160,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.search-suggestion-image img { max-width: 80%; max-height: 80%; object-fit: contain; }
.search-suggestion-content { flex: 1; min-width: 0; }
.search-suggestion-name {
  font-size: 13px; font-weight: 500; color: #f0f4f8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body:not(.dark-mode) .search-suggestion-name { color: #1a1d26; }
.search-suggestion-price { font-size: 12px; color: #06d6a0; font-weight: 600; }

/* ═══ HEADER ACTIONS ═══ */
.header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: auto;
}

.btn-auth, .btn-cart {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px;
  text-decoration: none; font-size: 13px;
  font-weight: 600; transition: all 0.25s;
  font-family: 'Outfit', sans-serif;
}
.btn-auth {
  background: rgba(255,255,255,0.06);
  color: #f0f4f8;
  border: 1px solid rgba(255,255,255,0.08);
}
.btn-auth:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}
body:not(.dark-mode) .btn-auth {
  background: #f0f2f7; color: #1a1d26;
  border: 1px solid rgba(0,0,0,0.08);
}
body:not(.dark-mode) .btn-auth:hover { background: #e8ebf0; }

.btn-auth svg, .btn-cart svg { width: 18px; height: 18px; }

/* ═══ USER DROPDOWN ═══ */
.user-dropdown { position: relative; }
.btn-user-avatar {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.25s;
}
.btn-user-avatar:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
.btn-user-avatar .user-avatar-img {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; border: 2px solid #06d6a0;
}
.btn-user-avatar .user-info { display: flex; flex-direction: column; }
.btn-user-avatar .user-name {
  font-size: 12px; font-weight: 600; color: #f0f4f8;
  max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-user-avatar .user-email {
  font-size: 10px; color: #5a6478;
  max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body:not(.dark-mode) .btn-user-avatar {
  background: #f0f2f7; border-color: rgba(0,0,0,0.08);
}
body:not(.dark-mode) .btn-user-avatar .user-name { color: #1a1d26; }
body:not(.dark-mode) .btn-user-avatar .user-email { color: #8b92a8; }

.user-dropdown-menu {
  position: absolute; top: 100%; right: 0;
  padding-top: 8px;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 1000;
}
.user-dropdown.open .user-dropdown-menu,
.user-dropdown:hover .user-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.user-dropdown-menu-inner {
  background: #1a2035;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4);
  min-width: 200px; padding: 6px; overflow: hidden;
}
body:not(.dark-mode) .user-dropdown-menu-inner {
  background: #fff; border-color: rgba(0,0,0,0.08);
  box-shadow: 0 12px 48px rgba(0,0,0,0.12);
}

.user-dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; color: #8892a4;
  text-decoration: none; font-size: 13px;
  border-radius: 10px; transition: all 0.15s;
}
.user-dropdown-menu a:hover { background: rgba(255,255,255,0.06); color: #f0f4f8; }
.user-dropdown-menu a svg { width: 18px; height: 18px; color: #5a6478; }
.user-dropdown-menu a:hover svg { color: #06d6a0; }
body:not(.dark-mode) .user-dropdown-menu a { color: #5a6178; }
body:not(.dark-mode) .user-dropdown-menu a:hover { background: #f0f2f7; color: #1a1d26; }

.user-dropdown-menu .logout-link {
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px; padding-top: 10px; color: #ff6b6b;
}
.user-dropdown-menu .logout-link svg { color: #ff6b6b; }
body:not(.dark-mode) .user-dropdown-menu .logout-link { border-top-color: #f0f2f7; }

/* ═══ CART BUTTON ═══ */
.btn-cart {
  background: linear-gradient(135deg, #06d6a0, #04b686);
  color: #0a0e1a; position: relative;
  border: none;
  box-shadow: 0 2px 12px rgba(6,214,160,0.2);
}
.btn-cart:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(6,214,160,0.35);
}
.cart-badge, .btn-cart .cart-badge {
  position: absolute; top: -5px; right: -5px;
  background: #ff6b6b; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  border: 2px solid #0a0e1a;
}
body:not(.dark-mode) .btn-cart .cart-badge { border-color: #f8f9fc; }

/* ═══ THEME TOGGLE ═══ */
.btn-theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; cursor: pointer;
  transition: all 0.25s;
}
.btn-theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}
.btn-theme-toggle svg { width: 18px; height: 18px; color: #8892a4; transition: all 0.3s; }
.btn-theme-toggle .icon-sun { display: none; }
.btn-theme-toggle .icon-moon { display: block; }

body.dark-mode .btn-theme-toggle .icon-sun { display: block; }
body.dark-mode .btn-theme-toggle .icon-moon { display: none; }

body:not(.dark-mode) .btn-theme-toggle {
  background: #f0f2f7; border-color: rgba(0,0,0,0.08);
}
body:not(.dark-mode) .btn-theme-toggle svg { color: #5a6178; }

/* ═══ SECONDARY NAV ═══ */
.header-secondary {
  background: rgba(10,14,26,0.5);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.04);
}
body:not(.dark-mode) .header-secondary {
  background: rgba(248,249,252,0.7);
  border-top-color: rgba(0,0,0,0.04);
}

.secondary-nav {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-links, .nav-links-right { display: flex; align-items: center; gap: 2px; }

.nav-links a, .nav-links-right a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; color: #8892a4;
  text-decoration: none; font-size: 13px;
  font-weight: 500; transition: all 0.2s;
  border-radius: 8px; white-space: nowrap;
}
.nav-links a:hover, .nav-links-right a:hover {
  color: #06d6a0; background: rgba(6,214,160,0.06);
}
body:not(.dark-mode) .nav-links a, body:not(.dark-mode) .nav-links-right a { color: #5a6178; }
body:not(.dark-mode) .nav-links a:hover, body:not(.dark-mode) .nav-links-right a:hover {
  color: #059b78; background: rgba(5,155,120,0.06);
}

.nav-links svg, .nav-links-right svg { width: 16px; height: 16px; }

/* Nav buttons */
.nav-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px;
  text-decoration: none; font-size: 12px;
  font-weight: 600; white-space: nowrap;
  transition: all 0.25s; border: none;
}
.nav-btn:hover { transform: translateY(-1px); }
.nav-btn svg { width: 14px; height: 14px; }
.nav-btn--green { background: linear-gradient(135deg, #06d6a0, #04b686); color: #0a0e1a; }
.nav-btn--green:hover { box-shadow: 0 4px 16px rgba(6,214,160,0.3); }

/* ═══ NAV DROPDOWN ═══ */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; color: #8892a4;
  font-size: 13px; font-weight: 500;
  border: none; background: none; cursor: pointer;
  border-radius: 8px; transition: all 0.2s;
  font-family: inherit; white-space: nowrap;
}
.nav-dropdown-trigger:hover { color: #06d6a0; background: rgba(6,214,160,0.06); }
body:not(.dark-mode) .nav-dropdown-trigger { color: #5a6178; }
body:not(.dark-mode) .nav-dropdown-trigger:hover { color: #059b78; background: rgba(5,155,120,0.06); }

.nav-dropdown-trigger .chevron {
  width: 12px; height: 12px;
  transition: transform 0.2s;
}
.nav-dropdown:hover .nav-dropdown-trigger .chevron { transform: rotate(180deg); }

.nav-dropdown-panel {
  position: absolute; top: 100%; left: 0;
  padding-top: 6px; opacity: 0; visibility: hidden;
  transform: translateY(-6px); transition: all 0.2s;
  z-index: 1000;
}
.nav-dropdown:hover .nav-dropdown-panel {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-panel-inner {
  background: #1a2035;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4);
  min-width: 220px; padding: 6px;
  border-top: 2px solid #06d6a0;
}
body:not(.dark-mode) .nav-dropdown-panel-inner {
  background: #fff; border-color: rgba(0,0,0,0.08);
  box-shadow: 0 12px 48px rgba(0,0,0,0.1);
  border-top-color: #059b78;
}

.nav-dropdown-panel-inner a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; color: #8892a4;
  text-decoration: none; font-size: 13px;
  border-radius: 8px; transition: all 0.15s;
}
.nav-dropdown-panel-inner a:hover {
  background: rgba(6,214,160,0.08); color: #06d6a0;
}
.nav-dropdown-panel-inner a svg { width: 16px; height: 16px; color: #5a6478; }
.nav-dropdown-panel-inner a:hover svg { color: #06d6a0; }
body:not(.dark-mode) .nav-dropdown-panel-inner a { color: #5a6178; }
body:not(.dark-mode) .nav-dropdown-panel-inner a:hover { background: rgba(5,155,120,0.06); color: #059b78; }

/* ═══ MOBILE SIDEBAR ═══ */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px); z-index: 9998;
  opacity: 0; visibility: hidden; transition: all 0.3s;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.mobile-sidebar {
  position: fixed; top: 0; right: -320px;
  width: 300px; height: 100vh;
  background: #0f1524;
  border-left: 1px solid rgba(255,255,255,0.06);
  z-index: 9999;
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}
body:not(.dark-mode) .mobile-sidebar {
  background: #fff; border-left-color: rgba(0,0,0,0.06);
  box-shadow: -8px 0 40px rgba(0,0,0,0.1);
}
.mobile-sidebar.active { right: 0; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
body:not(.dark-mode) .sidebar-header { border-bottom-color: rgba(0,0,0,0.06); }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo img { height: 28px; border-radius: 6px; }
.sidebar-logo span {
  font-family: 'Outfit', sans-serif;
  font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #06d6a0, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.sidebar-close {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #8892a4; transition: all 0.2s;
}
.sidebar-close:hover { background: rgba(255,99,107,0.1); color: #ff6b6b; border-color: rgba(255,99,107,0.2); }
.sidebar-close svg { width: 18px; height: 18px; }
body:not(.dark-mode) .sidebar-close {
  background: #f0f2f7; border-color: rgba(0,0,0,0.08); color: #5a6178;
}

.sidebar-nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; color: #8892a4;
  text-decoration: none; font-size: 14px;
  font-weight: 500; border-radius: 10px;
  transition: all 0.2s;
}
.sidebar-nav a:hover { background: rgba(6,214,160,0.06); color: #06d6a0; }
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
body:not(.dark-mode) .sidebar-nav a { color: #5a6178; }
body:not(.dark-mode) .sidebar-nav a:hover { background: rgba(5,155,120,0.06); color: #059b78; }

.sidebar-nav .sidebar-user-link {
  padding: 12px 14px; margin-bottom: 8px;
  background: rgba(6,214,160,0.06);
  border: 1px solid rgba(6,214,160,0.1);
  border-radius: 12px;
}
.sidebar-nav .sidebar-user-link img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 2px solid #06d6a0;
}
.sidebar-nav .sidebar-user-link .user-name { font-size: 14px; font-weight: 600; color: #f0f4f8; }
.sidebar-nav .sidebar-user-link .user-email { font-size: 11px; color: #5a6478; }
body:not(.dark-mode) .sidebar-nav .sidebar-user-link .user-name { color: #1a1d26; }

.sidebar-nav .logout-link { color: #ff6b6b !important; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 12px; }
.sidebar-nav .logout-link svg { color: #ff6b6b; }

/* ═══ MOBILE MENU TOGGLE ═══ */
.mobile-menu-toggle {
  display: none; width: 38px; height: 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; cursor: pointer;
  align-items: center; justify-content: center;
  color: #8892a4; transition: all 0.2s;
}
.mobile-menu-toggle:hover { background: rgba(255,255,255,0.1); }
.mobile-menu-toggle svg { width: 20px; height: 20px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .header-secondary { display: none; }
  .mobile-menu-toggle { display: flex; }
}

@media (max-width: 768px) {
  .header-container { gap: 12px; padding: 0 16px; }
  .search-box { max-width: 100%; }
  .btn-auth span, .btn-cart span { display: none; }
  .btn-auth, .btn-cart { padding: 9px 10px; }
  .btn-user-avatar .user-info { display: none; }
  .btn-user-avatar { padding: 4px; }
  .header-logo .logo-text { font-size: 16px; }
  .top-bar { height: 2px; }
}

@media (max-width: 480px) {
  .search-box { display: none; }
  .header-logo img { height: 28px; }
}

/* ═══ ANIMATIONS ═══ */
@keyframes cartBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.cart-badge { animation: cartBadgePulse 2s infinite; }
