

/* Basiseinstellungen */
:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --primary-color: #4a6fa5;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

/* Reset für Box-Modell und Standardabstände */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    padding: 0; /* Kein Padding für den Body */
}

/* Header */
.header {
    background-image: url('header/Fruehstueck_Header_schwarz_gelb_zweige.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    width: 100vw;
    top: 0;
    left: 0;
    height: 200px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition:
        transform 1s ease-in,
        opacity 1s ease-out;
    opacity: 1;
    transform: translateY(0);
}

/* Header wird nach oben verschoben und ausgeblendet */
.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

main {
    margin-top: 200px; /* Abstand für den Header */
    padding: 2rem 1rem 0; /* Abstand oben: 2rem, links/rechts: 1rem, unten: 0 */
    max-width: 1400px; /* Optionale Begrenzung der Breite */
    margin: 0 auto;
    display: flex;
    flex-direction: column; /* Ermöglicht flexible Anordnung der Kinder-Elemente */
    align-items: center; /* Zentriert alle Kinder-Elemente horizontal */
}

/* Der Text und andere interaktive Elemente im Header */
.header-image h1 {
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    font-size: clamp(1.2rem, 4vw, 2rem);
    margin: 0;
    padding: 0 20px;
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
}

/* Hauptvideo-Bereich */
.main-video-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 2rem; /* Zentriert den Container */
    padding: 0; /* Kein zusätzlicher Padding */
}

.main-video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio (für HD-Videos) */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin: 0 auto; /* Zentriert den Wrapper */
}

.main-video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: opacity 0.5s ease;
}

/* Vollbildbutton */
.icon-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.icon-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Thumbnail-Galerie */
.thumbnail-gallery {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 1rem 2rem;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto; /* Zentriert die Galerie */
}

.thumbnail-item {
    flex: 0 0 auto;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    opacity: 0;
    width: 200px;
    aspect-ratio: 16/9;
    position: relative;
}

.thumbnail-item.active {
    border: 2px solid var(--primary-color);
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    transform: scale(1);
    transform-origin: center;
}

.thumbnail-item:hover .thumbnail-img {
    transform: scale(1.5);
}

.thumbnail-title {
    padding: 0.5rem;
    background: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Medienabfragen für spezifische Anpassungen */
@media (max-width: 768px) {
    .thumbnail-item {
        width: 160px;
    }
}

@media (max-width: 480px) {
    .thumbnail-item {
        width: 120px;
    }
}

/* Scrollbar für Thumbnail-Galerie */
.thumbnail-gallery::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.thumbnail-gallery::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.thumbnail-gallery::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .main-video-wrapper {
        padding-bottom: 60%; /* Anpassung für kleinere Bildschirme */
    }
}

@media (max-width: 480px) {
    .main-video-wrapper {
        padding-bottom: 65%; /* Anpassung für Mobilgeräte */
    }
}

/* Animationen reduzieren für bessere Performance */
@media (prefers-reduced-motion: reduce) {
    .thumbnail-item {
        transition: none;
    }
    .main-video-wrapper video {
        transition: none;
    }
    .thumbnail-item:hover .thumbnail-img {
        transform: none;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #f5f5f5;
    }

    .thumbnail-title {
        background: #333;
    }

    .icon-button {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Fehler- und Infomeldungen */
.error-message, .info-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 5px;
    z-index: 1000;
    text-align: center;
}

.error-message {
    color: #ff6b6b;
}