/**
 * Product Video Popup Styles
 */

/* Action Buttons Group (Quick View + Video) */
.wowmart-product-action-buttons {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-flow: row wrap;
    gap: 3px;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Show buttons on hover */
li.product:hover .wowmart-pro-product-image-wrapper .wowmart-product-action-buttons {
    opacity: 1;
    visibility: visible;
}

/* Common Button Styles */
.wowmart-action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    font-size: 0;
}

.wowmart-action-btn:hover {
    background: #d32f2f;
    color: #ffffff;
    transform: scale(1.1);
}

.wowmart-action-btn svg {
    width: 20px;
    height: 20px;
}

/* Video Button Specific (play icon alignment) */
.wowmart-action-btn.wowmart-video-btn svg {
    margin-left: 2px; /* Align play icon better */
}

/* Video Popup Container */
.wowmart-video-popup {
    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;
}

.wowmart-video-popup.active {
    opacity: 1;
    visibility: visible;
}

/* Overlay */
.wowmart-video-popup .video-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

/* Video Container */
.wowmart-video-popup .video-popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 1000px;
    z-index: 10;
    transition: transform 0.3s ease;
    height: 90vh;
}

.wowmart-video-popup.active .video-popup-container {
    transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.wowmart-video-popup .video-popup-close {
    position: absolute;
    top: 0;
    right: -45px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    font-size: 0;
}

.wowmart-video-popup .video-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.wowmart-video-popup .video-popup-close svg {
    width: 20px;
    height: 20px;
}

/* Video Content */
.wowmart-video-popup .video-popup-content {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.wowmart-video-popup .video-popup-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading State */
.wowmart-video-popup .video-popup-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: videoPopupSpin 0.8s linear infinite;
}

.wowmart-video-popup .video-popup-content iframe[src] + ::before {
    display: none;
}

@keyframes videoPopupSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wowmart-video-popup .video-popup-container {
        width: 95%;
    }
    
    .wowmart-video-popup .video-popup-close {
        top: -45px;
        width: 36px;
        height: 36px;
    }
    
    .wowmart-pro-video-btn {
        width: 45px;
        height: 45px;
    }
    
    .wowmart-pro-video-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .wowmart-video-popup .video-popup-container {
        width: 100%;
        border-radius: 0;
    }
    
    .wowmart-video-popup .video-popup-content {
        border-radius: 0;
    }
    
    .wowmart-video-popup .video-popup-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.6);
    }
}

/* Disable body scroll when popup is open */
body.wowmart-video-popup-open {
    overflow: hidden;
}

/* Error message styling */
.video-error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    z-index: 10;
    max-width: 300px;
}

.video-error-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.video-error-message a {
    color: #ff4444;
    text-decoration: none;
}

.video-error-message a:hover {
    text-decoration: underline;
}
