/* Dynamischer Jahreszeiten-Header */
.main-header {
    position: relative;
    background-color: var(--primary-dark);
    color: var(--neutral-light);
    padding: 160px 0 90px;
    text-align: center;
    overflow: hidden;
    z-index: 1;
}

/* Basis-Overlay für alle Jahreszeiten */
.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 58, 95, 0.6) 0%, rgba(26, 58, 95, 0.5) 100%);
    z-index: -1;
}

/* Zusätzliches Overlay für Headerinhalt */
.header-content {
    position: relative;
    z-index: 10;
}

.header-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: rgba(33, 75, 95, 0.8);
    border-radius: 12px;
    z-index: -1;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
}

/* Jahreszeiten-Hintergründe */
.season-backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.season {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.season.active {
    opacity: 1;
}

/* Frühling */
.season-spring {
    background-image: url('images/header-spring.webp');
    opacity: 1;
    transition: none;
}

/* Sommer */
.season-summer {
    background-image: url('images/header-summer.webp');
}

/* Herbst */
.season-fall {
    background-image: url('images/header-fall.webp');
}

/* Winter */
.season-winter {
    background-image: url('images/header-winter.webp');
}

/* Animation für Frühling: Fallende Blütenblätter */
.spring-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

.spring-animation.active {
    opacity: 1;
}

.petal {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: rgba(255, 230, 244, 0.7);
    border-radius: 150% 0 150% 0;
    animation: falling-petals 10s linear infinite;
    animation-delay: 3s;
    opacity: 0;
}

.petal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 230, 244, 0.3);
    border-radius: 150% 0 150% 0;
    transform: rotate(45deg);
}

@keyframes falling-petals {
    0% {
        transform: translateY(-5%) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Animation für Sommer: Sonnenstrahlen */
.summer-animation {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

.summer-animation.active {
    opacity: 1;
}

.sun-rays {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0) 70%);
    animation: sun-pulse 5s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes sun-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Animation für Herbst: Fallende Blätter */
.fall-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

.fall-animation.active {
    opacity: 1;
}

.leaf {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(189, 83, 0, 0.6);
    border-radius: 50% 0 50% 50%;
    animation: falling-leaves 15s linear infinite;
    animation-delay: 3s;
    opacity: 0;
}

@keyframes falling-leaves {
    0% {
        transform: translateY(-5%) rotate(0deg) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(-30px);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) rotate(360deg) translateX(10px);
        opacity: 0;
    }
}

/* Animation für Winter: Schneefall */
.winter-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

.winter-animation.active {
    opacity: 1;
}

.snowflake {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: falling-snow 10s linear infinite;
    animation-delay: 3s;
    opacity: 0;
}

@keyframes falling-snow {
    0% {
        transform: translateY(-5%) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    50% {
        transform: translateY(50vh) translateX(20px);
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh) translateX(-20px);
        opacity: 0;
    }
}

/* Seasons Indicator (optional) */
.seasons-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 5;
}

.season-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.season-dot.active {
    background-color: white;
    transform: scale(1.2);
}

/* Header-Slider-Styles */
.header-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

/* Neuer Kontrast-Layer für bessere Lesbarkeit */
.header-slider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(20, 40, 60, 0.35) 0%, rgba(25, 55, 30, 0.25) 100%);
    z-index: 5;
    pointer-events: none;
}

.header-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation-duration: 40s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: normal;
    animation-fill-mode: both;
    content-visibility: auto;
}

.header-slide-spring {
    background-image: url('images/header-spring.webp');
    animation-name: slide-animation-spring;
    z-index: 4;
    opacity: 1;
    content-visibility: visible;
    transition: none;
}

.header-slide-summer {
    background-image: url('images/header-summer.webp');
    animation-name: slide-animation-summer;
    z-index: 3;
}

.header-slide-fall {
    background-image: url('images/header-fall.webp');
    animation-name: slide-animation-fall;
    z-index: 2;
}

.header-slide-winter {
    background-image: url('images/header-winter.webp');
    animation-name: slide-animation-winter;
    z-index: 1;
}

@keyframes slide-animation-spring {
    0%, 7% { opacity: 1; }       /* Stabile Startphase für LCP */
    20%, 40%, 60% { opacity: 0; }
    82%, 100% { opacity: 1; }    /* Früher Start, überlappt mit Winter-Ende */
}

@keyframes slide-animation-summer {
    0%, 12% { opacity: 0; }
    18%, 32% { opacity: 1; }     /* Überlappt mit Spring-Ende */
    43%, 100% { opacity: 0; }
}

@keyframes slide-animation-fall {
    0%, 38% { opacity: 0; }
    42%, 57% { opacity: 1; }     /* Überlappt mit Summer-Ende */
    63%, 100% { opacity: 0; }
}

@keyframes slide-animation-winter {
    0%, 58% { opacity: 0; }
    62%, 77% { opacity: 1; }     /* Überlappt mit Fall-Ende */
    85%, 100% { opacity: 0; }    /* Endet früh für Spring-Übergang */
}

/* Saisonale Badge-Styles */
.seasonal-badge {
    animation: pulse 2s infinite;
}

/* Saisonale Service-Hervorhebung */
.seasonal-highlight {
    border: 2px solid var(--accent-color);
    position: relative;
    overflow: visible;
}

.seasonal-highlight::before {
    content: 'Aktuell besonders gefragt';
    position: absolute;
    top: -12px;
    right: 20px;
    background-color: var(--accent-bright);
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

/* Pulsierender Animationseffekt */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsivität für kleinere Bildschirme */
@media only screen and (max-width: 768px) {
    .summer-animation {
        top: -50px;
        right: -50px;
        width: 200px;
        height: 200px;
    }
    
    .seasons-indicator {
        bottom: 10px;
        right: 10px;
    }
    
    .seasonal-badge {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .seasonal-highlight::before {
        font-size: 0.7rem;
        padding: 3px 10px;
        right: 10px;
    }
    
    .header-slide {
        background-position: center center;
    }
}

@media (max-width: 480px) {
    .seasonal-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

/* Fallback für Geräte mit reduced-motion-Präferenz */
@media (prefers-reduced-motion) {
    .header-slide {
        animation: none !important;
        transition: none !important;
        opacity: 0 !important;
    }
    
    .header-slide-spring {
        opacity: 1 !important; /* Zeige nur den Frühling an, wenn Bewegung reduziert ist */
    }
    
    .petal,
    .sun-rays,
    .leaf,
    .snowflake {
        animation: none !important;
        display: none !important; /* Verberge alle dekorativen Animationen */
    }
    
    .seasonal-badge::before {
        animation: none !important;
    }
}

/* Fallback für ältere Browser, die keine Animation unterstützen */
.no-animation .header-slide {
    animation: none;
    opacity: 0;
}

.no-animation .header-slide-spring {
    opacity: 1;
}