.video-container {
    position: relative;
    width: 100%;
    height: 80vh;
    max-height: 900px;
    background-color: #000;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .video-container {
        border-radius: 16px;
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: none;
    }
}

video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 80px;
    height: 80px;
    background: rgba(100, 221, 169, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(100, 221, 169, 0.4);
}

.video-container.paused .center-play-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.center-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #4ab38c;
}

.center-play-btn svg {
    width: 40px;
    height: 40px;
    fill: #000;
    margin-right: 4px;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: none;
    pointer-events: none;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: rgb(100, 221, 169);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 15px 20px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 15px;
    z-index: 20;
    direction: ltr;
}

.video-container:hover .controls,
.video-container.paused .controls {
    opacity: 1;
}

.btnplayer {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

.btnplayer:hover {
    color: rgb(100, 221, 169);
    background: rgba(255, 255, 255, 0.05);
}

.btnplayer svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.spacer {
    flex-grow: 1;
}

.time-display {
    font-size: 14px;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    font-family: 'Vazir', sans-serif;
}

.live-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-family: 'Vazir', sans-serif;
}

.live-badge.active {
    background: rgb(100, 221, 169);
    color: #000;
    box-shadow: 0 0 15px rgba(100, 221, 169, 0.4);
}

.live-badge:hover {
    filter: brightness(1.1);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px; 
    padding: 2px 6px; 
    border-radius: 20px;
    transition: background 0.3s ease;
}

.volume-container:hover {
    background: rgba(255, 255, 255, 0.1);
}

.volume-slider-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    opacity: 0;
}

@media (min-width: 769px) {
    .volume-container:hover .volume-slider-wrapper {
        width: 70px; 
        opacity: 1;
    }
}

.volume-text {
    font-size: 10px; 
    color: #cccccc;
    min-width: 28px;
    text-align: center;
    font-family: 'Vazir', sans-serif;
    direction: ltr;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.volume-container:hover .volume-text {
    opacity: 1;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    height: 11px; 
    border-radius: 5px;
    outline: none;
    border: none;
    margin: 0;
    position: relative;
    z-index: 1;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px; 
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    border: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px; 
    width: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    margin-top: -4px; 
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s, background 0.2s;
    position: relative;
    z-index: 2;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: rgb(100, 221, 169);
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

input[type=range]::-moz-range-thumb {
    height: 12px;
    width: 12px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

input[type=range]::-moz-range-thumb:hover {
    transform: scale(1.1);
    background: rgb(100, 221, 169);
}

.settings-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

#currentQualityLabel {
    color: white;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Vazir', sans-serif;
    user-select: none;
    padding: 0 5px;
}

#qualityMenu {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 150px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateX(-80px);
}

#qualityMenu.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.quality-option {
    padding: 10px 20px;
    color: #cccccc;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-family: 'Vazir', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.quality-option.active {
    color: rgb(100, 221, 169) !important;
    background: rgba(100, 221, 169, 0.1);
    font-weight: bold;
}

.quality-option.active::after {
    content: '✓';
    font-weight: bold;
    margin-left: 10px;
}

@supports (-webkit-touch-callout: none) {
    .settings-container {
        display: flex !important;
    }
    
    video::-webkit-media-controls-fullscreen-button {
        display: none;
    }
    
    .video-container {
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 768px) {
    .controls {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .btnplayer svg {
        width: 20px;
        height: 20px;
    }
    
    .time-display {
        font-size: 12px;
    }

    #qualityMenu {
        right: -10px;
        bottom: 45px;
        transform: translateX(0);
    }

    .volume-container {
        gap: 6px;
    }
    
    .volume-slider-wrapper {
        width: 60px !important;
        opacity: 1 !important;
        margin-right: 5px;
    }

    input[type=range] {
        height: 30px; 
    }
    
    input[type=range]::-webkit-slider-thumb {
        height: 14px;
        width: 14px;
        margin-top: -5px;
    }
    
    input[type=range]::-moz-range-thumb {
        height: 14px;
        width: 14px;
    }
    
    .volume-text {
        display: none;
    }
    
    #currentQualityLabel {
        font-size: 12px;
    }
}

.unmute-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 15, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    display: none; 
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 20; 
    font-family: sans-serif;
    font-weight: 600;
    font-size: 15px;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.unmute-overlay.show {
    display: flex;
}

.unmute-overlay .mute-icon {
    width: 20px;
    height: 20px;
}
