/**
 * Templines Product Video Styles
 *
 * @package viasun
 */

/* Video background */
.templines-background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Video indicator */
.templines-video-indicator {
    position: absolute;
    top: 30px;
    left: 25px;
    width: 45px;
    height: 45px;
    background-color: #fff;
    border: 0;
    border-radius: 50%;
    display: flex
;
    align-items: center;
    justify-content: center;
    z-index: 5;
    color: #bfa0a0;
    font-size: 16px;
}

.templines-video-indicator .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Single product video indicator */
.templines-video-indicator.single-product {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.8); 
}

.templines-video-indicator.single-product .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #222;
}

/* Single product background video */
.templines-background-video.single-product {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Video Modal */
.templines-video-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
}

.templines-video-modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    top: 50%;
    transform: translateY(-50%);
}

.templines-video-modal-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.templines-video-modal-body iframe,
.templines-video-modal-body video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

.templines-video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.templines-video-modal-close:hover,
.templines-video-modal-close:focus {
    color: #999;
    text-decoration: none;
    cursor: pointer;
}

/* Image transition */
.static-image .in-img-wrap {
    position: relative;
    overflow: hidden;
}

.static-image .in-img-wrap img {
    transition: opacity 0.3s ease;
}

/* Video play icon */
.templines-video-play-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    transform: scale(0.8);
}

.templines-video-play-icon:before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #333;
    margin-left: 4px;
}

.product:hover .templines-video-play-icon {
    transform: scale(1);
}

/* Hover video container */
#templines-hover-video-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    overflow: hidden;
    pointer-events: none;
    border-radius: 4px;
}

#templines-hover-video-container iframe,
#templines-hover-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Debug styles */
#templines-video-debug {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
}

#templines-video-debug div {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#templines-video-debug div.error {
    color: #ff6b6b;
    font-weight: bold;
    background-color: rgba(255, 0, 0, 0.2);
    padding: 5px;
}

/* MOV video specific styles */
#templines-hover-video-container video[type="video/quicktime"] {
    object-fit: cover;
    background-color: #000;
}

/* Responsive styles */
@media (max-width: 767px) {
    .templines-video-play-icon {
        width: 40px;
        height: 40px;
    }
    
    .templines-video-play-icon:before {
        border-width: 8px 0 8px 14px;
    }
}
