/* ==========================================================================
   GUIDED TOUR - Folio narrates
   ========================================================================== */

/* --- SECTION PICKER MODAL --- */

.tour-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tour-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.tour-modal {
  background: #fff;
  border-radius: 16px;
  width: 520px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 0;
}

.tour-modal-header {
  padding: 28px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.tour-modal-header h2 {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-color, #2d3748);
  margin: 0;
}

.tour-modal-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-light, #718096);
}

.tour-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted, #a0aec0);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.tour-modal-close:hover {
  background: var(--border-light, #f0f2f5);
  color: var(--text-color, #2d3748);
}

/* Full Tour Button */
.tour-full-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  margin: 20px 28px 12px;
  width: calc(100% - 56px);
  background: var(--primary-color, #5c6bc0);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tour-full-btn:hover {
  background: var(--primary-hover, #3f51b5);
  transform: translateY(-1px);
}

.tour-full-btn i {
  font-size: 18px;
  opacity: 0.9;
}

.tour-full-btn .btn-meta {
  font-weight: 400;
  opacity: 0.8;
  font-size: 13px;
  margin-left: auto;
}

/* Section Divider */
.tour-sections-label {
  padding: 8px 28px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-color, #5c6bc0);
}

/* Section Cards */
.tour-sections-list {
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tour-section-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-color, #f5f7fa);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tour-section-card:hover {
  border-color: var(--primary-color, #5c6bc0);
  background: var(--primary-light, #e8eaf6);
}

.tour-section-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--primary-color, #5c6bc0);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tour-section-info {
  flex: 1;
  min-width: 0;
}

.tour-section-info h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color, #2d3748);
}

.tour-section-info p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-light, #718096);
}

.tour-section-steps {
  font-size: 11px;
  color: var(--primary-color, #5c6bc0);
  white-space: nowrap;
  flex-shrink: 0;
}


/* --- SPOTLIGHT OVERLAY --- */

.tour-spotlight {
  position: fixed;
  z-index: 10001;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease, opacity 0.3s ease;
  opacity: 0;
}

.tour-spotlight.visible {
  opacity: 1;
}

/* When no target, spotlight covers nothing (full dim) */
.tour-spotlight.no-target {
  top: 50% !important;
  left: 50% !important;
  width: 0 !important;
  height: 0 !important;
  border-radius: 50%;
}


/* --- NARRATION PANEL --- */

.tour-panel {
  position: fixed;
  z-index: 10002;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  width: 340px;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease 0.1s, visibility 0.3s ease 0.1s;
}

.tour-panel.visible {
  opacity: 1;
  visibility: visible;
}

.tour-panel-body {
  padding: 20px 22px 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.tour-panel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light, #e8eaf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--primary-color, #5c6bc0);
}

.tour-panel-text {
  flex: 1;
  min-width: 0;
}

.tour-panel-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-color, #5c6bc0);
  margin-bottom: 4px;
}

.tour-panel-message {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-color, #2d3748);
}

/* Navigation */
.tour-panel-nav {
  padding: 10px 22px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border-light, #f0f2f5);
}

.tour-nav-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e1e5eb);
  background: #fff;
  color: var(--text-color, #2d3748);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tour-nav-btn:hover {
  background: var(--bg-color, #f5f7fa);
  border-color: var(--primary-color, #5c6bc0);
}

.tour-nav-btn.primary {
  background: var(--primary-color, #5c6bc0);
  border-color: var(--primary-color, #5c6bc0);
  color: #fff;
}

.tour-nav-btn.primary:hover {
  background: var(--primary-hover, #3f51b5);
}

.tour-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tour-nav-btn:disabled:hover {
  background: #fff;
  border-color: var(--border-color, #e1e5eb);
}

.tour-step-counter {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--primary-color, #5c6bc0);
}

.tour-nav-exit {
  background: none;
  border: none;
  color: var(--primary-color, #5c6bc0);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.tour-nav-exit:hover {
  color: var(--danger-color, #e53935);
}


/* --- INTERACTION BLOCKER --- */
/* Prevents user from accidentally manipulating the UI during tour */

.tour-blocker {
  position: fixed;
  inset: 0;
  z-index: 10000;
  cursor: default;
  display: none;
}

body.tour-active .tour-blocker {
  display: block;
}

.tour-blocker.interactive {
  pointer-events: none;
}

.tour-blocker.hoverable {
  pointer-events: none;
}


/* --- FOLIO DURING TOUR --- */

/* Bring Folio above the spotlight overlay so he's always visible */
body.tour-active .folio-container {
  z-index: 10003;
}

/* Suppress Folio's own speech bubble during tour (the panel narrates instead) */
body.tour-active #speechBubble {
  display: none !important;
}


/* --- HEADER TOUR BUTTON --- */

#tour-button {
  background: var(--primary-color, #5c6bc0);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  margin-right: 8px;
  flex-shrink: 0;
  align-self: center;
}

#tour-button:hover {
  background: #fff;
  color: var(--primary-color, #5c6bc0);
}