/* ── CineMetrix Studio — Guided Tour ─────────────────────────────────────── */

/* ── Persistent fixed Tour FAB — bottom LEFT, opposite "How scoring works" ── */
#cm-tour-fab {
  position: fixed;
  bottom: 22px;
  left: 20px;
  z-index: 8000;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  border-radius: 20px;
  background: rgba(11, 15, 26, 0.92);
  color: #d4af37;
  font-size: 11px;
  font-family: 'DM Mono', 'Courier New', monospace;
  letter-spacing: 0.07em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 12px rgba(212,175,55,0.15);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#cm-tour-fab:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 1);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,55,0.3);
}
#cm-tour-fab.tour-active { display: none; }

/* ── Overlay backdrop ──────────────────────────────────────────────────────── */
#cm-tour-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 8, 20, 0.93);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 12px 14px;
  box-sizing: border-box;
  overflow: hidden;
}
#cm-tour-overlay.active { display: flex; }

/* ── Tour card ─────────────────────────────────────────────────────────────── */
.tour-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  height: calc(100vh - 24px);
  max-height: 100%;
  overflow: hidden;
}

/* ── Step header ───────────────────────────────────────────────────────────── */
.tour-step-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}
.tour-step-counter {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: rgba(212, 175, 55, 0.6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tour-step-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tour-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.2s, transform 0.2s;
}
.tour-step-dot.active { background: #d4af37; transform: scale(1.3); }
.tour-step-dot.done   { background: rgba(212, 175, 55, 0.4); }

/* ── Body area ─────────────────────────────────────────────────────────────── */
#cm-tour-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Image stage: scrollable container, hides scrollbar ───────────────────── */
.tour-image-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tour-image-stage::-webkit-scrollbar { display: none; }

/* ── Image inner: natural size, highlights anchored inside ─────────────────── */
.tour-image-inner {
  position: relative;
  width: 100%;
}
.tour-image-inner img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
  border-radius: 10px;
}

/* ── Highlight box ─────────────────────────────────────────────────────────── */
.tour-highlight {
  position: absolute;
  border: 2.5px solid #f0cc30;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(240,204,48,0.18), 0 0 20px rgba(240,204,48,0.35);
  pointer-events: none;
  animation: tour-pulse 2s ease-in-out infinite;
}
@keyframes tour-pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(240,204,48,0.18), 0 0 20px rgba(240,204,48,0.35); }
  50%     { box-shadow: 0 0 0 6px rgba(240,204,48,0.08), 0 0 35px rgba(240,204,48,0.55); }
}

/* ── Balloon tooltip ───────────────────────────────────────────────────────── */
.tour-balloon {
  position: absolute;
  background: #0d1428;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 10;
  pointer-events: none;
}
.tour-balloon::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: #0d1428;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  transform: rotate(45deg);
}
.tour-balloon.arrow-left::before   { left:-6px;   top:18px; border-right:none;  border-top:none;    }
.tour-balloon.arrow-right::before  { right:-6px;  top:18px; border-left:none;   border-bottom:none; }
.tour-balloon.arrow-top::before    { top:-6px;    left:20px; border-right:none; border-bottom:none; }
.tour-balloon.arrow-bottom::before { bottom:-6px; left:20px; border-left:none;  border-top:none;    }

.tour-balloon-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  color: #d4af37;
  margin-bottom: 5px;
  line-height: 1.3;
}
.tour-balloon-body {
  font-size: 11px;
  color: rgba(200, 215, 240, 0.85);
  line-height: 1.5;
  font-family: -apple-system, sans-serif;
}

/* ── Welcome card ──────────────────────────────────────────────────────────── */
.tour-welcome-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 40px 28px;
  background: linear-gradient(135deg, #0b1020 0%, #0d1830 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 14px;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}
.tour-welcome-icon  { font-size: 38px; margin-bottom: 14px; display: block; }
.tour-welcome-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px; font-weight: 700; color: #d4af37;
  margin-bottom: 12px; line-height: 1.2;
}
.tour-welcome-body {
  font-size: 14px; color: rgba(200, 215, 240, 0.8);
  line-height: 1.65; max-width: 380px;
  margin: 0 auto; font-family: -apple-system, sans-serif;
}

/* ── Nav bar — flex-shrink:0 guarantees it's always on screen ──────────────── */
.tour-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 2px;
  gap: 10px;
}
.tour-nav-skip {
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  font-family: -apple-system, sans-serif;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.03em;
}
.tour-nav-skip:hover { color: rgba(255,255,255,0.75); border-color: rgba(255,255,255,0.4); }

/* Next button: !important on every property to beat any global button resets */
.tour-nav-next {
  background: linear-gradient(135deg, #c9952a, #d4af37) !important;
  border: none !important;
  color: #0b0f1a !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: -apple-system, sans-serif !important;
  padding: 8px 22px !important;
  border-radius: 20px !important;
  cursor: pointer !important;
  letter-spacing: 0.04em;
  transition: opacity 0.2s, transform 0.15s;
  opacity: 1 !important;
  flex-shrink: 0;
}
.tour-nav-next:hover { opacity: 0.85 !important; transform: scale(1.03); }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #cm-tour-overlay  { padding: 8px; }
  .tour-balloon     { padding: 8px 10px; }
  .tour-balloon-title { font-size: 11px; }
  .tour-balloon-body  { font-size: 10px; }
  .tour-welcome-title { font-size: 20px; }
  .tour-welcome-body  { font-size: 13px; }
  .tour-welcome-card  { padding: 28px 18px; }
  #cm-tour-fab { bottom: 16px; left: 14px; font-size: 10px; padding: 6px 12px; }
}
