/* ═══════════════════════════════════════════════════════════
   ProBroker AI — Contextual Guided Tour
   Dark premium glassmorphism, matching the Studio design system.
═══════════════════════════════════════════════════════════ */

/* ── Welcome overlay ─────────────────────────────────────── */

#onb-welcome {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

#onb-welcome.onb-hidden { display: none; }

.onb-welcome-inner {
  background: rgba(5, 11, 24, 0.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(52, 198, 244, 0.26);
  border-radius: 20px;
  padding: 36px 36px 30px;
  max-width: 400px;
  width: calc(100vw - 32px);
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(52, 198, 244, 0.06),
    0 32px 80px rgba(0, 0, 0, 0.88),
    0 0 60px rgba(52, 198, 244, 0.04);
  animation: onb-scale-in 0.38s cubic-bezier(0, 0, 0.2, 1);
}

/* Real ProBroker AI logo */
.onb-logo {
  width: 108px;
  height: 108px;
  object-fit: contain;
  display: block;
  margin: 0 auto 24px;
  filter: drop-shadow(0 0 18px rgba(52, 198, 244, 0.18));
}

.onb-welcome-title {
  font-family: var(--font, 'Inter', -apple-system, sans-serif);
  font-size: 21px;
  font-weight: 600;
  color: #F4F7FB;
  margin-bottom: 10px;
  line-height: 1.3;
}

.onb-welcome-body {
  font-family: var(--font, 'Inter', -apple-system, sans-serif);
  font-size: 14px;
  color: rgba(147, 163, 184, 0.9);
  line-height: 1.6;
  margin-bottom: 26px;
}

.onb-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* ── Backdrop ────────────────────────────────────────────── */

#onb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  transition: background 0.28s ease;
}

#onb-backdrop.onb-backdrop-full {
  background: rgba(3, 8, 20, 0.86);
  pointer-events: all;
}

#onb-backdrop.onb-backdrop-dim {
  background: rgba(3, 8, 20, 0.62);
  pointer-events: all;
}

/* ── Spotlight ring ──────────────────────────────────────── */

#onb-spotlight {
  position: fixed;
  z-index: 10001;
  pointer-events: none;
  border-radius: 10px;
  box-shadow:
    0 0 0 2px #34C6F4,
    0 0 0 5px rgba(52, 198, 244, 0.16),
    0 0 28px rgba(52, 198, 244, 0.12);
  transition:
    top    0.26s cubic-bezier(0, 0, 0.2, 1),
    left   0.26s cubic-bezier(0, 0, 0.2, 1),
    width  0.26s cubic-bezier(0, 0, 0.2, 1),
    height 0.26s cubic-bezier(0, 0, 0.2, 1);
  display: none;
  animation: onb-ring-pulse 2.8s ease-in-out infinite;
}

/* ── Tour card ───────────────────────────────────────────── */

#onb-card {
  position: fixed;
  z-index: 10005;
  background: rgba(6, 12, 26, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(52, 198, 244, 0.19);
  border-radius: 14px;
  padding: 20px 22px 18px;
  max-width: 300px;
  width: calc(100vw - 32px);
  box-shadow:
    0 0 0 1px rgba(52, 198, 244, 0.04),
    0 20px 60px rgba(0, 0, 0, 0.80);
  transition:
    top  0.26s cubic-bezier(0, 0, 0.2, 1),
    left 0.26s cubic-bezier(0, 0, 0.2, 1);
  animation: onb-scale-in 0.22s cubic-bezier(0, 0, 0.2, 1);
}

#onb-card.onb-hidden { display: none; }

.onb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.onb-step-badge {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  font-weight: 500;
  color: #34C6F4;
  background: rgba(52, 198, 244, 0.09);
  border: 1px solid rgba(52, 198, 244, 0.17);
  border-radius: 20px;
  padding: 2px 9px;
  letter-spacing: 0.05em;
}

.onb-card-skip {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 11px;
  color: rgba(147, 163, 184, 0.45);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s;
  white-space: nowrap;
}

.onb-card-skip:hover { color: rgba(147, 163, 184, 0.80); }

.onb-card-title {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: #F4F7FB;
  margin-bottom: 7px;
  line-height: 1.3;
}

.onb-card-body {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 13px;
  color: rgba(147, 163, 184, 0.9);
  line-height: 1.56;
  margin-bottom: 18px;
}

.onb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Footer variant for noNext steps: "Waiting for upload…" */
.onb-footer-skip-only {
  justify-content: space-between;
  align-items: center;
}

.onb-awaiting {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 11px;
  color: rgba(147, 163, 184, 0.40);
  font-style: italic;
}

/* ── Step dots ───────────────────────────────────────────── */

.onb-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.onb-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(52, 198, 244, 0.18);
  transition: background 0.2s, transform 0.2s;
}

.onb-dot-active {
  background: #34C6F4;
  transform: scale(1.35);
}

/* ── Buttons ─────────────────────────────────────────────── */

