/* Allgemeine Stile */
html, body {
    overflow-x: hidden;
}
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, hsl(258, 100%, 50%), #ff758c, #ffb347, #ffffff);
    color: white;
    text-align: center;
    min-height: 100vh; /* Stellt sicher, dass der Hintergrund die gesamte Höhe einnimmt */
    display: flex;
    flex-direction: column; /* Ermöglicht flexibles Layout für Header, Main und Footer */
    opacity: 0;
    transition: opacity 1s;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
}
body.loaded {
    opacity: 1;
}

header {
    padding: 20px;
    background: linear-gradient(90deg, rgba(34,0,51,0.7) 0%, rgba(255,117,140,0.7) 100%);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 2px solid #ffb347;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    gap: 10px;
}
header .logo {
    justify-self: end;
    height: 50px; /* Passe die Höhe des Logos an */
    vertical-align: middle;
    display: inline-block;
    filter: drop-shadow(0 0 12px #ffb347) drop-shadow(0 0 24px #7ed8ff);
    transition: transform 0.3s;
}
header .logo:hover {
    transform: scale(1.07) rotate(-3deg);
}
header h1 {
    justify-self: center;
    font-size: 2.5rem;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    margin: 0;
    font-family: 'Orbitron', Arial, sans-serif;
}
.lang-header {
    justify-self: start;
    margin-left: auto;
    margin-right: 0;
    align-self: center;
    border-radius: 50%;
    padding: 8px 12px;
    font-size: 1.5rem;
    background: rgba(0,0,0,0.4);
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px #0006;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    order: 3;
}
.lang-header:hover {
    background: #ffb347;
    color: #222;
    transform: scale(1.1) rotate(-6deg);
}

/* Toggle-Button */
#theme-toggle {
    margin-left: 18px;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px #0004;
}
#theme-toggle:hover {
    background: #ffb347;
    color: #222;
}
  
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
  
.countdown {
    margin: 20px 0;
}

.countdown h2 {
    font-family: 'Orbitron', Arial, sans-serif;
}
  
#timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Ermöglicht Umbruch der Boxen auf kleineren Bildschirmen */
}
  
.time-box {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    width: 100px; /* Feste Breite */
    height: 100px; /* Feste Höhe */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: box-shadow 0.3s;
}
  
.time-box span {
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Orbitron', Arial, sans-serif;
}
  
.time-box p {
    margin: 0;
    font-size: 1rem;
    font-family: 'Orbitron', Arial, sans-serif;
}
  
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    text-align: center;
}
  
footer p {
    margin: 0;
    font-size: 0.9rem;
}

footer a,
footer a:visited,
footer a:active {
    color: #fff !important;
    text-decoration: underline;
}

footer a:hover {
    color: #ffb347 !important;
    text-shadow: 0 0 8px #7ed8ff;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 20px auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.video-container::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 Seitenverhältnis */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

@keyframes countdown-fade {
    0%   { opacity: 0; transform: scale(1.03); filter: blur(2px);}
    30%  { opacity: 0.7; transform: scale(1.015); filter: blur(1.2px);}
    60%  { opacity: 1; transform: scale(1.005); filter: blur(0.5px);}
    100% { opacity: 1; transform: scale(1); filter: blur(0);}
}
.countdown-animate {
    animation: countdown-fade 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform, filter;
}

/* Animierte Hintergrundelemente */
.background-anim {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.palme-bg {
    position: absolute;
    z-index: 0;
    opacity: 0.7;
    pointer-events: none;
    /* Du kannst weitere Styles wie Animation, Größe, Position nach Wunsch anpassen */
}

.palme-bg.fly {
    width: 32px;
    height: auto;
    opacity: 0.28;
    position: absolute;
    animation: palme-wobble 6s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

@keyframes palme-wobble {
    0%   { transform: translateY(0) rotate(-3deg) scale(1);}
    50%  { transform: translateY(-8px) rotate(3deg) scale(1.05);}
    100% { transform: translateY(0) rotate(-3deg) scale(1);}
}

@keyframes palme-fly {
    0% {
        transform: translateY(0) scale(0.9) rotate(-10deg);
        opacity: 0.5;
    }
    10% {
        opacity: 0.7;
    }
    50% {
        transform: translateY(-30px) scale(1.1) rotate(10deg);
        opacity: 0.8;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        left: 100vw;
        transform: translateY(0) scale(0.9) rotate(-10deg);
        opacity: 0.5;
    }
}

/* Stelle sicher, dass der eigentliche Seiteninhalt über dem Hintergrund liegt */
body > *:not(.background-anim) {
    position: relative;
    z-index: 1;
}

/* Mobile-Optimierung */
@media (max-width: 768px) {
    header {
        flex-direction: column; /* Header-Elemente untereinander anordnen */
        gap: 5px;
    }

    header h1 {
        font-size: 1.8rem; /* Kleinere Schriftgröße für mobile Geräte */
    }

    header .logo {
        height: 40px; /* Kleinere Logo-Größe */
    }

    #timer {
        gap: 10px; /* Weniger Abstand zwischen den Boxen */
    }

    .time-box {
        width: 80px; /* Kleinere Boxen für mobile Geräte */
        height: 80px; /* Kleinere Boxen für mobile Geräte */
    }

    .time-box span {
        font-size: 1.5rem; /* Kleinere Schriftgröße */
    }

    .time-box p {
        font-size: 0.9rem; /* Kleinere Schriftgröße */
    }

    footer {
        font-size: 0.8rem; /* Kleinere Schriftgröße im Footer */
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem; /* Noch kleinere Schriftgröße für sehr kleine Geräte */
    }

    .video-container iframe {
        height: 150px; /* Noch kleinere Video-Höhe */
    }

    .time-box {
        width: 70px; /* Noch kleinere Boxen für sehr kleine Geräte */
        height: 70px; /* Noch kleinere Boxen für sehr kleine Geräte */
    }

    .time-box span {
        font-size: 1.2rem; /* Noch kleinere Schriftgröße */
    }

    .time-box p {
        font-size: 0.8rem; /* Noch kleinere Schriftgröße */
    }
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin: 24px 0 0 0;
}

.social-buttons a {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 2px 8px #0008;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.social-buttons a:hover {
    transform: scale(1.15) rotate(-6deg);
    box-shadow: 0 4px 16px #7ed8ff80;
    background: rgba(34,0,51,0.7);
}

.social-buttons img {
    width: 28px;
    height: 28px;
    display: block;
    filter: drop-shadow(0 0 4px #fff8);
}

.lang-header {
    justify-self: start;
    margin-left: auto;
    margin-right: 0;
    align-self: center;
    border-radius: 50%;
    padding: 8px 12px;
    font-size: 1.5rem;
    background: rgba(0,0,0,0.4);
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px #0006;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    order: 3;
}
.lang-header:hover {
    background: #ffb347;
    color: #222;
    transform: scale(1.1) rotate(-6deg);
}
