/**
 * Owleys Review Media Styles
 * 
 * Unified lightbox for photos and videos in reviews
 */

/* Video in review gallery (.revpics) */
.revpics .review-media-video,
.gallery .review-media-video {
    position: relative;
    display: inline-block;
}

.revpics .review-media-video video,
.gallery .review-media-video video {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
    display: block;
}

/* Play button overlay */
.review-media-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.review-media-play::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 12px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}

.review-media-video:hover .review-media-play {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Review photos strip (consolidated gallery above reviews) */
.review_photos .review-media-video,
.ugc-gallery .review-media-video {
    position: relative;
    display: inline-block;
}

.review_photos .review-media-video video,
.ugc-gallery .review-media-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review_photos .review-media-play,
.ugc-gallery .review-media-play {
    width: 28px;
    height: 28px;
}

.review_photos .review-media-play::after,
.ugc-gallery .review-media-play::after {
    border-width: 5px 0 5px 9px;
    margin-left: 2px;
}

/* ===== UNIFIED MEDIA LIGHTBOX ===== */
.owleys-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.owleys-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.owleys-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.owleys-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.owleys-lightbox-media {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.owleys-lightbox-media img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.owleys-lightbox-media video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 4px;
    background: #000;
}

/* Close button */
.owleys-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.owleys-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation arrows */
.owleys-lightbox-prev,
.owleys-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.owleys-lightbox-prev {
    left: 20px;
}

.owleys-lightbox-next {
    right: 20px;
}

.owleys-lightbox-prev:hover,
.owleys-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Custom arrows (not using parent theme icons) */
.lb-arrow {
    display: block;
    width: 12px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
}

.lb-arrow-left {
    transform: rotate(135deg);
    margin-left: 4px;
}

.lb-arrow-right {
    transform: rotate(-45deg);
    margin-right: 4px;
}

/* Counter */
.owleys-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}

/* Body lock when lightbox is open */
body.owleys-lightbox-open {
    overflow: hidden;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 767px) {
    /* Video thumbnails in reviews */
    .revpics .review-media-video video,
    .gallery .review-media-video video {
        width: 60px;
        height: 60px;
    }
    
    .review-media-play {
        width: 28px;
        height: 28px;
    }
    
    .review-media-play::after {
        border-width: 5px 0 5px 9px;
        margin-left: 2px;
    }
    
    /* .review_photos on mobile - same style as .ugc-gallery, show only 8 items */
    .review_photos {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
        position: relative;
    }
    
    .review_photos::-webkit-scrollbar {
        display: none;
    }
    
    .review_photos a {
        flex: 0 0 56px !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 8px;
        overflow: hidden;
        display: block;
    }
    
    /* Hide items after 8th on mobile */
    .review_photos a:nth-child(n+9) {
        display: none !important;
    }
    
    /* Show 8th item (for badge) */
    .review_photos a:nth-child(8) {
        display: block !important;
        position: relative;
    }
    
    .review_photos img,
    .review_photos video {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        display: block;
    }
    
    .review_photos .review-media-play {
        width: 22px;
        height: 22px;
    }
    
    .review_photos .review-media-play::after {
        border-width: 4px 0 4px 7px;
    }
    
    /* Mobile overflow badge for .review_photos */
    .review_photos .mobile-overflow-badge {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px;
        pointer-events: none;
    }
    
    /* Lightbox mobile adjustments */
    .owleys-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
    
    .owleys-lightbox-prev,
    .owleys-lightbox-next {
        width: 40px;
        height: 40px;
    }
    
    .owleys-lightbox-prev {
        left: 10px;
    }
    
    .owleys-lightbox-next {
        right: 10px;
    }
    
    .lb-arrow {
        width: 10px;
        height: 10px;
    }
    
    .owleys-lightbox-counter {
        bottom: 15px;
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .owleys-lightbox-media img,
    .owleys-lightbox-media video {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* Upload form video indicator */
.review-file-video {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.review-file-video::before {
    content: '';
    width: 16px;
    height: 16px;
    background: currentColor;
    mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 2v12h16V6H4m9 2.5l5 3.5-5 3.5v-7z"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 2v12h16V6H4m9 2.5l5 3.5-5 3.5v-7z"/></svg>') no-repeat center;
}

/* Feedback one - ensure video displays properly */
.feedback-one .gallery .review-media-video {
    display: inline-block;
    vertical-align: top;
}

.feedback-one .gallery video {
    border-radius: 8px;
}
