/* Image Carousel Block - Frontend Styles */
.hydrology-image-posts-carousel-block {
    position: relative;
    width: 100%;
    min-height: 400px;
    height: 400px;
    overflow: hidden;
    background: #000;
}

/* Full width alignment support */
.alignfull .hydrology-image-posts-carousel-block {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

.alignwide .hydrology-image-posts-carousel-block {
    margin-left: calc(25% - 25vw);
    margin-right: calc(25% - 25vw);
    width: 50vw;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.carousel-track.fade-transition {
    transition: opacity 0.5s ease-in-out;
}

/* Carousel Slides */
.carousel-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fade transition specific styles */
.fade-transition .carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.fade-transition .carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:focus {
    outline: 2px solid var(--color-green);
    outline-offset: 2px;
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-nav:disabled:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1);
}

/* Navigation Dots */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: white;
    border-color: white;
    transform: scale(1.3);
}

.carousel-dot:focus {
    outline: 2px solid var(--color-green);
    outline-offset: 2px;
}

/* Loading State */
.carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: rgba(39, 102, 123, 0.1);
    color: var(--color-medium-blue);
    font-size: 1.1rem;
}

/* No Images State */
.carousel-no-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: rgba(221, 235, 157, 0.1);
    color: var(--color-medium-blue);
    text-align: center;
    padding: 2rem;
}

.carousel-no-images .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Pause/Play Indicator */
.carousel-play-pause {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.hydrology-image-posts-carousel-block:hover .carousel-play-pause {
    opacity: 1;
}

.carousel-play-pause:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Accessibility */
.carousel-slide img[alt=""] {
    alt: "Carousel image";
}

/* Responsive Design */
@media (max-width: 768px) {
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .carousel-nav.prev {
        left: 10px;
    }
    
    .carousel-nav.next {
        right: 10px;
    }
    
    .carousel-dots {
        bottom: 15px;
        gap: 8px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
    
    .carousel-play-pause {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .carousel-dots {
        bottom: 10px;
        gap: 6px;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
}

/* Animation for slide transitions */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Custom height support */
.hydrology-image-posts-carousel-block[style*="height"] {
    height: inherit !important;
}

.hydrology-image-posts-carousel-block[style*="height"] .carousel-container,
.hydrology-image-posts-carousel-block[style*="height"] .carousel-track,
.hydrology-image-posts-carousel-block[style*="height"] .carousel-slide {
    height: inherit !important;
}

/* Large screens - bigger default height */
@media (min-width: 1200px) {
    .hydrology-image-posts-carousel-block {
        height: 500px;
        min-height: 500px;
    }
    
    .carousel-container,
    .carousel-track,
    .carousel-slide {
        min-height: 500px;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .carousel-track,
    .carousel-nav,
    .carousel-dot,
    .fade-transition .carousel-slide {
        transition: none;
    }
}