/* ================================================================
   All in One A11y — Video Player
   All colours that Elementor can override use CSS custom properties.
   ================================================================ */

.accessvideo-ecb {
  /* Section padding (desktop / mobile) — set inline by the renderer. */
  --ecb-pt: 40px;
  --ecb-pb: 52px;
  --ecb-pt-m: 30px;
  --ecb-pb-m: 39px;
  --ecb-radius: 16px;

  /* Colour tokens — overridable from Elementor style controls. */
  --ecb-btn-bg: rgba(0, 0, 0, 0.7);
  --ecb-btn-color: rgba(255, 255, 255, 0.85);
  --ecb-btn-border: rgba(255, 255, 255, 0.14);
  --ecb-btn-bg-hover: rgba(0, 0, 0, 0.85);
  --ecb-btn-color-hover: #ffffff;
  --ecb-btn-border-hover: rgba(255, 255, 255, 0.25);
  --ecb-bar-bg: #474747;
  --ecb-bar-color: rgba(255, 255, 255, 0.85);
  --ecb-seek-progress: #ffffff;
  --ecb-seek-thumb: #ffffff;
  --ecb-seek-track: rgba(255, 255, 255, 0.28);

  padding-top: var(--ecb-pt-m);
  padding-bottom: var(--ecb-pb-m);
}
@media screen and (min-width: 750px) {
  .accessvideo-ecb { padding-top: var(--ecb-pt); padding-bottom: var(--ecb-pb); }
}

/* Container */
.accessvideo-ecb .video-container { margin: 0 auto; max-width: 1300px; }
.accessvideo-ecb .ecb-player { max-width: 1150px; margin: 0 auto; }
.accessvideo-ecb .ecb-player.ecb-player--portrait { max-width: 360px; }

/* Frame */
.accessvideo-ecb .ecb-frame { --ecb-accent: #ffffff; border-radius: var(--ecb-radius); overflow: hidden; background: #000; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.45); }

/* Video wrap */
.accessvideo-ecb .ecb-video-wrap { position: relative; background: #000; overflow: hidden; aspect-ratio: 16 / 9; }
.accessvideo-ecb .ecb-player--portrait .ecb-video-wrap { aspect-ratio: 9 / 16; }
.accessvideo-ecb .ecb-video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; cursor: pointer; }

/* ── Playback bar ── */
.accessvideo-ecb .ecb-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--ecb-bar-bg);
  border-top: 1px solid rgba(0, 0, 0, 0.25);
  color: var(--ecb-bar-color);
}
.accessvideo-ecb .ecb-time {
  flex: 0 0 auto; min-width: 34px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ecb-bar-color); text-align: center;
}

/* ── Seek slider ── */
.accessvideo-ecb .ecb-seek {
  --ecb-progress: 0%; --ecb-buffered: 0%;
  flex: 1 1 auto; min-width: 0; height: 22px; margin: 0; padding: 0;
  background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; border-radius: 999px;
}
.accessvideo-ecb .ecb-seek:focus { outline: none; }
.accessvideo-ecb .ecb-seek:focus-visible { outline: 2px solid var(--ecb-accent); outline-offset: 3px; }

/* Webkit track */
.accessvideo-ecb .ecb-seek::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background:
    linear-gradient(var(--ecb-seek-progress), var(--ecb-seek-progress)) 0 0 / var(--ecb-progress) 100% no-repeat,
    linear-gradient(90deg, rgba(255,255,255,0.45) 0 var(--ecb-buffered), var(--ecb-seek-track) var(--ecb-buffered) 100%);
}
.accessvideo-ecb .ecb-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -4px; border: 0; border-radius: 50%;
  background: var(--ecb-seek-thumb);
  box-shadow: 0 0 0 0 transparent, 0 1px 4px rgba(0, 0, 0, 0.5);
  transform: scale(0.85); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.accessvideo-ecb .ecb-seek:hover::-webkit-slider-thumb,
.accessvideo-ecb .ecb-seek:active::-webkit-slider-thumb,
.accessvideo-ecb .ecb-seek:focus-visible::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ecb-accent) 35%, transparent), 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Firefox track */
.accessvideo-ecb .ecb-seek::-moz-range-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.45) 0 var(--ecb-buffered), var(--ecb-seek-track) var(--ecb-buffered) 100%);
}
.accessvideo-ecb .ecb-seek::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--ecb-seek-progress); }
.accessvideo-ecb .ecb-seek::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%;
  background: var(--ecb-seek-thumb);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.accessvideo-ecb .ecb-seek:hover::-moz-range-thumb,
