/* General Slider Styles (kept here for display) */
.dynamic-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 600px;
    /* Adjust height as needed */
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dynamic-slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    flex-direction: column;
    text-align: center;
    pointer-events: none;
}

.dynamic-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.dynamic-slider-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dynamic-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s;
}

.dynamic-dot.active {
    background-color: #007bff;
    border-color: #007bff;
}

/* Specific styles for Content Slider (kept here for display) */
.content-slider-container {
    height: 500px;
    /* Taller for content */
    background-color: #f0f0f0;
    /* Background for content slider */
}

.content-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dark overlay for text readability */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.content-slide-overlay h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.content-slide-overlay p {
    font-size: 1.2em;
    max-width: 70%;
    margin-bottom: 20px;
}

.content-slide-overlay .cta-button {
    background-color: #28a745;
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.content-slide-overlay .cta-button:hover {
    background-color: #218838;
}

/* Admin link style */
.edit-link {
    display: block;
    text-align: center;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #f0ad4e;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    max-width: 200px;
    transition: background-color 0.3s;
}

.edit-link:hover {
    background-color: #ec971f;
}


/* Container for the entire slider section */
.continuous-slider-section {
    width: 100%;
    overflow: hidden; /* Hide overflowing content for the continuous effect */
    position: relative;
}

/* Main slider container - defines the visible window */
.slider-container {
    width: 100%;
    overflow: hidden; /* Crucial to hide images outside the view */
    white-space: nowrap; /* Keep all images on one line */
    position: relative;
    border-radius: 1rem; /* Rounded corners for the visible area */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    background-color: #fff;
}

/* The track that holds all the images and will be animated */
.slider-track {
    display: inline-flex; /* Use inline-flex to keep content on one line and allow flex properties */
    animation: slide-left 40s linear infinite; /* Adjust duration based on number/width of images */
    /* Pause animation on hover */
    animation-play-state: running;
    will-change: transform; /* Optimize for animation */
    align-items: center; /* Vertically align images */
}

.slider-track:hover {
    animation-play-state: paused;
}

/* Individual image items */
.slider-item {
    height: 250px; /* Fixed height for all images */
    margin: 0 0.5rem; /* Space between images */
    display: inline-block; /* Treat as inline block for white-space: nowrap */
    overflow: hidden; /* Ensure image doesn't overflow its own bounds */
    border-radius: 0.5rem; /* Rounded corners for individual images */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Very subtle shadow on images */
    flex-shrink: 0; /* Prevent images from shrinking */
}

.slider-item img {
    height: 100%; /* Make image fill the fixed height */
    width: auto; /* Allow width to vary based on aspect ratio */
    object-fit: cover; /* Crop image to fill the height, maintaining aspect ratio */
    object-position: center; /* Center the image within its frame */
    display: block; /* Remove extra space below image */
}

/* Loading spinner and text */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #3b82f6; /* Blue spinner */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-text {
    text-align: center;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Keyframe animation for continuous sliding */
@keyframes slide-left {
    0% {
        transform: translateX(0%);
    }
    100% {
        /* This value needs to be dynamically set by JS for perfect loop */
        /* For now, it's a placeholder. JS will adjust it based on content width */
        transform: translateX(-50%); /* Placeholder: will be adjusted by JS */
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
