/* ═══════════════════════════════════════════
   TUTORIAL — styles/tutorial.css
   Interactive guided tour overlay
   ════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────── */

.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 51, 0.72);
  z-index: 9000;
  animation: t-fade-in 0.2s ease;
}

/* ── Highlight ring ──────────────────────── */
/*
   The ring creates the spotlight effect via a massive box-shadow spread.
   No separate overlay is needed when a target exists — the ring dims
   everything outside itself, leaving the target fully visible.
*/

.tutorial-ring {
  position: fixed;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-accent);
  box-shadow:
    0 0 0 9999px rgba(10, 31, 51, 0.68),
    0 0 0 4px rgba(184, 132, 42, 0.25),
    0 0 28px rgba(184, 132, 42, 0.45);
  z-index: 9001;
  pointer-events: none;
  transition: top 0.22s ease, left 0.22s ease, width 0.22s ease, height 0.22s ease;
  animation: t-ring-pulse 2.2s ease-in-out infinite;
}

/* ── Card ────────────────────────────────── */

.tutorial-card {
  position: fixed;
  z-index: 9002;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-xl);
  box-shadow:
    0 20px 60px rgba(10, 31, 51, 0.32),
    0 6px 16px  rgba(10, 31, 51, 0.18);
  overflow: hidden;
  animation: t-pop-in 0.24s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ── Header ──────────────────────────────── */

.tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.tutorial-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tutorial-logo-mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.tutorial-progress {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tutorial-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.tutorial-close-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-border);
}

/* ── Body ────────────────────────────────── */

.tutorial-body {
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.tutorial-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.tutorial-content {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.tutorial-content p {
  margin-bottom: var(--space-2);
}

.tutorial-content p:last-child {
  margin-bottom: 0;
}

.tutorial-content ul {
  padding-left: var(--space-4);
  margin-top: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-content li {
  list-style: disc;
}

.tutorial-content strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.tutorial-content em {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 500;
}

/* ── Footer ──────────────────────────────── */

.tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

/* ── Progress dots ───────────────────────── */

.tutorial-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.tutorial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.2s, transform 0.2s;
}

.tutorial-dot.is-active {
  background: var(--color-accent);
  transform: scale(1.35);
}

/* ── Buttons ─────────────────────────────── */

.tutorial-btns {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tutorial-btn {
  padding: 5px var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.5;
}

.tutorial-btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.tutorial-btn-ghost:hover {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
}

.tutorial-btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.tutorial-btn-primary:hover {
  background: var(--color-accent-hover, #9a6b1a);
}

/* ── Help button (sidebar) ───────────────── */

.tutorial-help-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-sidebar-text, rgba(255,255,255,0.55));
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  text-align: left;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
  overflow: hidden;
}

.tutorial-help-btn:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.06);
}

.tutorial-help-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar.collapsed .tutorial-help-btn .nav-label { display: none; }

/* ── Animations ──────────────────────────── */

@keyframes t-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes t-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

@keyframes t-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(10,31,51,0.68), 0 0 0 4px rgba(184,132,42,0.25), 0 0 28px rgba(184,132,42,0.45); }
  50%       { box-shadow: 0 0 0 9999px rgba(10,31,51,0.68), 0 0 0 6px rgba(184,132,42,0.35), 0 0 40px rgba(184,132,42,0.60); }
}

/* ── Dark mode adjustments ───────────────── */

[data-theme="dark"] .tutorial-overlay {
  background: rgba(4, 12, 20, 0.85);
}

[data-theme="dark"] .tutorial-ring {
  box-shadow:
    0 0 0 9999px rgba(4, 12, 20, 0.80),
    0 0 0 4px rgba(184, 132, 42, 0.30),
    0 0 28px rgba(184, 132, 42, 0.50);
}

[data-theme="dark"] @keyframes t-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(4,12,20,0.80), 0 0 0 4px rgba(184,132,42,0.30), 0 0 28px rgba(184,132,42,0.50); }
  50%       { box-shadow: 0 0 0 9999px rgba(4,12,20,0.80), 0 0 0 6px rgba(184,132,42,0.40), 0 0 40px rgba(184,132,42,0.65); }
}

[data-theme="dark"] .tutorial-card {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 6px 16px  rgba(0, 0, 0, 0.35);
}
