/**
 * YouTube Lazy Load Styles
 * Stili per la preview e il pulsante play dei video YouTube
 */

.youtube-lazy-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background-color: #000;
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.youtube-lazy-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.youtube-lazy-preview:hover::before {
    background: rgba(0, 0, 0, 0.2);
}

.youtube-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    transition: all 0.3s ease;
    z-index: 2;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.youtube-lazy-preview:hover .youtube-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Assicura che il container abbia position relative */
.embed-responsive.youtube-lazy-container,
[class*="embed-responsive"].youtube-lazy-container {
    position: relative;
}

/* Fallback per immagini thumbnail che non si caricano */
.youtube-lazy-preview[style*="maxresdefault.jpg"] {
    background-image: url('https://img.youtube.com/vi/VIDEO_ID/hqdefault.jpg');
}

/* Loading state opzionale */
.youtube-lazy-preview.loading {
    opacity: 0.5;
}

/* Stato quando il video sta per essere caricato */
.youtube-lazy-preview.fading-out {
    opacity: 0;
    pointer-events: none;
}
