/* YouTube Slider Styles */
.youtube-slider-container {
    width: 100%;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    padding-bottom: 40px; /* Extra space for indicators */
}

.youtube-slider {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
    padding: 20px 0;
}

.youtube-slide {
    cursor: pointer;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.youtube-slide:hover {
    transform: translateY(-8px);
}

/* Desktop - 3 videos */
.youtube-card {
    position: relative;
    width: 550px;
    height: 343px;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.youtube-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.youtube-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.youtube-card:hover img {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 49px;
    height: 35px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 21%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.youtube-card:hover .play-button {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Modal Styles */
.youtube-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.youtube-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-modal-content {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.youtube-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.youtube-close:hover {
    background: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

#youtube-player {
    width: 80vw;
    height: 45vw;
    max-width: 1200px;
    max-height: 675px;
    min-width: 320px;
    min-height: 180px;
}

#youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
/* Tablet - 2 videos */
@media (max-width: 1024px) and (min-width: 769px) {
    .youtube-card {
        width: calc((100vw - 80px) / 2);
        max-width: 450px;
        min-width: 300px;
        height: auto;
        padding-bottom: 56.25%;
    }
    
    .youtube-card img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .youtube-slider {
        gap: 15px;
        padding: 15px 0 25px 0;
    }
    
    .youtube-slider-container {
        padding-bottom: 50px;
    }
    
    .youtube-card {
        width: calc(100vw - 60px);
        max-width: 500px;
        min-width: 280px;
        height: auto;
        padding-bottom: 56.25%;
    }
    
    .youtube-card img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    #youtube-player {
        width: 95vw;
        height: 53vw;
        min-width: 280px;
        min-height: 157px;
    }
    
    .youtube-close {
        top: -35px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
    
    .slider-indicators {
        bottom: 0;
        margin-top: 25px;
    }
}

@media (max-width: 480px) {
    .youtube-slider {
        gap: 10px;
        padding: 15px 0 30px 0;
    }
    
    .youtube-slider-container {
        padding-bottom: 55px;
    }
    
    .youtube-card {
        width: calc(100vw - 40px);
        min-width: 250px;
        height: auto;
        padding-bottom: 56.25%;
    }
    
    .youtube-card img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .slider-indicators {
        bottom: 5px;
    }
}

/* Loading animation */
.youtube-slide.loading .youtube-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading 1.5s infinite;
    z-index: 1;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Auto-slide indicators */
.slider-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.slider-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background 0.3s ease;
}

.slider-indicator.active {
    background: #ff0000;
}

/* Pause on hover */
.youtube-slider-container:hover .youtube-slider {
    animation-play-state: paused;
}

/* Hide indicators on desktop */
@media (min-width: 768px) {
    .slider-indicators {
        display: none !important;
    }
}