/* =========================================
   1. HAMBURGER MENÜ BUTTON
========================================= */
.menu-toggle-btn {
    position: fixed;
    top: 30px; /* Perfekt vertikal ausgerichtet */
    left: 35px; /* Symmetrischer Abstand zum Rand */
    width: 50px;
    height: 50px;
    z-index: 120;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: fade 1s ease forwards;
    animation-delay: 0.4s;
    box-sizing: border-box !important;
}

.menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.menu-toggle-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle-btn.open span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.menu-toggle-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* =========================================
   2. DESKTOP NAVIGATION (SCHWEBEND / FLOATING)
========================================= */
.top-menu {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    height: 70px;
    z-index: 100;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    padding: 0 25px 0 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-menu.open { 
    top: 20px; 
}

/* --- BRAND-SCHRIFTZUG --- */
.top-menu h2.brand-logo { 
    font-family: 'Caveat', cursive, sans-serif;
    font-size: 3.6rem;
    font-weight: 700;
    color: #c084fc;
    transform: rotate(-10deg);
    margin-top: -12px;
    margin-bottom: -12px;
    margin-left: -20px;
    text-shadow: 
        0 0 15px rgba(192, 132, 252, 0.6), 
        0 0 30px rgba(168, 85, 247, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    line-height: 0.8;
    letter-spacing: 0.5px;
    cursor: default;
    user-select: none;
    transition: transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

.top-menu h2.brand-logo:hover {
    transform: rotate(-7deg) scale(1.06);
    color: #e879f9;
    text-shadow: 
        0 0 20px rgba(232, 121, 249, 0.8), 
        0 0 35px rgba(192, 132, 252, 0.6),
        0 4px 20px rgba(0, 0, 0, 0.9);
}

.menu-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 500;
    margin-left: 10px;
}

.menu-user-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.top-menu-links { display: flex; gap: 12px; align-items: center; }

.main-nav-link, .open-login-trigger {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 16px;
    height: 38px;
    box-sizing: border-box !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0);
    border: 1px solid transparent;
}

.main-nav-link:hover, .open-login-trigger:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.top-menu a.logout-btn { color: #f87171; }
.top-menu a.logout-btn:hover { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.2); color: #fca5a5; }

.top-menu .login-btn-guest { color: #4ade80; }
.top-menu .login-btn-guest:hover { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.2); color: #86efac; }


/* =========================================
   3. DROPDOWN LOGIK (DESKTOP)
========================================= */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-box {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    width: max-content; 
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 0;
    z-index: 200;
}

.dropdown-box::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.sub-nav-link {
    display: block !important;
    color: #cbd5e1 !important;
    padding: 10px 18px !important;
    margin: 0 8px !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    text-align: left !important;
    border-radius: 10px !important;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    height: auto !important;
}

.sub-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.nav-dropdown:hover .dropdown-box {
    display: block;
}

.mobile-dropdown-arrow {
    display: none;
}


/* =========================================
   4. YOUTUBE BRAND BUTTON STYLING
========================================= */
.nav-youtube-link {
    gap: 8px;
    box-sizing: border-box !important;
}

.yt-logo-icon {
    height: 16px;
    width: auto;
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.yt-logo-text {
    font-weight: 700;
    font-family: 'Roboto', 'Arial Black', sans-serif;
    letter-spacing: -0.5px;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1;
}

.nav-youtube-link:hover .yt-logo-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.8));
}


/* =========================================
   5. MOBILE NAVIGATION (MEDIA QUERY)
========================================= */
@media (max-width: 600px) {
    /* Exakte Zentrierung des Toggle-Buttons mobil */
    .menu-toggle-btn {
        top: 20px !important;
        left: 20px !important;
    }

    .top-menu {
        top: 0 !important;
        left: -280px;
        transform: none !important;
        width: 280px !important;
        max-width: none !important;
        height: 100vh !important;
        border-radius: 0 !important;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 90px 24px 30px 24px !important; /* Abgestimmt auf den Button */
        gap: 25px;
        background: rgba(15, 23, 42, 0.8) !important;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.5);
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .top-menu.open { left: 0 !important; }
    
    .top-menu h2.brand-logo { 
        display: block; 
        font-size: 2.2rem; 
        transform: none;
        margin-top: 0;
        margin-bottom: 0;
        margin-left: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
        width: 100%; 
        padding-bottom: 12px; 
    }

    .top-menu-links { flex-direction: column; width: 100%; gap: 12px; align-items: flex-start; }
    .top-menu .menu-user-badge { width: 100%; justify-content: center; padding: 10px; margin-left: 0; margin-top: 15px; order: 3; }
    
    /* Einheitsgröße für alle Hauptbuttons mobil */
    .main-nav-link, 
    .open-login-trigger, 
    .nav-youtube-link { 
        font-size: 1.1rem !important; 
        padding: 12px 16px !important; 
        width: 100% !important; 
        height: 48px !important;
        display: flex !important; 
        align-items: center !important;
        justify-content: flex-start !important;
        border-radius: 12px !important; 
        background: rgba(255, 255, 255, 0.03) !important; 
        border: 1px solid rgba(255, 255, 255, 0.05) !important; 
        box-sizing: border-box !important;
    }
    
    .main-nav-link:hover, 
    .open-login-trigger:hover, 
    .nav-youtube-link:hover { 
        background: rgba(255, 255, 255, 0.1) !important; 
    }

    .yt-logo-icon {
        height: 18px !important;
    }

    .yt-logo-text {
        font-size: 1.1rem !important;
        font-weight: 500 !important;
    }
    
    .nav-dropdown { width: 100%; display: flex; flex-direction: column; }
    
    .mobile-nav-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: rgba(255, 255, 255, 0.03); 
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        box-sizing: border-box;
        height: 48px;
    }

    .mobile-nav-wrapper .main-nav-link {
        border: none !important;
        background: transparent !important;
        width: auto !important;
        flex-grow: 1;
    }

    .mobile-dropdown-arrow {
        display: flex !important;
        align-items: center;
        justify-content: center;
        color: #cbd5e1;
        padding: 0 20px;
        height: 100%;
        cursor: pointer;
        font-size: 0.8rem;
        transition: transform 0.3s ease;
    }

    .mobile-dropdown-arrow.active {
        transform: rotate(180deg);
        color: #ffffff;
    }

    .nav-dropdown .dropdown-box {
        display: none !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        flex-direction: column !important;
        box-shadow: none !important;
        width: 100% !important;
        margin-top: 8px !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-radius: 14px !important;
        padding: 8px 0 !important;
        gap: 0 !important;
    }

    .nav-dropdown .dropdown-box.show-mobile {
        display: flex !important;
    }

    .sub-nav-link {
        font-size: 1rem !important;
        padding: 12px 18px !important;
        padding-left: 28px !important;
        margin: 0 8px !important;
        width: auto !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border: none !important;
        border-radius: 8px !important;
        white-space: normal !important;
    }

    .sub-nav-link:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .top-menu a.logout-btn { background: rgba(248, 113, 113, 0.05) !important; border-color: rgba(248, 113, 113, 0.1) !important; margin-top: 15px; }
    .top-menu a.logout-btn:hover { background: rgba(248, 113, 113, 0.15) !important; }
    .top-menu .login-btn-guest { background: rgba(74, 222, 128, 0.05) !important; border-color: rgba(74, 222, 128, 0.1) !important; margin-top: 15px; }
    .top-menu .login-btn-guest:hover { background: rgba(74, 222, 128, 0.15) !important; }
}


