/* ── Tour Guide ─────────────────────────────────────────────────────────── */

/* Backdrop pieces (4 dark + 1 transparent blocker) */
.tour-bd {
  position: fixed;
  z-index: 9980;
  pointer-events: all;
  background: rgba(0, 0, 0, 0.62);
}
.tour-bd-block {
  position: fixed;
  z-index: 9981;
  pointer-events: all;
  background: transparent;
  cursor: default;
}

/* Spotlight ring */
.tour-hl {
  position: fixed;
  z-index: 9982;
  border-radius: 10px;
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
  pointer-events: none;
  animation: tour-ring-pulse 2.2s ease-in-out infinite;
}
@keyframes tour-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2); }
  50%       { box-shadow: 0 0 0 7px rgba(88, 166, 255, 0.06); }
}

/* Tooltip card */
.tour-tip {
  position: fixed;
  z-index: 9990;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* Progress dots */
.tour-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}
.tour-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.tour-dot.on {
  background: var(--blue);
  transform: scale(1.25);
}
.tour-dot-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-left: 2px;
  letter-spacing: 0.3px;
}

/* Title */
.tour-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: -0.2px;
  line-height: 1.3;
  margin-bottom: 7px;
}
.tour-title kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--text-muted);
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* Body */
.tour-body {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

/* Keyboard demo block */
.tour-kbd-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border-sub);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 10px;
}
.tour-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-h);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  font-family: inherit;
}
.tour-key-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Try it button */
.tour-try {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 7px 12px;
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  border-radius: 7px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  transition: background 0.15s;
}
.tour-try:hover { background: var(--blue-bg-hover); }

/* Actions */
.tour-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tour-next {
  flex: 1;
  padding: 7px 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.tour-next:hover { opacity: 0.85; }
.tour-prev {
  padding: 7px 10px;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tour-prev:hover { color: var(--text-h); border-color: var(--text-dim); }
.tour-skip {
  margin-left: auto;
  padding: 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.68rem;
  cursor: pointer;
  transition: color 0.15s;
}
.tour-skip:hover { color: var(--text-muted); }

/* Tooltip arrow */
.tour-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--bg-surface);
  transform: rotate(45deg);
}
.tour-arrow-up {
  top: -7px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.tour-arrow-down {
  bottom: -7px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.tour-arrow-left {
  left: -7px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.tour-arrow-right {
  right: -7px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Footer "Tour" button (index page only) — same style as About / Privacy */
#tour-footer-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.7rem;
  padding: 5px 10px;
  transition: border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#tour-footer-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Confirmation dialog (shown when existing data would be replaced) */
.tour-confirm {
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.tour-confirm-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 28px 22px;
  max-width: 360px;
  width: calc(100% - 40px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}
.tour-confirm-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}
.tour-confirm-body {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}
.tour-confirm-body strong {
  color: var(--amber);
  font-weight: 600;
}
.tour-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tour-confirm-cancel {
  padding: 7px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.tour-confirm-cancel:hover { border-color: var(--text-dim); color: var(--text); }
.tour-confirm-ok {
  padding: 7px 16px;
  background: var(--blue);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.tour-confirm-ok:hover { opacity: 0.85; }

/* "Take a tour" button */
#tour-start-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.75;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#tour-start-btn:hover { opacity: 1; }

@keyframes tour-btn-attention {
  0%, 100% { opacity: 0.75; }
  50%       { opacity: 1; }
}
#tour-start-btn.tour-pulse {
  animation: tour-btn-attention 1.4s ease-in-out 4;
}
