/*
 * Jamroom Video - video player (jrVideo_player.tpl + js/jrVideo.js)
 * The controls are drawn inside the video, so the player looks the same in every skin.
 * All rules are scoped to .jrvp and reset button/input styles so skin styles do not leak in.
 * The accent (--jrvp-ac) is set by jrVideo.js from the skin's link color.
 */

.jrvp {
    --jrvp-ac: rgb(229,9,20);
    --jrvp-fg: rgb(255,255,255);
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    background: #000;
    color: var(--jrvp-fg);
    border-radius: 6px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    text-align: left;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.jrvp * {
    box-sizing: border-box;
}

.jrvp:focus-visible {
    box-shadow: 0 0 0 2px var(--jrvp-ac);
}

.jrvp.jrvp-idle {
    cursor: none;
}

.jrvp .jrvp-video {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000;
    object-fit: contain;
}

/* Buttons - reset skin styles */
.jrvp button {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.jrvp button[hidden] {
    display: none;
}

.jrvp button:focus-visible {
    outline: 2px solid var(--jrvp-ac);
    outline-offset: 2px;
    border-radius: 4px;
}

.jrvp svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Cover image while an audio track plays (playlists with audio and video) */
.jrvp .jrvp-cover {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    overflow: hidden;
    background: #000;
    pointer-events: none;
}

.jrvp.jrvp-is-audio .jrvp-cover {
    display: block;
}

.jrvp .jrvp-cover-bg {
    position: absolute;
    top: -10%;
    right: -10%;
    bottom: -10%;
    left: -10%;
    background-position: center;
    background-size: cover;
    filter: blur(28px) brightness(.55);
}

.jrvp .jrvp-cover-img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: 62%;
    max-width: 80%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-shadow: 0 12px 40px rgba(0,0,0,.55);
    transform: translate(-50%, -50%);
}

/* Gradients behind the controls and title */
.jrvp .jrvp-shade {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.6) 0, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 62%, rgba(0,0,0,.75) 100%);
    opacity: 1;
    transition: opacity .3s ease;
}

.jrvp .jrvp-top {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    padding: 14px 18px 0 18px;
    transition: opacity .3s ease;
    pointer-events: none;
}

