/**
 * EAEL Sticky Video Styles
 * Based on Essential Addons for Elementor Sticky Video implementation
 * Version: 1.9.6
 * Changes: Removed long-press requirement - instant touch drag like desktop
 */

/* Base Wrapper */
.eael-sticky-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Video Player Container */
.eael-sticky-video-player2 {
    position: relative;
    width: 100%;
    height: auto;
    transition: all 0.3s ease;
    min-height: 20px;
    overflow: visible;
}

.eael-sticky-video-player2.in {
    position: relative;
    margin: 0px;
    padding: 0px;
    height: 100%;
    border: 0;
    line-height: 1;
}

/* Sticky State */
.eael-sticky-video-player2.out {
    position: fixed !important;
    z-index: 999999 !important;
    width: 300px !important;
    height: 169px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Disable transitions on initial load */
.eael-sticky-video-player2.eaelsv-no-transition {
    transition: none !important;
}

/* Draggable cursor */
.eael-sticky-video-player2.out.eaelsv-draggable {
    cursor: move;
    cursor: grab;
}

.eael-sticky-video-player2.out.eaelsv-draggable.eaelsv-dragging {
    cursor: grabbing;
    transition: none !important;
    user-select: none;
}

/* Long-press activation feedback */
.eael-sticky-video-player2.out.eaelsv-long-press-active {
    border: 2px solid rgba(0, 123, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
    animation: eaelsv-pulse 0.5s ease-in-out;
}

@keyframes eaelsv-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Sticky Positioning */
.eael-sticky-video-player2.out.top-left {
    top: 20px !important;
    left: 20px !important;
}

.eael-sticky-video-player2.out.top-right {
    top: 20px !important;
    right: 20px !important;
}

.eael-sticky-video-player2.out.bottom-left {
    bottom: 20px !important;
    left: 20px !important;
}

.eael-sticky-video-player2.out.bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

/* Close Button - Responsive Implementation */
.eaelsv-sticky-player-close {
    position: absolute;
    right: 10px;
    top: 10px;
    display: none;
    padding: 8px;
    font-size: 16px;
    z-index: 9999;
    cursor: pointer;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    overflow: visible;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50px;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 1.8;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.eaelsv-sticky-player-close:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ff4444;
}

/* Mute Button */
.eaelsv-sticky-player-mute {
    position: absolute;
    left: 10px;
    top: 10px;
    display: none;
    padding: 8px;
    font-size: 16px;
    z-index: 9999;
    cursor: pointer;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    overflow: visible;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50px;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 1.8;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.eaelsv-sticky-player-mute:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
}

.eaelsv-sticky-player-mute.unmuted {
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
}

.eaelsv-sticky-player-mute.unmuted:hover {
    background: rgba(76, 175, 80, 0.2);
}

/* Overlay Styles */
.eaelsv-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
}

.eaelsv-overlay:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.eaelsv-overlay:hover:before {
    background: rgba(0, 0, 0, 0.5);
}

.eaelsv-overlay-icon {
    position: relative;
    z-index: 6;
    color: #fff;
    font-size: 60px;
    transition: all 0.3s ease;
}

.eaelsv-overlay:hover .eaelsv-overlay-icon {
    transform: scale(1.1);
}

.eaelsv-overlay-ignore {
    display: none;
}

/* Video Elements */
.eael-sticky-video-wrapper video,
.eael-sticky-video-wrapper iframe,
.eael-sticky-video-wrapper [data-plyr-provider] {
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* Plyr Video Player Customization */
.eael-sticky-video-wrapper .plyr {
    width: 100%;
    height: 100%;
}

.eael-sticky-video-wrapper .plyr__video-wrapper {
    background: #000;
}

.eael-sticky-video-wrapper .plyr__controls {
    display: none !important;
}

/* Force hide all Plyr controls in sticky mode */
.eael-sticky-video-player2.out .plyr__controls,
.eael-sticky-video-player2.out .plyr__control,
.eael-sticky-video-player2.out .plyr__control--overlaid {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Remove all Plyr control styling since controls are disabled */

/* Overlay Visibility States */
.eaelsv-overlay-visibility- .eaelsv-overlay {
    display: none;
}

.eaelsv-overlay-visibility-transparent .eaelsv-overlay {
    background: transparent !important;
}

.eaelsv-overlay-visibility-transparent .eaelsv-overlay:before {
    display: none;
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
    .eael-sticky-video-player2.out {
        max-width: calc(100vw - 40px) !important;
    }
    
    .eael-sticky-video-player2.out.top-left,
    .eael-sticky-video-player2.out.bottom-left {
        left: 10px !important;
    }
    
    .eael-sticky-video-player2.out.top-right,
    .eael-sticky-video-player2.out.bottom-right {
        right: 10px !important;
    }
    
    .eael-sticky-video-player2.out.top-left,
    .eael-sticky-video-player2.out.top-right {
        top: 10px !important;
    }
    
    .eael-sticky-video-player2.out.bottom-left,
    .eael-sticky-video-player2.out.bottom-right {
        bottom: 10px !important;
    }
    
    .eaelsv-overlay-icon {
        font-size: 35px;
    }
    
    .eaelsv-sticky-player-close {
        font-size: 14px;
        width: 26px;
        height: 26px;
        line-height: 1.6;
        right: 8px;
        top: 8px;
    }
    
    .eaelsv-sticky-player-mute {
        font-size: 14px;
        width: 26px;
        height: 26px;
        line-height: 1.6;
        left: 8px;
        top: 8px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .eael-sticky-video-player2.out {
        max-width: calc(100vw - 20px) !important;
    }
    
    .eaelsv-overlay-icon {
        font-size: 25px;
    }
    
    .eaelsv-sticky-player-close {
        font-size: 12px;
        width: 22px;
        height: 22px;
        line-height: 1.5;
        right: 6px;
        top: 6px;
    }
    
    .eaelsv-sticky-player-mute {
        font-size: 12px;
        width: 22px;
        height: 22px;
        line-height: 1.5;
        left: 6px;
        top: 6px;
    }
}

/* Loading States */
.eael-sticky-video-wrapper.loading {
    opacity: 0.7;
}

.eael-sticky-video-wrapper.loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: eaelsv-spin 1s linear infinite;
    z-index: 10;
}

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

/* Smooth Transitions */
.eael-sticky-video-player2.transitioning {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Accessibility */
.eaelsv-sticky-player-close:focus,
.eaelsv-overlay:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .eaelsv-sticky-player-close {
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .eaelsv-sticky-player-close:hover {
        background: rgba(0, 0, 0, 0.9);
        border-color: rgba(255, 255, 255, 0.5);
    }
}

/* RTL Support */
[dir="rtl"] .eael-sticky-video-player2.out.top-left {
    left: auto !important;
    right: 20px !important;
}

[dir="rtl"] .eael-sticky-video-player2.out.top-right {
    right: auto !important;
    left: 20px !important;
}

[dir="rtl"] .eael-sticky-video-player2.out.bottom-left {
    left: auto !important;
    right: 20px !important;
}

[dir="rtl"] .eael-sticky-video-player2.out.bottom-right {
    right: auto !important;
    left: 20px !important;
}

[dir="rtl"] .eaelsv-sticky-player-close {
    right: auto;
    left: 10px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .eaelsv-overlay:before {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .eaelsv-sticky-player-close {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #fff;
        color: #fff;
    }
}

/* Print Styles */
@media print {
    .eael-sticky-video-player2.out {
        display: none !important;
    }
}