/* ============================================================================
   Karusell Styling mit Swiper.js
   ============================================================================ */

/* Karusell Section */
.carousel-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Karusell Swiper Container */
.carousel-swiper {
    width: 100%;
    height: auto;
    min-height: 450px; /* Mindesthöhe für Karusell */
    padding-bottom: 50px; /* Platz für Pagination */
}

/* Carousel Item */
.carousel-item {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block !important; /* Fix: Swiper versteckt Slides */
}

.carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

/* Carousel Media (Bilder/Videos) */
.carousel-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video Placeholder */
.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Play Button */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.play-button i {
    margin-left: 3px; /* Optische Zentrierung */
}

/* Carousel Caption */
.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    color: white;
    padding: 30px 20px 20px;
    text-align: left;
}

.carousel-caption h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-caption p {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Swiper Navigation Buttons */
.carousel-swiper .swiper-button-prev,
.carousel-swiper .swiper-button-next {
    color: white;
    background: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.carousel-swiper .swiper-button-prev:hover,
.carousel-swiper .swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.carousel-swiper .swiper-button-prev::after,
.carousel-swiper .swiper-button-next::after {
    font-size: 20px;
}

/* Swiper Pagination */
.carousel-swiper .swiper-pagination {
    bottom: 10px;
}

.carousel-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: white;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.carousel-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: #007bff;
    width: 24px;
    border-radius: 5px;
}

/* ============================================================================
   Modal Styling
   ============================================================================ */

#carouselModal .modal-content {
    background: #1a1a1a;
    border: none;
    border-radius: 12px;
}

#carouselModal .modal-header {
    padding: 15px 20px;
}

#carouselModal .modal-body {
    padding: 0;
}

/* Modal Swiper */
.modal-swiper {
    width: 100%;
    height: auto;
}

/* Modal Media Container */
.modal-media-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Modal Media */
.modal-media {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Modal Description */
.modal-description {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.modal-description h2 {
    color: white;
    font-size: 1.75rem;
    font-weight: 600;
}

.modal-description p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
}

/* Modal Navigation */
.modal-swiper .swiper-button-prev,
.modal-swiper .swiper-button-next {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.modal-swiper .swiper-button-prev:hover,
.modal-swiper .swiper-button-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Modal Pagination */
.modal-swiper .swiper-pagination {
    bottom: 20px;
}

.modal-swiper .swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
}

.modal-swiper .swiper-pagination-bullet-active {
    opacity: 1;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

/* Tablet */
@media (max-width: 768px) {
    .carousel-item {
        height: 300px;
    }
    
    .carousel-caption h3 {
        font-size: 1.25rem;
    }
    
    .carousel-caption p {
        font-size: 0.875rem;
    }
    
    .play-button {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .modal-media {
        max-height: 60vh;
    }
    
    .modal-description h2 {
        font-size: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .carousel-section {
        padding: 10px 0;
    }
    
    .carousel-item {
        height: 250px;
        border-radius: 8px;
    }
    
    .carousel-caption {
        padding: 20px 15px 15px;
    }
    
    .carousel-caption h3 {
        font-size: 1.1rem;
    }
    
    .carousel-caption p {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .play-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .carousel-swiper .swiper-button-prev,
    .carousel-swiper .swiper-button-next {
        width: 36px;
        height: 36px;
    }
    
    .carousel-swiper .swiper-button-prev::after,
    .carousel-swiper .swiper-button-next::after {
        font-size: 16px;
    }
    
    .modal-media {
        max-height: 50vh;
    }
    
    .modal-description {
        padding: 15px;
    }
    
    .modal-description h2 {
        font-size: 1.25rem;
    }
    
    .modal-description p {
        font-size: 0.9rem;
    }
    
    .modal-swiper .swiper-button-prev,
    .modal-swiper .swiper-button-next {
        width: 40px;
        height: 40px;
    }
}

/* ============================================================================
   Loading States
   ============================================================================ */

.carousel-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================================================
   Accessibility
   ============================================================================ */

.carousel-item:focus,
.play-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .carousel-item,
    .play-button,
    .swiper-button-prev,
    .swiper-button-next {
        transition: none;
    }
    
    @keyframes loading {
        0%, 100% {
            background-position: 0 0;
        }
    }
}