/* Video Player Styles for Arzpaya Video Player */

.arzpaya-video-player {
    direction: rtl;
    font-family: 'IRANSansWeb_Medium', 'IRANSansWeb', Tahoma, Arial, sans-serif;
    margin: 20px 0;
    max-width: 100%;
    font-weight: 500;
}

.arzpaya-player-container {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, rgba(33, 51, 100, 0.1));
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.08));
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Video Player Title - Similar to Audio Player */
.arzpaya-video-player-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-body, #213364);
    text-align: right;
    margin-bottom: 0;
    order: -1;
    font-family: 'IRANSansWeb_Medium', 'IRANSansWeb', Tahoma, Arial, sans-serif;
}

/* Video Container */
.arzpaya-video-container {
    width: 100%;
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
}

/* Fullscreen button positioned on video */
.arzpaya-video-container .arzpaya-fullscreen-btn {
    position: absolute;
    bottom: 10px;
    right: 10px; /* Right side in RTL (left in LTR) */
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 6px;
    padding: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.arzpaya-video-container .arzpaya-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Fullscreen button icon - dark color for visibility on white background */
.arzpaya-video-container .arzpaya-fullscreen-btn img {
    filter: brightness(0) saturate(100%);
}

.arzpaya-video-container video {
    width: 100%;
    height: auto;
    min-height: 300px;
    max-height: 600px;
    object-fit: contain;
    display: block;
    background: #000;
    cursor: pointer;
}

.arzpaya-video-container video::-webkit-media-controls {
    display: none !important;
}

.arzpaya-video-container video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Controls Container */
.arzpaya-controls-container {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Default: right align buttons (left in RTL) */
    width: 100%;
    gap: 16px;
}

/* When platform link exists, use space-between */
.arzpaya-controls-container:has(.arzpaya-video-platform-link) {
    justify-content: space-between;
}

/* Platform Link Button - Similar to Castbox in Audio Player */
.arzpaya-video-platform-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-primary, #213364);
    text-decoration: none !important;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(33, 51, 100, 0.2);
    gap: 6px;
}

