/* Reset cơ bản - Scoped trong plugin */
.dabilux-slider-video * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.dabilux-slider-video {
    background-color: transparent;
    width: 100%;
    margin: 20px 0;
    font-family: sans-serif;
}

/* Khung bao ngoài Slider */
.dabilux-image-video-container {
    width: 100%;
    height: 700px;
    position: relative;
    background-color: transparent;
    overflow: hidden;
}

/* Mobile: Tỷ lệ 9:16 (portrait) */
@media (max-width: 768px) {
    .dabilux-image-video-container {
        height: auto;
        aspect-ratio: 9 / 16;
    }
    
    /* Fallback cho trình duyệt không hỗ trợ aspect-ratio */
    @supports not (aspect-ratio: 9 / 16) {
        .dabilux-image-video-container {
            height: 0;
            padding-bottom: 177.78%; /* 16/9 * 100% = 177.78% */
        }
    }
}

/* Container chứa ảnh */
.dabilux-image-video-display {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10; /* Luôn hiển thị phía trước, chỉ bị video đè khi video active */
}

.dabilux-image-video-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    transition: opacity 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: absolute;
    top: 0;
    left: 0;
    will-change: opacity;
}

.dabilux-image-video-display img.dabilux-image-video-active {
    opacity: 1;
}

/* Ảnh cho PC - hiển thị trên desktop, ẩn trên mobile */
.dabilux-image-video-display img.dabilux-image-pc {
    display: block;
}

.dabilux-image-video-display img.dabilux-image-mobile {
    display: none;
}

/* Ảnh cho Mobile - ẩn trên desktop, hiển thị trên mobile */
@media (max-width: 768px) {
    .dabilux-image-video-display img.dabilux-image-pc {
        display: none;
    }
    
    .dabilux-image-video-display img.dabilux-image-mobile {
        display: block;
    }
}

/* Thanh thời gian (Progress Bar) - Đã ẩn */
.dabilux-image-video-progress {
    display: none;
}

/* Nút Play Overlay trên ảnh - chỉ là visual indicator */
.dabilux-image-video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.9);
    border: 4px solid rgba(255, 255, 255, 0.9);
    cursor: default;
    pointer-events: none;
    z-index: 15;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.dabilux-image-video-play-overlay::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 24px solid white;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    margin-left: 6px;
}

.dabilux-image-video-play-overlay.show {
    display: flex;
}

/* Container chứa Video Youtube */
.dabilux-image-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Mặc định nằm sau ảnh */
    opacity: 0;
    pointer-events: none; /* Không cho click khi ẩn */
    transition: opacity 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    clip-path: inset(0);
    -webkit-clip-path: inset(0);
    will-change: opacity;
    visibility: hidden; /* Hoàn toàn ẩn khi không active */
}

/* Class kích hoạt hiển thị video */
.dabilux-image-video-wrapper.dabilux-image-video-show {
    z-index: 15; /* Đè lên ảnh khi video active */
    opacity: 1;
    pointer-events: auto;
    visibility: visible; /* Hiển thị khi active */
}

/* Iframe Youtube */
.dabilux-image-video-player {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Ẩn các phần tử YouTube không cần thiết */
.dabilux-image-video-player iframe {
    pointer-events: auto;
    border: none;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 0;
}

/* Ẩn các overlay elements của YouTube bằng cách crop */
.dabilux-image-video-wrapper.dabilux-image-video-show {
    clip-path: inset(0);
    -webkit-clip-path: inset(0);
}

/* Đảm bảo không có overflow để ẩn các phần tử bên ngoài */
.dabilux-image-video-container {
    overflow: hidden;
}

/* Nút điều hướng - Glassmorphism Style */
.dabilux-image-video-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    z-index: 20;
    font-size: 20px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dabilux-image-video-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.dabilux-image-video-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.dabilux-image-video-container:hover .dabilux-image-video-nav-btn {
    opacity: 1;
}

.dabilux-image-video-nav-btn.dabilux-image-video-prev {
    left: 20px;
}

.dabilux-image-video-nav-btn.dabilux-image-video-next {
    right: 20px;
}

/* Dots Navigation */
.dabilux-image-video-dots {
    position: absolute;
    bottom: 30px;
    right: 120px;
    display: flex;
    gap: 8px;
    z-index: 20;
    align-items: center;
}

.dabilux-image-video-dot {
    min-width: 16px;
    min-height: 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(200, 220, 240, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.dabilux-image-video-dot:hover {
    background: rgba(220, 235, 250, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.dabilux-image-video-dot.dabilux-image-video-active {
    min-width: 22px;
    min-height: 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.5), 0 0 15px rgba(255, 255, 255, 0.3);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dabilux-image-video-dot.dabilux-image-video-active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.95);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nút Unmute nhỏ ở góc trái trên */
.dabilux-image-video-unmute-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dabilux-image-video-unmute-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.dabilux-image-video-unmute-btn.show {
    display: flex;
    top: 50px;
    left: 30px;
}

.dabilux-image-video-unmute-btn svg {
    width: 18px;
    height: 18px;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .dabilux-image-video-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .dabilux-image-video-nav-btn.dabilux-image-video-prev {
        left: 10px;
    }
    
    .dabilux-image-video-nav-btn.dabilux-image-video-next {
        right: 10px;
    }
    
    .dabilux-image-video-dots {
        bottom: 15px;
        right: 15px;
        gap: 6px;
    }
    
    .dabilux-image-video-dot {
        min-width: 14px;
        min-height: 14px;
        width: 14px;
        height: 14px;
    }
    
    .dabilux-image-video-dot.dabilux-image-video-active {
        min-width: 20px;
        min-height: 20px;
        width: 20px;
        height: 20px;
    }
    
    .dabilux-image-video-dot.dabilux-image-video-active::before {
        width: 5px;
        height: 5px;
    }
}

