/* Demo Tutorial Styles */

/* ---- Highlight Ring ---- */
.tutorial-highlight {
  position: fixed;
  z-index: 10001;
  border: 2px solid #D97706;
  border-radius: 8px;
  pointer-events: none;
  animation: tutorial-pulse 2s ease-in-out infinite;
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

@keyframes tutorial-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(217, 119, 6, 0); }
}

/* ---- Tooltip Popup ---- */
.tutorial-popup {
  position: fixed;
  z-index: 10002;
  background: #18181B;
  border: 1px solid #2A2A2E;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 360px;
  width: calc(100vw - 32px);
  padding: 20px 24px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tutorial-popup.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Popup arrow */
.tutorial-popup::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.tutorial-popup[data-arrow="top"]::after {
  bottom: 100%;
  left: 24px;
  border-bottom-color: #18181B;
}

.tutorial-popup[data-arrow="bottom"]::after {
  top: 100%;
  left: 24px;
  border-top-color: #18181B;
}

.tutorial-popup[data-arrow="left"]::after {
  right: 100%;
  top: 20px;
  border-right-color: #18181B;
}

.tutorial-popup[data-arrow="right"]::after {
  left: 100%;
  top: 20px;
  border-left-color: #18181B;
}

/* ---- Centered Modal ---- */
.tutorial-popup.tutorial-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  max-width: 480px;
}

.tutorial-popup.tutorial-modal.visible {
  transform: translate(-50%, -50%) scale(1);
}

.tutorial-popup.tutorial-modal::after {
  display: none;
}

/* ---- Popup Content ---- */
.tutorial-step-counter {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: #71717A;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.tutorial-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  text-transform: uppercase;
  color: #E4E4E7;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.tutorial-body {
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-weight: 400;
  font-size: 0.9375rem;
  color: #A1A1AA;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.tutorial-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tutorial-btn-primary {
  background: #D97706;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tutorial-btn-primary:hover {
  background: #B45309;
}

.tutorial-btn-secondary {
  background: transparent;
  color: #A1A1AA;
  border: 1px solid #3F3F46;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.tutorial-btn-secondary:hover {
  border-color: #52525B;
  color: #E4E4E7;
}

.tutorial-skip {
  margin-left: auto;
  background: none;
  border: none;
  color: #52525B;
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.tutorial-skip:hover {
  color: #A1A1AA;
  text-decoration: underline;
}

/* ---- Progress Bar ---- */
.tutorial-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(63, 63, 70, 0.5);
  z-index: 10003;
}

.tutorial-progress-fill {
  height: 100%;
  background: #D97706;
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}

/* ---- Floating Widget ---- */
.tutorial-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: #D97706;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tutorial-widget:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
}

/* ---- Resume Prompt ---- */
.tutorial-resume-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tutorial-resume-card {
  background: #18181B;
  border: 1px solid #2A2A2E;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 100%;
  padding: 24px;
  text-align: center;
}

.tutorial-resume-card .tutorial-title {
  margin-bottom: 12px;
}

.tutorial-resume-card .tutorial-body {
  margin-bottom: 20px;
}

.tutorial-resume-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Demo interaction glow: applied to elements the tutorial is about to interact with ---- */
.tutorial-demo-glow {
  animation: tutorial-demo-glow-anim 0.5s ease-in-out 2;
  border-radius: 4px;
  position: relative;
  z-index: 2;
}

@keyframes tutorial-demo-glow-anim {
  0%, 100% { background-color: transparent; outline: 2px solid transparent; }
  50%       { background-color: rgba(217, 119, 6, 0.28); outline: 2px solid #D97706; outline-offset: 2px; }
}

/* ---- Mobile (<=640px) ---- */
@media (max-width: 640px) {
  /* Bottom sheet popup on mobile */
  .tutorial-popup:not(.tutorial-modal) {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-width: none;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }

  .tutorial-popup:not(.tutorial-modal).visible {
    transform: translateY(0);
  }

  .tutorial-popup:not(.tutorial-modal)::after {
    display: none;
  }

  /* Centered modals become full-width */
  .tutorial-popup.tutorial-modal {
    max-width: calc(100vw - 32px);
    padding: 20px 16px;
  }

  /* Larger touch targets on mobile */
  .tutorial-btn-primary,
  .tutorial-btn-secondary {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 0.875rem;
  }

  /* Footer: skip link goes to its own row */
  .tutorial-footer {
    gap: 8px;
  }

  .tutorial-skip {
    width: 100%;
    margin-left: 0;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
  }

  /* Step counter smaller on mobile */
  .tutorial-step-counter {
    font-size: 0.6875rem;
  }

  .tutorial-widget {
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: 16px;
  }
}
