/**
 * Header Component
 *
 * Enthält:
 * - Site Header (mit SVG Gradient-Wellen)
 * - Desktop Navigation
 * - Mobile Menu (Hamburger, Full-Screen Overlay)
 * - CTA Buttons
 *
 * Dependencies:
 * - base.css (CSS Variables)
 * - SVG Assets: wave-header.svg, wave-header-bottom.svg
 * - JavaScript: navigation.js (Mobile Menu Toggle)
 *
 * Extrahiert aus components.css: Zeilen 1094-1487
 * Datei-Größe: ~393 Zeilen
 *
 * @package SLV_Transporte
 * @version 1.0.0
 */


/* ============================================
   HEADER mit Gradient-Streifen
   ============================================ */

/**
 * Site Header Container
 * Non-Sticky Header mit weißem Hintergrund
 * Gradient-Streifen oben: #fcbc5b → #5cb8e9
 *
 * ÄNDERUNG: Von sticky zu relative für bessere Mobile UX
 * - Mehr Content-Fläche auf kleinen Bildschirmen
 * - Bessere Performance (keine Repaints)
 * - Moderne UX Best-Practice
 */
.site-header {
  background: var(--slv-bg-white);
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/**
 * Gradient-Welle oben: Gelb → Blau (SVG)
 * 50px hoch (responsive), geschwungene Wellen
 * SVG-Datei: assets/images/wave-header.svg
 *
 * Alte Implementierung (Backup):
 * background: linear-gradient(90deg, #fcbc5b 0%, #5cb8e9 100%);
 * height: 5px;
 */
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: url('../../images/wave-header-animated.svg') repeat-x;
  background-size: 200% 100%;
  background-position: 0% top;
  z-index: 1;
  animation: wave-scroll-header 20s linear infinite;
}

/**
 * Gradient-Welle unten (unter Header Content): Blau → Gelb (SVG)
 * 50px hoch (responsive), geschwungene Wellen nach unten
 * SVG-Datei: assets/images/wave-header-bottom-animated.svg
 *
 * WICHTIG: Welle bleibt INNERHALB des Headers (kein transform)
 * Position: Am unteren Rand des Headers, NICHT über den Content
 */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: url('../../images/wave-header-bottom-animated.svg') repeat-x;
  background-size: 200% 100%;
  background-position: 0% bottom;
  z-index: 1;
  animation: wave-scroll-header 25s linear infinite reverse;
}

/**
 * Wave Scroll Animation (Header)
 *
 * KORRIGIERT: Verwendet background-position statt translateX
 * für sichtbare horizontale Wellenbewegung.
 *
 * Funktionsweise:
 * - SVG ist doppelt breit (200%)
 * - Animation scrollt von 0% zu 100% (volle SVG-Breite)
 * - SVG wiederholt sich nahtlos (seamless loop)
 * - Linear timing für gleichmäßige Bewegung
 *
 * @since 1.2.1 - Korrigierte Wave Animation
 */
@keyframes wave-scroll-header {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 100% center;
  }
}

/**
 * Header Container (Layout)
 * Flexbox für Logo, Nav, CTA, Hamburger
 *
 * WICHTIG: Padding-Top/Bottom reserviert Platz für Wellen
 * - Top: ~3.5rem für obere Welle (50px)
 * - Bottom: ~3.5rem für untere Welle (50px)
 */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3.5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/**
 * Logo / Site Branding
 */
.site-branding {
  flex-shrink: 0;
}

.site-branding img {
  max-width: 180px;
  height: auto;
  display: block;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slv-text-dark);
  text-decoration: none;
  transition: color var(--slv-transition-fast);
}

.site-title:hover {
  color: var(--slv-primary-blue);
}

.site-description {
  font-size: 0.875rem;
  color: var(--slv-text-muted);
  margin-top: 0.25rem;
}

/**
 * Navigation Desktop
 * Hidden auf Mobile, Flex auf Tablet+
 */
.main-nav {
  display: none;
}

.nav-menu {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  color: var(--slv-text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
  color: var(--slv-primary-blue);
}

/**
 * Animierte Unterstreichung bei Hover
 *
 * Feature: Linie "wächst" von links nach rechts
 * Duration: 0.3s mit ease
 * Farbe: SLV Gelb
 *
 * WICHTIG: Nicht auf current-menu-item anwenden (hat statische Linie)
 *
 * @since 1.1.0 - Animation Enhancement Phase 1
 */
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--slv-primary-yellow);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

