/* ─── Ladica Light Video Player ─── */
.ladica-video {
  --ladica-video-color: #1ab5b0;
  --ladica-video-accent: #c9a84c;
  --ladica-video-radius: 16px;
  --ladica-video-text: #fff;
  --ladica-progress: 0%;
  --ladica-bar-h: 46px;
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0;
  color: var(--ladica-video-text);
  font-family: inherit;
  /* Обводка вокруг плеера */
  border-radius: calc(var(--ladica-video-radius) + 3px);
  outline: 2px solid var(--ladica-video-color);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(26, 181, 176, 0.12), 0 8px 32px rgba(0, 0, 0, 0.28);
}

/* ─── Stage ─── */
.ladica-video__stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #1c2424;
  border-radius: var(--ladica-video-radius) var(--ladica-video-radius) 0 0;
  aspect-ratio: 16 / 9;
}

.ladica-video__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1c2424;
}

.ladica-video__media::-webkit-media-controls {
  display: none !important;
}

/* ─── Base reset for buttons ─── */
.ladica-video__center,
.ladica-video__button,
.ladica-video__speed {
  appearance: none;
  border: 0;
  color: var(--ladica-video-text);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

/* ─── Center play button (over the stage) ─── */
.ladica-video__center {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--ladica-video-color);
  box-shadow: 0 6px 24px rgba(26, 181, 176, 0.45), 0 0 0 8px rgba(26, 181, 176, 0.14);
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.ladica-video__center:hover {
  box-shadow: 0 8px 28px rgba(26, 181, 176, 0.55), 0 0 0 12px rgba(26, 181, 176, 0.18);
  transform: translate(-50%, -50%) scale(1.07);
}

.ladica-video.is-playing .ladica-video__center {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
}

.ladica-video__center svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  margin-left: 3px;
}

/* ─── Controls bar — ONE single row ─── */
.ladica-video__controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  height: var(--ladica-bar-h);
  padding: 0;
  border-radius: 0 0 var(--ladica-video-radius) var(--ladica-video-radius);
  background: #1a2222;
  border-top: 1px solid rgba(26, 181, 176, 0.22);
  overflow: hidden;
}

/* ─── Hide the old timeline block — we integrate everything into __bar ─── */
.ladica-video__timeline {
  display: contents; /* children participate in the flex row directly */
}

/* ─── Progress slider ─── */
.ladica-video__progress {
  appearance: none;
  flex: 1 1 0;
  min-width: 40px;
  height: 4px;
  border-radius: 999px;
  outline: 0;
  background: linear-gradient(
    90deg,
    var(--ladica-video-color) var(--ladica-progress),
    rgba(255, 255, 255, 0.18) var(--ladica-progress)
  );
  cursor: pointer;
  margin: 0 4px;
  transition: height 120ms ease;
  align-self: center;
}

.ladica-video__progress:hover {
  height: 6px;
}

.ladica-video__progress::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 181, 176, 0.35);
}

.ladica-video__progress::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 181, 176, 0.35);
}

/* Volume slider (hidden by default, shown on wider screens) */
.ladica-video__volume {
  appearance: none;
  flex: 0 0 64px;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  outline: 0;
  background: linear-gradient(
    90deg,
    var(--ladica-video-color) var(--ladica-progress, 100%),
    rgba(255, 255, 255, 0.18) var(--ladica-progress, 100%)
  );
  cursor: pointer;
  display: none;
  align-self: center;
  margin: 0 2px;
}

.ladica-video__volume::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26, 181, 176, 0.3);
}

.ladica-video__volume::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

/* ─── Time display ─── */
.ladica-video__time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.ladica-video__current {
  padding-left: 6px;
}

.ladica-video__duration {
  padding-right: 6px;
}

/* Separator between current and duration */
.ladica-video__time-sep {
  display: none; /* not used, time elements shown separately */
}

/* ─── Buttons row ─── */
.ladica-video__bar {
  display: contents; /* all children go directly into the flex row */
}

/* Play button — teal background block, LEFT anchor */
.ladica-video__play {
  display: inline-grid;
  flex: 0 0 var(--ladica-bar-h);
  width: var(--ladica-bar-h);
  height: var(--ladica-bar-h);
  place-items: center;
  padding: 0;
  border-radius: 0 0 0 var(--ladica-video-radius);
  background: var(--ladica-video-color);
  color: #fff;
  transition: background 140ms ease, transform 120ms ease;
}

