/* ═══════════════════════════════════════════════════════════
   SpatiaForge — Tutorial System Styles
   ════════════════════════════════════════════════════════════ */

/* ── OVERLAY (dim + spotlight SVG) ─────────────────────────── */
#tut-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99000;
  pointer-events: none;
}
#tut-overlay.tut-active {
  display: block;
  pointer-events: all;
}
#tut-spotlight-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#tut-hole {
  transition: x 0.35s cubic-bezier(.4,0,.2,1),
              y 0.35s cubic-bezier(.4,0,.2,1),
              width  0.35s cubic-bezier(.4,0,.2,1),
              height 0.35s cubic-bezier(.4,0,.2,1);
}

/* ── CARD ───────────────────────────────────────────────────── */
#tut-card {
  display: none;
  position: fixed;
  z-index: 99100;
  width: 340px;
  background: #161b22;
  border: 1px solid #3d444d;
  border-radius: 12px;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  font-family: 'Inter', Arial, sans-serif;
  transition: left 0.35s cubic-bezier(.4,0,.2,1),
              top  0.35s cubic-bezier(.4,0,.2,1),
              opacity 0.2s ease;
}
#tut-card.tut-active {
  display: flex;
  flex-direction: column;
  animation: tutCardIn 0.28s cubic-bezier(.34,1.56,.64,1) both;
}
#tut-card.tut-transitioning {
  opacity: 0.5;
  transform: scale(0.98) !important;
}

@keyframes tutCardIn {
  from { opacity: 0; transform: scale(0.93) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── SVG ILLUSTRATION AREA ──────────────────────────────────── */
#tut-svg-wrap {
  background: linear-gradient(160deg, #0d1117 0%, #1c2230 100%);
  border-bottom: 1px solid #30363d;
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 158px;
}
#tut-svg-wrap svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
}

/* ── BODY ───────────────────────────────────────────────────── */
#tut-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── HEADER ROW (step counter + close) ─────────────────────── */
#tut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#tut-step-counter {
  font-size: 10px;
  font-weight: 600;
  color: #6e7681;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#tut-skip {
  background: transparent;
  border: none;
  color: #6e7681;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
#tut-skip:hover {
  color: #e6edf3;
  background: #21262d;
}

/* ── TITLE ──────────────────────────────────────────────────── */
#tut-title {
  font-size: 15px;
  font-weight: 700;
  color: #e6edf3;
  line-height: 1.3;
}

/* ── DESCRIPTION TEXT ───────────────────────────────────────── */
#tut-text {
  font-size: 12.5px;
  color: #8b949e;
  line-height: 1.65;
}
#tut-text strong {
  color: #e6edf3;
  font-weight: 600;
}
#tut-text code {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  background: #21262d;
  color: #3b82f6;
  padding: 1px 5px;
  border-radius: 3px;
}
#tut-text kbd {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #3d444d;
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── PROGRESS BAR ───────────────────────────────────────────── */
#tut-progress-wrap {
  height: 3px;
  background: #21262d;
  border-radius: 2px;
  overflow: hidden;
}
#tut-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(.4,0,.2,1);
  width: 0%;
}

/* ── STEP DOTS ──────────────────────────────────────────────── */
#tut-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}
.tut-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #30363d;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, width 0.2s;
  flex-shrink: 0;
}
.tut-dot.active {
  background: #3b82f6;
  width: 18px;
  border-radius: 3px;
  transform: none;
}
.tut-dot:hover:not(.active) {
  background: #8b949e;
  transform: scale(1.2);
}

/* ── NAV BUTTONS ────────────────────────────────────────────── */
#tut-nav {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
#tut-prev,
#tut-next {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', Arial, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, opacity 0.15s, transform 0.1s;
  border: none;
}
#tut-prev {
  background: #1c2230;
  border: 1px solid #30363d;
  color: #8b949e;
}
#tut-prev:hover:not(:disabled) {
  background: #21262d;
  color: #e6edf3;
}
#tut-prev:disabled {
  opacity: 0.3;
  cursor: default;
}
#tut-next {
  background: #3b82f6;
  color: #ffffff;
}
#tut-next:hover {
  background: #2563eb;
  transform: translateY(-1px);
}
#tut-next:active {
  transform: translateY(0);
}

/* ── TUTORIAL TRIGGER BUTTON (in header) ────────────────────── */
#tut-launch-btn {
  background: linear-gradient(135deg, #1c2230 0%, #21262d 100%);
  border: 1px solid #3d444d;
  color: #8b949e;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Inter', Arial, sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
#tut-launch-btn:hover {
  background: linear-gradient(135deg, #21262d 0%, #2a3444 100%);
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.25);
}
#tut-launch-btn .tut-btn-icon {
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  transition: background 0.15s;
}
#tut-launch-btn:hover .tut-btn-icon {
  background: #2563eb;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  #tut-card {
    width: calc(100vw - 24px);
    left: 12px !important;
    top: auto !important;
    bottom: 12px !important;
    transform: none !important;
    max-height: 90vh;
    overflow-y: auto;
  }
  #tut-svg-wrap {
    min-height: 120px;
    padding: 12px 16px 10px;
  }
  #tut-svg-wrap svg {
    max-width: 180px;
  }
}
