/**
 * nav-dropdown.css
 * Owns: 6-category dropdown nav (desktop) + accordion hamburger (mobile),
 *       mini Market Mood badge (.nav-mood-badge) injected by nav-dropdown.js.
 * Does NOT own: auth chip / mobile-auth-wrap (mobile-auth.css), page body layout.
 *
 * Load after base page styles. Pair with nav-dropdown.js.
 */

/* ── Reset & base nav shell ──────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 250;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  height: 56px;
  background: rgba(8, 11, 15, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── Left side: logo + breadcrumb ─────────────────────────────────── */
.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.logo {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #e8edf2;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo em { color: #00ff88; font-style: normal; }

.nav-breadcrumb {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.nav-breadcrumb span { color: #8a97a8; }

/* ── Center: 6-category nav ───────────────────────────────────────── */
.nav-categories {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  flex: 1;
  justify-content: center;
}

/* ── Category item (trigger + dropdown) ───────────────────────────── */
.nav-cat {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-cat-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 100%;
  padding: 0 0.85rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a97a8;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
  text-decoration: none;
  position: relative;
}

.nav-cat-btn::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 0.2rem;
  opacity: 0.6;
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* Categories that are just links (no dropdown) get no chevron */
.nav-cat-btn.no-chevron::after { display: none; }

.nav-cat:hover .nav-cat-btn,
.nav-cat.active .nav-cat-btn {
  color: #00ff88;
}

.nav-cat.open .nav-cat-btn::after {
  transform: rotate(180deg);
}

/* Active indicator bar under button */
.nav-cat.active .nav-cat-btn::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0.5rem; right: 0.5rem;
  height: 2px;
  background: #00ff88;
}

/* ── Dropdown panel ──────────────────────────────────────────────── */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: rgba(8, 11, 15, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 255, 136, 0.12);
  border-top: none;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  z-index: 10000;
  padding: 0.5rem 0;
  animation: navDropIn 0.15s ease;
}

@keyframes navDropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-cat.open .nav-dropdown { display: block; }

.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a97a8;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}

.nav-dropdown a:hover {
  color: #00ff88;
  background: rgba(0, 255, 136, 0.06);
}

.nav-dropdown a.active {
  color: #00ff88;
  background: rgba(0, 255, 136, 0.08);
}

.nav-dropdown a .nav-icon {
  font-size: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Command Center icon (right of categories) ────────────────────── */
.nav-cmd-icon {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.nav-cmd-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  color: #4a5568;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.06);
  transition: color 0.15s, border-color 0.15s;
  font-size: 0.85rem;
  position: relative;
}
.nav-cmd-link:hover {
  color: #00ff88;
  border-color: rgba(0,255,136,0.25);
}
.nav-cmd-link title-attr { display: none; }

/* ── Live indicator ───────────────────────────────────────────────── */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: #00ff88;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #00ff88;
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,255,136,0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(0,255,136,0); }
}

/* ── Right side (auth chip) ───────────────────────────────────────── */
.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

/* ── Hamburger ────────────────────────────────────────────────────── */
/* !important overrides inline <style> blocks on individual pages that
   still carry legacy hamburger rules (display: none/block, wrong margins,
   missing flex layout).  The canonical hamburger styles live HERE only. */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 0 !important;
  z-index: 260;
  flex-shrink: 0;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  overflow: visible !important;
  -webkit-appearance: none;
  appearance: none;
}
.hamburger span {
  display: block !important;
  width: 24px;
  height: 2px;
  background: #e8edf2 !important;
  /* No margin — flex space-between handles the 3-bar spacing inside 18px */
  margin: 0 !important;
  transition: transform 0.25s, opacity 0.25s;
  box-shadow: 0 0 4px rgba(232,237,242,0.4);
  pointer-events: none;
  flex-shrink: 0;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Mobile menu overlay ─────────────────────────────────────────── */
.nav-mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: rgba(8, 11, 15, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0,255,136,0.12);
  z-index: 240;
  padding: 0.75rem 0;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}
.nav-mobile-menu.open { display: block; }

