/* Zero-Flash Video Carousel CSS - Fixed */

/* Main carousel container */
.demo-video-carousel {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff; /* Changed from transparent to white */
}

.carousel-track {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    flex: 1 0 100%;
    position: relative;
}

/* Browser window styling */
.browser-window {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background-color: #ffffff;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1;
}

.browser-window.minimized {
    transform: scale(0.9);
    opacity: 0.7;
}

.browser-bar {
    height: 36px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    position: relative;
    z-index: 10; /* Keep controls above videos */
}

.window-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    z-index: 10;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 10;
}

.control.red { background-color: #ff5e58; }
.control.yellow { background-color: #ffbe2f; }
.control.green { background-color: #27c840; }

.browser-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
    z-index: 10;
}

/* Video container - Fixed with better responsive design */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #ffffff; /* White background to match browser window */
    overflow: hidden;
}

/* Videos - Fixed styling */
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the container */
}

/* Absolute video positioning for zero-flash transition */
.absolute-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    overflow: hidden;
    border-radius: 12px;
    background-color: #ffffff; /* Match browser window */
}

.absolute-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    overflow: hidden;
    background-color: #ffffff; /* Match browser window */
}

.absolute-video-wrapper[data-slide-index="0"] {
    opacity: 1;
    z-index: 2;
}

.absolute-video {
    width: auto; /* Allow width to adjust based on aspect ratio */
    height: auto; /* Allow height to adjust based on aspect ratio */
    max-width: 100%;
    max-height: 100%;
    object-fit: fill; /* Fill exactly without black bars */
}

/* Aspect ratio handling */
.video-aspect-ratio-fix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff; /* Match browser window */
}

.video-aspect-ratio-fix video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

/* Indicator dots */
.carousel-indicators {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 16px 0;
    margin-top: 5px;
    position: relative;
    z-index: 10; /* Keep indicators above videos */
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dddddd;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 10;
}

.indicator-dot:hover {
    background: #999999;
}

.indicator-dot.active {
    background: #11d31b; /* Keep green active state from new design */
    width: 10px;
    height: 10px;
}

/* Fixed responsive adjustments */
@media (max-width: 992px) {
    .carousel-container {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .demo-video-carousel {
        padding: 10px 0;
    }
    
    .carousel-container {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .browser-title {
        font-size: 12px;
        max-width: 60%;
    }
    
    /* Fix for video aspect ratio on tablets */
    .video-container {
        padding-bottom: 56.25%; /* Maintain 16:9 aspect ratio */
    }
}

@media (max-width: 480px) {
    .browser-bar {
        height: 30px;
        padding: 0 8px;
    }
    
    .control {
        width: 10px;
        height: 10px;
    }
    
    .browser-title {
        font-size: 10px;
        max-width: 50%;
    }
    
    /* Improved touch targets for mobile */
    .indicator-dot {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    
    .indicator-dot.active {
        width: 12px;
        height: 12px;
    }
    
    /* Consistent border radius on small screens */
    .browser-window {
        border-radius: 8px;
    }
    
    .browser-bar {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }
    
    /* Fix for smaller screens video display */
    .video-container {
        padding-bottom: 56.25%; /* Maintain aspect ratio */
    }
}

/* Fix for transitions and video fitting */
.carousel-track.transitioning {
    pointer-events: none; /* Prevent interaction during transition */
}
