/* ==========================================================================
   Universal Video Player (UVP) - BCCI.tv
   Modern OTT-style responsive video player
   ========================================================================== */

/* Container & Aspect Ratios */
.uvp-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    line-height: 1;
}

.uvp-aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.uvp-aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.uvp-aspect-1-1 {
    aspect-ratio: 1 / 1;
}

/* Player Wrapper */
.uvp-player-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.uvp-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.uvp-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.uvp-loading.uvp-hidden {
    opacity: 0;
    pointer-events: none;
}

.uvp-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #DC5034;
    border-radius: 50%;
    animation: uvp-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Error State
   ========================================================================== */
.uvp-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 15;
    color: #fff;
}

.uvp-error-content {
    text-align: center;
}

.uvp-error-content svg {
    margin-bottom: 12px;
    opacity: 0.7;
}

.uvp-error-text {
    font-size: 14px;
    margin: 0 0 16px;
    opacity: 0.8;
}

.uvp-retry-btn {
    padding: 8px 24px;
    background: #DC5034;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.uvp-retry-btn:hover {
    background: #c4442b;
}

/* ==========================================================================
   Controls Overlay
   ========================================================================== */
.uvp-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

.uvp-container:hover .uvp-controls,
.uvp-controls.uvp-controls-visible {
    opacity: 1;
}

.uvp-controls > * {
    pointer-events: auto;
}

/* Top Bar */
.uvp-controls-top {
    padding: 12px 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.uvp-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Center Play Button */
.uvp-controls-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.uvp-play-btn-large {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.9;
}

.uvp-play-btn-large:hover {
    transform: scale(1.1);
    opacity: 1;
}

.uvp-container.uvp-playing .uvp-play-btn-large {
    display: none;
}

/* Bottom Controls */
.uvp-controls-bottom {
    padding: 0 12px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

/* Progress Bar */
.uvp-progress-container {
    padding: 8px 0 6px;
    cursor: pointer;
}

.uvp-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: visible;
    transition: height 0.1s ease;
}

.uvp-progress-container:hover .uvp-progress-bar {
    height: 6px;
}

.uvp-progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    width: 0;
    transition: width 0.1s linear;
}

.uvp-progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #DC5034;
    border-radius: 2px;
    width: 0;
    transition: width 0.05s linear;
}

.uvp-progress-seek {
    position: absolute;
    top: -4px;
    left: 0;
    width: 100%;
    height: calc(100% + 8px);
    opacity: 0;
    cursor: pointer;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* Controls Row */
.uvp-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.uvp-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uvp-controls-right-side {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Buttons */
.uvp-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    color: #fff;
}

.uvp-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.uvp-btn svg {
    display: block;
}

/* Volume Group */
.uvp-volume-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.uvp-volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

.uvp-volume-group:hover .uvp-volume-slider {
    width: 60px;
    opacity: 1;
}

.uvp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.uvp-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Time Display */
.uvp-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding: 0 4px;
}

/* Speed Controls */
.uvp-speed-group {
    position: relative;
}

.uvp-speed-btn {
    font-size: 12px;
    font-weight: 600;
    min-width: 32px;
}

.uvp-speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 6px;
    padding: 4px 0;
    margin-bottom: 8px;
    min-width: 80px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    z-index: 20;
}

.uvp-speed-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.uvp-speed-menu button:hover {
    background: rgba(255,255,255,0.1);
}

.uvp-speed-menu button.active {
    color: #DC5034;
    font-weight: 600;
}

/* Captions Button */
.uvp-cc-btn.uvp-cc-active {
    background: rgba(220, 80, 52, 0.3);
}

/* ==========================================================================
   Settings Panel (Gear Menu)
   ========================================================================== */
.uvp-settings-group {
    position: relative;
}

.uvp-settings-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(18, 18, 18, 0.95);
    border-radius: 8px;
    margin-bottom: 10px;
    min-width: 200px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    z-index: 25;
    animation: uvp-panel-in 0.15s ease-out;
}

@keyframes uvp-panel-in {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.uvp-settings-menu {
    padding: 6px 0;
}

.uvp-settings-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 8px;
}

.uvp-settings-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.uvp-settings-label {
    flex: 1;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.uvp-settings-value {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-right: 4px;
}

.uvp-settings-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
    transition: background 0.15s;
}

.uvp-settings-back:hover {
    background: rgba(255, 255, 255, 0.08);
}

.uvp-settings-back span {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.uvp-settings-option {
    display: flex;
    align-items: center;
    padding: 9px 16px 9px 36px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.uvp-settings-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.uvp-settings-option.active {
    color: #DC5034;
    font-weight: 600;
}

.uvp-settings-option.active::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #DC5034;
}

/* ==========================================================================
   Fullscreen Styles
   ========================================================================== */
.uvp-container.uvp-fullscreen {
    border-radius: 0;
}

.uvp-container:fullscreen {
    border-radius: 0;
}

.uvp-container:-webkit-full-screen {
    border-radius: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .uvp-controls-bottom {
        padding: 0 8px 8px;
    }

    .uvp-controls-row {
        gap: 4px;
    }

    .uvp-btn {
        padding: 4px;
    }

    .uvp-time {
        font-size: 11px;
    }

    .uvp-play-btn-large svg {
        width: 44px;
        height: 44px;
    }

    .uvp-title {
        font-size: 12px;
    }

    .uvp-volume-group:hover .uvp-volume-slider {
        width: 40px;
    }

    .uvp-settings-panel {
        min-width: 170px;
    }
}

@media (max-width: 480px) {
    .uvp-controls-top {
        padding: 8px 10px;
    }

    .uvp-pip-btn {
        display: none;
    }

    .uvp-play-btn-large svg {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   MP4 Player - Context-specific styles
   ========================================================================== */

/* Page video player (.vid container - detail page) */
.vid .uvp-page-video {
    width: 100%;
    height: auto;
}

/* Override home-page.min.css: .video-section .vid video { height: 100% } */
.video-section .vid video {
    height: auto;
}

/* Card video player (hover-to-play cards/sliders) */
.hoverVideoPlayNow a > div {
    position: relative;
    height: 100%;
}

.hoverVideoPlayNow a > div > [id^="show_for_video_"],
.hoverVideoPlayNow a > div > [id^="show_for_image_"] {
    width: 100%;
    height: 100%;
}

.uvp-card-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Popup video player */
#video-modal .vid video {
    width: 100%;
    object-fit: contain;
}

/* End of file */
