/**
 * onboarding.css — Smart Onboarding UI v1.0
 * Non-invasive, dismissible, role-aware. Namespace: .ob-
 */

/* ── TOKENS ──────────────────────────────────────────── */
:root {
  --ob-blue:     #3B82F6;
  --ob-green:    #10B981;
  --ob-amber:    #F59E0B;
  --ob-purple:   #8B5CF6;
  --ob-radius:   14px;
  --ob-font:     system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ══════════════════════════════════════════════════════
   1. FLOATING LAUNCHER (bottom-right pill)
══════════════════════════════════════════════════════ */
.ob-launcher {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 99px;
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  color: #fff; font-family: var(--ob-font);
  font-size: 13px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 24px rgba(37,99,235,.3);
  transition: transform .15s, box-shadow .15s;
  animation: obBounceIn .4s cubic-bezier(.34,1.56,.64,1);
  user-select: none;
}
.ob-launcher:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(37,99,235,.4); }
.ob-launcher__pct {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.18); display: flex;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
}
.ob-launcher__close {
  margin-left: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  cursor: pointer; font-size: 11px; display: flex;
  align-items: center; justify-content: center;
}
.ob-launcher__close:hover { background: rgba(255,255,255,.2); }
.ob-launcher.hidden { display: none; }
@keyframes obBounceIn { from{opacity:0;transform:scale(.8)translateY(20px)} to{opacity:1;transform:scale(1)translateY(0)} }

/* ══════════════════════════════════════════════════════
   2. PANEL (slide-up checklist)
══════════════════════════════════════════════════════ */
.ob-panel {
  position: fixed; bottom: 80px; right: 24px; z-index: 901;
  width: 380px; max-width: calc(100vw - 48px);
  max-height: 520px;
  background: #fff; border-radius: var(--ob-radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.04);
  display: none; flex-direction: column; overflow: hidden;
  animation: obSlideUp .28s cubic-bezier(.4,0,.2,1);
  font-family: var(--ob-font);
}
.ob-panel.open { display: flex; }

.ob-panel__hdr {
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, #EFF6FF, #F0F7FF);
  border-bottom: 1px solid #E5E7EB;
}
.ob-panel__title {
  font-size: 16px; font-weight: 900; color: #1F2937;
  display: flex; align-items: center; gap: 8px;
}
.ob-panel__sub { font-size: 12px; color: #6B7280; margin-top: 4px; }
.ob-panel__close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: rgba(0,0,0,.04); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; color: #6B7280;
}
.ob-panel__close:hover { background: rgba(0,0,0,.08); }

/* Progress bar */
.ob-progress { padding: 0 20px 14px; }
.ob-progress__bar { height: 6px; background: #F3F4F6; border-radius: 3px; overflow: hidden; }
.ob-progress__fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--ob-blue), var(--ob-purple));
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.ob-progress__text {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 11px; font-weight: 700; color: #6B7280;
}

/* ── Body ──────────────────────────────────────────── */
.ob-panel__body {
  flex: 1; overflow-y: auto; padding: 8px 12px 14px;
  -webkit-overflow-scrolling: touch;
}

