:root {
    --bg: #ffffff;
    --body: #f4f7f6;
    --text: #2d3436;
    --muted: #888;
    --border: #eeeeee;
    --hover: #f7f7f7;
    --accent: #aaaaaa;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --overlay: rgba(0,0,0,0.4);
}

.dark-mode {
    --bg: #1e1e1e;
    --body: #121212;
    --text: #f5f5f5;
    --muted: #999999;
    --border: #333333;
    --hover: #2a2a2a;
}

body {
    margin: 0;
    padding-top: 120px;
    background: var(--body);
    color: var(--text);
    font-family: 'Segoe UI', sans-serif;
    transition: background 0.3s ease;
}

#page-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 900;
    backdrop-filter: blur(3px);
    pointer-events: none;
}

    #page-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

/* NAVBAR */
.floating-navbar {
    position: fixed;
    top: 25px;
    left: 10%;
    right: 10%;
    height: 70px;
    background: var(--bg);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow);
    z-index: 1000;
    border: 1px solid var(--border);
}

.navbar-left, .navbar-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.navbar-right {
    justify-content: flex-end;
    gap: 20px;
    position: relative;
}

.navbar-logo {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    justify-content: center;
    flex: 2;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-link {
    padding: 10px 22px;
    border-radius: 35px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
}

.nav-item:hover .nav-link {
    background: var(--hover);
    color: var(--accent);
}

.nav-icon-login {
    display: flex;
    align-items: center; /* Vertikale Zentrierung */
    justify-content: center; /* Horizontale Zentrierung */
    height: 100%; /* Nimmt die volle Höhe der Navbar ein */
    padding: 10px 22px;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
    border-radius: 35px;
}

    .nav-icon-login:hover {
        background: var(--hover);
        color: var(--text);
    }

    .nav-icon-login .material-icons-outlined {
        display: block; /* Entfernt den Baseline-Abstand von Text-Elementen */
        font-size: 24px; /* Standardgröße für Icons */
        line-height: 1; /* Verhindert zusätzliche Höhe durch Zeilenabstand */
    }

/* MEGA MENU */
.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding-top: 15px;
    opacity: 0;
    visibility: hidden;
    transition: .2s ease;
    z-index: 1001;
    display: flex;
    justify-content: center;
}

    .mega-menu.active {
        opacity: 1;
        visibility: visible;
    }

.mega-menu-content {
    background: var(--bg);
    border-radius: 35px;
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
}

.mega-main-grid {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.tile-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: var(--hover);
    border-radius: 25px;
    text-decoration: none;
    color: var(--text);
    transition: 0.2s;
    cursor: pointer;
    position: relative;
    z-index: 1002; 
}

    .tile-item:hover {
        background: var(--accent);
        color: white;
        transform: translateY(-3px);
    }

.tile-icon {
    font-size: 2.2rem !important;
    margin-right: 18px;
}

.tile-title {
    display: block;
    font-weight: 700;
    font-size: 1rem;
}

.tile-desc {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
}

.mega-secondary-list {
    flex: 1;
    border-left: 1px solid var(--border);
    padding-left: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text);
    border-radius: 15px;
    font-size: 0.95rem;
}

    .side-item:hover {
        background: var(--hover);
        color: var(--accent);
    }

/* PROFILE DROPDOWN - FIX: Rechtsbündig mit Navbar-Rand */
.profile-container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}

    .profile-avatar:hover {
        border-color: var(--accent);
    }

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: -20px; /* Negativer Wert gleicht das Navbar-Padding aus */
    width: 230px;
    margin-top: 15px;
    background: var(--bg);
    border-radius: 25px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: .2s ease;
    z-index: 1200;
}

    .profile-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .profile-dropdown a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 15px;
        text-decoration: none;
        color: var(--text);
        border-radius: 18px;
    }

        .profile-dropdown a:hover {
            background: var(--hover);
        }

.logout {
    color: #d63031 !important;
    font-weight: 600;
}

/* TOOLS */
.theme-switch {
    width: 46px;
    height: 24px;
    position: relative;
    cursor: pointer;
}

    .theme-switch input {
        display: none;
    }

.slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 34px;
    transition: .3s;
}

    .slider::before {
        content: '';
        position: absolute;
        width: 18px;
        height: 18px;
        background: white;
        border-radius: 50%;
        left: 3px;
        bottom: 3px;
        transition: .3s;
    }

input:checked + .slider {
    background: var(--accent);
}

    input:checked + .slider::before {
        transform: translateX(22px);
    }

