/**
 * Product Video Gallery Styles
 */

/* Gallery Container */
.product-video-gallery-container {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Gallery Wrapper */
.product-video-gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Video Player - Customized */
.product-video-player {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-video-player iframe {
    display: block;
    max-width: 100%;
    width: 100%;
    background-color: #000;
    border-radius: 8px;
}

/* Custom overlay for better appearance */
.product-video-player::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* Allow clicks to pass through to the iframe */
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Hide duplicate play/pause buttons */
.product-video-player .ytp-chrome-bottom .ytp-button.ytp-play-button {
    opacity: 0.4;
}

/* Improve visibility of YouTube controls generally */
.product-video-player .ytp-chrome-bottom {
    opacity: 0.7;
}

.product-video-player:hover .ytp-chrome-bottom {
    opacity: 1;
}

/* Fix YouTube player UI to show only one button at a time */
.product-video-player .ytp-button[aria-label="Play (k)"] .ytp-play-button-text {
    display: none !important;
}

.product-video-player .ytp-button[aria-label="Pause (k)"] .ytp-play-button-text {
    display: none !important;
}

/* Default video aspect ratio (16:9) */
.product-video-player iframe.standard-video {
    aspect-ratio: 16/9;
}

/* Vertical video aspect ratio (9:16) for shorts */
.product-video-player iframe.short-video {
    aspect-ratio: 9/16;
    margin: 0 auto;
    max-height: 80vh;
    max-width: 450px;
    border-radius: 12px;
}

/* Vertical video aspect ratio (9:16) for shorts */
.product-video-player iframe.short-video {
    aspect-ratio: 9/16;
    margin: 0 auto;
    max-height: 80vh;
    max-width: 450px;
}

/* Video Playlist Container with Navigation */
.product-video-list-container {
    position: relative;
    margin: 0 auto;
    width: 100%;
}

/* Navigation Arrows */
.video-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    border: none;
    opacity: 0.7;
}

.video-nav-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

.video-nav-arrow.prev {
    left: 5px;
}

.video-nav-arrow.next {
    right: 5px;
}

.video-nav-arrow svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Hide arrows if not needed */
.no-scroll-needed .video-nav-arrow {
    display: none;
}

/* Video Playlist */
.product-video-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0 40px; /* Space for arrows */
}

/* Hide scrollbar but keep functionality */
.product-video-list::-webkit-scrollbar {
    height: 0px;
    background: transparent;
}

.product-video-list {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Video Item */
.product-video-item {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 200px;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    background-color: #fff;
    transition: all 0.3s ease;
}

.product-video-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-video-item-inner {
    display: flex;
    flex-direction: column;
}

.product-video-item-thumbnail {
    position: relative;
    overflow: hidden;
}

.product-video-item-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.product-video-item-title {
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

/* Active state */
.product-video-item.active {
    border-color: #0073aa;
    background-color: #f0f7fc;
}

/* Responsive */
@media (max-width: 767px) {
    .product-video-list {
        padding-bottom: 5px;
    }
    
    .product-video-item {
        min-width: 120px;
    }
    
    /* Ensure arrows are visible on mobile */
    .video-nav-arrow {
        width: 30px;
        height: 30px;
    }
    
    .video-nav-arrow svg {
        width: 20px;
        height: 20px;
    }
}