/**
 * =====================================================
 * CAROUSEL COMPONENT STYLES
 * =====================================================
 * Modern carousel with video support
 * Nutzt das zentrale Design-System (design-system.css)
 * =====================================================
 */

/* Carousel Wrapper */
.carousel-wrapper {
    width: 100%;
    background-color: var(--background-beige);
    padding: 60px 0;
}

.carousel-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Base Carousel Styling */
.carousel-component .carousel-inner {
    height: 600px;
}

.carousel-component .carousel-item {
    height: 600px;
}

.carousel-component .carousel-item img {
    width: 100%;
    height: 600px;
    object-fit: cover;
}

/* Custom height support via data attribute */
.carousel-component[data-height] .carousel-inner,
.carousel-component[data-height] .carousel-item,
.carousel-component[data-height] .carousel-item img {
    height: var(--carousel-height, 600px);
}

/* Video Thumbnail Styling */
.carousel-item .video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.3s ease;
    z-index: 10;
}

.video-thumbnail-wrapper:hover .video-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-thumbnail-text {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: var(--font-size-overlay);
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    z-index: 9;
}

/* Video Modal Styling */
.video-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.video-modal.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.video-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-content video {
    max-width: 90%;
    max-height: 80vh;
    width: auto;
    height: 80vh;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.video-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: var(--text-white);
    font-size: var(--font-size-overlay);
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.video-close:hover,
.video-close:focus {
    color: var(--secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .carousel-wrapper {
        padding: 35px 0;
    }

    .carousel-container {
        padding: 0;
    }

    .carousel-component .carousel-inner,
    .carousel-component[data-height] .carousel-inner {
        height: 250px;
    }

    .carousel-component .carousel-item,
    .carousel-component[data-height] .carousel-item {
        height: 250px;
    }

    .carousel-component .carousel-item img,
    .carousel-component[data-height] .carousel-item img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    .carousel-item .video-thumbnail-wrapper {
        height: 250px;
    }

    .carousel-item .video-thumbnail-wrapper img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    .carousel-component .carousel-control-prev-icon,
    .carousel-component .carousel-control-next-icon {
        width: 30px;
        height: 30px;
    }

    .video-thumbnail-text {
        font-size: var(--font-size-overlay);
        top: 30%;
    }

    .video-play-button svg {
        width: 60px;
        height: 60px;
    }

    .video-modal-content video {
        max-width: 95%;
        max-height: 70vh;
        height: auto;
    }

    .video-close {
        top: 10px;
        right: 15px;
        font-size: var(--font-size-overlay);
    }
}

@media (max-width: 480px) {
    .carousel-wrapper {
        padding: 30px 0;
    }

    .carousel-component .carousel-inner,
    .carousel-component[data-height] .carousel-inner {
        height: 250px;
    }

    .carousel-component .carousel-item,
    .carousel-component[data-height] .carousel-item {
        height: 250px;
    }

    .carousel-component .carousel-item img,
    .carousel-component[data-height] .carousel-item img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    .carousel-item .video-thumbnail-wrapper {
        height: 250px;
    }

    .carousel-item .video-thumbnail-wrapper img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    .carousel-component .carousel-control-prev-icon,
    .carousel-component .carousel-control-next-icon {
        width: 25px;
        height: 25px;
    }

    .video-thumbnail-text {
        font-size: var(--font-size-overlay);
        top: 30%;
    }

    .video-play-button svg {
        width: 50px;
        height: 50px;
    }
}

/* Accessibility */
.video-thumbnail-wrapper:focus {
    outline: none;
}

.video-thumbnail-wrapper:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Smooth transitions */
.carousel-item {
    transition: transform 0.6s ease-in-out;
}

/* Loading state */
.video-modal-content video:not([src]) {
    background: #000;
}
