/**
 * Video.js Custom Control Bar Styling
 * BlazinStreetz Modern Glassmorphism Theme
 *
 * Applies glassmorphism aesthetic with large touch-friendly controls
 * Brand colors: Red (#dc3545) on Dark (#121212)
 *
 * @version 6.1.230
 * @author Robert Lawrence
 */

/* ====================================
   Control Bar — Glassmorphism
   ==================================== */

.video-js .vjs-control-bar {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin: 0 12px 10px 12px !important;
    padding: 0 8px !important;
    transition: opacity 0.2s ease !important;
}

/* ====================================
   Button Colors — BlazinStreetz Red
   ==================================== */

/* All Control Buttons — Base State */
.video-js .vjs-control-bar .vjs-button {
    color: var(--text-primary, #ffffff) !important;
    transition: all 0.2s ease !important;
    border-radius: 6px !important;
}

/* Button Hover State — Brand Red + Glass Highlight */
.video-js .vjs-control-bar .vjs-button:hover {
    color: var(--primary-color, #dc3545) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: scale(1.1);
}

/* Active/Playing State — Press Feedback */
.video-js .vjs-control-bar .vjs-button.vjs-playing,
.video-js .vjs-control-bar .vjs-button:active {
    color: var(--accent-color, #dc3545) !important;
    transform: scale(0.95);
}

/* ====================================
   Progress Bar — Expandable
   ==================================== */

/* Progress Holder Background */
.video-js .vjs-progress-control .vjs-progress-holder {
    background-color: rgba(255, 255, 255, 0.15) !important;
    height: 6px !important;
    border-radius: 3px !important;
    transition: height 0.2s ease, border-radius 0.2s ease !important;
}

/* Progress Holder — Hover Expand */
.video-js .vjs-progress-control:hover .vjs-progress-holder {
    height: 12px !important;
    border-radius: 6px !important;
}

/* Play Progress — Brand Red */
.video-js .vjs-play-progress {
    background-color: var(--primary-color, #dc3545) !important;
    border-radius: inherit !important;
}

/* Play Progress Scrubber Circle */
.video-js .vjs-play-progress:before {
    color: var(--primary-color, #dc3545) !important;
    font-size: 1em !important;
    top: -0.35em !important;
    transition: font-size 0.2s ease, top 0.2s ease !important;
}

/* Scrubber Grows on Hover */
.video-js .vjs-progress-control:hover .vjs-play-progress:before {
    font-size: 1.4em !important;
    top: -0.3em !important;
}

/* Load Progress */
.video-js .vjs-load-progress {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: inherit !important;
}

/* Progress Hover — Brighter Red */
.video-js .vjs-progress-holder:hover .vjs-play-progress {
    background-color: #e74c3c !important;
}

.video-js .vjs-progress-holder:hover .vjs-play-progress:before {
    color: #e74c3c !important;
}

/* ====================================
   Volume Control — Red Theme
   ==================================== */

.video-js .vjs-volume-panel {
    transition: all 0.2s ease !important;
}

.video-js .vjs-volume-bar {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.video-js .vjs-volume-level {
    background-color: var(--primary-color, #dc3545) !important;
}

.video-js .vjs-volume-level:before {
    color: var(--primary-color, #dc3545) !important;
}

.video-js .vjs-mute-control:hover {
    color: var(--primary-color, #dc3545) !important;
}

/* ====================================
   Custom Playlist Buttons
   ==================================== */

.vjs-previous-control,
.vjs-next-control {
    cursor: pointer;
    transition: all 0.2s ease !important;
    border-radius: 6px !important;
}

.vjs-previous-control .fas,
.vjs-next-control .fas {
    vertical-align: middle;
}

.vjs-previous-control:hover,
.vjs-next-control:hover {
    color: var(--primary-color, #dc3545) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: scale(1.1);
}

.vjs-previous-control:active,
.vjs-next-control:active {
    color: #e74c3c !important;
    transform: scale(0.95);
}

.vjs-previous-control.vjs-disabled,
.vjs-next-control.vjs-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ====================================
   Time Display — Pill Style
   ==================================== */

.video-js .vjs-current-time,
.video-js .vjs-duration,
.video-js .vjs-time-divider {
    color: rgba(255, 255, 255, 0.85) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.video-js .vjs-current-time,
.video-js .vjs-duration {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
}

/* ====================================
   Fullscreen Button
   ==================================== */

.video-js .vjs-fullscreen-control:hover {
    color: var(--primary-color, #dc3545) !important;
}

/* ====================================
   Loading Spinner — Brand Colors
   ==================================== */

.video-js .vjs-loading-spinner {
    border-color: rgba(220, 53, 69, 0.2) !important;
    border-top-color: var(--primary-color, #dc3545) !important;
}

/* ====================================
   SVG Icon Styling (experimentalSvgIcons)
   ==================================== */

.video-js .vjs-svg-icon {
    transition: transform 0.2s ease !important;
}

/* ====================================
   Overlay Previous/Next Controls
   ==================================== */

.vjs-overlay-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show when Video.js user is active (mirrors control bar show/hide).
   BSAPP-922: Require .vjs-has-started so the overlay defers to the
   native big-play button during the pre-play poster state — avoids
   two visible play affordances when mobile autoplay fails. */
.video-js.vjs-has-started.vjs-user-active .vjs-overlay-controls,
.video-js.vjs-has-started.vjs-paused .vjs-overlay-controls {
    opacity: 1;
}

.vjs-overlay-btn {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.vjs-overlay-btn:hover {
    background: rgba(220, 53, 69, 0.7);
    transform: scale(1.1);
    border-color: rgba(220, 53, 69, 0.5);
}

.vjs-overlay-btn:active {
    transform: scale(0.95);
    background: rgba(220, 53, 69, 0.9);
}

/* Center play/pause overlay — larger than prev/next */
.vjs-overlay-play-pause {
    width: 64px;
    height: 64px;
    font-size: 28px;
    background: rgba(220, 53, 69, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ====================================
   Mobile Responsive Adjustments
   ==================================== */

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .video-js .vjs-control-bar {
        margin: 0 8px 8px 8px !important;
        border-radius: 10px !important;
    }
}

/* Extra Small Mobile (< 576px) */
@media (max-width: 575px) {
    .video-js .vjs-control-bar {
        padding: 0 4px !important;
        margin: 0 6px 6px 6px !important;
        border-radius: 8px !important;
    }

    .video-js .vjs-control {
        width: 3.25em !important;  /* 52px touch target (3.25em × 16px) */
    }

    .video-js .vjs-time-control {
        padding-left: 0em !important;
        padding-right: 0em !important;
    }

    /* Hide time divider on small screens for space */
    .video-js .vjs-time-divider {
        display: none !important;
    }

    /* Remove pill background on mobile time to save space */
    .video-js .vjs-current-time,
    .video-js .vjs-duration {
        background: none !important;
        padding: 0 !important;
    }

    /* Overlay buttons slightly smaller on mobile */
    .vjs-overlay-btn {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .vjs-overlay-play-pause {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }
}

/* ====================================
   Touch Optimization
   ==================================== */

/* Touch feedback on mobile */
@media (hover: none) and (pointer: coarse) {
    .video-js .vjs-control-bar .vjs-button:active {
        transform: scale(0.92);
        color: var(--primary-color, #dc3545) !important;
        background: rgba(255, 255, 255, 0.12) !important;
    }
}

/* Hide volume panel on mobile (hardware-only volume control) */
@media (hover: none) and (pointer: coarse) {
    .video-js .vjs-volume-panel {
        display: none !important;
    }
}

/* ====================================
   Slider Styling — Consistent Red
   ==================================== */

.video-js .vjs-slider-bar {
    background-color: var(--primary-color, #dc3545) !important;
}

.video-js .vjs-slider:before {
    color: var(--primary-color, #dc3545) !important;
}