.jrvp .jrvp-title {
    overflow: hidden;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

.jrvp .jrvp-artist {
    overflow: hidden;
    opacity: .8;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* Big play button in the middle */
.jrvp .jrvp-big {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    padding: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    box-shadow: 0 0 0 2px rgba(255,255,255,.85);
    transition: transform .15s ease, background-color .15s ease, opacity .25s ease;
}

.jrvp .jrvp-big:hover {
    transform: scale(1.08);
    background: var(--jrvp-ac);
    box-shadow: none;
}

.jrvp.jrvp-playing .jrvp-big {
    opacity: 0;
    pointer-events: none;
}

/* Control bar */
.jrvp .jrvp-bar {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0 14px 8px 14px;
    transition: opacity .3s ease, transform .3s ease;
}

.jrvp .jrvp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.jrvp .jrvp-left,
.jrvp .jrvp-right {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.jrvp .jrvp-btn {
    width: 38px;
    height: 38px;
    padding: 8px;
    border-radius: 6px;
    opacity: .9;
    transition: opacity .15s ease, transform .15s ease, color .15s ease;
}

.jrvp .jrvp-btn:hover {
    opacity: 1;
    transform: scale(1.12);
}

.jrvp .jrvp-btn:disabled {
    opacity: .35;
    cursor: default;
    transform: none;
}

.jrvp .jrvp-btn.jrvp-on {
    color: var(--jrvp-ac);
}

.jrvp .jrvp-time {
    margin: 0 0 0 8px;
    font-size: 13px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    opacity: .9;
}

/* Hidden controls while playing */
.jrvp.jrvp-idle .jrvp-bar,
.jrvp.jrvp-idle .jrvp-top,
.jrvp.jrvp-idle .jrvp-shade {
    opacity: 0;
}

.jrvp.jrvp-idle .jrvp-bar {
    transform: translateY(8px);
    pointer-events: none;
}

/* Before the first play the poster is clean - only the big button and title */
.jrvp.jrvp-fresh .jrvp-bar {
    opacity: 0;
    pointer-events: none;
}

.jrvp.jrvp-fresh .jrvp-shade {
    background: linear-gradient(to bottom, rgba(0,0,0,.6) 0, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 100%);
}

/* Seek bar */
.jrvp .jrvp-seek {
    position: relative;
    height: 18px;
    margin: 0 4px;
    cursor: pointer;
    touch-action: none;
    outline: none;
}

.jrvp .jrvp-seek::before {
    content: "";
    position: absolute;
    top: 7px;
    right: 0;
    left: 0;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.25);
    transition: height .12s ease, top .12s ease;
}

.jrvp .jrvp-seek-buf,
.jrvp .jrvp-seek-fill {
    position: absolute;
    top: 7px;
    left: 0;
    width: 0;
    height: 4px;
    border-radius: 2px;
    transition: height .12s ease, top .12s ease;
    pointer-events: none;
}

.jrvp .jrvp-seek-buf {
    background: rgba(255,255,255,.4);
}

.jrvp .jrvp-seek-fill {
    background: var(--jrvp-ac);
}

.jrvp .jrvp-seek:hover::before,
.jrvp.jrvp-seeking .jrvp-seek::before,
.jrvp .jrvp-seek:hover .jrvp-seek-buf,
.jrvp.jrvp-seeking .jrvp-seek-buf,
.jrvp .jrvp-seek:hover .jrvp-seek-fill,
.jrvp.jrvp-seeking .jrvp-seek-fill {
    top: 6px;
    height: 6px;
}

.jrvp .jrvp-seek-thumb {
    position: absolute;
    top: 9px;
    left: 0;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--jrvp-ac);
    transform: scale(0);
    transition: transform .12s ease;
    pointer-events: none;
}

.jrvp .jrvp-seek:hover .jrvp-seek-thumb,
.jrvp .jrvp-seek:focus-visible .jrvp-seek-thumb,
.jrvp.jrvp-seeking .jrvp-seek-thumb {
    transform: scale(1);
}

.jrvp .jrvp-seek-tip {
    position: absolute;
    bottom: 22px;
    left: 0;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(0,0,0,.85);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity .12s ease;
    pointer-events: none;
}

.jrvp .jrvp-seek:hover .jrvp-seek-tip,
.jrvp.jrvp-seeking .jrvp-seek-tip {
    opacity: 1;
}

/* Volume - the slider opens on hover */
.jrvp .jrvp-volume {
    display: flex;
    align-items: center;
}

.jrvp input.jrvp-vol {
    --jrvp-pct: 100%;
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 0;
    height: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: linear-gradient(to right, var(--jrvp-fg) var(--jrvp-pct), rgba(255,255,255,.3) var(--jrvp-pct));
    opacity: 0;
    cursor: pointer;
    transition: width .2s ease, opacity .2s ease, margin .2s ease;
}

.jrvp .jrvp-volume:hover input.jrvp-vol,
.jrvp input.jrvp-vol:focus-visible {
    width: 80px;
    margin: 0 6px 0 2px;
    opacity: 1;
}

.jrvp input.jrvp-vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--jrvp-fg);
}

.jrvp input.jrvp-vol::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--jrvp-fg);
}

.jrvp input.jrvp-vol::-moz-range-track {
    background: transparent;
}

/* Loading spinner */
.jrvp .jrvp-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border: 4px solid rgba(255,255,255,.25);
    border-top-color: var(--jrvp-fg);
    border-radius: 50%;
    animation: jrvp-spin .8s linear infinite;
    pointer-events: none;
}

.jrvp.jrvp-wait .jrvp-spin {
    display: block;
}

.jrvp.jrvp-wait .jrvp-big {
    opacity: 0;
}

@keyframes jrvp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages (errors, pop-ups blocked) */
.jrvp .jrvp-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(0,0,0,.8);
    font-size: 14px;
    text-align: center;
    transform: translate(-50%, -50%);
}

.jrvp.jrvp-has-msg .jrvp-msg {
    display: block;
}

.jrvp.jrvp-has-msg:not(.jrvp-error) .jrvp-msg {
    top: auto;
    bottom: 70px;
    transform: translate(-50%, 0);
}

.jrvp.jrvp-error .jrvp-big {
    display: none;
}

