/* ===========================================
   MODERN HEADER - JSON SPEC DESIGN
   Glassmorphism Header mit Logo & Navigation
   =========================================== */

/* Header Container */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    height: 72px;
}

.modern-header-container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo & Branding */
.header-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #fcd34d);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.header-logo-circle span {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    font-family: 'Quicksand', sans-serif;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Quicksand', sans-serif;
    white-space: nowrap;
}

/* Theme Toggle in Header */
.theme-toggle-header {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #fcd34d);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: auto;
}

@media (min-width: 1024px) {
    .theme-toggle-header {
        margin-left: 0;
        margin-right: auto;
    }
}

.theme-toggle-header:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.theme-toggle-header:active {
    transform: scale(0.95);
}

.theme-toggle-header:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Desktop Navigation */
.header-nav-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .header-nav-desktop {
        display: flex;
        align-items: center;
        gap: 2rem;
        margin-left: auto;
    }
}

.header-nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.header-nav-link:hover {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.header-nav-link.active {
    color: #1e293b;
    font-weight: 600;
    border-bottom-color: #3b82f6;
}

/* Burger Menu Button - WCAG Compliant Touch Target */
.header-burger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 44px;     /* WCAG touch target minimum */
    min-height: 44px;    /* WCAG touch target minimum */
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

@media (min-width: 1024px) {
    .header-burger {
        display: none;
    }
}

.header-burger-line {
    width: 100%;
    height: 3px;
    background: #1e293b;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.header-burger:hover .header-burger-line {
    background: #3b82f6;
}

/* Burger Menu aktiv */
.header-burger.active .header-burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.header-burger.active .header-burger-line:nth-child(2) {
    opacity: 0;
}

.header-burger.active .header-burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.header-mobile-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* WICHTIG: Blockiert keine Klicks wenn geschlossen */
    transition: all 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling auf iOS */
}

.header-mobile-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Klicks erlauben wenn geöffnet */
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HEADER MUSIKPLAYER (KOMPAKT)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.header-music-player {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-right: auto;
}

@media (min-width: 1024px) {
    .header-music-player {
        display: flex;
    }
}

.header-music-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-music-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: scale(1.1);
}

.header-music-btn:active {
    transform: scale(0.95);
}

.header-music-play {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.header-music-play:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.header-mobile-menu-content {
    padding: 2rem 1.5rem;
}

.header-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-mobile-link {
    font-size: 1.125rem;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    padding: 0.875rem 1rem;  /* ~14px vertikal + font-size 1.125rem = >44px */
    min-height: 44px;        /* WCAG touch target minimum */
    display: flex;
    align-items: center;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.header-mobile-link:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.header-mobile-link.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    font-weight: 600;
}

/* Mobile: kleinere Logo */
@media (max-width: 640px) {
    .header-logo-circle {
        width: 40px;
        height: 40px;
    }

    .header-logo-circle span {
        font-size: 1.25rem;
    }

    .header-title {
        font-size: 1rem;
    }

    .modern-header {
        height: 64px;
    }

    .header-mobile-menu {
        top: 64px;
    }

    /* Stelle sicher, dass Touch-Events funktionieren */
    .header-burger {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .header-mobile-link {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Dark Mode */
.dark .modern-header {
    background: rgba(30, 41, 59, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark .header-title {
    color: #f1f5f9;
}

.dark .header-nav-link {
    color: #cbd5e1;
}

.dark .header-nav-link:hover,
.dark .header-nav-link.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.dark .header-burger-line {
    background: #f1f5f9;
}

.dark .header-burger:hover .header-burger-line {
    background: #60a5fa;
}

.dark .header-mobile-menu {
    background: rgba(30, 41, 59, 0.95);
}

.dark .header-mobile-link {
    color: #f1f5f9;
}

.dark .header-mobile-link:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.dark .header-mobile-link.active {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
}