/* =========================================
   6. LOGIN MODAL & FORMULAR
========================================= */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    z-index: 200; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.4s ease; 
    padding: 20px; 
}

.modal-overlay.show { opacity: 1; pointer-events: auto; }

.login-container { 
    width: 100%; 
    max-width: 400px; 
    background: rgba(30, 41, 59, 0.7); 
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px); 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    border-radius: 24px; 
    padding: 35px 30px; 
    box-shadow: 0 24px 60px 0 rgba(0, 0, 0, 0.7); 
    color: #ffffff; 
    transform: translateY(30px); 
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
    position: relative; 
}

.modal-overlay.show .login-container { transform: translateY(0); }

.close-modal-btn { 
    position: absolute; 
    top: 20px; 
    right: 20px; 
    background: none; 
    border: none; 
    color: #cbd5e1; 
    font-size: 1.5rem; 
    cursor: pointer; 
    line-height: 1; 
    transition: color 0.2s; 
}

.close-modal-btn:hover { color: #ffffff; }

.form-group { margin-bottom: 20px; text-align: left; width: 100%; }

label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 8px; color: #cbd5e1; letter-spacing: 0.5px; }

.form-control { 
    width: 100%; 
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 12px; 
    padding: 12px 16px; 
    color: #ffffff; 
    font-size: 0.95rem; 
    outline: none; 
    transition: all 0.2s; 
}

.form-control:focus { 
    background: rgba(255, 255, 255, 0.08); 
    border-color: rgba(255, 255, 255, 0.25); 
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); 
}

.error-msg { 
    background: rgba(248, 113, 113, 0.1); 
    border: 1px solid rgba(248, 113, 113, 0.2); 
    color: #fca5a5; 
    padding: 12px; 
    border-radius: 12px; 
    font-size: 0.85rem; 
    margin-bottom: 20px; 
    text-align: center; 
}

.btn-submit { 
    width: 100%; 
    background: #ffffff; 
    color: #0f172a; 
    border: none; 
    border-radius: 12px; 
    padding: 13px; 
    font-size: 0.95rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
    margin-top: 5px; 
}

.btn-submit:hover { 
    background: #e2e8f0; 
    transform: translateY(-1px); 
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1); 
}

.divider { 
    display: flex; 
    align-items: center; 
    text-align: center; 
    margin: 20px 0; 
    color: #64748b; 
    font-size: 0.75rem; 
    letter-spacing: 0.5px; 
    text-transform: uppercase; 
}

.divider::before, .divider::after { 
    content: ''; 
    flex: 1; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); 
}

.divider:not(:empty)::before { margin-right: .75em; }
.divider:not(:empty)::after { margin-left: .75em; }

.btn-guest { 
    width: 100%; 
    background: rgba(255, 255, 255, 0.05); 
    color: #ffffff; 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    border-radius: 12px; 
    padding: 13px; 
    font-size: 0.95rem; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.2s; 
}

.btn-guest:hover { 
    background: rgba(255, 255, 255, 0.1); 
    border-color: rgba(255, 255, 255, 0.3); 
}