/* AKHU Live CCTV/VMS Player Styles */

/* Modal & Player Wrapper */
.vms-player-modal .modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
}

.vms-player-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
}

.vms-player-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
}

/* Dual Engine Viewports Wrapper */
.vms-video-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #020617;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.vms-video-viewport video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Engine Active States */
.vms-engine {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.vms-engine.engine-active {
    opacity: 1;
    pointer-events: auto;
}

/* Player Overlays & Controls */
.vms-player-status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.vms-player-status-badge.status-live {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

.vms-player-status-badge.status-live .badge-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: live-pulse 1.5s infinite;
}

.vms-player-status-badge.status-dvr {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.vms-player-status-badge.status-dvr .badge-dot {
    width: 8px;
    height: 8px;
    background-color: #0ea5e9;
    border-radius: 50%;
}

@keyframes live-pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* DVR Timeline Controls */
.vms-dvr-bar {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

/* Time Quick Shifts buttons */
.dvr-quick-shifts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.dvr-quick-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dvr-quick-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.dvr-quick-btn.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
    color: #38bdf8;
}

/* Interactive Timeline Slider */
.dvr-timeline-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0.5rem;
}

.dvr-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
    cursor: pointer;
}

.dvr-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
}

.dvr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0ea5e9;
    box-shadow: 0 0 6px rgba(14, 165, 233, 0.8);
    margin-top: -4px;
    transition: transform 0.1s ease;
}

.dvr-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.dvr-time-display {
    font-family: monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    min-width: 60px;
    text-align: right;
}

/* Control Action Buttons */
.btn-go-live {
    background: #22c55e;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.btn-go-live:hover {
    background: #16a34a;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

.btn-go-live:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

/* Fullscreen overlays override */
.vms-video-viewport:fullscreen .vms-player-controls-floating,
.vms-video-viewport:-webkit-full-screen .vms-player-controls-floating {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .vms-player-modal .modal-dialog {
        margin: 0;
        max-width: 100vw;
        height: 100vh;
    }
    
    .vms-player-modal .modal-content {
        height: 100%;
        border-radius: 0;
    }

    .vms-video-viewport {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .dvr-quick-shifts {
        justify-content: center;
    }
}

/* YouTube Live Inspired Overlay Controls (Image 3 Style) */
.yt-overlay-controls {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0) 100%);
    transition: opacity 0.3s ease;
}

.yt-ctrl-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.yt-ctrl-btn:hover {
    color: #38bdf8;
    background: rgba(255, 255, 255, 0.1);
}

.yt-live-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.yt-live-btn.active {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.yt-live-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    animation: live-pulse 1.5s infinite;
}

/* Auto-hide overlay controls on mouse idle (in fullscreen or windowed) */
.vms-video-viewport.user-idle .yt-overlay-controls,
.vms-video-viewport.user-idle #playerTimestampOverlay {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease;
}

/* Smooth Interactive Volume Slider */
.yt-volume-slider {
    width: 0px;
    opacity: 0;
    transition: width 0.25s ease, opacity 0.25s ease;
    margin: 0;
}

.yt-volume-group:hover .yt-volume-slider,
.yt-volume-slider:focus,
.yt-volume-slider:active {
    width: 75px !important;
    opacity: 1 !important;
    margin-left: 6px;
}
