/* Reusable Carousel Component Styles */

.carousel-container {
    margin: 2rem 0;
    max-width: 100%;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa; /* Light background to fill any gaps */
    min-height: 400px; /* Minimum height */
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    display: none;
    align-items: center; /* Center content vertically */
    justify-content: center; /* Center content horizontally */
}

.carousel-slide.active {
    display: flex; /* Use flex to properly center content */
}

.carousel-slide .placeholder {
    width: 100%;
    max-height: 800px;
    min-height: 400px;
    background: transparent; /* No background for image containers */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
}

/* Only show gradient background for actual text placeholders (no images) */
.carousel-slide .placeholder:not(:has(img)) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 600px;
}

.carousel-slide img {
    width: 100%;
    max-height: 800px; /* Max height instead of fixed */
    height: auto; /* Auto height to preserve aspect ratio */
    object-fit: contain; /* Contain to show full image without cropping */
    border-radius: 8px;
    display: block; /* Remove any inline spacing */
}

/* Video support for MP4 files */
.carousel-slide video {
    width: 100%;
    max-height: 800px; /* Max height instead of fixed */
    height: auto; /* Auto height to preserve aspect ratio */
    object-fit: contain; /* Contain to show full video without cropping */
    border-radius: 8px;
}

/* Square video styling - use object-fit: cover to fill space */
.carousel-slide.square-video video {
    object-fit: cover;
    object-position: center bottom;
    height: 800px;
}

.carousel-slide .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 3rem 2rem 1.5rem;
    font-size: 1rem;
    line-height: 1.4;
    border-radius: 0 0 8px 8px;
    transition: opacity 0.3s ease;
}

/* For video captions - make them semi-transparent and allow interaction */
.carousel-slide:has(video) .caption {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); /* More transparent */
    pointer-events: none; /* Allow clicks to pass through */
}

/* Hide caption temporarily when hovering over video to access controls */
.carousel-slide:has(video:hover) .caption {
    opacity: 0.3;
}

/* Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev {
    left: 1rem;
}

.carousel-btn-next {
    right: 1rem;
}

.carousel-btn span {
    margin-top: -2px; /* Adjust for visual centering */
}

/* Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #667eea;
    transform: scale(1.2);
}

.indicator:hover {
    background: #888;
}

/* Carousel Variants */
.carousel-container.carousel-small .carousel-slide .placeholder,
.carousel-container.carousel-small .carousel-slide img,
.carousel-container.carousel-small .carousel-slide video {
    height: 300px; /* Increased from 250px */
}

.carousel-container.carousel-large .carousel-slide .placeholder,
.carousel-container.carousel-large .carousel-slide img,
.carousel-container.carousel-large .carousel-slide video {
    height: 700px; /* Increased from 500px for extra large displays */
}

.carousel-container.carousel-wide {
    max-width: none;
    width: 100%;
}

/* Auto-height variant for different aspect ratios */
.carousel-container.carousel-auto-height .carousel-slide .placeholder,
.carousel-container.carousel-auto-height .carousel-slide img,
.carousel-container.carousel-auto-height .carousel-slide video {
    height: auto;
    min-height: 400px; /* Increased from 300px */
}

/* No captions variant */
.carousel-container.carousel-no-captions .carousel-slide .caption {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel-slide .placeholder,
    .carousel-slide img,
    .carousel-slide video {
        height: 350px; /* Increased from 300px for mobile */
        font-size: 1rem;
    }
    
    .carousel-container.carousel-small .carousel-slide .placeholder,
    .carousel-container.carousel-small .carousel-slide img,
    .carousel-container.carousel-small .carousel-slide video {
        height: 250px; /* Increased from 200px */
    }
    
    .carousel-container.carousel-large .carousel-slide .placeholder,
    .carousel-container.carousel-large .carousel-slide img,
    .carousel-container.carousel-large .carousel-slide video {
        height: 450px; /* Increased from 350px */
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .carousel-btn-prev {
        left: 0.5rem;
    }
    
    .carousel-btn-next {
        right: 0.5rem;
    }
    
    .carousel-slide .caption {
        font-size: 0.9rem;
        padding: 2rem 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .carousel-slide .placeholder,
    .carousel-slide img,
    .carousel-slide video {
        height: 280px; /* Increased from 250px */
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .carousel-slide .caption {
        font-size: 0.8rem;
        padding: 1.5rem 0.75rem 0.75rem;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
}