/* Nucleora Menubar - Fusion 360 Style
   Uses app's CSS variables for theme compatibility */

/* CRITICAL: Hide ALL old navigation immediately */
.rail,
nav.rail,
header,
.header,
.topbar,
#topbar,
.stepper,
.tabs,
#headerNav,
#sideNav,
.workflow-stepper,
.guided-panel,
.rail-brand,
.rail-group,
.rail-item,
.rail-toggle,
.rail-label,
.header-right,
.test-version-banner {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Reset main layout - remove rail margin */
main {
  margin-left: 0 !important;
  padding-top: 36px !important;
  width: 100% !important;
}

/* Hide body's built-in padding/margin for old layout */
body {
  padding-left: 0 !important;
}

/* Menubar container - uses app variables */
.nucleora-menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--bg2, var(--n-bg-1, #ffffff));
  border-bottom: 1px solid var(--line, var(--n-line-1, #dce0e5));
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  user-select: none;
}

/* Logo */
.menubar-logo {
  display: flex;
  align-items: center;
  padding: 0 12px 0 4px;
  cursor: pointer;
  border-right: 1px solid var(--line, var(--n-line-1, #dce0e5));
  margin-right: 4px;
  height: 100%;
}

.menubar-logo img {
  height: 24px;
  width: auto;
}

/* Menu items */
.menubar-menu {
  position: relative;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--ink, var(--n-ink-1, #13181d));
}

.menubar-menu:hover,
.menubar-menu.active {
  background: var(--panel2, var(--n-bg-3, #f1f3f5));
}

/* Dropdown */
.menubar-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--panel, var(--n-bg-2, #ffffff));
  border: 1px solid var(--line, var(--n-line-1, #dce0e5));
  border-radius: 6px;
  box-shadow: var(--n-shadow-3, 0 4px 10px rgba(19,24,29,.14));
  padding: 6px 0;
  z-index: 10001;
  display: none;
}

.menubar-menu.active .menubar-dropdown {
  display: block;
}

.menubar-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  gap: 12px;
  color: var(--ink, var(--n-ink-1, #13181d));
}

.menubar-item:hover {
  background: var(--panel2, var(--n-bg-3, #f1f3f5));
}

.menubar-item-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
  color: var(--muted, var(--n-ink-2, #4a535d));
}

.menubar-item-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.menubar-divider {
  height: 1px;
  background: var(--line, var(--n-line-1, #dce0e5));
  margin: 6px 0;
}

.menubar-section-label {
  padding: 6px 16px 4px;
  font-size: 11px;
  color: var(--muted, var(--n-ink-2, #4a535d));
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Right side spacer */
.menubar-spacer {
  flex: 1;
}

/* Welcome screen */
.nucleora-welcome {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg, var(--n-bg-0, #f2f4f6));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 40px;
}

.nucleora-welcome.hidden {
  display: none;
}

.welcome-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  opacity: 0.6;
}

.welcome-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink, var(--n-ink-1, #13181d));
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 14px;
  color: var(--muted, var(--n-ink-2, #4a535d));
  margin-bottom: 40px;
  text-align: center;
  max-width: 400px;
}

.welcome-actions {
  display: grid;
  grid-template-columns: repeat(3, 180px);
  gap: 16px;
  max-width: 600px;
}

.welcome-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--panel, var(--n-bg-2, #ffffff));
  border: 1px solid var(--line, var(--n-line-1, #dce0e5));
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.welcome-action:hover {
  border-color: var(--acc, var(--n-accent, #17457c));
  box-shadow: var(--n-shadow-2, 0 2px 4px rgba(19,24,29,.10));
  transform: translateY(-2px);
}

.welcome-action-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  color: var(--acc, var(--n-accent, #17457c));
}

.welcome-action-icon svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
}

.welcome-action-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink, var(--n-ink-1, #13181d));
  margin-bottom: 4px;
}

.welcome-action-desc {
  font-size: 12px;
  color: var(--muted, var(--n-ink-2, #4a535d));
  text-align: center;
}

/* Welcome screen shows by default, body.has-active-view hides it */
body.has-active-view .nucleora-welcome {
  display: none !important;
}

/* Menubar buttons (theme toggle, logout) */
.menubar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 4px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--ink, var(--n-ink-1, #13181d));
  cursor: pointer;
  transition: background 0.15s;
}

.menubar-btn:hover {
  background: var(--line, var(--n-line-1, rgba(0,0,0,0.08)));
}

.menubar-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.menubar-logout {
  margin-right: 8px;
}

.menubar-logout:hover {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}
