/* ── MuniPro Video Tour Player ──────────────────────────────────────── */

/* Container */
#mp-tour-pip {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 225px;
  z-index: 10000;
  background: #1a1a2e;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: width 0.25s ease, height 0.25s ease;
  outline: none;
}
#mp-tour-pip[hidden] {
  display: none !important;
}
#mp-tour-pip.mp-pip-expanded {
  width: 720px;
  height: 405px;
}

/* Header / drag handle */
.mp-pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 43, 92, 0.92);
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
}
.mp-pip-header:active {
  cursor: grabbing;
}
.mp-pip-title {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-pip-header-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.mp-pip-header-btns button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
}
.mp-pip-header-btns button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

/* Video element */
.mp-pip-video {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #000;
  display: block;
  object-fit: contain;
}
.mp-pip-video::cue {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 14px;
  font-family: 'Calibri', sans-serif;
}

/* Controls bar */
.mp-pip-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
}
.mp-pip-controls button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.mp-pip-controls button:hover {
  opacity: 1;
}

/* Play button */
.mp-pip-play {
  flex-shrink: 0;
}

/* Scrubber */
.mp-pip-scrubber {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: visible;
}
.mp-pip-progress {
  height: 100%;
  background: #4472C4;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

/* Chapter tick marks */
.mp-pip-tick {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 1px;
  pointer-events: none;
}

/* Time display */
.mp-pip-time {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 75px;
  text-align: center;
}

/* Speed selector */
.mp-pip-speed {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  font-size: 10px;
  padding: 2px 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.mp-pip-speed option {
  background: #1a1a2e;
  color: white;
}

/* CC button */
.mp-pip-cc {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.mp-pip-cc-active {
  color: #4472C4 !important;
  opacity: 1 !important;
}

/* Fullscreen button */
.mp-pip-fs {
  flex-shrink: 0;
}

/* ── Chapter list (expanded mode only) ─────────────────────────────── */
.mp-pip-chapters {
  background: rgba(0, 0, 0, 0.9);
  padding: 4px 0;
  max-height: 120px;
  overflow-y: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.mp-pip-chapters[hidden] {
  display: none;
}
.mp-pip-chapter-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
}
.mp-pip-chapter-item:hover {
  background: rgba(68, 114, 196, 0.3);
  color: white;
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #mp-tour-pip {
    transition: none !important;
  }
  .mp-pip-progress {
    transition: none !important;
  }
}
