/* Video Hover Preview Styles */

.video-preview-container {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-preview-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.video-preview-container a {
    position: relative;
    display: block;
    overflow: hidden;
}

/* Thumbnail Image */
.video-preview-container .item-thumb {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.video-preview-container:hover .item-thumb {
    opacity: 0;
}

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

.video-preview-container:hover .preview-video {
    opacity: 1;
}

.video-preview-container.playing .preview-video {
    display: block !important;
    opacity: 1;
}

/* Preview Overlay - Removed since play button is not needed */

/* Loading State - Simplified without overlay */
.video-preview-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 4;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State - Simplified */
.video-preview-container.error::after {
    content: '⚠️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 4;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .video-preview-container:hover {
        transform: none; /* Disable lift effect on mobile */
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .video-preview-container:hover .item-thumb {
        opacity: 1; /* Keep thumbnail visible on touch devices */
    }
    
    .video-preview-container:hover .preview-video {
        opacity: 0; /* Don't auto-play on touch */
    }
}

/* High Performance Mode */
.video-preview-container.performance-mode .preview-video {
    will-change: opacity;
}

.video-preview-container.performance-mode:hover {
    will-change: transform, box-shadow;
}

/* Accessibility */
.video-preview-container:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Duration Badge Enhancement */
.video-preview-container .time-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 4;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-preview-container:hover .time-duration {
    background: rgba(0, 0, 0, 0.9);
}

/* Smooth Transitions for Better UX */
.video-preview-container * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Preload Optimization */
.video-preview-container.preloaded .preview-video {
    display: block;
}

/* Quality Indicators */
.video-preview-container.hd::before {
    content: 'HD';
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 255, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    z-index: 4;
}

.video-preview-container.sd::before {
    content: 'SD';
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 170, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    z-index: 4;
}
