/* =========================================
   1. HAMBURGER MENÜ BUTTON
========================================= */
.menu-toggle-btn {
    position: fixed;
    top: 25px;
    left: 25px;
    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;
}

.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 (TOP MENU)
========================================= */
.top-menu {
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    height: 90px;
    z-index: 100;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    padding: 0 30px 0 100px;
    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: 0; }
.top-menu h2 { color: #ffffff; font-size: 1.3rem; font-weight: 600; letter-spacing: 0.5px; }

.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: 15px; align-items: center; }

.main-nav-link, .open-login-trigger {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0);
    border: 1px solid transparent;
    display: inline-block;
}

.main-nav-link:hover, .open-login-trigger:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.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: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    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: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 0;
    z-index: 200;
}

.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: 8px !important;
    transition: all 0.2s ease;
    white-space: nowrap !important;
}

.sub-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.nav-dropdown:hover .dropdown-box {
    display: block;
}

/* Desktop-Standard: Pfeil verstecken */
.mobile-dropdown-arrow {
    display: none;
}


/* =========================================
   4. MOBILE NAVIGATION (MEDIA QUERY)
========================================= */
@media (max-width: 600px) {
    .top-menu {
        top: 0 !important;
        left: -280px;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 100px 24px 30px 24px;
        gap: 25px;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        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; }
    .top-menu h2 { display: block; font-size: 1.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); width: 100%; padding-bottom: 12px; margin-bottom: 5px; }
    .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; }
    
    .main-nav-link, .open-login-trigger { 
        font-size: 1.1rem; 
        padding: 12px 16px; 
        width: 100%; 
        display: block; 
        border-radius: 12px; 
        background: rgba(255, 255, 255, 0.03); 
        border: 1px solid rgba(255, 255, 255, 0.05); 
        box-sizing: border-box;
    }
    .main-nav-link:hover, .open-login-trigger:hover { background: rgba(255, 255, 255, 0.1); }
    
    .nav-dropdown { width: 100%; display: flex; flex-direction: column; }
    
    /* Mobiler Wrapper für Musik-Link + Pfeil nebeneinander */
    .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;
    }

    /* Link-Optik innerhalb des Wrappers zurücksetzen */
    .mobile-nav-wrapper .main-nav-link {
        border: none !important;
        background: transparent !important;
        width: auto !important;
        flex-grow: 1;
    }

    /* Der mobile Pfeil-Button zum Aufklappen */
    .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;
    }

    /* Drehung des Pfeils bei geöffnetem Zustand */
    .mobile-dropdown-arrow.active {
        transform: rotate(180deg);
        color: #ffffff;
    }

    /* Dropdown mobil standardmäßig schließen */
    .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;
    }

    /* Aktiv-Klasse, die per JS getoggelt wird */
    .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); border-color: rgba(248, 113, 113, 0.1); margin-top: 15px; }
    .top-menu a.logout-btn:hover { background: rgba(248, 113, 113, 0.15); }
    .top-menu .login-btn-guest { background: rgba(74, 222, 128, 0.05); border-color: rgba(74, 222, 128, 0.1); margin-top: 15px; }
    .top-menu .login-btn-guest:hover { background: rgba(74, 222, 128, 0.15); }
}


/* =========================================
   5. 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); 
}