
        /* Local Font-Face directly pointing to public_html/ */
        @font-face {
            font-family: 'Bahij TheSansArabic';
            src: url('/Bahij_TheSansArabic-SemiBold.eot');
            src: url('/Bahij_TheSansArabic-SemiBold.eot?#iefix') format('embedded-opentype'),
                 url('/Bahij_TheSansArabic-SemiBold.woff') format('woff'),
                 url('/Bahij_TheSansArabic-SemiBold.ttf') format('truetype');
            font-weight: 600;
            font-style: normal;
            font-display: swap;
        }

        .player-wrapper {
    font-family: 'Bahij TheSansArabic', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

.player-wrapper *,
.player-wrapper *::before,
.player-wrapper *::after {
    box-sizing: border-box;
}

        .player-wrapper {
            width: 100%;
            height: 100%;
            background-color: #000000;
            color: #ffffff;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
        }



        /* Full Screen Video Container */
        .video-container {
            position: relative;
            width: 100%;
            height: 100%;
            background-color: #000000;
            overflow: hidden;
            touch-action: manipulation;
            user-select: none;
            -webkit-user-select: none;
            -webkit-tap-highlight-color: transparent;
        }

        /* Auto-Hide UI Elements Class */
        .video-container.hide-ui {
            cursor: none;
        }

        .video-container.hide-ui .top-bar,
        .video-container.hide-ui .bottom-bar,
        .video-container.hide-ui .center-controls,
        .video-container.hide-ui .popover-menu,
        .video-container.hide-ui .subtitle-settings-modal {
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.4s ease;
        }

        .top-bar, .bottom-bar, .center-controls, .popover-menu, .subtitle-settings-modal {
            transition: opacity 0.3s ease;
        }

        video {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* Subtitle Styling Variables */
        :root {
            --sub-color: #ffffff;
            --sub-bg: rgba(0, 0, 0, 0.8);
            --sub-size: 18px;
            --sub-font: 'Bahij TheSansArabic', sans-serif;
        }

        /* Subtitle Alignment with Dynamic Custom Properties */
        ::cue {
            background: var(--sub-bg) !important;
            color: var(--sub-color) !important;
            font-size: var(--sub-size) !important;
            font-family: var(--sub-font) !important;
            border-radius: 4px !important;
        }

/*        .video-container video::cue {*/
/*    line: 85% !important;*/
/*}*/

        /* Double Tap & Full Overlay Click */
        .tap-overlay {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 50%;
            height: 100%;
            z-index: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            pointer-events: auto;
        }

        .tap-overlay.left { left: 0; }
        .tap-overlay.right { right: 0; }

        .seek-indicator {
            background: rgba(255, 191, 0, 0.25);
            border: 1px solid #ffbf00;
            color: #ffffff;
            padding: 12px 20px;
            border-radius: 30px;
            font-size: 14px;
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 8px;
            opacity: 0;
            transform: scale(0.8);
            transition: all 0.2s ease;
            pointer-events: none;
            direction: ltr;
        }

        .seek-indicator.show {
            opacity: 1;
            transform: scale(1);
        }

        /* Top Header Bar */
        .top-bar {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
            z-index: 3;
        }

        .movie-title {
            font-size: 16px;
            font-weight: 700;
            color: #ffffff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 70%;
        }

        .top-actions {
            display: flex;
            gap: 16px;
        }

        .top-actions i {
            cursor: pointer;
            opacity: 0.8;
            transition: opacity 0.2s;
        }

        .top-actions i:hover { 
            opacity: 1; 
        }

        /* Center Controls */
        .center-controls {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            align-items: center;
            gap: 24px;
            z-index: 3;
        }

        .play-main-btn {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: rgba(255, 191, 0, 0.2);
            border: 2px solid #ffbf00;
            color: #ffffff;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            backdrop-filter: blur(5px);
            transition: transform 0.2s;
            -webkit-tap-highlight-color: transparent;
        }

        .play-main-btn:hover {
            transform: scale(1.08);
        }

        .skip-btn {
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            opacity: 0.8;
            display: flex;
            align-items: center;
            -webkit-tap-highlight-color: transparent;
        }

        /* Base Popover Menu */
        .popover-menu {
            position: absolute;
            bottom: 75px;
            background: rgba(18, 20, 29, 0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 16px;
            padding: 14px;
            display: none;
            z-index: 4;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
        }

        .popover-menu.show {
            display: flex;
        }

        /* Quality Menu */
        #qualityMenu { 
            right: 50px; 
            width: 150px;
            flex-direction: column;
            gap: 4px;
        }

        /* Audio & Subtitles Menu */
        #audioSubMenu {
            right: 70px;
            width: 360px;
            display: none;
            gap: 16px;
        }

        #audioSubMenu.show {
            display: flex;
        }

        .menu-column {
            flex: 1;
            display: flex;
            flex-direction: column;
            max-height: 230px;
            overflow-y: auto;
            padding-right: 4px;
        }

        .menu-column::-webkit-scrollbar {
            width: 3px;
        }
        .menu-column::-webkit-scrollbar-thumb {
            background: rgba(255, 191, 0, 0.5);
            border-radius: 3px;
        }

        .column-divider {
            width: 1px;
            background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.15), transparent);
        }

        #topMoreMenu { 
            right: 20px; 
            top: 55px; 
            bottom: auto; 
            width: 200px; 
            flex-direction: column;
            gap: 4px;
        }

        .menu-section-title {
            font-size: 13px;
            color: #ffbf00;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            margin-bottom: 8px;
            padding-bottom: 4px;
            border-bottom: 1px solid rgba(255, 191, 0, 0.2);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .menu-option {
            font-size: 13px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            color: #d1d5db;
            padding: 8px 10px;
            margin-bottom: 2px;
            border-radius: 8px;
            transition: all 0.2s ease;
        }

        .menu-option:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #ffffff;
        }

        .menu-option.active {
            color: #ffffff;
            font-weight: 700;
            background: linear-gradient(90deg, rgba(255, 191, 0, 0.25), rgba(255, 191, 0, 0.05));
            border-left: 3px solid #ffbf00;
        }

        .menu-option .dot {
            width: 6px;
            height: 6px;
            background-color: #ffbf00;
            border-radius: 50%;
            box-shadow: 0 0 8px #ffbf00;
        }

        .badge-hd {
            font-size: 9px;
            background: #ffbf00;
            color: #000000;
            padding: 1px 4px;
            border-radius: 4px;
            font-weight: bold;
        }

        /* --- Subtitle Customization Modal --- */
        .subtitle-settings-modal {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            
            background: rgba(18, 20, 29, 0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: 16px;
            padding: 16px;
            z-index: 10;
            display: none;
            flex-direction: column;
            gap: 16px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.12);
            dir: rtl;
        }

        .subtitle-settings-modal.show {
            display: flex;
        }

        .sub-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            padding-bottom: 10px;
        }

        .sub-modal-header h3 {
            font-size: 15px;
            font-weight: bold;
            color: #ffbf00;
        }

        .sub-modal-header .close-btn {
            cursor: pointer;
            color: #ccc;
            font-size: 16px;
            transition: color 0.2s;
        }

        .sub-modal-header .close-btn:hover {
            color: #fff;
        }

        .sub-setting-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .sub-setting-label {
            font-size: 14px;
            font-weight: 600;
            color: #ffffff;
            width: 70px;
        }

        .sub-btn-group {
            display: flex;
            gap: 8px;
            flex: 1;
            justify-content: flex-end;
        }

        

        .font-select {
            width: 100%;
            max-width: 180px;
            background: rgba(0, 0, 0, 0.6);
            color: #ffffff;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            padding: 6px 10px;
            font-size: 13px;
            cursor: pointer;
            outline: none;
        }

        /* Bottom Controls Bar */
        .bottom-bar {
            position: absolute;
            bottom: 12px;
            left: 12px;
            right: 12px;
            background: rgba(15, 17, 23, 0.88);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 8px 14px;
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 3;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .control-btn {
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            opacity: 0.85;
            padding: 2px;
            transition: opacity 0.2s, color 0.2s;
            -webkit-tap-highlight-color: transparent;
        }

        .control-btn:hover {
            opacity: 1;
            color: #ffbf00;
        }

        .control-btn.hidden {
            display: none !important;
        }

        .progress-container {
            flex-grow: 1;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 11px;
            color: #aaa;
            position: relative;
        }

         .volume-bar {
            width: 100%;
            height: 5px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 3px;
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            touch-action: none;
        }

         .volume-fill {
            height: 100%;
            background: #ffbf00;
            border-radius: 3px;
            width: 0%;
            position: relative;
        }

        .progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    display: block;
    touch-action: none;
    direction: ltr;
    overflow: visible;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    height: 100%;
    width: 0%;
    background: #ffbf00;
    border-radius: 3px;
    direction: ltr;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    right: -6px;
    left: auto;
    width: 13px;
    height: 13px;
    background-color: #ffbf00;
    border: 2px solid #ffffff;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease;
}