.arzpaya-video-platform-link:hover {
    background: rgba(33, 51, 100, 0.1);
    color: var(--text-primary, #213364);
    text-decoration: none !important;
    border-color: rgba(33, 51, 100, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 51, 100, 0.15);
}

.arzpaya-video-platform-link:active {
    transform: translateY(0);
}

/* Buttons Group */
.arzpaya-buttons-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

/* Control Buttons - Similar to Audio Player */
.arzpaya-play-btn,
.arzpaya-backward-btn,
.arzpaya-forward-btn,
.arzpaya-mute-btn,
.arzpaya-fullscreen-btn {
    background: transparent;
    color: var(--text-body, #213364);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
}

.arzpaya-play-btn.arzpaya-play-pause {
    background: var(--accent-primary, #3D72FE);
    color: #FFFFFF;
    border-radius: 50%;
    border: 2px solid var(--accent-primary, #3D72FE);
}

.arzpaya-play-btn.arzpaya-play-pause.arzpaya-playing {
    border: none;
}

.arzpaya-play-btn.arzpaya-play-pause:not(.arzpaya-playing) {
    border: 2px solid var(--accent-primary, #3D72FE);
}

/* Icon styles - similar to audio player */
.arzpaya-backward-btn img,
.arzpaya-forward-btn img,
.arzpaya-mute-btn img {
    width: 24px;
    height: 24px;
    display: block;
    transition: all 0.3s ease;
    filter: none;
    /* رنگ SVG در لایت مود: مشکی */
    color: var(--text-body, #213364);
}

/* رنگ SVG در لایت مود - برای دکمه‌های غیر play-pause */
.arzpaya-play-btn:not(.arzpaya-play-pause) img,
.arzpaya-backward-btn img,
.arzpaya-forward-btn img,
.arzpaya-mute-btn img {
    filter: brightness(0) saturate(100%);
}

/* Style play and pause SVG icons */
.arzpaya-play-btn.arzpaya-play-pause img {
    width: 22px;
    height: 22px;
    display: block;
    filter: none;
}

.arzpaya-fullscreen-btn img {
    width: 24px;
    height: 24px;
    display: block;
    transition: all 0.3s ease;
    filter: brightness(0) saturate(100%);
}

.arzpaya-play-btn:hover,
.arzpaya-backward-btn:hover,
.arzpaya-forward-btn:hover,
.arzpaya-mute-btn:hover,
.arzpaya-fullscreen-btn:hover {
    color: var(--accent-primary, #3D72FE);
    transform: translateY(-2px);
    opacity: 0.7;
}

.arzpaya-play-btn.arzpaya-play-pause:hover {
    background: var(--accent-secondary, #1b4fd8);
    box-shadow: var(--shadow-hover, 0 6px 20px rgba(0, 0, 0, 0.12));
    opacity: 0.9;
    color: #FFFFFF;
    transform: translateY(-2px);
}

.arzpaya-play-btn:active,
.arzpaya-backward-btn:active,
.arzpaya-forward-btn:active,
.arzpaya-mute-btn:active,
.arzpaya-fullscreen-btn:active {
    transform: translateY(0);
}

/* Progress Container - Full Width Below Video */
.arzpaya-progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
    min-height: 8px; /* Reserve space for progress bar hover state to prevent layout shift */
}

.arzpaya-time-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary, rgba(33, 51, 100, 0.8));
    font-weight: 500;
    margin-bottom: 5px;
}

.arzpaya-progress-bar {
    width: 100%;
    height: 8px; /* Fixed height to prevent layout shift on hover */
    background: var(--border-color, rgba(33, 51, 100, 0.1));
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: visible; /* Changed from hidden to visible to allow handle to show */
    direction: ltr; /* Force LTR for progress bar to fill from left to right */
    display: flex;
    align-items: center; /* Center the progress fill vertically */
}

.arzpaya-progress-track {
    width: 100%;
    height: 100%;
    position: relative;
    direction: ltr;
}

.arzpaya-progress-fill {
    height: 6px; /* Normal height */
    background: linear-gradient(90deg, var(--accent-primary, #3D72FE), var(--accent-secondary, #1b4fd8));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease, height 0.2s ease;
    position: relative;
    direction: ltr;
    align-self: center; /* Center vertically in flex container */
}

.arzpaya-progress-handle {
    position: absolute;
    top: 50%;
    left: 0; /* Changed from right: 0 to left: 0 for LTR */
    transform: translate(-50%, -50%); /* Changed from translate(50%, -50%) */
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--accent-primary, #3D72FE);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: left 0.1s ease, opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.arzpaya-progress-bar:hover .arzpaya-progress-handle {
    opacity: 1;
}

.arzpaya-progress-bar:hover .arzpaya-progress-fill {
    height: 8px; /* Thicker on hover */
}

/* Volume Control Wrapper */
.arzpaya-volume-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Volume Control Box - Popup Style */
.arzpaya-volume-control {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: var(--card-bg, #FFFFFF);
    border: 1px solid var(--border-color, rgba(33, 51, 100, 0.1));
    border-radius: 6px;
    padding: 4px 11px;
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.15));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    white-space: nowrap;
}

.arzpaya-volume-control.arzpaya-volume-visible {
    pointer-events: auto;
}

/* Add invisible bridge between button and control */
.arzpaya-volume-control::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 6px;
    height: 100%;
    background: transparent;
}

/* Arrow pointing to the button (RTL: arrow on the right side pointing left) */
.arzpaya-volume-control::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid var(--card-bg, #FFFFFF);
    filter: drop-shadow(-1px 0 1px rgba(33, 51, 100, 0.1));
}

.arzpaya-volume-wrapper:hover .arzpaya-volume-control,
.arzpaya-volume-wrapper.arzpaya-volume-hover .arzpaya-volume-control,
.arzpaya-volume-control:hover,
.arzpaya-volume-control.arzpaya-volume-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

/* Volume Slider */
.arzpaya-volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color, rgba(33, 51, 100, 0.1));
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    direction: ltr;
    margin: 0;
    position: relative;
}

/* Filled portion for WebKit browsers */
.arzpaya-volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, 
        var(--accent-primary, #3D72FE) 0%, 
        var(--accent-primary, #3D72FE) var(--slider-value, 100%), 
        var(--border-color, rgba(33, 51, 100, 0.1)) var(--slider-value, 100%), 
        var(--border-color, rgba(33, 51, 100, 0.1)) 100%);
    border-radius: 2px;
}

.arzpaya-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-primary, #3D72FE);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-top: -5px;
}

.arzpaya-volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent-secondary, #1b4fd8);
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(61, 114, 254, 0.4);
}

.arzpaya-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent-primary, #3D72FE);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.arzpaya-volume-slider::-moz-range-thumb:hover {
    background: var(--accent-secondary, #1b4fd8);
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(61, 114, 254, 0.4);
}

/* Filled portion for Firefox */
.arzpaya-volume-slider::-moz-range-progress {
    background: var(--accent-primary, #3D72FE);
    height: 4px;
    border-radius: 2px 0 0 2px;
}

.arzpaya-volume-slider::-moz-range-track {
    background: var(--border-color, rgba(33, 51, 100, 0.1));
    height: 4px;
    border-radius: 2px;
}

/* Fullscreen Mode */
.arzpaya-video-player.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
    margin: 0;
    border-radius: 0;
    width: 100vw;
    height: 100vh;
}

.arzpaya-video-player.fullscreen .arzpaya-player-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 0;
    background: #000;
    border: none;
    box-shadow: none;
    gap: 0;
    justify-content: flex-end;
}

