/* 1. Main container hides the overflow */
.custom-video-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 40px 0; 
    background: transparent;
}

/* 2. The track holds everything and animates infinitely */
.cvc-track {
    display: flex;
    width: max-content;
    animation: cvc-scroll 35s linear infinite; 
}

/* Instantly freeze the entire track on hover */
.cvc-track:hover {
    animation-play-state: paused;
}

/* Jab track par hover ho, toh SAB cards ko gray aur thora dim kar do */
.cvc-track:hover .cvc-card {
    filter: grayscale(100%) brightness(0.6);
}

/* 3. The group ensures perfect math for the infinite loop */
.cvc-group {
    display: flex;
    gap: 20px; /* Space between slides */
    padding-right: 20px;
}

/* 4. The individual video cards */
.cvc-card {
    width: calc(20vw - 20px); 
    min-width: 240px; 
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transform: scale(1);
    /* Added 'filter' to the transition for smooth gray effect */
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease; 
    z-index: 1;
    filter: grayscale(0%) brightness(1); /* Default state */
}

/* INCREASED SCALE, SHADOW, AND REMOVE GRAYSCALE ON HOVER */
.cvc-track .cvc-card:hover {
    transform: scale(1.08); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); 
    z-index: 20; 
    filter: grayscale(0%) brightness(1); /* Wapis original color mein lay aao */
}

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

/* ENABLE CONTROLS INTERACTION ON HOVER */
.cvc-card:hover video {
    pointer-events: auto; 
}

/* PLAY BUTTON INDICATOR */
.play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; 
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* The Play Triangle */
.play-indicator::after {
    content: '';
    border-style: solid;
    border-width: 12px 0 12px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 6px; 
}

/* Hide play indicator when hovering */
.cvc-card:hover .play-indicator {
    opacity: 0;
}

/* 5. The seamless loop animation */
@keyframes cvc-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}

/* RESPONSIVE LAYOUTS */
@media (max-width: 1024px) {
    .cvc-card { 
        width: calc(25vw - 20px); 
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .cvc-card { 
        width: 75vw; 
        min-width: 260px;
    }
    .play-indicator {
        width: 50px;
        height: 50px;
    }
    .play-indicator::after {
        border-width: 10px 0 10px 15px;
        margin-left: 5px;
    }
}
