/* Tutorial overlay — sits on top of the live terminal.
   Spotlights one element at a time and shows an explanatory card. */

.tut-root {
  position: fixed; inset: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tut-root.active { pointer-events: auto; }
.tut-root:not(.active) .tut-dim,
.tut-root:not(.active) .tut-spotlight,
.tut-root:not(.active) .tut-card,
.tut-root:not(.active) .tut-loading { display: none; }

/* Minimal centered loading spinner used while the FF prep runs. */
.tut-loading {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  z-index: 10000;
}
.tut-spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(214, 221, 231, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tut-spin 0.8s linear infinite;
}
.tut-loading-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.65;
}
@keyframes tut-spin {
  to { transform: rotate(360deg); }
}

/* Four-piece dim that surrounds the spotlight rectangle.
   Using box-shadow on the spotlight is simpler but blocks clicks. */
.tut-dim {
  position: absolute; inset: 0;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.25s ease;
}

.tut-spotlight {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(8, 8, 10, 0.72), 0 0 32px rgba(77, 149, 232, 0.45);
  pointer-events: none;
  transition: top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.tut-root .tut-dim { display: none; } /* dim handled via spotlight box-shadow */
.tut-root.active .tut-dim { display: none; }

/* The card */
.tut-card {
  position: absolute;
  width: min(440px, calc(100vw - 40px));
  background: #1a1818;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(77, 149, 232, 0.2);
  overflow: hidden;
  transition: top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.tut-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #151617;
}
.tut-step {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0.85;
}
.tut-step b { color: var(--accent); font-weight: 700; }
.tut-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--text);
  flex: 1;
}
.tut-skip {
  background: transparent;
  color: var(--text);
  opacity: 0.5;
  border: none;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: opacity 0.15s, background 0.15s;
}
.tut-skip:hover { opacity: 1; background: rgba(214, 221, 231, 0.05); }

.tut-body {
  padding: 20px 22px 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  opacity: 0.85;
}
.tut-body h4 {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.015em;
  color: var(--text);
  opacity: 1;
}
.tut-body p { margin: 0 0 12px; }
.tut-body ul { margin: 0 0 12px; padding-left: 18px; }
.tut-body li { margin-bottom: 6px; }
.tut-body b { color: var(--text); font-weight: 600; }
.tut-body code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  background: rgba(77, 149, 232, 0.1);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 3px;
}

.tut-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: #151617;
}
.tut-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
}
.tut-btn:hover { border-color: var(--accent); color: var(--accent); }
.tut-btn:disabled { opacity: 0.3; cursor: default; }
.tut-btn:disabled:hover { border-color: var(--border); color: var(--text); }
.tut-next {
  background: var(--accent);
  color: #0b0e14;
  border-color: var(--accent);
}
.tut-next:hover { background: #6cabf0; color: #0b0e14; border-color: #6cabf0; }

.tut-dots {
  display: flex; gap: 6px;
}
.tut-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border);
  transition: background 0.15s, transform 0.15s;
}
.tut-dots span.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* Resume / restart pill, anchored bottom-left when tour is dismissed */
.tut-resume {
  position: fixed;
  bottom: 18px; left: 18px;
  z-index: 9998;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  transition: all 0.12s;
  text-decoration: none;
}
.tut-resume:hover { border-color: var(--accent); color: var(--accent); }
.tut-resume.show { display: inline-flex; align-items: center; gap: 8px; }