.accessvideo-ecb .ecb-seek:focus-visible::-moz-range-thumb {
  transform: scale(1.15);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ecb-accent) 35%, transparent), 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ── Round bar buttons (mute, skip) ── */
.accessvideo-ecb .ecb-round {
  position: relative; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; line-height: 1; cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}
.accessvideo-ecb .ecb-round svg { width: 16px; height: 16px; pointer-events: none; }
.accessvideo-ecb .ecb-round:hover { border-color: #ffffff; box-shadow: 0 0 0 1.5px #ffffff; background: rgba(0,0,0,0.25); color: #fff; }
.accessvideo-ecb .ecb-round:active { transform: scale(0.92); }
.accessvideo-ecb .ecb-round:focus { outline: none; }
.accessvideo-ecb .ecb-round:focus-visible { border-color: #ffffff; box-shadow: 0 0 0 1.5px #ffffff; outline: 2px solid #ffffff; outline-offset: 3px; }
.accessvideo-ecb .ecb-round:hover .ecb-tooltip,
.accessvideo-ecb .ecb-round:focus-visible .ecb-tooltip { opacity: 1; }
.accessvideo-ecb .ecb-bar > .ecb-round:last-child .ecb-tooltip { left: auto; right: 0; transform: none; }

/* Portrait bar tweaks */
.accessvideo-ecb .ecb-player--portrait .ecb-bar { gap: 6px; padding: 8px 10px; }
.accessvideo-ecb .ecb-player--portrait .ecb-time { min-width: 0; font-size: 11px; }
.accessvideo-ecb .ecb-player--portrait .ecb-round { width: 30px; height: 30px; font-size: 10px; }
.accessvideo-ecb .ecb-player--portrait .ecb-round svg { width: 14px; height: 14px; }

/* ── Skip buttons ── */
.accessvideo-ecb .ecb-skip { width: 38px; height: 38px; border-color: transparent; background: transparent; }
.accessvideo-ecb .ecb-skip:hover { background: transparent; }
.accessvideo-ecb .ecb-skip .ecb-skip-ring { position: absolute; inset: 4px; width: auto; height: auto; transform-origin: 50% 54.1667%; }
.accessvideo-ecb .ecb-skip .ecb-skip-num { position: relative; margin-top: 2px; font-size: 9.5px; font-weight: 800; letter-spacing: -0.02em; }
.accessvideo-ecb .ecb-skip.is-spinning .ecb-skip-ring { animation: ecb-spin-back 0.5s cubic-bezier(0.34, 1.2, 0.5, 1); }
.accessvideo-ecb .ecb-skip:not([data-ecb-skip^="-"]).is-spinning .ecb-skip-ring { animation-name: ecb-spin-fwd; }
.accessvideo-ecb .ecb-skip.is-spinning .ecb-skip-num { animation: ecb-num-pop 0.5s ease; }
.accessvideo-ecb .ecb-skip[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.accessvideo-ecb .ecb-skip[aria-disabled="true"]:hover { border-color: transparent; box-shadow: none; }
.accessvideo-ecb .ecb-skip[aria-disabled="true"]:active { transform: none; }
@keyframes ecb-spin-back { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@keyframes ecb-spin-fwd  { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ecb-num-pop   { 0%, 100% { transform: scale(1); } 40% { transform: scale(0.82); } }

.accessvideo-ecb .ecb-player--portrait .ecb-skip { width: 32px; height: 32px; }
.accessvideo-ecb .ecb-player--portrait .ecb-skip .ecb-skip-ring { width: auto; height: auto; inset: 3px; }
.accessvideo-ecb .ecb-player--portrait .ecb-skip .ecb-skip-num { font-size: 8px; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .accessvideo-ecb .ecb-round,
  .accessvideo-ecb .ecb-seek::-webkit-slider-thumb,
  .accessvideo-ecb .ecb-seek::-moz-range-thumb { transition: none; }
  .accessvideo-ecb .ecb-skip.is-spinning .ecb-skip-ring,
  .accessvideo-ecb .ecb-skip.is-spinning .ecb-skip-num { animation: none; }
}

/* ── Overlay controls (CC, AD, Play, Transcript) ── */
.accessvideo-ecb .ecb-controls {
  position: absolute; right: 12px; bottom: 12px; z-index: 10;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  list-style: none; margin: 0; padding: 0;
}
.accessvideo-ecb .ecb-controls li { list-style: none; margin: 0; padding: 0; }
.accessvideo-ecb .ecb-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; min-width: 32px; padding: 0; margin: 0;
  border-radius: 8px;
  background: var(--ecb-btn-bg);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--ecb-btn-border);
  color: var(--ecb-btn-color);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  line-height: 1;
}
.accessvideo-ecb .ecb-btn:hover,
.accessvideo-ecb .ecb-btn:focus-visible {
  background: var(--ecb-btn-bg-hover);
  color: var(--ecb-btn-color-hover);
  border-color: var(--ecb-btn-border-hover);
  outline: none;
}
.accessvideo-ecb .ecb-btn svg { width: 14px; height: 14px; }
.accessvideo-ecb .ecb-icon-pause,
.accessvideo-ecb .ecb-icon-play { pointer-events: none; }
.accessvideo-ecb .ecb-btn-text { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }

/* Tooltip */
.accessvideo-ecb .ecb-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.9); border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff; font-size: 0.7rem; font-weight: 500; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.15s ease;
}
.accessvideo-ecb .ecb-btn:hover .ecb-tooltip,
.accessvideo-ecb .ecb-btn:focus-visible .ecb-tooltip { opacity: 1; }

/* ── Transcript drawer ── */
.accessvideo-ecb .ecb-transcript-drawer:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.accessvideo-ecb .ecb-transcript-drawer { margin-top: 14px; border-radius: var(--ecb-radius); border: 1px solid #ddd; background: #fff; overflow: hidden; }
.accessvideo-ecb .ecb-transcript-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #111; color: #fff;
  border-top-left-radius: var(--ecb-radius); border-top-right-radius: var(--ecb-radius);
}
.accessvideo-ecb .ecb-transcript-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.accessvideo-ecb .ecb-transcript-close {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #fff; cursor: pointer; padding: 4px; border-radius: 4px;
}
.accessvideo-ecb .ecb-transcript-close:hover,
.accessvideo-ecb .ecb-transcript-close:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.accessvideo-ecb .ecb-transcript-scroll { max-height: 260px; overflow: auto; padding: 16px; }
.accessvideo-ecb .ecb-transcript-content { color: #222; font-size: 15px; line-height: 1.7; }
.accessvideo-ecb .ecb-transcript-content p:first-child { margin-top: 0; }
.accessvideo-ecb .ecb-transcript-content p:last-child { margin-bottom: 0; }

/* ── Active (on) state for toggle buttons ── */
.accessvideo-ecb button[data-ecb-pause-toggle].is-active,
.accessvideo-ecb button[data-ecb-cc-toggle].is-active,
.accessvideo-ecb button[data-ecb-ad-toggle].is-active {
  color: var(--ecb-btn-color-hover, #ffffff);
  border-color: var(--ecb-btn-border-hover, rgba(255, 255, 255, 0.35));
  background: var(--ecb-btn-bg-hover, rgba(0, 0, 0, 0.9));
}
.accessvideo-ecb button[data-ecb-pause-toggle].is-active::after,
.accessvideo-ecb button[data-ecb-cc-toggle].is-active::after,
.accessvideo-ecb button[data-ecb-ad-toggle].is-active::after {
  content: ""; position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 999px;
  background: #22c55e; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

/* ── Mobile ── */
@media screen and (max-width: 749px) {
  .accessvideo-ecb .ecb-player,
  .accessvideo-ecb .ecb-player.ecb-player--portrait { max-width: 100%; }
  .accessvideo-ecb .ecb-bar { gap: 6px; padding: 8px 10px; }
  .accessvideo-ecb .ecb-time { min-width: 0; font-size: 11px; }
  .accessvideo-ecb .ecb-round { width: 30px; height: 30px; font-size: 10px; }
  .accessvideo-ecb .ecb-skip { width: 32px; height: 32px; }
  .accessvideo-ecb .ecb-skip .ecb-skip-ring { inset: 3px; }
  .accessvideo-ecb .ecb-skip .ecb-skip-num { font-size: 8px; }
}
