/* ─────────────────────────────────────────────
   StockTrendz AI™ Navbar (Professional Redesign)
   ───────────────────────────────────────────── */

:root {
  --nav-bg: rgba(9, 10, 16, 0.78);
  --nav-border: rgba(255, 255, 255, 0.07);

  --panel-bg: rgba(12, 14, 22, 0.96);
  --panel-border: rgba(255, 255, 255, 0.09);

  --text: rgba(255, 255, 255, 0.78);
  --text-strong: rgba(255, 255, 255, 0.95);
  --text-muted: rgba(255, 255, 255, 0.50);

  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.18);

  --green: rgba(34, 197, 94, 1);
  --red: rgba(239, 68, 68, 1);
  --amber: rgba(251, 191, 36, 1);

  --radius: 14px;
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 66px;

  z-index: 1000;

  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nav-border);

  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 22px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Brand ── */
.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.logo-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.logo-text-group {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.logo-text {
  font-family: "Sora", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.logo-tag {
  font-size: 0.72rem;
  font-weight: 900;
  background: var(--accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: 6px;
}

.logo-tm {
  font-size: 0.68rem;
  opacity: 0.6;
  margin-left: -4px;
  color: #fff;
}

/* ── Desktop Menu ── */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;

  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 9px 14px;
  border-radius: 12px;

  font-family: "Sora", sans-serif;
  font-size: 0.86rem;
  font-weight: 650;

  color: var(--text);
  background: transparent;
  border: 1px solid transparent;

  text-decoration: none;
  cursor: pointer;

  transition: all 0.18s ease;
}

.nav-link:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-link--active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.nav-link--highlight {
  border-color: rgba(139, 92, 246, 0.4) !important;
  background: rgba(139, 92, 246, 0.08) !important;
}

.nav-link--highlight:hover {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: rgba(139, 92, 246, 0.6) !important;
}

.nav-link--highlight-amber {
  border-color: rgba(251, 191, 36, 0.4) !important;
  background: rgba(251, 191, 36, 0.08) !important;
}

.nav-link--highlight-amber:hover {
  background: rgba(251, 191, 36, 0.15) !important;
  border-color: rgba(251, 191, 36, 0.6) !important;
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

/* dropdown caret */
.nav-dropdown-toggle {
  border: none;
  outline: none;
}

.nav-dropdown-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 4px;

  border-right: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);

  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

/* ── Dropdown Panels ── */
.nav-dropdown {
  position: relative;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;

  width: 360px;
  padding: 12px;

  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;

  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(16px);

  display: none;
  z-index: 1001;
}

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

.nav-dropdown.open .nav-dropdown-toggle::after {
  transform: rotate(225deg);
}

.nav-panel-title {
  font-family: "Sora", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);

  padding: 6px 10px 12px 10px;
}

/* dropdown items */
.nav-panel-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 12px;
  border-radius: 14px;
  border: 1px solid transparent;

  text-decoration: none;
  transition: all 0.18s ease;
}

.nav-panel-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
}

.nav-panel-item.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.22);
}

.panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

.panel-icon.purple { background: rgba(139, 92, 246, 0.18); }
.panel-icon.cyan   { background: rgba(34, 211, 238, 0.14); }
.panel-icon.violet { background: rgba(167, 139, 250, 0.14); }
.panel-icon.green  { background: rgba(52, 211, 153, 0.14); }
.panel-icon.amber  { background: rgba(251, 191, 36, 0.14); }

.panel-title {
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
  font-weight: 750;
  color: #fff;
}

.panel-desc {
  font-family: "Sora", sans-serif;
  font-size: 0.76rem;
  margin-top: 2px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Right Side ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-market-status {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 12px;
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-ist-clock {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.nav-session-badge {
  display: flex;
  align-items: center;
  gap: 7px;

  padding: 6px 10px;
  border-radius: 999px;

  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  border: 1px solid rgba(255, 255, 255, 0.08);
}

.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.badge-closed {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.25);
  color: rgba(239, 68, 68, 0.95);
}

.badge-open {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.25);
  color: rgba(34, 197, 94, 0.95);
}

.badge-preopen {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.25);
  color: rgba(251, 191, 36, 0.95);
}

.session-dot.closed { background: var(--red); }
.session-dot.open { background: var(--green); box-shadow: 0 0 10px rgba(34, 197, 94, 0.75); }
.session-dot.preopen { background: var(--amber); box-shadow: 0 0 10px rgba(251, 191, 36, 0.7); }

/* Auth Buttons */
.nav-auth-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn-ghost {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;

  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);

  color: #fff;
  font-weight: 750;
  font-size: 0.84rem;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: 0.18s ease;
}

.nav-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn-primary {
  height: 38px;
  padding: 0 16px;
  border-radius: 12px;

  background: var(--accent);
  border: 1px solid rgba(139, 92, 246, 0.55);

  color: #fff;
  font-weight: 850;
  font-size: 0.84rem;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: 0.18s ease;
}

.nav-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25);
}

/* Avatar */
.nav-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);

  color: #fff;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 0.78rem;
  font-weight: 900;

  transition: all 0.18s ease;
}

.nav-avatar-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

/* ── Hamburger ── */
.nav-hamburger {
  display: none;
  z-index: 1002;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-hamburger span {
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  display: block;
  margin: 5px 0;
}

/* ── Mobile Drawer ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);

  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;

  width: 310px;
  height: 100%;
  padding: 20px;

  background: rgba(10, 12, 18, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.08);

  z-index: 1002;
  overflow-y: auto;

  transform: translateX(110%);
  transition: transform 0.25s ease;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-drawer.open {
  transform: translateX(0%);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-bottom: 16px;
  margin-bottom: 18px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: #fff;
}

.drawer-brand-tag {
  font-size: 0.7rem;
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 6px;
}

.drawer-ist {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.drawer-item {
  display: flex;
  align-items: center;

  padding: 12px 14px;
  border-radius: 14px;

  color: rgba(255, 255, 255, 0.70);
  text-decoration: none;

  font-weight: 750;
  font-size: 0.92rem;

  transition: 0.18s ease;
}

.drawer-item:hover,
.drawer-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.drawer-section-label {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;

  color: rgba(255, 255, 255, 0.35);
  margin: 14px 0 4px 14px;
  letter-spacing: 0.08em;
}

.drawer-child {
  padding-left: 34px;
  font-size: 0.88rem;
  font-weight: 650;
}

.drawer-auth {
  margin-top: auto;
  padding-top: 18px;

  border-top: 1px solid rgba(255, 255, 255, 0.06);

  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Buttons inside drawer */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 44px;
  border-radius: 14px;

  font-weight: 850;
  text-decoration: none;
  font-size: 0.92rem;

  cursor: pointer;
  transition: 0.18s ease;
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary {
  background: var(--accent);
  border: 1px solid rgba(139, 92, 246, 0.55);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .nav-menu { display: none; }
  .nav-hamburger { display: block; }
}

/* Embed mode */
html.embed-mode .navbar,
html.embed-mode .nav-drawer,
html.embed-mode .nav-overlay,
html.embed-mode footer.footer {
  display: none !important;
}

html.embed-mode body {
  padding-top: 0 !important;
}