/* ===================================================================
   TRENDS FOR SALE (TFS) - GLOBAL NAVBAR & HEADER STYLES
   =================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

.header-container {
  max-width: 1360px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Branding */
.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
  position: relative;
  overflow: hidden;
}

.brand-logo-wrap svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.site-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Desktop Navigation */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 8px;
}

.nav-item {
  position: relative;
  padding-bottom: 8px;
  margin-bottom: -8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--border-subtle);
}

.nav-link.active {
  color: var(--accent-cyan);
}

.nav-link svg.chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
  stroke: currentColor;
}

.nav-item:hover .nav-link svg.chevron {
  transform: rotate(180deg);
}

/* Mega-dropdown Menu - Restricted strictly to Tools option */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  transform: translateY(6px);
  width: 330px;
  max-width: 90vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.4);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Invisible hover bridge restricted strictly to the Tools button width (not spanning navbar) */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -16px;
  right: 0;
  left: auto;
  width: 95px;
  height: 16px;
  background: transparent;
  pointer-events: none;
}

.nav-item.has-dropdown:hover .dropdown-menu,
.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-item.has-dropdown:hover .dropdown-menu::before,
.nav-item:hover .dropdown-menu::before {
  pointer-events: auto;
}

.dropdown-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dropdown-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-col-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border-subtle);
}

.dropdown-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.dropdown-card:hover {
  background: var(--border-subtle);
  transform: translateX(3px);
}

.dropdown-card-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-card-icon svg {
  width: 16px;
  height: 16px;
}

.dropdown-card-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-card-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* PWA Network Status Pill */
.network-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  user-select: none;
}

.network-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.network-pill.online .network-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.network-pill.offline {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
}

.network-pill.offline .network-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
}

/* Native PWA Install Button */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pwa-install-btn:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(168, 85, 247, 0.25));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
  transform: translateY(-1px);
}

.pwa-install-btn svg {
  width: 14px;
  height: 14px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.user-avatar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan-glow);
  transform: rotate(15deg);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Hamburger for Mobile */
.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: var(--header-height);
  right: -100%;
  width: 100%;
  max-width: 340px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-surface);
  border-left: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: right var(--transition-normal);
  z-index: 999;
  overflow-y: auto;
}

.mobile-nav-drawer.open {
  right: 0;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.brand-abbr {
  display: none;
}

@media (max-width: 992px) {
  .main-navigation .nav-links {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
}

/* Small Screens & Mobile: Tidy TFS Title */
@media (max-width: 640px) {
  .brand-full {
    display: none;
  }
  .brand-abbr {
    display: inline-block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
  }
  .site-tagline {
    display: none;
  }
  .header-container {
    padding: 0 14px;
    gap: 10px;
  }
  .header-actions {
    gap: 8px;
  }
  .network-pill .network-label {
    display: none;
  }
  .network-pill {
    padding: 6px;
  }
  .pwa-install-btn span {
    display: none;
  }
  .pwa-install-btn {
    padding: 6px 8px;
  }
  .btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
}

