/* ============================================================
   Interactive Demo Tour (Slack-style guided walkthrough)
   ============================================================ */

.equip-demo-fab {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 999999;
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.equip-demo-fab button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 650;
  transition: all 0.3s ease;
}

.equip-demo-fab button:hover {
  transform: translateY(-2px);
}

.equip-demo-fab .equip-demo-start:hover {
  background: #0066d6;
  color: #fff;
}

.equip-demo-fab .equip-demo-reset:hover {
  color: #fff;
}

.equip-demo-fab .equip-demo-start {
  background: #007AFF;
  color: #fff;
}

.equip-demo-fab .equip-demo-reset {
  background: #111;
  color: #fff;
  opacity: 0.92;
}

.equip-demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 999998;
  pointer-events: none;
}

.equip-demo-backdrop {
  position: absolute;
  inset: 0;
  /* Dark backdrop for demo tour - only visible when tour is active */
  background: rgba(0, 0, 0, 0.42);
  /* Block all clicks to the app during tour */
  pointer-events: auto;
  cursor: not-allowed;
}

/* Allow clicks on form elements during tour (for step 2) */
.equip-demo-overlay.active-step-2 input,
.equip-demo-overlay.active-step-2 select,
.equip-demo-overlay.active-step-2 textarea {
  pointer-events: auto !important;
  position: relative;
  z-index: 9999999 !important;
}

.equip-demo-spotlight {
  position: absolute;
  border-radius: 14px;
  /* Keep the highlighted area 100% unmodified/undimmed (preserves underlying borders) */
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 3px solid #007AFF;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.9),
    /* Darken everything outside the spotlight */
    0 0 0 9999px rgba(0,0,0,0.72);
  /* Block clicks to the highlighted element during tour */
  pointer-events: auto;
  cursor: not-allowed;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.equip-demo-welcome-message {
  position: fixed;
  right: 18px;
  top: 70px;
  z-index: 999998;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 380px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #212529;
  animation: slideInFromRight 0.3s ease-out;
}

.equip-demo-welcome-message .equip-demo-welcome-close {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.equip-demo-welcome-message .equip-demo-welcome-close:hover {
  color: #212529;
}

.equip-demo-tooltip {
  position: absolute;
  width: min(440px, calc(100vw - 28px));
  background: #fff;
  color: #111;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.26);
  padding: 18px 18px 14px;
  pointer-events: auto;
}

.equip-demo-tooltip .equip-demo-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: #111;
  font-size: 20px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
}

.equip-demo-tooltip .equip-demo-close:hover {
  background: #f2f2f2;
}

.equip-demo-tooltip h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.equip-demo-tooltip p {
  margin: 0 0 12px;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #333;
}

.equip-demo-tooltip .equip-demo-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
}

.equip-demo-tooltip .equip-demo-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.equip-demo-tooltip .equip-demo-progress {
  font-size: 0.9375rem;
  color: #666;
}

.equip-demo-tooltip .equip-demo-actions {
  display: flex;
  gap: 8px;
}

.equip-demo-tooltip .equip-demo-done-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.equip-demo-tooltip .equip-demo-get-started,
.equip-demo-tooltip .equip-demo-view-sample {
  background: #007AFF;
  color: #fff;
}

.equip-demo-tooltip .equip-demo-get-started:hover,
.equip-demo-tooltip .equip-demo-view-sample:hover,
.equip-demo-tooltip .equip-demo-next:hover {
  background: #0066d6;
  color: #fff;
}

.equip-demo-tooltip .equip-demo-start-template {
  background: #28a745;
  color: #fff;
}

.equip-demo-tooltip button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 650;
  font-size: 0.9375rem;
}

.equip-demo-tooltip .equip-demo-back {
  background: #f2f2f2;
  color: #111;
}

.equip-demo-tooltip .equip-demo-next {
  background: #007AFF;
  color: #fff;
}

.equip-demo-tooltip .equip-demo-create-equipment {
  background: #e5e5e5;
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

.equip-demo-tooltip .equip-demo-create-equipment:hover {
  background: #e5e5e5;
  color: #666;
}

.equip-demo-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 84px;
  z-index: 999999;
  background: rgba(0,0,0,0.86);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.22);
  max-width: min(520px, calc(100vw - 28px));
}

/* ============================================================
   Mobile: tour FAB, tooltip, toast, welcome message
   ============================================================ */
@media (max-width: 768px) {
  .equip-demo-fab {
    top: 12px;
    right: 12px;
    flex-wrap: wrap;
    gap: 8px;
    max-width: calc(100vw - 24px);
  }
  .equip-demo-fab button {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
    min-width: 44px;
  }
  .equip-demo-welcome-message {
    right: 12px;
    left: 12px;
    top: 60px;
    max-width: none;
    width: auto;
  }
  .equip-demo-tooltip {
    width: min(400px, calc(100vw - 24px));
    /* Keep the tour from covering most of the screen on mobile. */
    max-height: min(52vh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 14px;
  }
  .equip-demo-tooltip h3 {
    font-size: 1.125rem;
  }
  .equip-demo-tooltip p {
    font-size: 1rem;
    margin-bottom: 10px;
  }
  .equip-demo-tooltip .equip-demo-controls-row {
    flex-wrap: wrap;
  }
  .equip-demo-tooltip button {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }
  .equip-demo-toast {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 16px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    transform: none;
  }
  .equip-demo-spotlight {
    border-radius: 12px;
    border-width: 2px;
  }
}
