/* ==========================================================================
   ParcelPlans · Interactive Narrated Guided Tour (Unified Storyboard Engine)
   ========================================================================== */

.btn-demo {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.22));
  border: 1px solid rgba(16, 185, 129, 0.65);
  color: #ecfdf5;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-demo:hover {
  transform: translateY(-1px);
  border-color: #34d399;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.42);
}

.btn-demo .demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: ppDemoPulse 1.8s ease-in-out infinite;
}

@keyframes ppDemoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

/* Spotlight highlight ring around active UI element */
.pp-tour-spotlight {
  position: fixed;
  z-index: 4100;
  pointer-events: none;
  border: 2.5px solid #34d399;
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18), 0 0 28px rgba(16, 185, 129, 0.45);
  transition: all 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  opacity: 0;
}

.pp-tour-spotlight.visible {
  opacity: 1;
}

.pp-tour-spotlight-tag {
  position: absolute;
  top: -28px;
  left: 10px;
  background: #064e3b;
  color: #a7f3d0;
  border: 1px solid #34d399;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

/* Floating Eleanor Avatar Picture-in-Picture Bubble (shown ONLY on avatar beats) */
.pp-tour-pip {
  position: fixed;
  right: 26px;
  bottom: 108px;
  z-index: 4300;
  width: 214px;
  height: 214px;
  border-radius: 9999px;
  padding: 4px;
  background: linear-gradient(135deg, #10b981, #38bdf8);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.65), 0 0 28px rgba(16, 185, 129, 0.35);
  transform: scale(0.82) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.pp-tour-pip.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.pp-tour-pip video {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
  background: #0b111b;
}

.pp-tour-pip-badge {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  background: rgba(11, 17, 27, 0.94);
  border: 1px solid rgba(52, 211, 153, 0.6);
  color: #ecfdf5;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* Floating Technical Callout Card (Centered Lower-Third Chyron above dock) */
.pp-tour-callout {
  position: fixed;
  left: 50%;
  bottom: 108px;
  z-index: 4250;
  width: min(640px, calc(100vw - 520px));
  min-width: 340px;
  background: rgba(11, 17, 27, 0.93);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-left: 4px solid #10b981;
  border-radius: 12px;
  padding: 10px 15px;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pp-tour-callout.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pp-tour-callout-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #34d399;
  margin-bottom: 3px;
}

.pp-tour-callout-metric {
  font-size: 14.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.pp-tour-callout-detail {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 2px;
  line-height: 1.4;
}

.pp-tour-caption {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.45;
}

/* Bottom Cinema Control Dock */
.pp-tour-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(120%);
  z-index: 4400;
  width: min(980px, calc(100vw - 32px));
  background: rgba(11, 17, 27, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 16px;
  padding: 10px 14px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.pp-tour-dock.open {
  transform: translateX(-50%) translateY(0);
}

.pp-tour-dock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pp-tour-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pp-tour-btn {
  background: #182334;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #f1f5f9;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pp-tour-btn:hover {
  background: #1e2c42;
  border-color: rgba(56, 189, 248, 0.6);
}

.pp-tour-btn.primary {
  background: #10b981;
  border-color: #10b981;
  color: #041019;
  font-weight: 800;
}

.pp-tour-btn.primary:hover {
  background: #34d399;
}

.pp-tour-meta {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pp-tour-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  width: 18px;
  flex-shrink: 0;
}

.pp-tour-eq span {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: #34d399;
  transition: height 0.15s ease;
}

.pp-tour-dock.playing .pp-tour-eq span {
  animation: ppEqBar 0.7s ease-in-out infinite;
}
.pp-tour-dock.playing .pp-tour-eq span:nth-child(2) { animation-delay: 0.15s; }
.pp-tour-dock.playing .pp-tour-eq span:nth-child(3) { animation-delay: 0.30s; }
.pp-tour-dock.playing .pp-tour-eq span:nth-child(4) { animation-delay: 0.45s; }

@keyframes ppEqBar {
  0%, 100% { height: 5px; }
  50% { height: 16px; }
}

.pp-tour-title-wrap {
  min-width: 0;
}

.pp-tour-ch-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-tour-ch-sub {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pp-tour-time {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  color: #cbd5e1;
  white-space: nowrap;
}

/* Chapter Progress Strip */
.pp-tour-chapters {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.pp-tour-seg {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: rgba(30, 44, 66, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
  cursor: pointer;
  padding: 0 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  text-align: left;
  transition: border-color 0.15s ease;
}

.pp-tour-seg:hover {
  border-color: rgba(56, 189, 248, 0.6);
}

.pp-tour-seg.active {
  border-color: #34d399;
}

.pp-tour-seg-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.35), rgba(56, 189, 248, 0.35));
  pointer-events: none;
}

.pp-tour-seg-label {
  position: relative;
  z-index: 1;
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-tour-seg.active .pp-tour-seg-label {
  color: #ecfdf5;
}

/* Clean recording mode (?record=1): hides interactive controls & browser PiP (ffmpeg composites HQ PiP) */
body.pp-record-mode .pp-tour-pip {
  display: none !important;
}

body.pp-record-mode .pp-tour-dock {
  width: min(860px, calc(100vw - 48px));
  bottom: 14px;
  padding: 8px 14px;
}

body.pp-record-mode .pp-tour-controls,
body.pp-record-mode .pp-tour-right-ctl {
  display: none !important;
}

body.pp-record-mode .pp-tour-callout {
  bottom: 94px;
  width: 650px;
}

@media (max-width: 820px) {
  .pp-tour-pip {
    width: 146px;
    height: 146px;
    right: 12px;
    bottom: 118px;
  }
  .pp-tour-callout {
    left: 12px;
    right: 168px;
    bottom: 118px;
  }
  .pp-tour-chapters {
    grid-template-columns: repeat(4, 1fr);
  }
}