/* ── Category group ──────────────────────────────── */
.ob-group {
  margin-bottom: 12px;
}
.ob-group__hdr {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: #9CA3AF; padding: 6px 8px 4px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Step item ───────────────────────────────────── */
.ob-step {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 10px; border-radius: 10px;
  transition: background .12s; cursor: pointer; position: relative;
}
.ob-step:hover { background: #F9FAFB; }
.ob-step.done  { opacity: .65; }

.ob-step__check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #D1D5DB; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all .2s; margin-top: 1px;
}
.ob-step.done .ob-step__check {
  border-color: var(--ob-green); background: var(--ob-green); color: #fff;
}
.ob-step.skipped .ob-step__check {
  border-color: #D1D5DB; background: #F3F4F6; color: #9CA3AF;
}
.ob-step:not(.done):not(.skipped) .ob-step__check { border-color: var(--ob-blue); }

.ob-step__icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ob-step__info { flex: 1; min-width: 0; }
.ob-step__label {
  font-size: 13px; font-weight: 700; color: #1F2937; line-height: 1.3;
}
.ob-step.done .ob-step__label { text-decoration: line-through; color: #9CA3AF; }
.ob-step__desc {
  font-size: 11px; color: #9CA3AF; margin-top: 2px;
}
.ob-step__skip {
  font-size: 10px; font-weight: 700; color: var(--ob-blue);
  background: none; border: none; cursor: pointer;
  padding: 2px 6px; border-radius: 4px; opacity: 0;
  transition: opacity .12s;
}
.ob-step:hover .ob-step__skip { opacity: 1; }
.ob-step__skip:hover { background: #EFF6FF; }

/* ══════════════════════════════════════════════════════
   3. AI TIP CARDS
══════════════════════════════════════════════════════ */
.ob-tips { padding: 0 12px 8px; }
.ob-tip {
  display: flex; gap: 10px; padding: 10px 12px;
  border-radius: 10px; margin-bottom: 6px;
  font-size: 12px; line-height: 1.5; color: #374151;
  transition: border-color .13s;
}
.ob-tip--high   { background: #EFF6FF; border: 1px solid #DBEAFE; }
.ob-tip--medium { background: #FFFBEB; border: 1px solid #FEF3C7; }
.ob-tip--low    { background: #F0FDF4; border: 1px solid #D1FAE5; }
.ob-tip__icon   { font-size: 18px; flex-shrink: 0; }
.ob-tip__title  { font-weight: 800; color: #1F2937; margin-bottom: 2px; }
.ob-tip__action {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; color: var(--ob-blue);
  background: rgba(59,130,246,.08); border: none; cursor: pointer;
}
.ob-tip__action:hover { background: rgba(59,130,246,.15); }

/* ══════════════════════════════════════════════════════
   4. SETUP WIZARD (full-screen overlay for admin)
══════════════════════════════════════════════════════ */
.ob-wizard-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(107,114,128,.40); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.ob-wizard-backdrop.open { display: flex; }

.ob-wizard {
  background: #fff; border-radius: 20px;
  width: 560px; max-width: 94vw; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: obSlideUp .28s cubic-bezier(.4,0,.2,1);
}

.ob-wizard__hdr {
  padding: 24px 28px 16px;
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  color: #fff;
}
.ob-wizard__hdr-title { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.ob-wizard__hdr-sub   { font-size: 13px; opacity: .75; }

/* Stepper dots */
.ob-wizard__steps {
  display: flex; gap: 6px; padding: 0 28px; margin-top: -10px;
  position: relative; z-index: 1;
}
.ob-wizard__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.3); transition: all .2s;
}
.ob-wizard__dot.done   { background: var(--ob-green); }
.ob-wizard__dot.active { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }

.ob-wizard__body { flex: 1; overflow-y: auto; padding: 24px 28px; }

.ob-wizard__footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; border-top: 1px solid #F3F4F6;
}

/* Field groups */
.ob-field { margin-bottom: 14px; }
.ob-field label {
  display: block; font-size: 12px; font-weight: 700;
  color: #374151; margin-bottom: 5px;
}
.ob-field input, .ob-field select, .ob-field textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid #E5E7EB; border-radius: 8px;
  font-size: 13px; color: #1F2937; outline: none;
  box-sizing: border-box; transition: border-color .13s;
  font-family: var(--ob-font);
}
.ob-field input:focus, .ob-field select:focus, .ob-field textarea:focus { border-color: var(--ob-blue); }
.ob-field textarea { height: 80px; padding: 10px 12px; resize: none; }

/* Module toggles */
.ob-module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ob-module-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border: 2px solid #E5E7EB; border-radius: 10px;
  cursor: pointer; transition: border-color .13s, background .13s;
  user-select: none;
}
.ob-module-card:hover { border-color: #DBEAFE; }
.ob-module-card.active { border-color: var(--ob-blue); background: #EFF6FF; }
.ob-module-card__icon { font-size: 20px; }
.ob-module-card__name { font-size: 12px; font-weight: 700; color: #1F2937; }
.ob-module-card__desc { font-size: 10px; color: #9CA3AF; }

/* Buttons */
.ob-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 18px; border-radius: 9px;
  font-size: 13px; font-weight: 700; border: none;
  cursor: pointer; transition: all .13s; font-family: var(--ob-font);
}
.ob-btn--primary { background: var(--ob-blue); color: #fff; }
.ob-btn--primary:hover { background: #2563EB; }
.ob-btn--ghost   { background: transparent; color: #6B7280; }
.ob-btn--ghost:hover   { color: #374151; background: #F3F4F6; }
.ob-btn--success { background: var(--ob-green); color: #fff; }

/* ══════════════════════════════════════════════════════
   5. CONFETTI / CELEBRATION
══════════════════════════════════════════════════════ */
.ob-celebrate {
  position: fixed; inset: 0; z-index: 1200;
  pointer-events: none; display: flex;
  align-items: center; justify-content: center;
}
.ob-celebrate__msg {
  font-size: 32px; font-weight: 900; color: #1F2937;
  text-align: center; animation: obPop .5s cubic-bezier(.34,1.56,.64,1);
  pointer-events: auto; background: #fff; padding: 30px 50px;
  border-radius: 20px; box-shadow: 0 16px 60px rgba(0,0,0,.12);
}
@keyframes obPop { from{opacity:0;transform:scale(.6)} to{opacity:1;transform:scale(1)} }

/* ══════════════════════════════════════════════════════
   6. INLINE BANNER (top of page, dismissible)
══════════════════════════════════════════════════════ */
.ob-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, #EFF6FF, #F0F7FF);
  border-bottom: 1px solid #DBEAFE;
  font-family: var(--ob-font);
  font-size: 13px; color: #374151;
}
.ob-banner__icon { font-size: 18px; }
.ob-banner__text { flex: 1; font-weight: 600; }
.ob-banner__btn  {
  padding: 5px 14px; border-radius: 7px;
  background: var(--ob-blue); color: #fff;
  font-size: 12px; font-weight: 700; border: none; cursor: pointer;
}
.ob-banner__btn:hover { background: #2563EB; }
.ob-banner__dismiss {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: #9CA3AF; padding: 4px;
}

/* ══════════════════════════════════════════════════════
   7. SKELETON
══════════════════════════════════════════════════════ */
.ob-skel {
  height: 42px; border-radius: 10px; margin-bottom: 6px;
  background: linear-gradient(90deg,#F3F4F6 25%,#E9EAED 50%,#F3F4F6 75%);
  background-size: 200% 100%;
  animation: obShim 1.4s infinite;
}
@keyframes obShim { 0%{background-position:200% 0}100%{background-position:-200% 0} }

@keyframes obSlideUp { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }

/* ══════════════════════════════════════════════════════
   8. RESPONSIVE
══════════════════════════════════════════════════════ */
@media(max-width:480px) {
  .ob-launcher  { bottom:16px; right:16px; padding:8px 14px; font-size:12px; }
  .ob-panel     { bottom:70px; right:12px; width:calc(100vw - 24px); max-height:70vh; }
  .ob-wizard    { max-width:100vw; border-radius:16px; }
  .ob-module-grid { grid-template-columns:1fr; }
}
