.carousel-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 60vh;
    min-height: 300px;
    max-height: 500px;
    margin: 20px auto;
    margin-top: 100px;
    overflow: hidden;
}

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

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Text overlay positioning */
.slide h1 {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
    z-index: 5;
}

.slide p {
    position: absolute;
    bottom: 60px;
    left: 20px;
    color: white;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    margin: 0;
    z-index: 5;
}

/* Alternative right-aligned text positioning */
.slide.text-right h1 {
    left: auto;
    right: 20px;
}

.slide.text-right p {
    left: auto;
    right: 20px;
}

/* Modern Slider Control Styles */
.slider-control {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(200px, 60%);
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    z-index: 10;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.slider-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: grab;
    z-index: 2;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.slider-thumb:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slider-thumb:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* Hide the old buttons */
.prev-button, .next-button {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel-container {
        height: 50vh;
        min-height: 250px;
        margin-top: 80px;
    }
    
    .slide h1 {
        bottom: 15px;
        left: 15px;
        right: 15px;
    }
    
    .slide p {
        bottom: 50px;
        left: 15px;
        right: 15px;
    }
    
    .slide.text-right h1 {
        left: 15px;
        right: 15px;
    }
    
    .slide.text-right p {
        left: 15px;
        right: 15px;
    }
    
    .slider-control {
        bottom: 15px;
        width: 80%;
    }
}

@media (max-width: 576px) {
    .carousel-container {
        height: 40vh;
        min-height: 200px;
        margin-top: 70px;
    }
    
    .slide h1 {
        font-size: 1.2rem;
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    .slide p {
        font-size: 0.8rem;
        bottom: 40px;
        left: 10px;
        right: 10px;
    }
    
    .slider-control {
        bottom: 10px;
        width: 90%;
        height: 4px;
    }
    
    .slider-thumb {
        width: 16px;
        height: 16px;
    }
}