/**
 * Aktiver Menüpunkt: Gelbe Unterstreichung (statisch, immer sichtbar)
 * Überschreibt die Hover-Animation für current-menu-item
 */
.nav-menu .current-menu-item a::after {
  width: 100%;
}

/**
 * CTA Button im Header
 * Blauer Hintergrund, Gelb bei Hover
 *
 * RESPONSIVE STRATEGIE:
 * - Desktop (≥ 768px): Sichtbar im Header
 * - Mobile (< 768px): Ausgeblendet (wird stattdessen im Mobile-Menü angezeigt)
 *
 * Grund: Platzmangel auf Mobile (Logo + CTA + Hamburger = zu voll)
 * Lösung: CTA wird ins Mobile-Menü verschoben (Best Practice: Airbnb, Uber, Zalando)
 */
.cta-button {
  background: var(--slv-primary-blue);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  display: inline-block;
}

.cta-button:hover {
  background: var(--slv-primary-yellow);
  border-color: var(--slv-primary-blue);
  color: var(--slv-text-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(92, 184, 233, 0.3);
}

/**
 * CTA-Button auf Mobile ausblenden
 * Button wird stattdessen im Mobile-Menü angezeigt (.cta-button-mobile)
 */
/**
 * CTA-Button auf Mobile & Tablet ausblenden
 * Button wird stattdessen im Mobile-Menü angezeigt (.cta-button-mobile)
 * 
 * ÄNDERUNG: Breakpoint erhöht auf 992px
 * Verhindert Überlappung auf Tablets (iPad)
 */
@media (max-width: 991px) {
  .cta-button {
    display: none;
  }
}

/**
 * Hamburger Icon (Mobile Only)
 */
.menu-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--slv-primary-blue);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/**
 * Hamburger Animation (Aktiv → X)
 */
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/**
 * Mobile Menu Overlay
 * Full-Screen mit Gradient-Hintergrund
 */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #5cb8e9 0%, #fcbc5b 100%);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.mobile-menu[aria-hidden="false"] {
  transform: translateX(0);
}

/**
 * Mobile Menu Close Button
 */
.menu-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.menu-close:hover {
  transform: rotate(90deg);
}

/**
 * Mobile Navigation Menu
 */
.mobile-nav-menu {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  text-align: center;
}

.mobile-nav-menu li {
  margin: 1.5rem 0;
}

.mobile-nav-menu a {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 600;
  text-decoration: none;
  padding: 1rem 2rem;
  display: block;
  min-height: 44px;
  transition: opacity 0.3s ease;
  border-radius: 4px;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu .current-menu-item a {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.1);
}

/**
 * CTA Button in Mobile Menu
 *
 * RESPONSIVE STRATEGIE:
 * - Mobile/Tablet (< 992px): Sichtbar im Mobile-Menü
 * - Desktop (≥ 992px): Ausgeblendet
 */
.mobile-menu-cta {
  margin-top: 2rem;
  display: block;
  /* Standardmäßig sichtbar */
}

.cta-button-mobile {
  background: #ffffff;
  color: var(--slv-primary-blue);
  padding: 1rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  display: inline-block;
  transition: all 0.3s ease;
}

.cta-button-mobile:hover {
  background: var(--slv-primary-yellow);
  color: var(--slv-text-dark);
  transform: scale(1.05);
}

/**
 * Mobile-Menu-CTA auf Desktop ausblenden
 */
@media (min-width: 992px) {
  .mobile-menu-cta {
    display: none;
  }
}

/**
 * Header Responsive - Desktop Only (ab 992px)
 */
@media (min-width: 992px) {
  .header-container {
    padding: 3.5rem 2rem;
  }

  .main-nav {
    display: block;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-menu {
    display: none;
  }
}

@media (min-width: 1200px) {
  .header-container {
    padding: 4rem 2rem;
  }
}

/* ============================================
   REDUCED MOTION SUPPORT - Wave Animation
   ============================================ */

/**
 * Accessibility: Deaktiviert Wave-Animation
 * Für Nutzer mit prefers-reduced-motion
 *
 * @since 1.2.0 - Animation Enhancement Phase 3
 */
@media (prefers-reduced-motion: reduce) {
  .site-header::before,
  .site-header::after {
    animation: none;
  }
}