/* ═══════════════════════════════════════════════════════════
   Custom Video Player Styles
   ═══════════════════════════════════════════════════════════ */

/* Player Container */
.dbox-player-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.dbox-player-container.fullscreen {
    max-width: 100%;
    border-radius: 0;
}

/* Video Element */
.dbox-player-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* iframe wrapper for external sources */
.dbox-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Controls Bar */
.dbox-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 40px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dbox-player-container:hover .dbox-controls,
.dbox-player-container.show-controls .dbox-controls {
    opacity: 1;
}

/* Progress Bar */
.dbox-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s ease;
}

.dbox-progress-container:hover {
    height: 6px;
}

.dbox-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    border-radius: 2px;
    position: relative;
    transition: width 0.1s linear;
}

.dbox-progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.dbox-progress-container:hover .dbox-progress-bar::after {
    transform: translateY(-50%) scale(1);
}

.dbox-buffered {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    top: 0;
    left: 0;
}

/* Controls Row */
.dbox-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dbox-controls-left,
.dbox-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Control Buttons */
.dbox-ctrl-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.dbox-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.dbox-ctrl-btn.play-btn {
    font-size: 1.3rem;
}

/* Time Display */
.dbox-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', monospace;
    white-space: nowrap;
}

/* Volume Slider */
.dbox-volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dbox-volume-slider {
    width: 0;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.dbox-volume-container:hover .dbox-volume-slider {
    width: 70px;
    opacity: 1;
}

.dbox-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* Speed Menu */
.dbox-speed-menu {
    position: absolute;
    bottom: 60px;
    right: 16px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    display: none;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.dbox-speed-menu.visible {
    display: block;
}

.dbox-speed-option {
    padding: 8px 20px;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
    text-align: center;
}

.dbox-speed-option:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #fff;
}

.dbox-speed-option.active {
    color: #a78bfa;
    font-weight: 700;
}

/* Big Play Overlay */
.dbox-big-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.dbox-big-play i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.dbox-big-play:hover i {
    transform: scale(1.1);
}

.dbox-big-play.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Loading Spinner */
.dbox-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 6;
}

.dbox-loading.visible {
    display: flex;
}

.dbox-loading i {
    font-size: 2.5rem;
    color: #a78bfa;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dbox-player-container {
        border-radius: 0;
    }

    .dbox-ctrl-btn {
        font-size: 1rem;
        padding: 4px;
        min-width: 28px;
        min-height: 28px;
    }

    .dbox-controls {
        padding: 30px 10px 8px;
    }

    .dbox-time {
        font-size: 0.7rem;
    }
}