.progress-bar:hover .progress-thumb {
    transform: translateY(-50%) scale(1.2);
}

        .time-tooltip {
            position: absolute;
            bottom: 25px;
            background: #ffbf00;
            color: #000000;
            font-weight: bold;
            font-size: 11px;
            padding: 3px 8px;
            border-radius: 6px;
            pointer-events: none;
            display: none;
            transform: translateX(-50%);
            white-space: nowrap;
            box-shadow: 0 4px 10px rgba(0,0,0,0.5);
            z-index: 5;
        }

        .volume-fill {
            width: 100%;
        }

        .volume-container {
            display: flex !important;
            align-items: center;
            gap: 8px;
            width: 120px;
        }

        /* Desktop Mode */
        @media (min-width: 769px) {
            .movie-title {
                font-size: 18px;
            }
            .play-main-btn {
                width: 76px;
                height: 76px;
            }
            .bottom-bar {
                padding: 12px 18px;
                bottom: 16px;
                left: 16px;
                right: 16px;
            }
            .progress-container {
                font-size: 13px;
            }
        }

        /* Mobile Specific UI Optimization */
        @media (max-width: 768px) {
            .play-main-btn {
                width: 52px;
                height: 52px;
            }
            .bottom-bar {
                padding: 6px 10px;
                bottom: 8px;
                left: 8px;
                right: 8px;
                gap: 8px;
            }
            .movie-title {
                font-size: 14px;
            }
            #audioSubMenu {
                right: 8px;
                left: 8px;
                width: auto;
            }
            #qualityMenu {
                right: 12px;
            }
            .progress-container {
                font-size: 11px;
            }
            .volume-container {
                width: 120px;
            }
        }

        .toast {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 191, 0, 0.95);
    color: #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    display: none;
    z-index: 10;
}
    
.player-wrapper {
    width: 100%;
    height: 100%;
    min-height: 0;
    position: relative;
}

.video-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    position: relative;
}

@media (max-width: 768px) and (orientation: portrait) {
    .player-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

    .video-container {
        width: 100%;
        height: 100%;
        aspect-ratio: 16 / 9;
    }

    .bottom-bar {
        bottom: 8px;
        left: 8px;
        right: 8px;
    }
}