/* YouTube Carousel Styles */
.ywc-youtube-carousel {
    position: relative;
    max-width: 100%;
    margin: 40px 0;
}

.carousel-container {
    display: flex;
    transition: transform 0.3s ease;
    gap: 20px;
}

.video-slide {
    flex: 0 0 calc(33.333% - 14px);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.video-slide:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

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

.video-slide:hover .video-thumbnail img {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease;
    z-index: 2;
}

.video-slide:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.video-info {
    padding: 20px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.4;
}

.video-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color, rgba(0,0,0,0.7));
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 3;
}

.carousel-nav:hover {
    background: var(--accent-color, rgba(0,0,0,0.9));
    opacity: 0.8;
}

.carousel-nav.prev {
    left: -25px;
}

.carousel-nav.next {
    right: -25px;
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.modal-close:hover {
    opacity: 0.7;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Stili per le diverse card */
.ywc-youtube-carousel.card-classic .video-slide {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ywc-youtube-carousel.card-modern .video-slide {
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.ywc-youtube-carousel.card-minimal .video-slide {
    border-radius: 0;
    box-shadow: none;
    border-bottom: 3px solid transparent;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.ywc-youtube-carousel.card-minimal .video-slide:hover {
    border-bottom-color: var(--accent-color, #ff6b35);
    transform: none;
}

/* Messaggio nessun video */
.ywc-no-videos {
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    margin: 20px 0;
}

.ywc-no-videos p {
    color: #6c757d;
    margin: 0;
    font-style: italic;
    font-size: 16px;
}

/* Autoplay indicators */
.ywc-youtube-carousel[data-autoplay="yes"] .carousel-nav {
    opacity: 0.6;
}

.ywc-youtube-carousel[data-autoplay="yes"]:hover .carousel-nav {
    opacity: 1;
}

/* Loading state */
.video-slide.loading .video-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .video-slide {
        flex: 0 0 calc(50% - 10px);
    }
    
    .carousel-nav.prev {
        left: -20px;
    }
    
    .carousel-nav.next {
        right: -20px;
    }
}

@media (max-width: 768px) {
    .video-slide {
        flex: 0 0 calc(50% - 10px);
    }
    
    .carousel-nav {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .carousel-nav.prev {
        left: -15px;
    }
    
    .carousel-nav.next {
        right: -15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .video-info {
        padding: 15px;
    }
    
    .video-title {
        font-size: 14px;
    }
    
    .video-description {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .video-slide {
        flex: 0 0 calc(100% - 20px);
    }
    
    .carousel-nav.prev {
        left: -10px;
    }
    
    .carousel-nav.next {
        right: -10px;
    }
    
    .play-button svg {
        width: 50px;
        height: 50px;
    }
    
    .ywc-youtube-carousel {
        margin: 20px 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.video-slide {
    animation: slideIn 0.5s ease forwards;
}

/* Focus states for accessibility */
.video-slide:focus,
.carousel-nav:focus,
.modal-close:focus {
    outline: 2px solid var(--accent-color, #ff6b35);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .video-slide {
        border: 2px solid #000;
    }
    
    .carousel-nav {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .video-slide,
    .carousel-nav,
    .play-button,
    .carousel-container {
        transition: none;
    }
    
    .video-slide:hover {
        transform: none;
    }
    
    .video-slide:hover .play-button {
        transform: translate(-50%, -50%);
    }
}
