/**
 * Product Gallery Video Styles
 * 
 * Styles for video slides in the product gallery
 * Works with existing .custom-product-gallery structure
 */

/* Video slide specific styles */
.fp-slide-video {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 80vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.fp-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* Video overlay controls */
.fp-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.fp-video-container:hover .fp-video-overlay {
    opacity: 1;
}

.fp-video-play-pause {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
}

.fp-video-play-pause:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.fp-pause-icon {
    display: none;
}

.fp-video-element[data-playing="true"]+.fp-video-overlay .fp-play-icon {
    display: none;
}

.fp-video-element[data-playing="true"]+.fp-video-overlay .fp-pause-icon {
    display: inline;
}

/* Play badge for video slides */
.fp-play-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.fp-play-badge::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 10px solid #fff;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    margin-left: 2px;
}

/* Video thumbnail styles */
.fp-thumb-video {
    position: relative;
}

.fp-thumb-video .fp-thumb-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.fp-thumb-img--no-poster {
    width: 100%;
    height: 72px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

.fp-thumb-img--no-poster::before {
    content: "Video";
}

.fp-thumb-video .fp-play-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.fp-thumb-video .fp-play-badge::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid #fff;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-left: 1px;
}

/* PhotoSwipe video container */
.fp-pswp-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-pswp-video iframe,
.fp-pswp-video video {
    width: 100%;
    height: 100%;
    max-width: 90vw;
    max-height: 80vh;
    border: none;
}

/* Fallback modal styles */
.fp-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fp-lightbox-modal img,
.fp-lightbox-modal video {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.fp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.fp-modal-close:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fp-play-badge {
        width: 24px;
        height: 24px;
        bottom: 6px;
        left: 6px;
    }

    .fp-play-badge::after {
        border-left: 8px solid #fff;
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
    }

    .fp-thumb-video .fp-play-badge {
        width: 18px;
        height: 18px;
        bottom: 3px;
        left: 3px;
    }

    .fp-thumb-video .fp-play-badge::after {
        border-left: 5px solid #fff;
        border-top: 3px solid transparent;
        border-bottom: 3px solid transparent;
    }
}

/* Ensure video slides work with existing gallery styles */
.custom-product-gallery .fp-slide-video {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-product-gallery .fp-slide-video img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

/* Hover effects for video slides */
.fp-slide-video:hover .fp-play-badge {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.fp-thumb-video:hover .fp-play-badge {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    transition: all 0.2s ease;
}