/* VudioPlayer — fixed-bottom overlay + floating video pane.
   Ported from BOSS's addins/bx-common-components/player/player.css.
   Loaded globally by layouts/header.html.twig; inert until a page calls init(). */

.vudio-player {
    position: fixed;
    bottom: -100px;
    left: 0;
    width: 100%;
    height: 90px;
    background-color: #181818;
    color: white;
    z-index: 9999;
    transition: bottom 0.3s ease-in-out;
    border-top: 1px solid #282828;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 100vw;
}

.vudio-player--visible {
    bottom: 0;
}

/* Reserve space at the bottom of the page so the fixed overlay doesn't hide content. */
body.vudio-player-active {
    padding-bottom: 90px;
}

.vudio-player__close-btn {
    margin-left: 12px;
    font-size: 14px;
    opacity: 0.7;
}
.vudio-player__close-btn:hover {
    opacity: 1;
}

/* -------- Floating video pane (types 2/3) -------- */
.vudio-video-pane {
    position: fixed;
    background: #000;
    border: 1px solid #282828;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    z-index: 10000; /* sits above .vudio-player */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    cursor: move; /* whole pane is draggable */
    /* NB: no overflow:hidden — it would clip the jQuery UI resize handles. */
}
.vudio-video-pane button,
.vudio-video-pane .ui-resizable-handle { cursor: default; }
.vudio-video-pane .ui-resizable-n,
.vudio-video-pane .ui-resizable-s { cursor: ns-resize; }
.vudio-video-pane .ui-resizable-e,
.vudio-video-pane .ui-resizable-w { cursor: ew-resize; }

.vudio-video-pane:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    border: none;
    border-radius: 0;
    cursor: default;
}
.vudio-video-pane:fullscreen .vudio-video-pane__video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Resize handles — jQuery UI adds .ui-resizable-handle divs but ships no size
   unless jquery-ui.css is loaded. Give them visible size + hover affordance. */
.vudio-video-pane .ui-resizable-handle {
    position: absolute;
    background: transparent;
}
.vudio-video-pane .ui-resizable-n,
.vudio-video-pane .ui-resizable-s {
    left: 0;
    width: 100%;
    height: 6px;
    cursor: ns-resize;
}
.vudio-video-pane .ui-resizable-n { top: -3px; }
.vudio-video-pane .ui-resizable-s { bottom: -3px; }
.vudio-video-pane .ui-resizable-e,
.vudio-video-pane .ui-resizable-w {
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
}
.vudio-video-pane .ui-resizable-e { right: -3px; }
.vudio-video-pane .ui-resizable-w { left: -3px; }
.vudio-video-pane .ui-resizable-ne,
.vudio-video-pane .ui-resizable-nw,
.vudio-video-pane .ui-resizable-se,
.vudio-video-pane .ui-resizable-sw {
    width: 14px;
    height: 14px;
    z-index: 2;
}
.vudio-video-pane .ui-resizable-ne { top: -3px; right: -3px; cursor: nesw-resize; }
.vudio-video-pane .ui-resizable-nw { top: -3px; left: -3px;  cursor: nwse-resize; }
.vudio-video-pane .ui-resizable-se { bottom: -3px; right: -3px; cursor: nwse-resize; }
.vudio-video-pane .ui-resizable-sw { bottom: -3px; left: -3px;  cursor: nesw-resize; }
/* Subtle visual hint on the SE corner so users know it's grabbable */
.vudio-video-pane .ui-resizable-se {
    background:
        linear-gradient(135deg, transparent 45%, #666 45%, #666 55%, transparent 55%),
        linear-gradient(135deg, transparent 65%, #666 65%, #666 75%, transparent 75%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    opacity: 0.7;
}
.vudio-video-pane__header {
    background: #181818;
    color: #b3b3b3;
    padding: 4px 10px;
    cursor: move;
    font-size: 12px;
    user-select: none;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vudio-video-pane__title {
    font-weight: 500;
}
.vudio-video-pane__close {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 14px;
    padding: 0 2px;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}
.vudio-video-pane__close:hover {
    opacity: 1;
    color: #fff;
}
.vudio-video-pane__video {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    min-height: 0;
    object-fit: contain;
}

/* -------- Bottom bar layout -------- */
.vudio-player__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.vudio-player__left {
    display: flex;
    align-items: center;
    width: 30%;
    min-width: 0;
    flex-shrink: 1;
}

.vudio-player__left .vudio-player__trackart {
    width: 56px;
    height: 56px;
    margin-right: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.vudio-player__left .vudio-player__track-info {
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 1;
}

.vudio-player__left .vudio-player__track-title {
    font-size: 14px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vudio-player__left .vudio-player__track-artist {
    margin-top: -2px;
    font-size: 14px;
    font-style: italic;
    color: #b3b3b3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vudio-player__center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 40%;
    min-width: 0;
}

.vudio-player__control-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.vudio-player__control-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 16px;
    margin: 0 10px;
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
}

.vudio-player__control-btn:hover {
    color: white;
}

.vudio-player__control-btn:active {
    transform: scale(0.95);
}

.vudio-player__control-btn--active {
    color: #1db954;
}

.vudio-player__play-pause-btn {
    background-color: white;
    color: black;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.vudio-player__play-pause-btn:hover {
    background-color: #f0f0f0;
    color: black;
    transform: scale(1.05);
}

.vudio-player__progress-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.vudio-player__progress-row span {
    font-size: 11px;
    color: #b3b3b3;
    min-width: 35px;
}

.vudio-player__progress-bar {
    flex: 1;
    margin: 0 10px;
    height: 8px;
    -webkit-appearance: none;
    background: #4f4f4f;
    border-radius: 4px;
    outline: none;
}

.vudio-player__progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    margin-top: 0px; /* -4px centres on the track; +2px nudges it down */
}

.vudio-player__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30%;
    min-width: 0;
    flex-shrink: 0;
}

.vudio-player__volume-control {
    display: flex;
    align-items: center;
    width: 125px;
    max-width: 100%;
    flex-shrink: 1;
}

.vudio-player__volume-control i {
    color: #b3b3b3;
    margin-right: 8px;
}

.vudio-player__volume-bar {
    flex: 1;
    min-width: 0;
    height: 4px;
    -webkit-appearance: none;
    background: #4f4f4f;
    border-radius: 2px;
    outline: none;
}

.vudio-player__volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: -2px; /* Center thumb on track */
}

.vudio-player__volume-control:hover .vudio-player__volume-bar::-webkit-slider-thumb {
    opacity: 1;
}

/* -------- Host-page row highlight --------
   Bootstrap's .table-active covers most tables; these keep the playing row
   legible in the scheduling board's dense category tables, which restyle rows. */
[data-player-container] tr.table-active {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-player-container] tr.table-active td {
    color: #000;
}

/* The play control is normally revealed on row hover (.show-on-hover); keep it
   visible on the playing row so the pause icon doesn't vanish when the mouse
   moves away. */
[data-player-container] tr.table-active .show-on-hover {
    visibility: visible;
}
