/* ========== CUSTOM VIDEO PLAYER STYLES ========== */
.custom-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.custom-video-container.active {
    visibility: visible;
    opacity: 1;
}

.custom-video-player {
    width: 90%;
    max-width: 1280px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

.video-wrapper {
    position: relative;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.2s ease;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-time {
    color: white;
    font-size: 13px;
    font-family: monospace;
    min-width: 100px;
}

.progress-slider {
    flex: 1;
    height: 5px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00bcd4;
    cursor: pointer;
}

.progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

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

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

.controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    color: white;
    font-size: 18px;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.08);
}

/* Close button */
.close-video-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    transition: background 0.15s ease;
    z-index: 100;
    border: none;
}

.close-video-btn:hover {
    background: #f44336;
}

/* Volume Control */
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

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

/* Toast Notifications */
.video-toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    /* شلنا الـ backdrop-filter من هنا -> خلفية غامقة كافية بصريًا من غير التكلفة */
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    white-space: nowrap;
    font-family: monospace;
}

.video-toast.show {
    opacity: 1;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #00bcd4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .custom-video-player {
        width: 100%;
        border-radius: 0;
    }
    .volume-slider {
        width: 60px;
    }
    .progress-time {
        font-size: 11px;
        min-width: 80px;
    }
    .close-video-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}
