/* ════════════════════════════════════════════
   Video Player Styles (Manim Animation Support)
   ════════════════════════════════════════════ */

/* ── Math Animation Video Container ── */
.math-animation,
video.math-animation {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 1.5em auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.06);
  background: #000;
  line-height: 0; /* remove bottom gap */
}

/* ── Custom Controls Styling ── */
.math-animation::-webkit-media-controls-panel {
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  opacity: 0;
  transition: opacity 0.3s;
}

.math-animation:hover::-webkit-media-controls-panel {
  opacity: 1;
}

/* ── Video Caption ── */
.video-caption {
  display: block;
  max-width: 800px;
  margin: 0.5em auto 1.5em;
  font-size: 0.875rem;
  color: var(--md-default-fg-color--light);
  text-align: center;
  font-style: italic;
}

.video-caption strong {
  color: var(--md-default-fg-color--lighter);
  font-style: normal;
}

/* ── GIF Fallback ── */
img.math-animation {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 1.5em auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .math-animation,
  video.math-animation,
  img.math-animation {
    border-radius: 8px;
    max-width: 100%;
  }

  .video-caption {
    padding: 0 1rem;
    font-size: 0.8rem;
  }
}

/* ── Error State ── */
.video-error::after {
  content: '⚠️ Video unavailable — please refresh or check your connection';
  display: block;
  padding: 2rem;
  text-align: center;
  color: var(--md-default-fg-color--light);
  background: rgba(255,82,82,0.05);
  border-radius: 8px;
}
