.Video {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.Video.fade-in {
  opacity: 1;
}

.MediaControlContainer {
  position: relative; /* CRITICAL: This creates the positioning context */
  display: inline-block;
  width: max-content; /* Ensure container sizes to content */
  height: max-content;
}

.MediaControlSpacer {
  display: flex;
  position: relative;
  padding: 0;
  margin: 0;
  width: 5rem;
  height: 3.75rem;
  min-height: 3.75rem;
  min-width: 5rem;
  background-color: #444;
  border-radius: 0.25rem;
  border: 2px dashed #666; /* Visual indicator for drop zone */
}

.MediaControl {
  display: flex;
  position: absolute; /* Out of flow */
  top: 0; /* Start at top of container */
  left: 0; /* Start at left of container */
  width: 5rem;
  height: 3.75rem;
  min-width: 3.5rem;
  min-height: 1.8725rem;
  z-index: 12000; /* Above Hand and other MUI elements */
  border-radius: 0.25rem;
}

.MediaControl .Video {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  top: 0;
  left: 0;
  background-color: #444;
  border-radius: 0.25rem;
  border: 1px solid black;
}

.MediaControl .Controls {
  display: none; /* Hidden by default, shown on hover */
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  min-width: fit-content;
  min-height: fit-content;
  z-index: 1251; /* Above the Indicators but below active move handles */
  background-color: rgba(64, 64, 64, 64);
  backdrop-filter: blur(5px);
  opacity: 0.85;
}

.MediaControl:hover .Controls {
  display: flex; /* Show controls on hover */
  flex-direction: row;
}

/* Indicators: visual, non-interactive icons anchored lower-left of the container.
   They are independent from the interactive Controls and scale responsively. */
.Indicators {
  position: absolute;
  z-index: 1250; /* Above the video but below active move handles */
  /* Use percentage offsets so the indicators scale and stick to lower-left of the target */
  left: 4%;
  bottom: 4%;
  display: flex;
  flex-direction: column;
  pointer-events: none; /* non-interactive */
  align-items: flex-start;
  opacity: 0.5;
}

.Indicators .IndicatorRow {
  display: flex;
  gap: 0.12rem;
  align-items: center;
}
.Indicators .IndicatorItem {
  background: rgba(0, 0, 0, 0.45);
  padding: 0.12rem;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.Indicators .IndicatorItem svg {
  /* make svg scale relative to parent (which is sized by the Moveable target) */
  width: 1.6rem;
  height: 1.6rem;
}

/* Make indicator items size proportionally to the target using relative units */
.Indicators .IndicatorItem {
  padding: 0.35rem;
  border-radius: 999px;
}

/* Reduce absolute pixel values that may prevent scaling; use clamp for min/max */
.Indicators .IndicatorItem svg {
  width: clamp(0.6rem, 6%, 1.2rem);
  height: clamp(0.6rem, 6%, 1.2rem);
}

/* Ensure interactive Controls are reachable even when target is small: allow Controls to overflow
   the moveable target visually (they are positioned absolute inside the target). */
.MediaControl .Controls {
  overflow: visible;
}

.MediaControl .Controls > div {
  border-radius: 0.25em;
  cursor: pointer;
}

/* Invert highlight behavior for control buttons:
   - Buttons are transparent by default so they don't visually obscure the video when not hovered.
   - On hover/focus (keyboard or pointer) they show a light background to indicate interactivity.
   - Scope to MUI IconButton root class to avoid affecting other controls.
*/
.MediaControl .Controls .MuiIconButton-root {
  background: transparent;
  transition: background-color 120ms ease, color 120ms ease;
  padding: 0.25rem;
  margin: 0.08rem;
}
.MediaControl .Controls .MuiIconButton-root:hover,
.MediaControl .Controls .MuiIconButton-root:focus {
  background: rgba(255,255,255,0.5); /* subtle light highlight on hover/focus */
}
.MediaControl .Controls .MuiIconButton-root:active {
  background: rgba(255,255,255,0.18);
}

/* Ensure accessible focus indicator for keyboard users */
.MediaControl .Controls .MuiIconButton-root:focus-visible {
  outline: 2px solid rgba(255,255,255,0.22);
  outline-offset: 2px;
}

.moveable-control-box {
  border: none;
  --moveable-color: unset !important;
}

.moveable-control-box .moveable-direction {
  border: none !important;
}
