/* YouTube-style player for local videos (static/js/jj_video_player.js). */
.jj-vp {
    --jj-vp-red: #f00;
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    overflow: hidden;
    border-radius: inherit;
    background: #000;
    color: #fff;
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.jj-vp[hidden] {
    display: none !important;
}

.jj-vp--wide {
    display: block;
    width: 100%;
}

.jj-vp--fill {
    position: absolute;
    inset: 0;
    display: block;
}

.jj-vp > .jj-vp__video {
    display: block;
}

.jj-vp--fill > .jj-vp__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.jj-vp:fullscreen,
.jj-vp:-webkit-full-screen {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
}

.jj-vp:fullscreen > .jj-vp__video,
.jj-vp:-webkit-full-screen > .jj-vp__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.jj-vp:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.jj-vp.is-playing.is-idle {
    cursor: none;
}

.jj-vp__btn,
.jj-vp__big,
.jj-vp__menu-item {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.jj-vp svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Big centre button: shown while the video is stopped */
.jj-vp__big {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 18px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.jj-vp__big:hover,
.jj-vp__big:focus-visible {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(1.08);
}

.jj-vp__big svg {
    margin-left: 2px;
}

.jj-vp.is-playing .jj-vp__big,
.jj-vp.is-scrubbing .jj-vp__big {
    opacity: 0;
    pointer-events: none;
}

.jj-vp--xs .jj-vp__big {
    width: 48px;
    height: 48px;
    padding: 13px;
}

/* Autoplay mode: nothing but the picture until the visitor interacts or the loops finish */
.jj-vp.is-bare,
.jj-vp.is-bare.is-idle {
    cursor: pointer;
}

.jj-vp.is-bare .jj-vp__controls,
.jj-vp.is-bare .jj-vp__shade,
.jj-vp.is-bare .jj-vp__big,
.jj-vp.is-bare .jj-vp__flash,
.jj-vp.is-bare .jj-vp__menu {
    display: none;
}

/* Brief icon when toggling with a click or the keyboard */
.jj-vp__flash {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 56px;
    height: 56px;
    padding: 14px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
}

.jj-vp__flash.is-on {
    animation: jj-vp-flash 0.55s ease-out;
}

@keyframes jj-vp-flash {
    0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

.jj-vp__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.jj-vp.is-waiting.is-playing .jj-vp__spinner {
    opacity: 1;
    animation: jj-vp-spin 0.8s linear infinite;
}

@keyframes jj-vp-spin {
    to { transform: rotate(360deg); }
}

/* Bottom bar */
.jj-vp__shade {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    height: 110px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.jj-vp__controls {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    padding: 0 10px 4px;
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.jj-vp.is-playing.is-idle .jj-vp__controls {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}

.jj-vp.is-playing.is-idle .jj-vp__shade {
    opacity: 0;
}

.jj-vp__progress {
    position: relative;
    height: 16px;
    cursor: pointer;
    touch-action: none;
}

.jj-vp__track {
    position: absolute;
    right: 0;
    bottom: 6px;
    left: 0;
    height: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.28);
    transition: height 0.12s ease, bottom 0.12s ease;
}

.jj-vp__progress:hover .jj-vp__track,
.jj-vp.is-scrubbing .jj-vp__track {
    bottom: 5px;
    height: 5px;
}

.jj-vp__buffered,
.jj-vp__played {
    position: absolute;
    inset: 0;
    transform: scaleX(0);
    transform-origin: left center;
}

.jj-vp__buffered {
    background: rgba(255, 255, 255, 0.4);
}

.jj-vp__played {
    background: var(--jj-vp-red);
}

.jj-vp__thumb {
    position: absolute;
    bottom: 3px;
    left: 0;
    width: 13px;
    height: 13px;
    margin-left: -6.5px;
    border-radius: 50%;
    background: var(--jj-vp-red);
    transform: scale(0);
    transition: transform 0.12s ease;
}

.jj-vp__progress:hover .jj-vp__thumb,
.jj-vp.is-scrubbing .jj-vp__thumb {
    transform: scale(1);
}

.jj-vp__tip {
    position: absolute;
    bottom: 22px;
    left: 0;
    padding: 5px 9px;
    border-radius: 4px;
    background: rgba(28, 28, 28, 0.92);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
}

.jj-vp__progress:hover .jj-vp__tip,
.jj-vp.is-scrubbing .jj-vp__tip {
    opacity: 1;
}

.jj-vp__row {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 38px;
}

.jj-vp__btn {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 7px;
    border-radius: 50%;
    opacity: 0.92;
    transition: opacity 0.12s ease, background-color 0.12s ease, transform 0.2s ease;
}

.jj-vp__btn:hover,
.jj-vp__btn:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    opacity: 1;
}

.jj-vp__btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.jj-vp.is-menu .jj-vp__settings {
    transform: rotate(45deg);
}

.jj-vp__volume {
    display: flex;
    align-items: center;
}

.jj-vp__slider {
    --jj-v: 100%;
    width: 0;
    height: 14px;
    margin: 0;
    background: none;
    opacity: 0;
    transition: width 0.2s ease, margin 0.2s ease, opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.jj-vp__volume:hover .jj-vp__slider,
.jj-vp__slider:focus-visible,
.jj-vp__slider:active {
    width: 56px;
    margin: 0 8px 0 2px;
    opacity: 1;
}

.jj-vp__slider::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(to right, #fff var(--jj-v), rgba(255, 255, 255, 0.3) var(--jj-v));
}

.jj-vp__slider::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    margin-top: -4.5px;
    border-radius: 50%;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

.jj-vp__slider::-moz-range-track {
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.jj-vp__slider::-moz-range-progress {
    height: 3px;
    border-radius: 2px;
    background: #fff;
}

.jj-vp__slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

.jj-vp__time {
    display: flex;
    gap: 4px;
    margin-left: 6px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.95;
}

.jj-vp__sep {
    opacity: 0.7;
}

.jj-vp__spacer {
    flex: 1 1 auto;
}

/* Settings menu (playback speed) */
.jj-vp__menu {
    position: absolute;
    right: 12px;
    bottom: 64px;
    z-index: 4;
    min-width: 168px;
    max-height: calc(100% - 80px);
    padding: 6px 0;
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(28, 28, 28, 0.94);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
    transform-origin: bottom right;
    animation: jj-vp-menu 0.16s ease-out;
}

.jj-vp__menu[hidden] {
    display: none;
}

@keyframes jj-vp-menu {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.jj-vp__menu-title {
    padding: 8px 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 13px;
    font-weight: 500;
}

.jj-vp__menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px 9px 10px;
    font-size: 13px;
    text-align: left;
}

.jj-vp__menu-item:hover,
.jj-vp__menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.jj-vp__menu-check {
    width: 20px;
    height: 20px;
    opacity: 0;
}

.jj-vp__menu-item.is-active .jj-vp__menu-check {
    opacity: 1;
}

/* Narrow players (carousels, cards) */
.jj-vp--sm .jj-vp__pip,
.jj-vp--sm .jj-vp__volume:not(:hover) .jj-vp__slider {
    display: none;
}

.jj-vp--sm .jj-vp__volume:hover .jj-vp__slider {
    width: 44px;
}

.jj-vp--xs .jj-vp__settings,
.jj-vp--xs .jj-vp__sep,
.jj-vp--xs [data-dur] {
    display: none;
}

.jj-vp--xs .jj-vp__btn {
    width: 32px;
    height: 32px;
    padding: 6px;
}

.jj-vp--xs .jj-vp__row {
    height: 32px;
}

.jj-vp--xs .jj-vp__time {
    margin-left: 2px;
    font-size: 12px;
}

.jj-vp--xs .jj-vp__menu {
    right: 6px;
    bottom: 54px;
}

.jj-vp--sm .jj-vp__menu-item {
    padding-block: 6px;
}

.jj-vp--sm .jj-vp__menu-title {
    padding-block: 6px 8px;
}

.jj-vp:fullscreen .jj-vp__row,
.jj-vp:-webkit-full-screen .jj-vp__row {
    height: 48px;
}

.jj-vp:fullscreen .jj-vp__btn,
.jj-vp:-webkit-full-screen .jj-vp__btn {
    width: 46px;
    height: 46px;
    padding: 9px;
}

.jj-vp:fullscreen .jj-vp__time,
.jj-vp:-webkit-full-screen .jj-vp__time {
    font-size: 15px;
}

.jj-vp--still .jj-vp__controls,
.jj-vp--still .jj-vp__shade,
.jj-vp--still .jj-vp__big,
.jj-vp--still .jj-vp__menu {
    animation: none;
    transition: none;
}
