/* ── BLACKFEED SHARED NAV ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('/static/theme.css');
@import url('/static/mobile.css');

/* Global font upgrade — pages can override via their own :root vars */
body {
  font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: var(--font-size-base, 14px);
}
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
}

#app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Row 1: Section bar ── */
.nav-section-bar {
  background: var(--nav-bg, rgba(4,6,18,0.97));
  border-bottom: 1px solid var(--border, #1a2a40);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 48px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--accent, #38bdf8);
  padding-right: 20px;
  border-right: 1px solid var(--border, #1a2a40);
  margin-right: 8px;
  font-family: var(--mono, monospace);
  white-space: nowrap;
  text-decoration: none;
  transition: opacity .15s;
}
.nav-brand:hover { opacity: .8; }

.nav-section-tab {
  padding: 0 16px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text3, #64748b);
  text-decoration: none;
  transition: color .15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.nav-section-tab:hover { color: var(--text1, #e2e8f0); }
.nav-section-tab.active { color: var(--accent, #38bdf8); border-bottom-color: var(--accent, #38bdf8); }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* User menu */
.nav-user-wrap {
  position: relative;
}
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border, #1a2a40);
  border-radius: 2px;
  background: none;
  cursor: pointer;
  transition: border-color .15s;
}
.nav-user-btn:hover { border-color: var(--accent, #38bdf8); }
#nav-user {
  font-size: 12px;
  color: var(--text3, #64748b);
  font-family: 'Inter', sans-serif;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-caret {
  font-size: 9px;
  color: var(--text3, #64748b);
}
.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--nav-bg, rgba(4,6,18,0.97));
  border: 1px solid var(--border, #1a2a40);
  min-width: 200px;
  z-index: 400;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border-radius: 2px;
}
.nav-user-wrap.open .nav-user-dropdown { display: block; }
.nav-user-dropdown a,
.nav-user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2, #94a3b8);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .15s;
  border-bottom: 1px solid var(--border, #1a2a40);
}
.nav-user-dropdown a:last-child,
.nav-user-dropdown button:last-child { border-bottom: none; }
.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover { color: var(--accent, #38bdf8); background: rgba(56,189,248,0.04); }
.nav-user-dropdown .nav-logout-btn:hover { color: var(--neg, #f87171); }
.nav-user-dropdown .nav-tour-toggle:hover { color: var(--pos, #34d399); }

#theme-btn {
  padding: 6px 10px;
  border: 1px solid var(--border, #1a2a40);
  color: var(--text3, #64748b);
  cursor: pointer;
  background: none;
  font-size: 14px;
  border-radius: 2px;
  line-height: 1;
  transition: all .15s;
}
#theme-btn:hover { border-color: var(--accent, #38bdf8); color: var(--accent, #38bdf8); }

/* Tour help button */
#tour-help-btn {
  padding: 6px 10px;
  border: 1px solid var(--border, #1a2a40);
  color: var(--text3, #64748b);
  cursor: pointer;
  background: none;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono, monospace);
  border-radius: 2px;
  line-height: 1;
  transition: all .15s;
}
#tour-help-btn:hover { border-color: var(--accent, #38bdf8); color: var(--accent, #38bdf8); }
#tour-help-btn.has-tour { color: var(--accent, #38bdf8); border-color: rgba(56,189,248,0.4); }

.nav-mob-btn {
  display: none;
  padding: 6px 10px;
  border: 1px solid var(--border, #1a2a40);
  color: var(--text3, #64748b);
  cursor: pointer;
  background: none;
  font-size: 16px;
  border-radius: 2px;
  line-height: 1;
}

/* ── Row 2: Sub-nav ── */
.nav-sub-bar {
  background: var(--bg2, #070b1a);
  border-bottom: 1px solid var(--border, #1a2a40);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 36px;
}

.nav-sub {
  display: none;
  align-items: center;
  height: 100%;
  gap: 0;
  flex: 1;
}
.nav-sub.active { display: flex; }

.nav-sub-link {
  padding: 0 13px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text3, #64748b);
  text-decoration: none;
  transition: color .15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.nav-sub-link:hover { color: var(--text1, #e2e8f0); }
.nav-sub-link.active { color: var(--accent, #38bdf8); border-bottom-color: var(--accent, #38bdf8); }

/* + NEW EVENT button in events sub-nav */
.nav-new-event-btn {
  margin-left: auto;
  padding: 4px 14px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--accent, #38bdf8);
  border: 1px solid var(--accent, #38bdf8);
  border-radius: 6px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: all .15s;
  cursor: pointer;
}
.nav-new-event-btn:hover {
  background: var(--accent, #38bdf8);
  color: var(--bg, #04040e);
}
@keyframes nav-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(56,189,248,0); }
  50%     { box-shadow: 0 0 0 4px rgba(56,189,248,0.15); }
}
.nav-new-event-btn { animation: nav-pulse 3s ease-in-out infinite; }

/* ── Mobile menu ── */
.nav-mob-menu {
  display: none;
  position: fixed;
  top: 84px;
  left: 0;
  right: 0;
  background: var(--nav-bg, rgba(4,6,18,0.97));
  border-bottom: 1px solid var(--border, #1a2a40);
  z-index: 250;
  flex-direction: column;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}
.nav-mob-menu.open { display: flex; }

.nav-mob-section-hdr {
  padding: 10px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent, #38bdf8);
  font-family: 'Inter', sans-serif;
  background: var(--bg3, #0b1020);
  border-bottom: 1px solid var(--border, #1a2a40);
}
.nav-mob-menu a {
  display: block;
  padding: 11px 28px;
  color: var(--text2, #94a3b8);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border, #1a2a40);
  transition: color .15s;
}
.nav-mob-menu a:hover { color: var(--accent, #38bdf8); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-mob-btn { display: inline-flex !important; }
  .nav-section-tab { display: none !important; }
  .nav-sub-bar { display: none !important; }
}

/* ════════════════════════════════════════════════
   SECTION THEMES — accent + sub-nav tint per section
   ════════════════════════════════════════════════ */

/* INTELLIGENCE — Sky blue (was EVENTS) */
body[data-section="intelligence"] {
  --accent: #38bdf8;
  --accent-rgb: 56,189,248;
  --section-tint: rgba(56,189,248,0.03);
  --section-border: rgba(56,189,248,0.15);
}

/* SETTINGS — Cool slate */
body[data-section="settings"] {
  --accent: #94a3b8;
  --accent-rgb: 148,163,184;
  --section-tint: rgba(148,163,184,0.03);
  --section-border: rgba(148,163,184,0.15);
}

/* EVENTS — Sky blue (legacy, for any unmigrated pages) */
body[data-section="events"] {
  --accent: #38bdf8;
  --accent-rgb: 56,189,248;
  --section-tint: rgba(56,189,248,0.03);
  --section-border: rgba(56,189,248,0.15);
}

/* MARKETS — Amber / gold */
body[data-section="markets"] {
  --accent: #f59e0b;
  --accent-rgb: 245,158,11;
  --section-tint: rgba(245,158,11,0.03);
  --section-border: rgba(245,158,11,0.15);
}

/* TRADING — Emerald green */
body[data-section="trading"] {
  --accent: #10b981;
  --accent-rgb: 16,185,129;
  --section-tint: rgba(16,185,129,0.03);
  --section-border: rgba(16,185,129,0.15);
}

/* ADMIN — Violet */
body[data-section="admin"] {
  --accent: #8b5cf6;
  --accent-rgb: 139,92,246;
  --section-tint: rgba(139,92,246,0.03);
  --section-border: rgba(139,92,246,0.15);
}

/* Sub-nav tint per section */
body[data-section] .nav-sub-bar {
  background: linear-gradient(to right, var(--section-tint, transparent), transparent);
  border-bottom-color: var(--section-border, var(--border, #1a2a40));
}

/* Section tab active + brand color follow the theme */
body[data-section] .nav-section-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
body[data-section] .nav-sub-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
body[data-section] .nav-brand { color: var(--accent); }

/* Pulse animation for NEW EVENT follows theme */
@keyframes nav-pulse-themed {
  0%,100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb,56,189,248),0); }
  50%     { box-shadow: 0 0 0 4px rgba(var(--accent-rgb,56,189,248),0.15); }
}
body[data-section] .nav-new-event-btn {
  animation: nav-pulse-themed 3s ease-in-out infinite;
}

/* Light mode — soften the tints */
body.light[data-section] .nav-sub-bar {
  background: linear-gradient(to right, var(--section-tint, transparent), transparent);
}
