/* Remove debug borders - comment out when debugging is done */
/*
.image-carousel-container {
    border: 3px dashed red !important;
}
.carousel-wrapper {
    border: 3px dashed orange !important;
}
.carousel-slides {
    border: 3px dashed green !important;
}
.carousel-slide {
    border: 3px dashed blue !important;
}
*/

.image-carousel-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 80vh; /* Use viewport height for better responsiveness */
    min-height: 500px; /* Ensure minimum height */
    max-height: 900px; /* Cap maximum height */
    overflow: hidden;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5; /* Light background for better contrast */
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 90%; /* Allow some margin on sides */
    max-height: 90%; /* Allow some margin on top/bottom */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3); /* Add shadow for depth */
}

.carousel-slide a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 30px 20px 20px;
    text-align: center;
}

.carousel-caption h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); /* Better text visibility */
}

.carousel-caption p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); /* Better text visibility */
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6); /* Slightly more opaque */
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border-radius: 4px; /* Consistent rounding */
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.05); /* Slight hover effect */
}

.carousel-prev {
    left: 15px; /* Moved slightly inward */
}

.carousel-next {
    right: 15px; /* Moved slightly inward */
}

.carousel-dots {
    text-align: center;
    padding: 20px;
    background: rgba(0,0,0,0.05); /* Subtle background */
}

.carousel-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3); /* Better contrast */
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.carousel-dot.active {
    background: #007cba; /* Nice blue accent */
    border-color: #005a87;
}

.carousel-dot:hover {
    background: #555;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .carousel-wrapper {
        height: 70vh; /* Use viewport height on mobile too */
        min-height: 400px;
        max-height: 600px;
    }
    
    .carousel-slide img {
        max-width: 95%; /* Even more space usage on mobile */
        max-height: 95%;
    }
    
    .carousel-caption {
        padding: 20px 15px 15px;
    }
    
    .carousel-caption h3 {
        font-size: 18px;
    }
    
    .carousel-caption p {
        font-size: 14px;
    }
    
    .carousel-prev,
    .carousel-next {
        padding: 10px 15px;
        font-size: 16px;
    }
}