/* ==========================================================================
   feature_tutorial.css — Visual Annotated Screenshot Tutorials & Help (?)
   ========================================================================== */

.ft-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(var(--ui-brand-rgb, 148, 163, 184), 0.45);
  background: rgba(15, 23, 42, 0.85);
  color: var(--ui-brand-strong, #e2e8f0);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
  flex-shrink: 0;
  pointer-events: auto;
}

.ft-help-btn:hover,
.ft-help-btn:focus-visible {
  transform: translateY(-1px) scale(1.06);
  background: rgba(var(--ui-brand-rgb, 148, 163, 184), 0.24);
  border-color: var(--ui-brand-strong, #f8fafc);
  box-shadow: 0 0 14px rgba(var(--ui-brand-rgb, 148, 163, 184), 0.42);
  outline: none;
}

.ft-help-btn--sm {
  width: 22px;
  height: 22px;
  min-width: 22px;
  font-size: 11px;
}

.ft-help-btn--pill {
  width: auto;
  padding: 0 10px;
  height: 28px;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* Modal Backdrop */
#modal-feature-tutorial {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 6, 14, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#modal-feature-tutorial.is-open {
  display: flex;
}

.ft-dialog {
  width: min(1160px, 100%);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13, 19, 32, 0.98) 0%, rgba(8, 12, 22, 0.99) 100%);
  border: 1px solid rgba(var(--ui-brand-rgb, 148, 163, 184), 0.36);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  color: #f1f5f9;
  overflow: hidden;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
}

/* Header */
.ft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.75);
  flex-wrap: wrap;
}

.ft-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ft-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(var(--ui-brand-rgb, 148, 163, 184), 0.16);
  border: 1px solid rgba(var(--ui-brand-rgb, 148, 163, 184), 0.45);
  color: var(--ui-brand-strong, #e2e8f0);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ft-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.ft-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.ft-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ft-select {
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ft-mode-toggle {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ft-mode-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.ft-mode-btn.is-active {
  background: rgba(var(--ui-brand-rgb, 148, 163, 184), 0.25);
  color: #f8fafc;
}

.ft-close-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ft-close-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}

/* Main Body */
.ft-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

/* Annotated Screenshot Stage */
.ft-stage-wrap {
  position: relative;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(30, 41, 59, 0.35), rgba(2, 6, 23, 0.92));
  overflow: auto;
}

.ft-stage {
  position: relative;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(var(--ui-brand-rgb, 148, 163, 184), 0.32);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.65);
  background: #060a14;
  user-select: none;
}

.ft-screenshot-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ft-screenshot-layer svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Annotation Overlay: SVG Leader Lines + Pins + Callout Labels */
.ft-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.ft-leader-line {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
  transition: opacity 0.16s ease, stroke-width 0.16s ease;
}

.ft-leader-halo {
  fill: none;
  stroke: rgba(2, 6, 23, 0.85);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.16s ease;
}

.ft-leader-dot {
  fill: #38bdf8;
  stroke: #020617;
  stroke-width: 2;
  transition: opacity 0.16s ease, r 0.16s ease;
}

.ft-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #020617;
  background: #38bdf8;
  color: #020617;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 4px 10px rgba(0, 0, 0, 0.65);
  transition: transform 0.14s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.ft-pin:hover,
.ft-pin.is-active {
  transform: translate(-50%, -50%) scale(1.2);
  background: #facc15;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.45), 0 4px 14px rgba(0, 0, 0, 0.8);
  z-index: 6;
}

.ft-callout {
  position: absolute;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 196px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(7, 11, 22, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.72);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.78);
  z-index: 3;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.ft-callout:hover,
.ft-callout.is-active {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: #facc15;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.35), 0 10px 24px rgba(0, 0, 0, 0.88);
  z-index: 7;
}

.ft-callout.is-dimmed,
.ft-pin.is-dimmed,
.ft-leader-line.is-dimmed,
.ft-leader-halo.is-dimmed,
.ft-leader-dot.is-dimmed {
  opacity: 0.18;
}

.ft-callout.is-hidden,
.ft-pin.is-hidden,
.ft-leader-line.is-hidden,
.ft-leader-halo.is-hidden,
.ft-leader-dot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.ft-callout-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.ft-callout-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #38bdf8;
  color: #020617;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 9px;
  font-weight: 900;
  flex-shrink: 0;
}

.ft-callout.is-active .ft-callout-num {
  background: #facc15;
}

.ft-callout-title {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.03em;
  line-height: 1.15;
}

.ft-callout-desc {
  font-size: 10px;
  line-height: 1.25;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.ft-callout-press {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
}

.ft-kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: #fde047;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
}

/* Right-hand Control Legend Sidebar */
.ft-sidebar {
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 15, 28, 0.92);
  min-height: 0;
  overflow: hidden;
}

.ft-sidebar-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #94a3b8;
}

.ft-step-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ft-step-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.65);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s ease;
}

.ft-step-item:hover,
.ft-step-item.is-active {
  border-color: rgba(250, 204, 21, 0.72);
  background: rgba(30, 41, 59, 0.9);
  transform: translateX(-2px);
}

.ft-step-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ft-step-item-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
}

.ft-step-item-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #38bdf8;
  color: #020617;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

.ft-step-item.is-active .ft-step-item-num {
  background: #facc15;
}

.ft-step-item-desc {
  font-size: 11.5px;
  line-height: 1.38;
  color: #cbd5e1;
}

.ft-step-item-press {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  color: #94a3b8;
}

/* Footer Nav Bar */
.ft-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.75);
}

.ft-nav-btn {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.ft-nav-btn:hover:not(:disabled) {
  border-color: var(--ui-brand-strong, #38bdf8);
  background: rgba(var(--ui-brand-rgb, 56, 189, 248), 0.18);
}

.ft-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.ft-step-counter {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10.5px;
  color: #94a3b8;
}

/* Live DOM target pulse when hovering a step while that feature is open */
.ft-live-target-pulse {
  outline: 2px solid #facc15 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.65) !important;
}

@media (max-width: 960px) {
  .ft-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow-y: auto;
  }

  .ft-sidebar {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 260px;
  }

  .ft-callout {
    max-width: 150px;
    padding: 4px 6px;
  }

  .ft-callout-desc {
    display: none;
  }
}
