/* Video Carousel Component Styles */
.video-carousel-section {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px 0 30px 0;
    margin-top: 0;
}

.video-carousel-header {
    text-align: center;
    margin-bottom: 20px;
}

.video-carousel-header p {
    color: #666;
    font-size: 1.2rem;
    margin: 0;
}

.carousel-container {
    position: relative;
    overflow: hidden;
}

.carousel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    height: 600px;
}

.carousel-track {
    display: flex;
    gap: 20px;
    padding: 0 40px;
    scroll-behavior: smooth;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    height: 100%;
    align-items: center;
    scrollbar-width: thin;
    scrollbar-color: #860c7e rgba(134, 12, 126, 0.2);
    -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
    height: 8px;
}

.carousel-track::-webkit-scrollbar-track {
    background: rgba(134, 12, 126, 0.1);
}

.carousel-track::-webkit-scrollbar-thumb {
    background: #860c7e;
    border-radius: 4px;
}

.video-card {
    flex: 0 0 auto;
    width: 300px;
    height: 533px;
    background-color: #f8f8f8;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;  /* Changed from default to pointer to indicate interactivity */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    pointer-events: auto;  /* Ensure pointer events are enabled */
}

.video-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(134, 12, 126, 0.3);
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #000;
    overflow: hidden;
}

/* Show first frame while loading */
.video-card .vjs-poster {
    background-size: cover;
    background-position: center;
}

/* Ensure video is visible and fills container */
.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

/* Hide all native video controls */
video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
}

video::-webkit-media-controls-panel {
    display: none !important;
}

video::-webkit-media-controls-play-button {
    display: none !important;
}

video::-moz-media-controls {
    display: none !important;
}

video::-ms-media-controls {
    display: none !important;
}



/* Navigation buttons */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(134, 12, 126, 0.8);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover {
    background-color: #860c7e;
}

.nav-button.prev {
    left: 10px;
}

.nav-button.next {
    right: 10px;
}

.nav-button::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-left: 3px solid white;
    border-bottom: 3px solid white;
    transform: rotate(45deg);
}

.nav-button.next::before {
    transform: rotate(-135deg);
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 1.5em;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .video-carousel-section {
        padding: 15px 0 20px 0;
    }
    
    .video-carousel-header {
        margin-bottom: 15px;
    }
    
    .video-carousel-header p {
        font-size: 1rem;
    }
    
    .carousel-wrapper {
        height: 550px;
    }
    
    .video-card {
        width: 280px;
        height: 498px;
    }
    
    .carousel-track {
        padding: 0 15px;
        gap: 12px;
        scroll-snap-type: x mandatory;
    }
    
    .video-card {
        scroll-snap-align: center;
    }
    
    /* Keep nav buttons visible on mobile */
    .nav-button {
        width: 40px;
        height: 40px;
        background-color: rgba(134, 12, 126, 0.95);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .nav-button.prev {
        left: 5px;
    }
    
    .nav-button.next {
        right: 5px;
    }
    
    .nav-button::before {
        width: 10px;
        height: 10px;
        border-width: 2px;
    }
    
    .carousel-track {
        padding: 0 50px; /* Make room for nav buttons */
    }
}

@media (max-width: 480px) {
    .video-carousel-section {
        padding: 10px 0 15px 0;
    }
    
    .video-carousel-header {
        margin-bottom: 10px;
    }
    
    .video-carousel-header p {
        font-size: 0.9rem;
        padding: 0 15px;
    }
    
    .carousel-wrapper {
        height: 500px;
    }
    
    .video-card {
        width: 70vw;
        height: calc(70vw * 1.778); /* 16:9 aspect ratio */
        max-width: 280px;
        max-height: 498px;
    }
    
    .carousel-track {
        padding: 0 10px;
        gap: 10px;
        scroll-snap-type: x mandatory;
    }
    
    .video-card {
        scroll-snap-align: center;
    }
}
/* Gradient overlay at bottom for better button visibility */
.video-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .video-container::after {
    opacity: 1;
}

/* Custom play button overlay */
.custom-play-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-play-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-play-btn svg {
    width: 24px;
    height: 24px;
    filter: none;
}

.custom-play-btn svg path,
.custom-play-btn svg rect {
    fill: #333;
}

/* Adjust play icon position to center it better */
.custom-play-btn .play-icon path {
    transform: translate(1px, 0);
}

/* Hide pause button when video is playing and not hovering */
.video-card:not(:hover) .custom-play-btn[data-state="playing"] {
    opacity: 0;
    pointer-events: none;
}

/* Always show play/pause button on hover */
.video-card:hover .custom-play-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Video.js specific styles for carousel and cards */
.video-card .video-js,
.ratio .video-js {
    width: 100% \!important;
    height: 100% \!important;
    position: absolute \!important;
    top: 0 \!important;
    left: 0 \!important;
}

/* Ensure Video.js fills the container properly */
.ratio .vjs-tech {
    object-fit: cover;
}

/* Hide Video.js big play button since we have custom one */
.video-card .vjs-big-play-button,
.ratio .vjs-big-play-button {
    display: none \!important;
}

/* Show controls on hover */
.video-card .vjs-control-bar,
.ratio .vjs-control-bar {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .vjs-control-bar,
.video-card .vjs-playing .vjs-control-bar,
.ratio:hover .vjs-control-bar,
.ratio .vjs-playing .vjs-control-bar {
    opacity: 1;
}

/* Apply gradient overlay to card videos for better button visibility */
.ratio .video-container::after,
.ratio > div:first-child::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.ratio:hover .video-container::after,
.ratio:hover > div:first-child::after {
    opacity: 1;
}

/* Ensure play button appears above gradient and in correct position for cards */
.ratio .custom-play-btn {
    z-index: 10;
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
}
