/**
 * Video Product Cards - Live Preview Animations
 * Uses captured WebM videos for each product
 */

/* Product Card Video Container */
.product-card .product-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Video Element */
.product-card .product-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.product-card:hover .product-video {
    opacity: 1;
    transform: scale(1.05);
}

/* Fallback Image (shows before video loads) */
.product-card .product-preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.product-card:hover .product-preview-image {
    opacity: 0;
    transform: scale(1.05);
}

/* Hide old animated placeholders */
.product-card .animated-placeholder {
    display: none !important;
}

.product-card .animated-image-container .animated-placeholder {
    display: none !important;
}

/* Gradient Overlay */
.product-card .video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%, 
        rgba(0, 0, 0, 0.5) 40%,
        transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* Product Specific Glows */
.product-card.operator .product-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, 
        rgba(102, 126, 234, 0.15) 0%, 
        transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: pulseGlow 4s ease-in-out infinite;
}

.product-card.coder .product-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, 
        rgba(0, 191, 166, 0.15) 0%, 
        transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: pulseGlow 4s ease-in-out infinite 1s;
}

.product-card.market .product-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, 
        rgba(255, 107, 107, 0.15) 0%, 
        transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: pulseGlow 4s ease-in-out infinite 2s;
}

.product-card.agent .product-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, 
        rgba(240, 147, 251, 0.15) 0%, 
        transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: pulseGlow 4s ease-in-out infinite 3s;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Loading State */
.product-card .video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card .video-loading.active {
    opacity: 1;
}

.product-card .video-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color, #667eea);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Play Button Hint */
.product-card .play-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.product-card:hover .play-hint {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.product-card .play-hint i {
    color: white;
    font-size: 20px;
    margin-left: 4px; /* Optical centering for play icon */
}

/* Live Badge */
.product-card .live-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 15;
    font-size: 12px;
    color: white;
    font-weight: 600;
}

.product-card .live-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 4px rgba(0, 255, 136, 0);
    }
}

/* Corner Shine Effect */
.product-card .corner-shine {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.15) 0%, 
        transparent 70%);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .corner-shine {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .product-card .product-image {
        height: 200px;
    }
    
    .product-card .play-hint {
        width: 50px;
        height: 50px;
    }
    
    .product-card .play-hint i {
        font-size: 16px;
    }
}
