/* Video Horizontal Carousel Widget Styles */
.vgw-horizontal-carousel {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    padding: 20px 0;
}

/* מסלול הוידאו */
.vgw-video-track {
    display: flex;
    height: 100%;
    align-items: center;
    will-change: transform;
    cursor: grab;
}

.vgw-video-track:active {
    cursor: grabbing;
}

/* אייטם וידאו */
.vgw-video-item {
    flex: 0 0 auto;
    width: 320px;
    height: 90%;
    max-width: 100%;
    margin: 0 15px;
    position: relative;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    transform: scale(0.85);
    opacity: 0.7;
}

.vgw-video-item.active {
    transform: scale(1);
    opacity: 1;
    z-index: 10;
}

.vgw-video-item:hover {
    transform: scale(0.9);
}

.vgw-video-item.active:hover {
    transform: scale(1.02);
}

/* קונטיינר הוידאו */
.vgw-video-container {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.2);
    background: #111;
}

/* נגן וידאו */
.vgw-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    outline: none;
    background: #000;
}

/* טקסט מעל הסרטון */
.vgw-text-overlay {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    max-width: calc(100% - 20px);
    word-wrap: break-word;
}

.vgw-text-overlay.overlay-left {
    left: 10px;
    right: auto;
    transform: none;
}

.vgw-text-overlay.overlay-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.vgw-text-overlay.overlay-right {
    right: 10px;
    left: auto;
    transform: none;
}

/* Mobile optimized - vertical format */
.vgw-mobile-optimized .vgw-video-item {
    width: 200px;
}

.vgw-mobile-optimized .vgw-video-player {
    aspect-ratio: 9/16;
    object-fit: cover;
}





/* placeholder לוידאו ללא poster */
.vgw-video-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #222, #444);
    color: #fff;
    overflow: hidden;
}

.vgw-video-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* overlay עם כפתור play */
.vgw-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    backdrop-filter: blur(2px);
}

.vgw-play-overlay::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: pulse 2.5s infinite ease-in-out;
}

.vgw-play-overlay i {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.vgw-play-overlay:hover {
    background: rgba(0, 0, 0, 0.6);
}

.vgw-play-overlay:hover i {
    transform: scale(1.1);
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

/* אנימציות */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vgw-horizontal-carousel {
    animation: fadeInUp 0.6s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vgw-horizontal-carousel {
        height: 50vh;
        padding: 15px 0;
    }
    
    .vgw-video-item {
        width: 250px;
        margin: 0 10px;
    }
    
    .vgw-mobile-optimized .vgw-video-item {
        width: 180px;
    }
    
    .vgw-text-overlay {
        font-size: 12px;
        padding: 6px 10px;
        max-width: calc(100% - 16px);
    }
}

@media (max-width: 480px) {
    .vgw-horizontal-carousel {
        height: 45vh;
        padding: 10px 0;
    }
    
    .vgw-video-item {
        width: 200px;
        margin: 0 8px;
    }
    
    .vgw-mobile-optimized .vgw-video-item {
        width: 150px;
    }
    
    .vgw-play-overlay {
        font-size: 36px;
    }
    
    .vgw-play-overlay::before {
        width: 60px;
        height: 60px;
    }
    
    .vgw-text-overlay {
        font-size: 11px;
        padding: 4px 8px;
        max-width: calc(100% - 12px);
        top: 8px;
    }
    
    .vgw-text-overlay.overlay-left,
    .vgw-text-overlay.overlay-right {
        left: 8px;
        right: 8px;
        transform: none;
    }
}

/* תמיכה בעברית - RTL */
[dir="rtl"] .vgw-video-track {
    direction: ltr; /* שמור על כיוון הפיזי של הפלקס */
}

[dir="rtl"] .vgw-video-item {
    direction: rtl; /* אבל שמור על כיוון הטקסט */
}



/* Loading state */
.vgw-video-player[data-loading="true"] {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite ease-in-out;
    position: relative;
}

.vgw-video-player[data-loading="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

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

/* Smooth transitions */
.vgw-horizontal-carousel * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.vgw-video-item:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    border-radius: 16px;
}

.vgw-video-player:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
} 