/* ========================================
   IMAGE CAROUSEL COMPONENT STYLES
   ======================================== */

.image-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: transparent;
    margin: 0;
    padding: 0;
}

.carousel-container {
    display: flex;
    animation: scrollLeft 40s linear infinite;
    width: fit-content;
    gap: 0; /* Keine Abstände zwischen den Bildern */
}

.carousel-item {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
    position: relative;
    display: block;
}

.carousel-item:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.carousel-item img {
    display: block;
    height: 200px; /* Standardhöhe - kann angepasst werden */
    width: auto;
    object-fit: cover;
    border: none;
    outline: none;
}

/* Verschiedene Höhen für unterschiedliche Carousel-Varianten */
.image-carousel.carousel-small .carousel-item img {
    height: 150px;
}

.image-carousel.carousel-medium .carousel-item img {
    height: 200px;
}

.image-carousel.carousel-large .carousel-item img {
    height: 250px;
}

.image-carousel.carousel-xl .carousel-item img {
    height: 300px;
}

/* Animation pausieren bei Hover */
.image-carousel:hover .carousel-container {
    animation-play-state: paused;
}

/* Dragging-Zustand */
.carousel-container.dragging {
    animation: none !important;
    cursor: grabbing;
    user-select: none;
}

.carousel-container:not(.dragging) {
    cursor: grab;
}

/* Scroll-Animation von rechts nach links */
@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Langsamere Animation Variante */
.image-carousel.carousel-slow .carousel-container {
    animation-duration: 60s;
}

/* Schnellere Animation Variante */
.image-carousel.carousel-fast .carousel-container {
    animation-duration: 20s;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .carousel-item img {
        height: 120px;
    }
    
    .image-carousel.carousel-small .carousel-item img {
        height: 100px;
    }
    
    .image-carousel.carousel-medium .carousel-item img {
        height: 120px;
    }
    
    .image-carousel.carousel-large .carousel-item img {
        height: 150px;
    }
    
    .image-carousel.carousel-xl .carousel-item img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .carousel-item img {
        height: 100px;
    }
    
    .image-carousel.carousel-large .carousel-item img,
    .image-carousel.carousel-xl .carousel-item img {
        height: 120px;
    }
}

/* Loading State */
.carousel-item.loading {
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item.loading::after {
    content: "Lädt...";
    color: #999;
    font-size: 12px;
}

/* Accessibility */
.carousel-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .carousel-container {
        animation-duration: 120s; /* Langsamere Animation für Nutzer mit reduzierten Bewegungen */
    }
    
    .carousel-item:hover {
        transform: none; /* Kein Hover-Effekt */
    }
}

/* Touch-optimiert für mobile Geräte */
@media (hover: none) and (pointer: coarse) {
    .carousel-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .carousel-item:active {
        transform: scale(0.98);
    }
}