/* --- Video.js Player Plugin Custom Styles --- */

/* Better visibility for control bar on light videos */
.video-js .vjs-control-bar {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

/* converting overlay */
.vjs-converting::after {
    content: "Transcoding Media...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: sans-serif;
    font-size: 14px;
    z-index: 99;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Simple Spinner */
.vjs-converting::before {
    content: "";
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: vjs-spin 1s linear infinite;
    z-index: 100;
}

@keyframes vjs-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Native Mode: Force Control Bar to Bottom & Tech Centered */
.vjs-native-mode {
    width: 100% !important;
    height: 100% !important;
}

.vjs-native-mode .vjs-control-bar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 101 !important;
}

/* Force Video Tech to be small/intrinsic in Native Mode */
.vjs-native-mode .vjs-tech {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    position: absolute !important;
}

/* Fix Passive Event Listener Error on Mobile */
.vjs-control-bar,
.vjs-progress-control,
.vjs-volume-control {
    touch-action: none;
}

/* --- Audio Transparent Mode (Album Art) --- */
/* Makes the player background and video element transparent so HFS cover shows through */
.vjs-transparent-mode.vjs-has-started .vjs-poster {
    display: none !important;
}

.vjs-transparent-mode {
    background-color: transparent !important;
    pointer-events: none;
    /* Let clicks pass through to HFS background (Close Dialog) */
}

/* Hide the black video element in this mode */
.vjs-transparent-mode .vjs-tech {
    opacity: 0 !important;
}

/* Ensure controls remain interactive */
.vjs-transparent-mode .vjs-control-bar {
    pointer-events: auto;
    z-index: 10 !important;
}