/* Busipy Video Slider Premium Styling */

.busipy-video-slider {
    position: relative;
    padding-bottom: 40px;
    /* Space for pagination */
    overflow: hidden;
}

/* Slider interaction - we only use JS to stop autoplay, keeping everything clickable */
.busipy-video-slider.busipy-is-playing .swiper-wrapper {
    /* No pointer-events: none here! */
}

.busipy-video-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    /* Kesin sinematik oran */
    border-radius: 15px;
    overflow: hidden !important;
    background: #000;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.busipy-video-iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: none;
    z-index: 5;
}

.busipy-video-iframe-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block !important;
}


.busipy-video-card.is-active-playing {
    z-index: 2;
    /* Bring active video to front */
}

.busipy-video-card:hover {
    transform: none !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.busipy-video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    background-color: #000;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

/* Video oynatılırken her türlü yardımcı öğeyi (ikon, thumbnail) koddan ve ekrandan temizle */
.busipy-video-card.is-active-playing .busipy-play-overlay,
.busipy-video-card[data-is-playing="true"] .busipy-play-overlay,
.busipy-video-card.is-active-playing .busipy-video-thumbnail,
.busipy-video-card[data-is-playing="true"] .busipy-video-thumbnail,
.busipy-video-card.is-active-playing i,
.busipy-video-card.is-active-playing span[class*="icon"],
.busipy-video-card.is-active-playing .elementor-video-icon {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: -10 !important;
    pointer-events: none !important;
}

.busipy-video-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    transition: opacity 0.3s ease;
}

.busipy-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 24px;
    transition: background 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    /* Ensure click passes through to the card */
    z-index: 2;
}

.busipy-video-card:hover .busipy-play-overlay {
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(1.1);
}

.busipy-video-iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 5;
    /* Play butonunun (z-index: 2) üstünde kalması için */
}

/* Swiper Flexbox Fixes - 10+ video eklendiğinde alt alta dizilmeyi engeller */
.busipy-video-slider .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

.busipy-video-slider .swiper-slide {
    flex-shrink: 0 !important;
    height: auto !important;
}

.busipy-video-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Swiper Controls */
.busipy-swiper-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.busipy-swiper-button-prev {
    left: 10px;
}

.busipy-swiper-button-next {
    right: 10px;
}

.busipy-swiper-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.swiper-pagination-bullet {
    transition: all 0.3s ease;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.3);
}

/* Modal Styling */
.busipy-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.busipy-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
}

.busipy-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

.busipy-modal-video-container {
    width: 100%;
    height: 100%;
}

.busipy-modal-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .busipy-play-overlay {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .busipy-swiper-button {
        display: flex !important;
        /* Force visibility on mobile */
        opacity: 1 !important;
        background-color: rgba(0, 0, 0, 0.5) !important;
        z-index: 1000 !important;
        width: 35px !important;
        height: 35px !important;
    }

    .busipy-swiper-button-prev {
        left: 5px !important;
    }

    .busipy-swiper-button-next {
        right: 5px !important;
    }

    /* Editor specific fixes */
    .elementor-editor-active .busipy-video-slider {
        min-height: 200px;
        background: rgba(0, 0, 0, 0.02);
        border: 1px dashed #ccc;
        padding: 20px;
    }

    .elementor-editor-active .busipy-video-card {
        min-height: 150px;
    }