/* Video.js Progress Control Override - Move progress bar above all other controls like YouTube */

/* Clip control bar when it slides off (hide overflow) */
.video-js.vjs-has-started {
    overflow: hidden;
}

/* Modify control bar to accommodate progress bar on top */
.vjs-has-started .vjs-control-bar {
    height: 60px !important;
    padding-top: 20px !important;
    background: linear-gradient(to bottom, transparent 0%, transparent 33%, rgba(0, 0, 0, 0.6) 70%, rgba(0, 0, 0, 0.69) 90%, rgba(0, 0, 0, 0.8) 100%) !important;
}

/* Position progress control at the top of control bar */
.video-js .vjs-progress-control {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 20px !important;
    z-index: 10 !important;

    /* Remove flex properties since we're using absolute positioning */
    flex: none !important;

    /* Add padding for better interaction area */
    padding: 8px 12px 0 12px !important;
    box-sizing: border-box !important;

    /* Background for the progress area */
    background: transparent !important;
}

/* Style the progress holder */
.video-js .vjs-progress-control .vjs-progress-holder {
    height: 4px !important;
    margin: 0 !important;
    border-radius: 2px !important;
}

/* Make progress holder slightly larger on hover (less aggressive) */
.video-js .vjs-progress-control:hover .vjs-progress-holder {
    height: 5px !important;
    transition: all 0.1s ease !important;
}

/* Use dynamic palette color for progress bar (orange theme) */
.video-js .vjs-play-progress {
    background-color: var(--user-primary, var(--color-primary, #ff9900)) !important;
}

.video-js .vjs-volume-level {
    background-color: var(--user-primary, var(--color-primary, #ff9900)) !important;
}

/* Adjust other controls to not overlap with progress bar */
.video-js .vjs-control-bar>.vjs-control:not(.vjs-progress-control) {
    position: relative !important;
    top: 0 !important;
}

/* Fix circle positioning - always center it vertically */
.video-js .vjs-play-progress:before,
.video-js .vjs-volume-level:before {
    font-size: 0.8em !important;
    top: -0.3em !important;
    right: -0.4em !important;
}

/* Time tooltip adjustments for top position */
.video-js .vjs-time-tooltip {
    top: -3.8em !important;
}

/* Mouse display line */
.video-js .vjs-progress-control .vjs-mouse-display {
    height: 4px !important;
}

.video-js .vjs-progress-control:hover .vjs-mouse-display {
    height: 5px !important;
}

/* Ensure progress control is interactive across full width */
.video-js .vjs-progress-control {
    touch-action: none !important;
    cursor: pointer !important;
}

/* Hide progress control when controls are hidden */
.video-js.vjs-user-inactive.vjs-playing .vjs-progress-control {
    opacity: 0 !important;
    transition: opacity 1s !important;
}

/* Show progress control when controls are visible */
.video-js:not(.vjs-user-inactive) .vjs-progress-control,
.video-js.vjs-paused .vjs-progress-control {
    opacity: 1 !important;
    transition: opacity 0.1s !important;
}

/* Position fullscreen, theater mode, and settings buttons to the right */
.video-js .vjs-fullscreen-control,
.video-js .vjs-theater-control,
.video-js .vjs-settings-control {
    margin-left: 0 !important;
}

/* Create a spacer to push right controls to the right */
.video-js .vjs-custom-control-spacer {
    display: flex !important;
    flex: 1 !important;
    order: 500 !important;
}

/* Ensure right-side controls are grouped together */
.video-js .vjs-control-bar {
    justify-content: flex-start !important;
}

/* Order: theater, then gear (settings), then fullscreen on the right */
.video-js .vjs-theater-control {
    order: 997 !important;
}

.video-js .vjs-settings-control,
.video-js .vjs-setting-control {
    order: 998 !important;
}

.video-js .vjs-fullscreen-control {
    order: 999 !important;
}

/* Cached/legacy settings button: show cog icon (same as vjs-icon-cog) */
.video-js .vjs-setting-control .icon-cog:before {
    content: "\f110";
    font-family: VideoJS;
    font-weight: 400;
    font-style: normal;
}

/* Show time display (current time / duration) - Video.js default hides these */
.video-js .vjs-current-time,
.video-js .vjs-current-time-display,
.video-js .vjs-duration,
.video-js .vjs-duration-display,
.video-js .vjs-time-divider {
    display: block !important;
    visibility: visible !important;
}

/* Ensure time controls are visible in control bar */
.video-js .vjs-time-control.vjs-current-time,
.video-js .vjs-time-control.vjs-time-divider,
.video-js .vjs-time-control.vjs-duration {
    display: flex !important;
}

/* Hide remaining-time when using current/duration format */
.video-js .vjs-remaining-time {
    display: none !important;
}

/* Theme overrides (consolidated from skinfb.css – light control bar, menu colors, big play) */
.video-js .vjs-control-bar {
    background-color: rgba(252, 252, 252, 0.19) !important;
    color: #ffffff !important;
    font-size: 14px !important;
}

.video-js .vjs-control-bar2 {
    background-color: #fcfcfc !important;
}

.video-js .vjs-big-play-button {
    background-color: rgba(255, 255, 255, 0.1) !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

.video-js:hover .vjs-big-play-button,
.video-js .vjs-big-play-button:focus,
.video-js .vjs-big-play-button:active {
    background-color: rgba(255, 255, 255, 0.23) !important;
}

.video-js .vjs-loading-spinner {
    border-color: rgba(255, 255, 255, 0.7) !important;
}

.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-item,
.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-title {
    background-color: #151b17 !important;
    margin: 0.3em 0 !important;
    padding: 0.5em !important;
    border-radius: 0.3em !important;
}

.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected {
    background-color: #2483d5 !important;
}

/* Control bar fully hides when user inactive (slide off + invisible) */
.video-js.not-hover.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar,
.video-js.not-hover.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar,
.video-js.not-hover.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar,
.video-js.not-hover.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar,
.video-js.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(100%);
    transition: visibility 0.35s, opacity 0.35s, transform 0.35s ease;
}

.video-js.not-hover.vjs-has-started.vjs-paused.vjs-user-active .vjs-progress-control,
.video-js.not-hover.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-progress-control,
.video-js.not-hover.vjs-has-started.vjs-playing.vjs-user-active .vjs-progress-control,
.video-js.not-hover.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-progress-control,
.video-js.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-progress-control {
    height: 0.25em !important;
    top: -0.25em !important;
    pointer-events: none;
    transition: height 1s, top 1s;
}

.video-js.not-hover.vjs-has-started.vjs-paused.vjs-user-active.vjs-fullscreen .vjs-progress-control,
.video-js.not-hover.vjs-has-started.vjs-paused.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,
.video-js.not-hover.vjs-has-started.vjs-playing.vjs-user-active.vjs-fullscreen .vjs-progress-control,
.video-js.not-hover.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,
.video-js.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control {
    opacity: 0;
    transition: opacity 1s ease 1s;
}