/* Mobile category accordion ─── */
.mobile-cat {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mobile-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a97a8;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}
.mobile-cat-btn.active { color: #00ff88; }
.mobile-cat-chevron {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.mobile-cat.open .mobile-cat-chevron { transform: rotate(180deg); }

/* Mobile sub-links ── */
.mobile-sub-links {
  display: none;
  flex-direction: column;
  padding: 0 0 0.25rem 0;
  background: rgba(0,255,136,0.02);
}
.mobile-cat.open .mobile-sub-links { display: flex; }
.mobile-sub-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem 0.55rem 2rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a5568;
  text-decoration: none;
  transition: color 0.12s;
}
.mobile-sub-links a:hover,
.mobile-sub-links a.active { color: #00ff88; }
.mobile-sub-links a .nav-icon { font-size: 0.8rem; }

/* Mobile cmd center link ─── */
.mobile-cmd-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4a5568;
  text-decoration: none;
  border-top: 1px solid rgba(255,255,255,0.04);
  transition: color 0.12s;
}
.mobile-cmd-link:hover { color: #00ff88; }

/* ── Responsive breakpoints ──────────────────────────────────────── */

/* Medium desktop: tighten category spacing */
@media (min-width: 769px) and (max-width: 1200px) {
  .nav-cat-btn { padding: 0 0.6rem; font-size: 0.58rem; }
  .live-indicator { display: none; }
  .nav-breadcrumb { display: none; }
}

/* Small desktop: hide breadcrumb + live */
@media (min-width: 769px) and (max-width: 960px) {
  .nav-cat-btn { padding: 0 0.45rem; font-size: 0.54rem; }
  .nav-cmd-icon { display: none; }
}

/* Mobile: hide desktop categories, show hamburger */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-categories { display: none !important; }
  .nav-cmd-icon { display: none; }
  .live-indicator { display: none; }
  .nav-breadcrumb { display: none; }
  .hamburger {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: 24px !important;
    height: 18px !important;
    overflow: visible !important;
  }
}

/* ── Mini Market Mood badge (injected by nav-dropdown.js) ────────── */
.nav-mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
}

.nav-mood-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  /* default neutral until data loads */
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
}

.nav-mood-badge:hover .nav-mood-dot {
  transform: scale(1.1);
}

.nav-mood-dot-score {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  color: #e8edf2;
}

/* Color variants set via data-mood attribute on .nav-mood-dot */
.nav-mood-dot[data-mood="green"] {
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.45);
  box-shadow: 0 0 8px rgba(0,255,136,0.18);
}
.nav-mood-dot[data-mood="green"] .nav-mood-dot-score { color: #00ff88; }

.nav-mood-dot[data-mood="yellow"] {
  background: rgba(255, 183, 0, 0.15);
  border-color: rgba(255, 183, 0, 0.45);
  box-shadow: 0 0 8px rgba(255,183,0,0.15);
}
.nav-mood-dot[data-mood="yellow"] .nav-mood-dot-score { color: #ffb700; }

.nav-mood-dot[data-mood="red"] {
  background: rgba(255, 68, 85, 0.15);
  border-color: rgba(255, 68, 85, 0.45);
  box-shadow: 0 0 8px rgba(255,68,85,0.15);
}
.nav-mood-dot[data-mood="red"] .nav-mood-dot-score { color: #ff4455; }

/* Text label next to dot — must be large + opaque enough to read at a glance.
   Previous 0.56rem / 65% opacity was technically in the DOM but practically invisible. */
.nav-mood-text {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a97a8;
  white-space: nowrap;
  transition: color 0.15s;
  line-height: 1.2;
}

.nav-mood-badge[data-mood="green"] .nav-mood-text { color: #00ff88; }
.nav-mood-badge[data-mood="yellow"] .nav-mood-text { color: #ffb700; }
.nav-mood-badge[data-mood="red"] .nav-mood-text { color: #ff4455; }

/* On mobile, inline <style> blocks on HTML pages hide .nav-left entirely.
   Override that so the logo + mood badge remain visible on mobile. */
@media (max-width: 768px) {
  .nav-left { display: flex !important; }
  .nav-mood-dot { width: 24px; height: 24px; }
  .nav-mood-dot-score { font-size: 7px; }
  .nav-mood-text { font-size: 0.58rem; }
}