/* Hide title in fullscreen */
.arzpaya-video-player.fullscreen .arzpaya-video-player-title {
    display: none;
}

.arzpaya-video-player.fullscreen .arzpaya-video-container {
    width: 100%;
    height: 100%;
    flex: 1;
    border-radius: 0;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arzpaya-video-player.fullscreen .arzpaya-video-container video {
    width: 100%;
    height: 100%;
    min-height: auto;
    max-height: none;
    object-fit: contain;
}

/* Progress and Controls in Fullscreen - Overlay at bottom */
.arzpaya-video-player.fullscreen .arzpaya-progress-container {
    position: absolute;
    bottom: 90px; /* More space from controls */
    left: 0;
    right: 0;
    padding: 0 20px;
    margin: 0;
    z-index: 20;
}

.arzpaya-video-player.fullscreen .arzpaya-controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    padding: 15px 20px 20px 20px;
    border-radius: 0;
    z-index: 20;
    align-items: center;
    justify-content: flex-end; /* Default: right align buttons (left in RTL) */
}

/* When platform link exists in fullscreen, use space-between */
.arzpaya-video-player.fullscreen .arzpaya-controls-container:has(.arzpaya-video-platform-link) {
    justify-content: space-between;
    align-items: center;
}

/* Platform link visibility in fullscreen - improve contrast */
.arzpaya-video-player.fullscreen .arzpaya-video-platform-link {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-color: rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.arzpaya-video-player.fullscreen .arzpaya-video-platform-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Improve button visibility in fullscreen - Add background for better contrast */
.arzpaya-video-player.fullscreen .arzpaya-play-btn,
.arzpaya-video-player.fullscreen .arzpaya-backward-btn,
.arzpaya-video-player.fullscreen .arzpaya-forward-btn,
.arzpaya-video-player.fullscreen .arzpaya-mute-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%; /* Circular buttons in fullscreen */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.arzpaya-video-player.fullscreen .arzpaya-play-btn:hover,
.arzpaya-video-player.fullscreen .arzpaya-backward-btn:hover,
.arzpaya-video-player.fullscreen .arzpaya-forward-btn:hover,
.arzpaya-video-player.fullscreen .arzpaya-mute-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Play button in fullscreen - more visible */
.arzpaya-video-player.fullscreen .arzpaya-play-btn.arzpaya-play-pause {
    background: var(--accent-primary, #3D72FE);
    box-shadow: 0 4px 12px rgba(61, 114, 254, 0.4);
    border-radius: 50%; /* Circular play button */
}

.arzpaya-video-player.fullscreen .arzpaya-play-btn.arzpaya-play-pause:hover {
    background: var(--accent-secondary, #1b4fd8);
    box-shadow: 0 6px 16px rgba(61, 114, 254, 0.5);
}

/* Button icons in fullscreen - white for better visibility */
.arzpaya-video-player.fullscreen .arzpaya-backward-btn img,
.arzpaya-video-player.fullscreen .arzpaya-forward-btn img,
.arzpaya-video-player.fullscreen .arzpaya-mute-btn img {
    filter: brightness(0) saturate(100%) invert(1);
}

.arzpaya-video-player.fullscreen .arzpaya-play-btn.arzpaya-play-pause img {
    filter: none; /* Play button has colored background, no filter needed */
}

/* Fullscreen button in fullscreen mode - Move to avoid timer overlap */
.arzpaya-video-player.fullscreen .arzpaya-video-container .arzpaya-fullscreen-btn {
    bottom: 140px; /* Above progress bar to avoid timer overlap */
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 30;
    border-radius: 50%; /* Circular button */
}

/* Loading State */
.arzpaya-video-player.loading .arzpaya-player-container {
    opacity: 0.7;
    pointer-events: none;
}

.arzpaya-video-player.loading .arzpaya-play-btn {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error State */
.arzpaya-video-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    direction: rtl;
}

/* Dark Theme Support */
[data-theme="dark"] .arzpaya-player-container {
    background: var(--card-bg, #1a2332);
    border-color: var(--border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .arzpaya-video-player-title {
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .arzpaya-time-display {
    color: var(--text-secondary, rgba(255, 255, 255, 0.85));
}

[data-theme="dark"] .arzpaya-video-player-title {
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .arzpaya-progress-bar {
    background: var(--border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .arzpaya-btn {
    background: transparent;
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .arzpaya-play-btn.arzpaya-play-pause {
    background: var(--accent-primary, #3D72FE);
    color: #FFFFFF;
    border: 2px solid var(--accent-primary, #3D72FE);
}

[data-theme="dark"] .arzpaya-play-btn.arzpaya-play-pause.arzpaya-playing {
    border: none;
}

[data-theme="dark"] .arzpaya-play-btn.arzpaya-play-pause:not(.arzpaya-playing) {
    border: 2px solid var(--accent-primary, #3D72FE);
}

[data-theme="dark"] .arzpaya-play-btn:hover,
[data-theme="dark"] .arzpaya-backward-btn:hover,
[data-theme="dark"] .arzpaya-forward-btn:hover,
[data-theme="dark"] .arzpaya-mute-btn:hover,
[data-theme="dark"] .arzpaya-fullscreen-btn:hover {
    color: var(--accent-primary, #3D72FE);
}

[data-theme="dark"] .arzpaya-play-btn.arzpaya-play-pause:hover {
    background: var(--accent-secondary, #1b4fd8);
    box-shadow: var(--shadow-hover, 0 6px 20px rgba(0, 0, 0, 0.35));
    opacity: 0.9;
    color: #FFFFFF;
}

/* Platform Link - Dark Mode */
[data-theme="dark"] .arzpaya-video-platform-link {
    background: transparent;
    color: var(--text-primary, #FFFFFF);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .arzpaya-video-platform-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary, #FFFFFF);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

/* رنگ SVG در دارک مود: سفید */
[data-theme="dark"] .arzpaya-play-btn:not(.arzpaya-play-pause) img {
    filter: brightness(0) saturate(100%) invert(1);
}

[data-theme="dark"] .arzpaya-backward-btn img,
[data-theme="dark"] .arzpaya-forward-btn img,
[data-theme="dark"] .arzpaya-mute-btn img {
    filter: brightness(0) saturate(100%) invert(1);
}

[data-theme="dark"] .arzpaya-fullscreen-btn img {
    filter: brightness(0) saturate(100%) invert(1);
}

/* Fullscreen button on video - Dark mode */
[data-theme="dark"] .arzpaya-video-container .arzpaya-fullscreen-btn {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .arzpaya-video-container .arzpaya-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Fullscreen button icon - white in dark mode */
[data-theme="dark"] .arzpaya-video-container .arzpaya-fullscreen-btn img {
    filter: brightness(0) saturate(100%) invert(1);
}

/* Fullscreen mode - Dark mode */
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-player-container {
    background: #000;
}

[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-controls-container {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 50%, transparent 100%);
}

/* Button visibility in fullscreen dark mode */
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-play-btn,
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-backward-btn,
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-forward-btn,
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-mute-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%; /* Circular buttons in fullscreen */
}

/* Platform link in fullscreen dark mode */
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-video-platform-link {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-color: rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
}

[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-video-platform-link:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-play-btn:hover,
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-backward-btn:hover,
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-forward-btn:hover,
[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-mute-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .arzpaya-video-player.fullscreen .arzpaya-video-container .arzpaya-fullscreen-btn {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Play/Pause icons in dark mode - no filter */
[data-theme="dark"] .arzpaya-play-btn.arzpaya-play-pause:hover img {
    filter: none;
}

[data-theme="dark"] .arzpaya-volume-control {
    background: var(--card-bg, #1a2332);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.35));
}

[data-theme="dark"] .arzpaya-volume-slider {
    background: var(--border-color, rgba(255, 255, 255, 0.1));
}

/* Filled portion for WebKit in dark theme */
[data-theme="dark"] .arzpaya-volume-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to right, 
        var(--accent-primary, #3D72FE) 0%, 
        var(--accent-primary, #3D72FE) var(--slider-value, 100%), 
        var(--border-color, rgba(255, 255, 255, 0.1)) var(--slider-value, 100%), 
        var(--border-color, rgba(255, 255, 255, 0.1)) 100%);
}

[data-theme="dark"] .arzpaya-volume-slider::-moz-range-progress {
    background: var(--accent-primary, #3D72FE);
}

[data-theme="dark"] .arzpaya-volume-slider::-moz-range-track {
    background: var(--border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .arzpaya-volume-control::after {
    border-left-color: var(--card-bg, #1a2332);
    filter: drop-shadow(-1px 0 1px rgba(0, 0, 0, 0.3));
}

/* Responsive Design */
@media (max-width: 768px) {
    .arzpaya-player-container {
        padding: 15px;
        gap: 12px;
    }
    
    .arzpaya-buttons-group {
        gap: 6px;
    }
    
    .arzpaya-play-btn,
    .arzpaya-backward-btn,
    .arzpaya-forward-btn,
    .arzpaya-mute-btn,
    .arzpaya-fullscreen-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .arzpaya-time-display {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .arzpaya-player-container {
        padding: 15px;
    }
    
    .arzpaya-controls-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .arzpaya-video-platform-link {
        width: 100%;
        text-align: center;
        order: 2;
    }
    
    .arzpaya-buttons-group {
        flex-direction: row;
        gap: 8px;
        width: 100%;
        justify-content: center; /* Center align buttons in mobile */
        order: 1;
    }
    
    .arzpaya-play-btn.arzpaya-play-pause {
        width: 48px;
        height: 48px;
        font-size: 20px;
        order: 2; /* Play/Pause in the middle */
    }
    
    /* Reorder buttons for RTL: forward, play/pause, rewind (from right to left) */
    .arzpaya-forward-btn {
        order: 1;
    }
    
    .arzpaya-backward-btn {
        order: 3;
    }
    
    /* Hide volume button in mobile */
    .arzpaya-volume-wrapper {
        display: none !important;
    }
    
    /* Video container and video - full size in mobile without black bars */
    .arzpaya-video-container {
        min-height: 0;
        aspect-ratio: 16 / 9; /* Common video aspect ratio */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .arzpaya-video-container video {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        object-fit: cover; /* Fill container without black bars */
    }
    
    /* Fullscreen mobile styles - Ensure proper layout when platform link exists */
    /* When platform link exists in fullscreen mobile - stack progress bar above controls */
    .arzpaya-video-player.fullscreen .arzpaya-controls-container:has(.arzpaya-video-platform-link) {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    /* Progress bar positioning when platform link exists - above controls */
    .arzpaya-video-player.fullscreen:has(.arzpaya-video-platform-link) .arzpaya-progress-container {
        bottom: 150px; /* More space above controls container (buttons + link button) */
        z-index: 21; /* Above controls */
    }
    
    /* When no platform link, keep default positioning */
    .arzpaya-video-player.fullscreen:not(:has(.arzpaya-video-platform-link)) .arzpaya-progress-container {
        bottom: 90px; /* Default position */
    }
    
    .arzpaya-video-player.fullscreen .arzpaya-video-platform-link {
        width: 100%;
        text-align: center;
        order: 2;
    }
    
    .arzpaya-video-player.fullscreen .arzpaya-buttons-group {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    /* Fullscreen button positioning when platform link exists - above progress bar */
    .arzpaya-video-player.fullscreen:has(.arzpaya-video-platform-link) .arzpaya-video-container .arzpaya-fullscreen-btn {
        bottom: 200px; /* Above progress bar (which is at 150px) */
    }
}

/* Accessibility - Remove outline on focus */
.arzpaya-play-btn:focus,
.arzpaya-backward-btn:focus,
.arzpaya-forward-btn:focus,
.arzpaya-mute-btn:focus,
.arzpaya-fullscreen-btn:focus {
    outline: none;
}

.arzpaya-progress-bar:focus,
.arzpaya-volume-slider:focus {
    outline: none;
}

/* Animation for button states */
.arzpaya-play-btn .play-icon,
.arzpaya-play-btn .pause-icon {
    transition: all 0.3s ease;
}

.arzpaya-mute-btn .volume-icon,
.arzpaya-mute-btn .mute-icon {
    transition: all 0.3s ease;
}

.arzpaya-fullscreen-btn .fullscreen-icon,
.arzpaya-fullscreen-btn .exit-fullscreen-icon {
    transition: all 0.3s ease;
}

/* Custom scrollbar for webkit browsers */
.arzpaya-video-player::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.arzpaya-video-player::-webkit-scrollbar-track {
    background: var(--border-color, rgba(33, 51, 100, 0.1));
    border-radius: 3px;
}

.arzpaya-video-player::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #3D72FE);
    border-radius: 3px;
}

.arzpaya-video-player::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary, #1b4fd8);
}