/* Recovery Monitor System — ui/tour.css
   Recovery Guide AI — Onboarding Tour Styles
   ─────────────────────────────────────────────────
   Design principles:
   - Dark overlay with spotlight cutout
   - Floating tooltip card with smooth transitions
   - Calm, clinical aesthetic — matches dashboard theme
   - No aggressive animations, no flashing
   ─────────────────────────────────────────────────
*/

/* ── ANIMATIONS ──────────────────────────────── */
@keyframes rms-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rms-fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

@keyframes rms-slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-12px); }
}

@keyframes rms-spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 4000px rgba(5, 8, 18, 0.82), 0 0 0 2px rgba(91, 114, 232, 0.4); }
  50%       { box-shadow: 0 0 0 4000px rgba(5, 8, 18, 0.82), 0 0 0 3px rgba(91, 114, 232, 0.7); }
}

@keyframes rms-badgeSlide {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── TOUR OVERLAY ────────────────────────────── */
.rms-tour-overlay {
  position:         fixed;
  inset:            0;
  z-index:          9998;
  pointer-events:   none;
  background:       transparent;
}

/* ── SPOTLIGHT ───────────────────────────────── */
.rms-tour-spotlight {
  position:         absolute;
  z-index:          9999;
  pointer-events:   none;
  transition:       top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
  border-radius:    12px;
  animation:        rms-spotlightPulse 2.5s ease-in-out infinite;
  box-shadow:       0 0 0 4000px rgba(5, 8, 18, 0.82),
                    0 0 0 2px rgba(91, 114, 232, 0.5);
}

/* ── TOOLTIP CARD ────────────────────────────── */
.rms-tour-tooltip {
  position:         absolute;
  z-index:          10002;
  background:       #1a1f33;
  border:           1px solid #2d3654;
  border-radius:    16px;
  box-shadow:       0 8px 40px rgba(0, 0, 0, 0.55),
                    0 0 0 1px rgba(91, 114, 232, 0.15);
  width:            380px;
  overflow:         hidden;
}

.rms-tour-anim-in  { animation: rms-fadeIn  0.22s ease forwards; }
.rms-tour-anim-out { animation: rms-fadeOut 0.22s ease forwards; }
.rms-tour-slide-out { animation: rms-slideOut 0.18s ease forwards; }

/* ── TOOLTIP HEADER ──────────────────────────── */
.rms-tour-tooltip__header {
  display:          flex;
  align-items:      center;
  gap:              10px;
  padding:          16px 16px 12px;
  border-bottom:    1px solid #2a3050;
  background:       #161b2e;
}

.rms-tour-tooltip__icon {
  font-size:        1.3rem;
  flex-shrink:      0;
  width:            28px;
  text-align:       center;
}

.rms-tour-tooltip__title {
  flex:             1;
  font-size:        0.9375rem;
  font-weight:      600;
  color:            #e8ecf4;
  font-family:      "Inter", system-ui, sans-serif;
  line-height:      1.3;
}

.rms-tour-tooltip__close {
  background:       transparent;
  border:           none;
  color:            #5a6180;
  font-size:        1rem;
  cursor:           pointer;
  padding:          4px 6px;
  border-radius:    6px;
  transition:       background 0.15s, color 0.15s;
  flex-shrink:      0;
}

.rms-tour-tooltip__close:hover {
  background:       #252a40;
  color:            #e8ecf4;
}

/* ── TOOLTIP BODY ────────────────────────────── */
.rms-tour-tooltip__body {
  padding:          14px 16px 12px;
}

.rms-tour-tooltip__message {
  font-size:        0.875rem;
  color:            #b8c2dc;
  line-height:      1.65;
  margin:           0 0 10px;
  font-family:      "Inter", system-ui, sans-serif;
}

.rms-tour-tooltip__tip {
  font-size:        0.8125rem;
  color:            #6b7ba4;
  background:       #131828;
  border-left:      3px solid #3b4d82;
  border-radius:    0 6px 6px 0;
  padding:          8px 12px;
  line-height:      1.5;
  font-family:      "Inter", system-ui, sans-serif;
}

/* ── TOOLTIP FOOTER ──────────────────────────── */
.rms-tour-tooltip__footer {
  display:          flex;
  align-items:      center;
  justify-content:  space-between;
  padding:          10px 16px 14px;
  border-top:       1px solid #1e2440;
  gap:              12px;
}

/* ── PROGRESS DOTS ───────────────────────────── */
.rms-tour-tooltip__progress {
  display:          flex;
  align-items:      center;
  gap:              5px;
}

.rms-tour-tooltip__dot {
  width:            7px;
  height:           7px;
  border-radius:    50%;
  background:       #2a3050;
  transition:       background 0.2s, transform 0.2s;
}

.rms-tour-tooltip__dot.done   { background: #3b4d82; }
.rms-tour-tooltip__dot.active { background: #5b72e8; transform: scale(1.3); }

/* ── TOOLTIP CONTROLS ────────────────────────── */
.rms-tour-tooltip__controls {
  display:          flex;
  gap:              8px;
  align-items:      center;
}

/* ── BUTTONS ─────────────────────────────────── */
.rms-tour-btn {
  font-family:      "Inter", system-ui, sans-serif;
  font-size:        0.8125rem;
  font-weight:      500;
  padding:          7px 16px;
  border-radius:    8px;
  cursor:           pointer;
  border:           none;
  transition:       background 0.15s, color 0.15s, opacity 0.15s;
  white-space:      nowrap;
}

.rms-tour-btn--primary {
  background:       #5b72e8;
  color:            #fff;
}

.rms-tour-btn--primary:hover {
  background:       #4a61d6;
}

.rms-tour-btn--ghost {
  background:       transparent;
  color:            #7a88b4;
  border:           1px solid #2a3050;
}

.rms-tour-btn--ghost:hover {
  background:       #1e2440;
  color:            #e8ecf4;
}

/* ── WELCOME PROMPT ──────────────────────────── */
.rms-tour-welcome-backdrop {
  position:         fixed;
  inset:            0;
  z-index:          10010;
  background:       rgba(5, 8, 18, 0.75);
  display:          flex;
  align-items:      center;
  justify-content:  center;
  backdrop-filter:  blur(4px);
}

.rms-tour-welcome-card {
  background:       #1a1f33;
  border:           1px solid #2d3654;
  border-radius:    20px;
  padding:          36px 32px;
  max-width:        440px;
  width:            90%;
  text-align:       center;
  box-shadow:       0 24px 80px rgba(0, 0, 0, 0.6);
}

.rms-tour-welcome-icon {
  font-size:        2.5rem;
  margin-bottom:    16px;
}

.rms-tour-welcome-title {
  font-size:        1.25rem;
  font-weight:      700;
  color:            #e8ecf4;
  margin-bottom:    12px;
  font-family:      "Inter", system-ui, sans-serif;
}

.rms-tour-welcome-body {
  font-size:        0.9rem;
  color:            #8a93b2;
  line-height:      1.65;
  margin-bottom:    24px;
  font-family:      "Inter", system-ui, sans-serif;
}

.rms-tour-welcome-body strong {
  color:            #b8c2dc;
}

.rms-tour-welcome-actions {
  display:          flex;
  flex-direction:   column;
  gap:              10px;
  margin-bottom:    16px;
}

.rms-tour-welcome-actions .rms-tour-btn {
  font-size:        0.9375rem;
  padding:          11px 24px;
  border-radius:    10px;
}

.rms-tour-welcome-note {
  font-size:        0.8rem;
  color:            #4a5470;
  font-family:      "Inter", system-ui, sans-serif;
}

.rms-tour-welcome-note strong {
  color:            #5b72e8;
}

/* ── COMPLETION BADGE ────────────────────────── */
.rms-tour-complete-badge {
  position:         fixed;
  bottom:           24px;
  right:            24px;
  z-index:          10020;
  background:       #1a1f33;
  border:           1px solid #2a3a5e;
  border-radius:    14px;
  padding:          14px 16px;
  display:          flex;
  align-items:      center;
  gap:              12px;
  box-shadow:       0 8px 32px rgba(0,0,0,0.45);
  max-width:        320px;
  animation:        rms-badgeSlide 0.3s ease forwards;
}

.rms-tour-complete-badge__icon {
  font-size:        1.4rem;
  flex-shrink:      0;
}

.rms-tour-complete-badge__text {
  display:          flex;
  flex-direction:   column;
  gap:              2px;
  flex:             1;
}

.rms-tour-complete-badge__text strong {
  font-size:        0.875rem;
  color:            #e8ecf4;
  font-family:      "Inter", system-ui, sans-serif;
}

.rms-tour-complete-badge__text span {
  font-size:        0.8rem;
  color:            #6b7ba4;
  font-family:      "Inter", system-ui, sans-serif;
}

.rms-tour-complete-badge__close {
  background:       transparent;
  border:           none;
  color:            #5a6180;
  font-size:        0.9rem;
  cursor:           pointer;
  padding:          4px;
  border-radius:    6px;
  flex-shrink:      0;
  transition:       color 0.15s;
}

.rms-tour-complete-badge__close:hover {
  color: #e8ecf4;
}

/* ── TOPBAR ADDITIONS ────────────────────────── */
.ndos-topbar__brand-name {
  font-weight:      700;
}

.ndos-topbar__brand-tag {
  font-size:        0.7rem;
  text-transform:   uppercase;
  letter-spacing:   0.1em;
  color:            #5b72e8;
  background:       rgba(91, 114, 232, 0.12);
  padding:          2px 7px;
  border-radius:    4px;
  font-weight:      500;
  margin-left:      4px;
}

.ndos-topbar__right {
  display:          flex;
  align-items:      center;
  gap:              14px;
}

.ndos-topbar__help-btn {
  display:          flex;
  align-items:      center;
  gap:              6px;
  background:       rgba(91, 114, 232, 0.1);
  border:           1px solid rgba(91, 114, 232, 0.25);
  border-radius:    8px;
  color:            #5b72e8;
  font-size:        0.8rem;
  font-weight:      500;
  padding:          5px 11px;
  cursor:           pointer;
  transition:       background 0.15s, border-color 0.15s;
  font-family:      "Inter", system-ui, sans-serif;
}

.ndos-topbar__help-btn:hover {
  background:       rgba(91, 114, 232, 0.2);
  border-color:     rgba(91, 114, 232, 0.5);
}

.ndos-topbar__help-icon {
  font-size:        0.875rem;
  font-weight:      700;
  width:            18px;
  height:           18px;
  border-radius:    50%;
  background:       #5b72e8;
  color:            #fff;
  display:          flex;
  align-items:      center;
  justify-content:  center;
  flex-shrink:      0;
  line-height:      1;
}

.ndos-topbar__help-label {
  display:          inline;
}

@media (max-width: 520px) {
  .ndos-topbar__help-label { display: none; }
  .rms-tour-tooltip        { width: calc(100vw - 32px); left: 16px !important; }
  .rms-tour-complete-badge { max-width: calc(100vw - 48px); }
}
