/**
 * Better Video Lazy Load - Styles
 * Version: 1.0.0
 */

.bvll-container {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
    background-color: #000;
    cursor: pointer;
    border-radius: 0;
}

.bvll-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 0;
}

.bvll-container:hover .bvll-thumbnail {
    opacity: 0.85;
    transform: scale(1.02);
}

.bvll-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.bvll-container:hover .bvll-play-button {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.bvll-play-button svg {
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* YouTube play button is already styled via SVG */
.bvll-play-button:not(.vimeo) svg path {
    transition: all 0.3s ease;
}

/* Vimeo play button hover effect */
.bvll-play-button.vimeo svg circle {
    transition: all 0.3s ease;
}

.bvll-container:hover .bvll-play-button.vimeo svg circle {
    fill: #1ab7ea;
}

/* Loading state */
.bvll-container.bvll-loading {
    cursor: wait;
}

.bvll-container.bvll-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bvll-spin 0.8s linear infinite;
    z-index: 20;
}

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

/* Loaded video iframe */
.bvll-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .bvll-container {
        margin: 15px 0;
    }
    
    .bvll-play-button svg {
        width: 56px;
        height: 56px;
    }
}

@media screen and (max-width: 480px) {
    .bvll-play-button svg {
        width: 48px;
        height: 48px;
    }
}

/* Accessibility improvements */
.bvll-container:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

.bvll-container:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure images render sharply */
.bvll-thumbnail {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Performance optimization */
.bvll-container {
    will-change: transform;
    transform: translateZ(0);
}