.onb-btn-primary {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: #07090F;
  background: #34C6F4;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}

.onb-btn-primary:hover  { opacity: 0.87; transform: translateY(-1px); }
.onb-btn-primary:active { transform: translateY(0); }

.onb-btn-ghost {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: rgba(147, 163, 184, 0.52);
  background: none;
  border: 1px solid rgba(120, 150, 190, 0.18);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.onb-btn-ghost:hover:not(:disabled) {
  color: #F4F7FB;
  border-color: rgba(120, 150, 190, 0.34);
}

.onb-btn-ghost:disabled {
  opacity: 0.30;
  cursor: not-allowed;
}

.onb-btn-skip-lg {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 400;
  color: rgba(147, 163, 184, 0.50);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
  white-space: nowrap;
}

.onb-btn-skip-lg:hover { color: rgba(147, 163, 184, 0.85); }

/* ── Top-bar Guide button ────────────────────────────────── */

.onb-topbar-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font, 'Inter', -apple-system, sans-serif);
  font-size: 12px;
  font-weight: 500;
  color: rgba(52, 198, 244, 0.82);
  background: rgba(52, 198, 244, 0.07);
  border: 1px solid rgba(52, 198, 244, 0.20);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.onb-topbar-guide-btn svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.onb-topbar-guide-btn:hover {
  background: rgba(52, 198, 244, 0.13);
  border-color: rgba(52, 198, 244, 0.38);
  color: #34C6F4;
  transform: translateY(-1px);
}

.onb-topbar-guide-btn:active { transform: translateY(0); }

/* ── Guide launcher panel ────────────────────────────────── */

#onb-launcher {
  position: fixed;
  top: 54px;
  right: 12px;
  z-index: 10020;
  min-width: 252px;
  max-width: 288px;
}

#onb-launcher.onb-hidden { display: none; }

.onb-launcher-inner {
  background: rgba(4, 9, 20, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(52, 198, 244, 0.20);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(52, 198, 244, 0.05),
    0 24px 72px rgba(0, 0, 0, 0.90);
  animation: onb-scale-in 0.16s cubic-bezier(0, 0, 0.2, 1);
  transform-origin: top right;
}

.onb-launcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 9px;
  border-bottom: 1px solid rgba(52, 198, 244, 0.09);
}

.onb-launcher-title {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(147, 163, 184, 0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onb-launcher-close {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 12px;
  color: rgba(147, 163, 184, 0.35);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.13s;
  line-height: 1;
}

.onb-launcher-close:hover { color: rgba(147, 163, 184, 0.75); }

.onb-launcher-list {
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 400px;
  overflow-y: auto;
}

.onb-launcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}

.onb-launcher-item:hover {
  background: rgba(52, 198, 244, 0.07);
  border-color: rgba(52, 198, 244, 0.10);
}

.onb-launcher-item--primary {
  background: rgba(52, 198, 244, 0.09);
  border-color: rgba(52, 198, 244, 0.18);
  margin-bottom: 3px;
}

.onb-launcher-item--primary:hover {
  background: rgba(52, 198, 244, 0.15);
  border-color: rgba(52, 198, 244, 0.28);
}

.onb-launcher-item-icon {
  font-size: 11px;
  color: #34C6F4;
  opacity: 0.75;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.onb-launcher-item--primary .onb-launcher-item-icon {
  opacity: 1;
}

.onb-launcher-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.onb-launcher-item-label {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 12.5px;
  font-weight: 500;
  color: #F4F7FB;
  line-height: 1.3;
}

.onb-launcher-item-desc {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 10.5px;
  color: rgba(147, 163, 184, 0.48);
  line-height: 1.3;
}

.onb-launcher-notice {
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 11.5px;
  color: rgba(52, 198, 244, 0.70);
  padding: 10px 14px;
  border-top: 1px solid rgba(52, 198, 244, 0.09);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

/* ── Inline help tooltip (JS-managed, body-appended) ──────── */

/* Old CSS pseudo-element approach removed — tooltip is now a
   single #onb-tip div appended to <body> by onboarding.js so it
   is never clipped by overflow:hidden panels. */

#onb-tip {
  position: fixed;
  z-index: 10060;
  display: none;
  max-width: 280px;
  width: max-content;
  background: rgba(4, 9, 20, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(147, 163, 184, 0.90);
  font-family: var(--font, 'Inter', -apple-system, sans-serif);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.54;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(52, 198, 244, 0.18);
  box-shadow:
    0 0 0 1px rgba(52, 198, 244, 0.05),
    0 10px 36px rgba(0, 0, 0, 0.80);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s;
  white-space: normal;
  word-wrap: break-word;
}

/* ── Animations ──────────────────────────────────────────── */

@keyframes onb-scale-in {
  from { opacity: 0; transform: scale(0.94) translateY(6px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

@keyframes onb-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #34C6F4, 0 0 0 5px rgba(52,198,244,0.16), 0 0 28px rgba(52,198,244,0.12); }
  50%       { box-shadow: 0 0 0 2px #34C6F4, 0 0 0 7px rgba(52,198,244,0.24), 0 0 40px rgba(52,198,244,0.18); }
}

/* ── Reduced motion ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  #onb-card, .onb-welcome-inner { animation: none; }
  #onb-spotlight                 { animation: none; transition: none; }
  #onb-card                      { transition: none; }
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .onb-welcome-inner { padding: 30px 20px 22px; }
  .onb-welcome-title { font-size: 19px; }

  #onb-card {
    max-width: calc(100vw - 20px);
    bottom: 14px;
    top: auto !important;
    left: 10px !important;
  }
}
