/* assets/css/app_layout.css - v3.2 (Final Hide Fix) */

:root {
    --app-bg: #0f172a;
    --app-card: #1e293b;
    --app-accent: #0ea5e9;
    --app-text: #f8fafc;
    --app-muted: #94a3b8;
    --app-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 23, 42, 0.95);
    
    --nav-height-mobile: 65px;
    --nav-height-desktop: 70px;
}

/* --- GRUNDLAYOUT --- */
body {
    margin: 0; padding: 0;
    background-color: var(--app-bg); color: var(--app-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-bottom: calc(var(--nav-height-mobile) + 20px); /* Platz für Bottom Nav */
    padding-top: 0;
}

/* Icons Fix */
i.fa-solid, i.fa-regular, i.fa-brands { display: inline-block; }

/* --- 1. HEADER (Mobile Top) --- */
.app-header {
    position: sticky; top: 0; z-index: 1100;
    background: var(--glass-bg); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--app-border);
    height: 60px; padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between;
}
.app-brand { font-size: 1.1rem; font-weight: 800; color: #fff; text-decoration: none; text-transform: uppercase; letter-spacing: 1px; display:flex; align-items:center; }
.app-header-actions { display: flex; gap: 18px; align-items: center; }

/* --- 2. BOTTOM NAV (Mobile Default) --- */
.app-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: var(--nav-height-mobile);
    background: #0f172a; border-top: 1px solid var(--app-border);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 1000; padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; color: var(--app-muted); font-size: 10px; gap: 4px;
    width: 20%; height: 100%; transition: 0.2s; position: relative;
}
.nav-item i { font-size: 20px; margin-bottom: 2px; }
.nav-item.active { color: var(--app-accent); }
.nav-item.active i { transform: translateY(-2px); filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.4)); }

.nav-badge {
    position: absolute; top: 6px; right: 20%;
    background: #ef4444; color: white; font-size: 10px; font-weight: bold;
    min-width: 16px; height: 16px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #0f172a; padding: 0 3px;
}

/* --- 3. MENÜ OVERLAY (Full Screen) --- */
.menu-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: #0f172a; color: white;
    display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto; padding-bottom: 80px;
}
.menu-overlay.open { transform: translateY(0); }

.menu-header {
    padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
    background: var(--app-card); border-bottom: 1px solid var(--app-border);
    position: sticky; top: 0; z-index: 10;
}
.menu-close-btn { background: none; border: none; color: white; font-size: 24px; cursor: pointer; }

.menu-section { padding: 20px; border-bottom: 1px solid var(--app-border); }
.menu-section-title { font-size: 11px; text-transform: uppercase; color: var(--app-muted); font-weight: 800; margin-bottom: 15px; letter-spacing: 1px; }

/* Grid Tiles */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-tile {
    background: rgba(255,255,255,0.03); padding: 16px; border-radius: 16px;
    text-decoration: none; color: white; display: flex; flex-direction: column;
    align-items: center; text-align: center; gap: 10px; border: 1px solid var(--app-border);
    transition: 0.2s;
}
.menu-tile:active { background: rgba(255,255,255,0.08); transform: scale(0.98); }

/* Listen */
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-list-item { display: flex; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.05); text-decoration: none; color: var(--app-text); font-size: 15px; align-items: center; gap: 15px; }
.menu-list-item:last-child { border-bottom: none; }
.menu-list-item i { width: 24px; text-align: center; color: var(--app-muted); }

/* Quick Stats Bar */
.user-stats-bar { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.stat-chip { background: rgba(255,255,255,0.05); padding: 8px 14px; border-radius: 99px; font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 8px; font-weight: 600; border: 1px solid var(--app-border); }

/* --- 4. DESKTOP STYLES (> 1024px) --- */
@media (min-width: 1024px) {
    body { padding-top: var(--nav-height-desktop); padding-bottom: 0; }
    .app-header { display: none; } 
    .app-nav {
        top: 0; bottom: auto; height: var(--nav-height-desktop);
        background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(15px);
        border-top: none; border-bottom: 1px solid var(--app-border);
        justify-content: center; gap: 40px; padding: 0;
    }
    .nav-item { flex-direction: row; width: auto; font-size: 14px; font-weight: 600; padding: 0 20px; border-radius: 12px; height: 45px; }
    .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
    .nav-item i { font-size: 18px; margin: 0; }
    .nav-badge { top: -5px; right: -5px; }
    
    .menu-overlay { width: 400px; left: auto; right: 0; border-left: 1px solid var(--app-border); box-shadow: -10px 0 30px rgba(0,0,0,0.5); }
}

/* ==========================================================================
   WICHTIG: ALTE CHAT BUTTONS VERSTECKEN
   ========================================================================== */

/* 1. Private Chat Button (unten links) */
.dmp-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 2. Community Chat Button (unten rechts) */
.comm-chat-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 3. Z-Index Korrekturen für die Drawer (müssen über der neuen Nav liegen) */
.dm-leftbar,        /* Private Chat Liste */
.comm-chat-drawer,  /* Community Chat */
.dm-chatdock,       /* Chat Fenster */
.dm-menu {          /* Kontextmenü */
    z-index: 99999 !important; 
}

/* 4. Platz schaffen auf Mobile, damit Drawer nicht unter der Nav verschwinden */
@media (max-width: 980px) {
    .dm-leftbar { bottom: var(--nav-height-mobile) !important; top: 0 !important; border-radius: 0 !important; width: 100% !important; max-width: 100% !important; }
    .comm-chat-drawer { bottom: var(--nav-height-mobile) !important; height: auto !important; top: 0 !important; width: 100% !important; max-width: 100% !important; }
    
    /* Schließen-Buttons in den alten Drawern besser sichtbar machen */
    .comm-chat-head-btn, .dm-close {
        padding: 15px !important; /* Größere Touch-Area */
    }
}