.hamburger {
    display: none;
    width: 28px;
    height: 20px;
    position: relative;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}

    .hamburger span {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 10px;
        transition: 0.3s;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8.5px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8.5px) rotate(-45deg);
    }

@media(max-width:900px) {
    .desktop-only {
        display: none;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .floating-navbar {
        left: 5%;
        right: 5%;
        padding: 0 20px;
    }

    .profile-dropdown {
        right: 0;
    }
}

.mobile-panel {
    position: fixed;
    top: 105px;
    left: 1%;
    right: 1%;
    bottom: 20px;
    background: var(--bg);
    border-radius: 30px;
    box-shadow: var(--shadow);
    z-index: 1500;
    transform: translateX(120%);
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid var(--border);
}

    .mobile-panel.open {
        transform: translateX(0);
    }

.mobile-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

    .mobile-header button {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text);
        cursor: pointer;
    }

.mobile-content {
    display: flex;
    width: 100%;
    transition: .3s ease;
    height: calc(100% - 75px);
}

.mobile-page {
    min-width: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

    .mobile-page a {
        padding: 18px;
        background: var(--hover);
        border-radius: 20px;
        text-decoration: none;
        color: var(--text);
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 15px;
    }

#mobile-back {
    display: flex; /* Macht den Button zum Flex-Container */
    align-items: center; /* Vertikale Zentrierung des Icons */
    justify-content: center; /* Horizontale Zentrierung des Icons */
    width: 40px; /* Feste Breite für einen runden Button */
    height: 40px; /* Feste Höhe */
    padding: 0; /* Wichtig: Padding entfernen */
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 50%;
    transition: background 0.2s;
}

.mobile-theme {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background: var(--hover);
    border-radius: 20px;
}




/*Login Page*/
.eye {
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pupil {
    width: 8px;
    height: 8px;
    background: #1e1e1e;
    border-radius: 50%;
    will-change: transform;
}

/* Responsivität für Mobile */
@media (max-width: 768px) {
    .login-side-info {
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }

    .panik-card {
        max-width: 450px;
    }
}

.login-error {
    animation: panik-shake 0.4s ease-in-out;
}

@keyframes panik-shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}


/* Der äußere Container - nur für Größe und Positionierung */
.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

    /* Leichter Hover-Effekt (bewegt sich 1px nach oben) */
    .profile-avatar:hover {
        transform: translateY(-1px);
    }

/* Das Profilbild, falls vorhanden */
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Optional: Ein feiner Rahmen um das Bild */
    border: 2px solid var(--bg); /* Passt sich an Light/Dark Mode an */
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* Die Initialen - LIGHT MODE (Standard) */
.fallback-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Moderne Typografie */
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    user-select: none; /* Verhindert, dass der Text beim Klicken markiert wird */
    /* Styling Light Mode */
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #334155;
    border: 2px solid var(--bg); /* Rand passt sich deinem Hintergrund an */
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Die Initialen - DARK MODE Anpassung (reagiert auf deine .dark-mode Klasse) */
.dark-mode .fallback-initials {
    background: linear-gradient(135deg, #334155, #1e293b);
    color: #f8fafc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* --- NEUER DROPDOWN HEADER --- */
.dropdown-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 15px 10px;
    gap: 8px;
}

/* Der Container für das große Bild */
.dropdown-avatar-large {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    border: 3px solid var(--bg); /* Gleicher Trick wie beim kleinen Avatar */
    margin-bottom: 5px;
}

.profile-img-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Große Initialen */
.fallback-initials-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 26px; /* Schön groß */
    letter-spacing: 1px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #334155;
}

.dark-mode .fallback-initials-large {
    background: linear-gradient(135deg, #334155, #1e293b);
    color: #f8fafc;
}

/* Benutzername im Header */
.dropdown-user-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    word-break: break-word;
}

/* Spezielles Styling für den "Mein Profil" Button */
.profile-dropdown a.dropdown-profile-link {
    justify-content: center;
    padding: 8px 20px;
    background: var(--hover);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    border: 1px solid var(--border);
    transition: 0.2s;
}

    .profile-dropdown a.dropdown-profile-link:hover {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }

/* Trennlinie */
.dropdown-divider {
    height: 1px;
    background-color: var(--border);
    margin: 5px 0;
}

/* Fix für den Logout Button im Dropdown (damit das Icon linksbündig bleibt) */
.profile-dropdown form button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 18px;
    text-align: left;
}

    .profile-dropdown form button:hover {
        background: var(--hover);
    }