.ladica-video__play:hover {
  background: color-mix(in srgb, var(--ladica-video-color) 85%, #fff);
}

.ladica-video__play:active {
  transform: scale(0.93);
}

.ladica-video__play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* All other buttons */
.ladica-video__button {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 34px;
  height: var(--ladica-bar-h);
  place-items: center;
  padding: 0 6px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  transition: background 130ms ease, color 130ms ease, transform 110ms ease;
  margin: 0 1px;
}

.ladica-video__button:hover,
.ladica-video__button:focus-visible {
  background: rgba(26, 181, 176, 0.15);
  color: var(--ladica-video-color);
  outline: none;
}

.ladica-video__button:active {
  transform: scale(0.91);
}

.ladica-video__button[disabled] {
  cursor: not-allowed;
  opacity: 0.28;
}

.ladica-video__button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ─── Back / Forward seek ─── */
.ladica-video__back svg,
.ladica-video__forward svg {
  width: 17px;
  height: 17px;
}

/* ─── Stop (hidden) ─── */
.ladica-video__stop {
  display: none !important;
}

/* ─── CC button ─── */
.ladica-video__captions {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-width: 30px;
  padding: 0 5px;
}

.ladica-video__captions.is-active {
  color: var(--ladica-video-color);
  background: rgba(26, 181, 176, 0.15);
  border-radius: 4px;
}

/* ─── Speed button ─── */
.ladica-video__speed {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 34px;
  height: var(--ladica-bar-h);
  place-items: center;
  padding: 0 5px;
  border-radius: 6px;
  background: transparent;
  color: var(--ladica-video-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 130ms ease, transform 110ms ease;
  margin: 0 1px;
}

.ladica-video__speed:hover,
.ladica-video__speed:focus-visible {
  background: rgba(201, 168, 76, 0.14);
  outline: none;
}

.ladica-video__speed:active {
  transform: scale(0.91);
}

/* ─── Spacer ─── */
.ladica-video__spacer {
  flex: 1 1 auto;
  min-width: 0;
  display: none; /* not needed — progress takes all space */
}

/* ─── Title below the player ─── */
.ladica-video__title {
  margin-top: 0.7rem;
  color: color-mix(in srgb, var(--ladica-video-color) 70%, #fff);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ─── Error ─── */
.ladica-video-error {
  padding: 12px 14px;
  border-left: 4px solid #b42318;
  background: #fff5f5;
  color: #7a271a;
}

/* ─── Mobile ─── */
@media (max-width: 560px) {
  .ladica-video {
    --ladica-bar-h: 40px;
  }

  .ladica-video__back,
  .ladica-video__forward,
  .ladica-video__captions {
    display: none;
  }

  .ladica-video__center {
    width: 52px;
    height: 52px;
  }

  .ladica-video__center svg {
    width: 20px;
    height: 20px;
  }

  .ladica-video__time {
    font-size: 10px;
  }

  .ladica-video__speed {
    min-width: 28px;
    font-size: 10px;
  }
}

/* ─── Admin preview ─── */
.ladica-admin-preview {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 72px !important;
  height: 40px !important;
  max-width: 72px !important;
  max-height: 40px !important;
  overflow: hidden;
  border-radius: 4px;
  background: #1c2424;
  color: #8aadab;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}

.ladica-admin-preview img {
  display: block !important;
  width: 72px !important;
  height: 40px !important;
  max-width: 72px !important;
  max-height: 40px !important;
  object-fit: cover;
}

.ladica-admin-preview--empty span {
  display: block;
  color: var(--ladica-video-color, #1ab5b0);
  font-size: 18px;
  line-height: 1;
  opacity: 0.78;
}

.ladica-admin-poster-form {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 420px;
}

.ladica-admin-poster-form input[type="url"] {
  width: 260px;
  max-width: 100%;
}

.settings_page_ladica-light-video-player .widefat th:first-child,
.settings_page_ladica-light-video-player .widefat td:first-child {
  width: 86px;
}

.settings_page_ladica-light-video-player .widefat td {
  vertical-align: middle;
}