/* Speed menu */
.jrvp .jrvp-menu {
    position: absolute;
    right: 14px;
    bottom: 64px;
    display: none;
    min-width: 170px;
    padding: 6px 0;
    border-radius: 8px;
    background: rgba(20,20,20,.94);
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.jrvp.jrvp-menu-open .jrvp-menu {
    display: block;
}

.jrvp .jrvp-menu-head {
    padding: 6px 14px 8px 14px;
    opacity: .7;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.jrvp .jrvp-menu-item {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 7px 14px;
}

.jrvp .jrvp-menu-item:hover {
    background: rgba(255,255,255,.1);
}

.jrvp .jrvp-menu-item svg {
    width: 18px;
    height: 18px;
    visibility: hidden;
}

.jrvp .jrvp-menu-item.jrvp-on svg {
    visibility: visible;
    color: var(--jrvp-ac);
}

/* Videos panel (slides in over the video) */
.jrvp .jrvp-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 360px;
    max-width: 100%;
    background: rgba(12,12,12,.92);
    box-shadow: -12px 0 32px rgba(0,0,0,.45);
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    visibility: hidden;
}

.jrvp.jrvp-panel-open .jrvp-panel {
    transform: translateX(0);
    visibility: visible;
}

.jrvp .jrvp-panel-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px 6px 16px;
}

.jrvp .jrvp-panel-title {
    font-size: 16px;
    font-weight: 600;
}

.jrvp .jrvp-panel-close {
    width: 36px;
    height: 36px;
    padding: 8px;
}

.jrvp .jrvp-panel-list {
    flex: 1 1 auto;
    margin: 0;
    padding: 0 0 8px 0;
    overflow-y: auto;
    list-style: none;
}

.jrvp .jrvp-ep {
    margin: 0;
    padding: 0;
    list-style: none;
}

.jrvp .jrvp-ep-btn {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 8px 16px;
}

.jrvp .jrvp-ep-btn:hover {
    background: rgba(255,255,255,.08);
}

.jrvp .jrvp-ep-current .jrvp-ep-btn {
    background: rgba(255,255,255,.12);
}

.jrvp .jrvp-ep-thumb {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 112px;
    height: 63px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255,255,255,.08);
}

.jrvp .jrvp-ep-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    object-fit: cover;
}

.jrvp .jrvp-ep-num {
    position: absolute;
    bottom: 4px;
    left: 6px;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
}

.jrvp .jrvp-ep-current .jrvp-ep-thumb {
    box-shadow: 0 0 0 2px var(--jrvp-ac);
}

.jrvp .jrvp-ep-text {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.jrvp .jrvp-ep-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.jrvp .jrvp-ep-meta {
    overflow: hidden;
    margin: 3px 0 0 0;
    opacity: .7;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Page player while the video plays in the pop-out window */
.jrvp .jrvp-popped {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0,0,0,.72);
    text-align: center;
}

.jrvp.jrvp-is-popped .jrvp-popped {
    display: flex;
}

.jrvp.jrvp-is-popped .jrvp-big,
.jrvp.jrvp-is-popped .jrvp-bar {
    display: none;
}

.jrvp .jrvp-popped-icon {
    width: 40px;
    height: 40px;
    opacity: .85;
}

.jrvp .jrvp-popped-text {
    padding: 0 16px;
    font-size: 15px;
}

.jrvp .jrvp-here {
    gap: 6px;
    padding: 7px 16px 7px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,.16);
    font-size: 14px;
}

.jrvp .jrvp-here:hover {
    background: var(--jrvp-ac);
}

.jrvp .jrvp-here svg {
    width: 18px;
    height: 18px;
}

/* Full screen */
.jrvp.jrvp-fs {
    max-height: none;
    border-radius: 0;
    aspect-ratio: auto;
}

.jrvp.jrvp-fs .jrvp-title {
    font-size: 20px;
}

/* Small players - fewer controls (jrvp-small is set by jrVideo.js below 480px) */
.jrvp.jrvp-small .jrvp-time,
.jrvp.jrvp-small .jrvp-speed,
.jrvp.jrvp-small .jrvp-prev,
.jrvp.jrvp-small .jrvp-artist {
    display: none;
}

.jrvp.jrvp-small .jrvp-btn {
    width: 34px;
    height: 34px;
    padding: 7px;
}

.jrvp.jrvp-small .jrvp-big {
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    padding: 16px;
}

/* Pop-out window: the player fills the window */
body.jrvp-window {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
}

.jrvp.jrvp-fill {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
}

@media (prefers-reduced-motion: reduce) {
    .jrvp .jrvp-shade,
    .jrvp .jrvp-top,
    .jrvp .jrvp-bar,
    .jrvp .jrvp-panel,
    .jrvp .jrvp-btn,
    .jrvp .jrvp-big {
        transition: none;
    }
}
