/* ─── DemoPlayer Styles ──────────────────────────────────────────────────── */

.dp-root {
  display: inline-block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a1a;
}

/* ─── Window Chrome ──────────────────────────────────────────────────────── */

.dp-window-chrome {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  background: #2a2a2a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
}

.dp-traffic-lights {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.dp-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.dp-dot-close {
  background: #ff5f57;
}

.dp-dot-minimize {
  background: #febc2e;
}

.dp-dot-maximize {
  background: #28c840;
}

.dp-window-title {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  text-align: center;
  margin-right: 68px; /* offset for traffic lights */
}

/* ─── Viewport ───────────────────────────────────────────────────────────── */

.dp-viewport {
  position: relative;
  overflow: hidden;
  background: #1a1a2e;
}

.dp-content-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* ─── Cursor ─────────────────────────────────────────────────────────────── */

.dp-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
  transition: none;
  /* Offset so tip of arrow aligns with position */
  margin-left: -2px;
  margin-top: -2px;
}

.dp-cursor svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: transform 0.1s ease;
}

.dp-click-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-8px, -8px) scale(0);
  opacity: 0;
  pointer-events: none;
}

.dp-click-ring.dp-click-active {
  animation: dp-click-ripple 0.45s ease-out forwards;
}

@keyframes dp-click-ripple {
  0% {
    transform: translate(-8px, -8px) scale(0);
    opacity: 0.8;
  }
  100% {
    transform: translate(-8px, -8px) scale(1.5);
    opacity: 0;
  }
}

/* ─── Controls ───────────────────────────────────────────────────────────── */

.dp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 14px;
  background: #1a1a1a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dp-play-pause {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.dp-play-pause:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dp-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.dp-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.dp-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Highlight ──────────────────────────────────────────────────────────── */

.dp-highlight {
  outline: 2px solid rgba(99, 102, 241, 0.7) !important;
  outline-offset: 2px;
  border-radius: 4px;
  animation: dp-highlight-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes dp-highlight-pulse {
  0% {
    outline-color: rgba(99, 102, 241, 0.5);
  }
  100% {
    outline-color: rgba(99, 102, 241, 0.9);
  }
}

/* ─── Typing Caret ───────────────────────────────────────────────────────── */

.dp-typing-caret {
  position: absolute;
  width: 2px;
  background: #fff;
  pointer-events: none;
  z-index: 5;
  animation: dp-caret-blink 0.6s step-end infinite;
}

@keyframes dp-caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Hidden span for measuring text width */
.dp-measure-span {
  position: absolute;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ─── Hover / Active States ──────────────────────────────────────────────── */

/* Generic button hover/active via fake cursor */
.dp-content-wrapper button.dp-hovered,
.dp-content-wrapper [role="button"].dp-hovered {
  filter: brightness(1.2);
}

.dp-content-wrapper button.dp-active,
.dp-content-wrapper [role="button"].dp-active {
  filter: brightness(0.85);
  transform: scale(0.97);
}

/* Generic link/interactive hover */
.dp-content-wrapper a.dp-hovered,
.dp-content-wrapper [data-dp-interactive].dp-hovered {
  filter: brightness(1.15);
}

/* ─── Callout Tooltips ───────────────────────────────────────────────────── */

.dp-callout {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  /* Soft cap so long callout text wraps within the stage. The positioning
     code measures the rendered width to decide which side to anchor to. */
  max-width: 260px;
}

.dp-callout-content {
  background: #fff;
  color: #1a1a2e;
  font-size: 13px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 7px 14px;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    0 1px 4px rgba(0, 0, 0, 0.15);
  line-height: 1.4;
  white-space: normal;
}

.dp-callout-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
}

/* Arrow positions */
.dp-callout-top .dp-callout-arrow {
  bottom: -5px;
  left: 50%;
  margin-left: -5px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.dp-callout-bottom .dp-callout-arrow {
  top: -5px;
  left: 50%;
  margin-left: -5px;
  box-shadow: -1px -1px 4px rgba(0, 0, 0, 0.06);
}

.dp-callout-left .dp-callout-arrow {
  right: -5px;
  top: 50%;
  margin-top: -5px;
  box-shadow: 2px -1px 4px rgba(0, 0, 0, 0.08);
}

.dp-callout-right .dp-callout-arrow {
  left: -5px;
  top: 50%;
  margin-top: -5px;
  box-shadow: -1px 2px 4px rgba(0, 0, 0, 0.08);
}
