/* ===========================================================================
   Tutorial Mode -- Styles
   =========================================================================== */

/* Tutorial toggle in header */
.tutorial-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tutorial-toggle .label {
  font-size: 0.72rem;
  color: var(--t3);
  transition: color .2s;
}
.tutorial-toggle.active .label {
  color: #3b82f6;
}

/* When tutorial is active, annotated elements get positioned for badges */
.tutorial-active [data-tutorial] {
  position: relative;
}

/* The "?" badge on each element */
.tutorial-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: auto;
  cursor: pointer;
  animation: tutorialPulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 8px rgba(59,130,246,.4);
  line-height: 1;
}

/* Smaller badge for inline elements */
.tutorial-badge.inline {
  position: relative;
  top: auto;
  right: auto;
  display: inline-flex;
  width: 13px;
  height: 13px;
  font-size: 8px;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

@keyframes tutorialPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.92); }
}

/* Tooltip overlay */
.tutorial-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 380px;
  min-width: 240px;
  background: var(--bg-card);
  border: 1px solid #3b82f6;
  border-radius: var(--r-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(59,130,246,.15);
  padding: 0;
  pointer-events: auto;
  animation: tooltipFadeIn .15s ease-out;
}

[data-theme="light"] .tutorial-tooltip {
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 0 0 1px rgba(59,130,246,.15);
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tutorial-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem 0.4rem;
  border-bottom: 1px solid var(--bdr);
}

.tutorial-tooltip-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #3b82f6;
  font-family: var(--sans);
}

.tutorial-tooltip-close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--bg-input);
  color: var(--t3);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.tutorial-tooltip-close:hover {
  background: var(--bdr);
  color: var(--t1);
}

.tutorial-tooltip-body {
  padding: 0.6rem 0.8rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--t2);
  font-family: var(--sans);
  max-height: 360px;
  overflow-y: auto;
}

.tutorial-tooltip-body b {
  color: var(--t1);
  font-weight: 600;
}

.tutorial-tooltip-body code {
  background: var(--bg-input);
  border: 1px solid var(--bdr);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #3b82f6;
}

.tutorial-tooltip-body br {
  display: block;
  content: "";
  margin-top: 0.2rem;
}

.tutorial-tooltip-body i {
  font-style: italic;
  color: var(--t3);
}

/* Backdrop (click to dismiss) */
.tutorial-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: transparent;
}

/* Arrow/pointer for tooltip */
.tutorial-tooltip-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--bg-card);
  border: 1px solid #3b82f6;
  transform: rotate(45deg);
  z-index: -1;
}
.tutorial-tooltip-arrow.top {
  bottom: -6px;
  border-top: none;
  border-left: none;
}
.tutorial-tooltip-arrow.bottom {
  top: -6px;
  border-bottom: none;
  border-right: none;
}
