/* Scrolling Videos Section */
.scrolling-videos-section {
    padding: 20px 0 60px 0;
    background: #ffffff;
    overflow: hidden;
}

.scrolling-header {
    margin-bottom: 40px;
}

.marquee-container {
    display: flex;
    width: 100%;
    overflow: hidden;
    position: relative;
    /* Gradient masks for smooth fade */
    mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
}

.marquee-content {
    display: flex;
    gap: 0;
    /* Remove gap to eliminate white spaces */
    animation: scroll 60s linear infinite;
    padding: 20px 0;
    flex-shrink: 0;
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-33.333%);
        /* Move by exactly one third since we have 3 copies */
    }
}

.video-card-vertical {
    width: 200px;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0 8px;
    /* Add margin instead of gap for better control */
    background: #000;
    /* Black background to prevent white spaces */
}

.video-card-vertical:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    z-index: 10;
    border-color: rgba(139, 92, 246, 0.3);
}

.video-card-vertical video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    pointer-events: none;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.video-card-vertical:hover .video-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.video-tag {
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: auto;
    margin-top: 10px;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    opacity: 0;
    transition: all 0.3s ease;
}

.video-card-vertical:hover .play-icon-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Modal Styles */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.video-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    aspect-ratio: 9/16;
    background: black;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.video-modal-overlay.active .video-modal-content {
    transform: scale(1);
}

.video-modal-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .scrolling-videos-section {
        padding: 10px 0 40px 0;
    }

    .scrolling-header {
        margin-bottom: 24px;
        padding: 0 16px;
    }

    .scrolling-header h2 {
        font-size: 24px;
    }

    .scrolling-header p {
        font-size: 16px;
    }

    .marquee-content {
        animation-duration: 40s;
        /* Faster on mobile */
    }

    .video-card-vertical {
        width: 140px;
        height: 240px;
        margin: 0 6px;
    }

    .video-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
    }

    .play-icon-overlay {
        width: 48px;
        height: 48px;
    }

    .play-icon-overlay svg {
        width: 32px;
        height: 32px;
    }
}